delete($exerciseId);
// if the question has been removed from the exercise
if ($objExercise->removeFromList($deleteQuestion)) {
$nbrQuestions--;
}
}
// destruction of the Question object
unset($objQuestionTmp);
}
?>
';
if ($nbrQuestions) {
$my_exercise = new Exercise();
//forces the query to the database
$my_exercise->read($_GET['exerciseId']);
$questionList=$my_exercise->selectQuestionList();
// 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;";
if (is_array($questionList)) {
foreach ($questionList as $id) {
//To avoid warning messages
if (!is_numeric($id)) {
continue;
}
$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).'';
// this variable $show_quiz_edition comes from admin.php blocks the exercise/quiz modifications
if ($show_quiz_edition) {
$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, 60).'', array('style'=>$styleQuestion));
// Question type
list($typeImg, $typeExpl) = $objQuestionTmp->get_type_icon_html();
$questionType = Display::tag('div', Display::return_icon($typeImg, $typeExpl, array(), 32), array('style'=>$styleType));
// Question category
$txtQuestionCat = Security::remove_XSS(Testcategory::getCategoryNameForQuestion($objQuestionTmp->id));
if (empty($txtQuestionCat)) {
$txtQuestionCat = "-";
}
$questionCategory = Display::tag('div', '
'.cut($txtQuestionCat, 55).'', 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 '
';
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, $my_exercise->feedback_type, true);
echo '
';
echo '
';
echo '
';
unset($objQuestionTmp);
}
}
}
if (!$nbrQuestions) {
echo Display::display_warning_message(get_lang('NoQuestion'));
}
echo '
'; //question list div
}