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 //$questionList = $objExercise->selectQuestionList(true); $objExercise->setCategoriesGrouping(false); // Show exercises as in category settings //$questionList = $objExercise->getQuestionListWithMediasUncompressed(); // Show all questions no matter the category settings. $tempCategoryOrder = $objExercise->specialCategoryOrders; $objExercise->specialCategoryOrders = false; $questionList = $objExercise->selectQuestionList(true); $objExercise->specialCategoryOrders = $tempCategoryOrder; // 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 ($objQuestionTmp->type == CALCULATED_ANSWER && $objQuestionTmp->isAnswered()) { $edit_link = ''.Display::return_icon('edit_na.png',get_lang('Modify'), array(), ICON_SIZE_SMALL).''; }*/ $edit_link = ($objQuestionTmp->type == CALCULATED_ANSWER && $objQuestionTmp->isAnswered()) ? ''.Display::return_icon( 'edit_na.png', get_lang('QuestionEditionNotAvailableBecauseItIsAlreadyAnsweredHoweverYouCanCopyItAndModifyTheCopy'), array(), ICON_SIZE_SMALL ).'' : ''. Display::return_icon( 'edit.png', get_lang('Modify'), array(), ICON_SIZE_SMALL ).''; $delete_link = null; 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.' '.cut($title, 42).'', array('style'=>$styleQuestion) ); // Question type list($typeImg, $typeExpl) = $objQuestionTmp->get_type_icon_html(); $questionType = Display::tag('div', Display::return_icon($typeImg, $typeExpl, array(), ICON_SIZE_MEDIUM), array('style'=>$styleType)); // Question category $txtQuestionCat = Security::remove_XSS(Testcategory::getCategoryNameForQuestion($objQuestionTmp->id)); if (empty($txtQuestionCat)) { $txtQuestionCat = "-"; } $questionCategory = Display::tag('div', ''.cut($txtQuestionCat, 42).'', 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 '
'; showQuestion($id, 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 }