delete($exerciseId); // if the question has been removed from the exercise if ($objExercise->removeFromList($deleteQuestion)) { $nbrQuestions--; } } // destruction of the Question object unset($objQuestionTmp); } $ajax_url = api_get_path(WEB_AJAX_PATH).'exercise.ajax.php?'.api_get_cidreq().'&exercise_id='.intval($exerciseId); ?>
'; $token = Security::get_token(); //deletes a session when using don't know question type (ugly fix) Session::erase('less_answer'); // If we are in a test $inATest = isset($exerciseId) && $exerciseId > 0; if (!$inATest) { echo Display::return_message(get_lang('ChoiceQuestionType'), 'warning'); } else { if ($nbrQuestions) { // In the building exercise mode show question list ordered as is. $objExercise->setCategoriesGrouping(false); // In building mode show all questions not render by teacher order. $objExercise->questionSelectionType = EX_Q_SELECTION_ORDERED; $allowQuestionOrdering = true; $showPagination = api_get_configuration_value('show_question_pagination'); if (!empty($showPagination) && $nbrQuestions > $showPagination) { $length = api_get_configuration_value('question_pagination_length'); $url = api_get_self().'?'.api_get_cidreq(); // Use pagination for exercise with more than 200 questions. $allowQuestionOrdering = false; $start = ($page - 1) * $length; $questionList = $objExercise->getQuestionForTeacher($start, $length); $paginator = new Knp\Component\Pager\Paginator(); $pagination = $paginator->paginate([]); $pagination->setTotalItemCount($nbrQuestions); $pagination->setItemNumberPerPage($length); $pagination->setCurrentPageNumber($page); $pagination->renderer = function ($data) use ($url) { $render = '