public function calculateRowsPerPageForStandardQuestion(array $question, int $max_rows_per_page, int $extra_rows, int $question_key): array 	{ 		$standard_answers_data = []; 		$standard_question_data = []; 		$question_answer_last_index = 0; 		$question_answers = $question['answers'];  		$question['answers']->each(function (Answer $answer, int $key) use (&$standard_answers_data, &$standard_question_data, &$question, &$max_rows_per_page, &$question_answers, &$extra_rows, &$question_answer_last_index, &$question_key) { 			$answers = collect(); 			$answers_next_page = false;  			if ($extra_rows > 0 && $question_key > 0) { 				$answers->push($question_answers); 				$standard_answers_data = $answers->flatten(1)->take($extra_rows)->all();  				$question_answer_last_index = $extra_rows; 				$answers_next_page = false; 				$extra_rows = 0; 			}  			if (($key + 1) % $max_rows_per_page == 0) { 				$answers->push($question_answers); 				$standard_answers_data = array_merge($standard_answers_data, $answers->flatten(1)->splice(0, $key)->all());  				$question_answer_last_index = $key; 				$answers_next_page = true; 			}  			if (($key + 1) == $question_answers->count()) { // if all question answers fit on page or if some answers will be transferred to next page 				$answers->push($question_answers);  				$standard_answers_data = array_merge($standard_answers_data, $answers->flatten(1)->splice($question_answer_last_index, ($key + 1) + 1)->all()); 				$extra_rows = $extra_rows > 0 ? $extra_rows : ($key + 1) - $question_answer_last_index; 				$answers_next_page = true; 			}  			$answers = collect($standard_answers_data);  			$standard_question_data = [ 				'id' => $question['id'], 				'type' => $question['type'], 				'title' => $question['title'], 				'code' => $question['code'], 				'answers' => $answers, 				'question_answer_rows' => $answers->count(), 				'answers_next_page' => $answers_next_page, 			]; 		});  		return $standard_question_data; 	}