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); ?>
" style="display:none;">

setQuestionList(); echo '
'; echo '
'; $token = Security::get_token(); // Deletes a session when using don't know question type (ugly fix). unset($_SESSION['less_answer']); echo Question::getMediaLabels(); // If we are in a test. $inATest = isset($exerciseId) && $exerciseId > 0; if (!$inATest) { echo "

".get_lang("ChoiceQuestionType")."

"; } else { // Title line echo "
"; echo "
 ".get_lang('Questions')."
"; echo "
".get_lang('Type')."
"; echo "
".get_lang('Category')."
"; echo "
".get_lang('Difficulty')."
"; echo "
".get_lang('Score')."
"; echo "
"; echo "
 
"; echo '
'; if ($nbrQuestions) { // Always getting list from DB. $objExercise->setCategoriesGrouping(false); $questionList = $objExercise->getQuestionListWithMediasUncompressed(); // Style for columns. $styleQuestion = "width:50%; float:left;"; $styleType = "width:4%; float:left; padding-top:4px; text-align:center;"; $styleCat = "width:22%; float:left; padding-top:8px; text-align:center;"; $styleLevel = "width:6%; float:left; padding-top:8px; text-align:center;"; $styleScore = "width:4%; float:left; padding-top:8px; text-align:center;"; $category_list = Testcategory::getListOfCategoriesNameForTest($objExercise->id, false); if (is_array($questionList)) { foreach ($questionList as $id) { // To avoid warning messages. if (!is_numeric($id)) { continue; } /** @var Question $objQuestionTmp */ $objQuestionTmp = Question :: read($id); $question_class = get_class($objQuestionTmp); $clone_link = ''.Display::return_icon('cd.gif',get_lang('Copy'), array(), ICON_SIZE_SMALL).''; $edit_link = ''.Display::return_icon('edit.png',get_lang('Modify'), array(), ICON_SIZE_SMALL).''; if ($objExercise->edit_exercise_in_lp == true) { $delete_link = ''.Display::return_icon('delete.png',get_lang('RemoveFromTest'), array(), ICON_SIZE_SMALL).''; } $edit_link = Display::tag('div', $edit_link, array('style'=>'float:left; padding:0px; margin:0px')); $clone_link = Display::tag('div', $clone_link, array('style'=>'float:left; padding:0px; margin:0px')); $delete_link = Display::tag('div', $delete_link, array('style'=>'float:left; padding:0px; margin:0px')); $actions = Display::tag('div', $edit_link.$clone_link.$delete_link, array('class'=>'edition','style'=>'width:100px; right:10px; margin-top: 0px; position: absolute; top: 10%;')); $title = Security::remove_XSS($objQuestionTmp->selectTitle()); $move = Display::return_icon('all_directions.png',get_lang('Move'), array('class'=>'moved', 'style'=>'margin-bottom:-0.5em;')); // Question name $questionName = Display::tag('div', ''.$move.' '.Text::cut($title, 42).'', array('style'=>$styleQuestion)); // Question type. list($typeImg, $typeExpl) = $objQuestionTmp->get_type_icon_html(); $question_media = null; if (!empty($objQuestionTmp->parent_id)) { $objQuestionMedia = Question::read($objQuestionTmp->parent_id); $question_media = ' '.Question::getMediaLabel($objQuestionMedia->question); } $questionType = Display::tag('div', Display::return_icon($typeImg, $typeExpl, array(), ICON_SIZE_MEDIUM), array('style' => $styleType)); // Question category. $category_labels = Testcategory::return_category_labels($objQuestionTmp->category_list, $category_list); if (empty($category_labels)) { $category_labels = ""; } $questionCategory = Display::tag('div', ''.$category_labels.$question_media.'', array('style'=>$styleCat)); // Question level. $txtQuestionLevel = $objQuestionTmp->level; if (empty($objQuestionTmp->level)) { $txtQuestionLevel = '-'; } $questionLevel = Display::tag('div', $txtQuestionLevel, array('style'=>$styleLevel)); // Question score $questionScore = Display::tag('div', $objQuestionTmp->selectWeighting(), array('style'=>$styleScore)); echo '
'; echo '
'; echo $questionName; echo $questionType; echo $questionCategory; echo $questionLevel; echo $questionScore; echo $actions; echo '
'; echo '
'; echo '

'; //echo get_lang($question_class.$label); echo get_lang($question_class); echo '
'; //echo get_lang('Level').': '.$objQuestionTmp->selectLevel(); echo '
'; echo $objExercise->showQuestion($objQuestionTmp, false, null, null, false, true, false, true, $objExercise->feedback_type, true); echo '

'; echo '
'; echo '
'; unset($objQuestionTmp); } } } if (!$nbrQuestions) { echo Display::display_warning_message(get_lang('NoQuestion')); } echo '
'; //question list div }