4 require_once
'./Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
5 require_once
'./Modules/TestQuestionPool/interfaces/interface.ilGuiQuestionScoringAdjustable.php';
6 require_once
'./Modules/TestQuestionPool/interfaces/interface.ilGuiAnswerScoringAdjustable.php';
7 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
37 parent::__construct();
38 include_once
"./Modules/TestQuestionPool/classes/class.assMultipleChoice.php";
42 $this->
object->loadFromDb($id);
55 $hasErrors = (!$always) ? $this->
editQuestion(
true) :
false;
79 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
81 $form->setFormAction($this->ctrl->getFormAction($this));
83 $isSingleline = ($this->
object->lastChange == 0 && !array_key_exists(
'types',
$_POST)) ? (($this->object->getMultilineAnswerSetting()) ?
false :
true) : $this->
object->isSingleline;
84 if ($checkonly) $isSingleline = (
$_POST[
'types'] == 0) ?
true :
false;
87 $form->setMultipart(TRUE);
91 $form->setMultipart(FALSE);
93 $form->setTableWidth(
"100%");
94 $form->setId(
"assmultiplechoice");
107 $form->setValuesByPost();
108 $errors = !$form->checkInput();
109 $form->setValuesByPost();
110 if (
$errors) $checkonly =
false;
113 if (!$checkonly) $this->tpl->setVariable(
"QUESTION_DATA", $form->getHTML());
123 $position = key(
$_POST[
'cmd'][
'uploadchoice']);
133 $position = key(
$_POST[
'cmd'][
'removeimagechoice']);
135 $this->
object->removeAnswerImage($position);
145 $position = key(
$_POST[
'cmd'][
'addchoice']);
146 $this->
object->addAnswer(
"", 0, 0, $position+1);
156 $position = key(
$_POST[
'cmd'][
'removechoice']);
157 $this->
object->deleteAnswer($position);
173 $is_question_postponed = FALSE,
174 $user_post_solutions = FALSE,
175 $show_specific_inline_feedback = FALSE
181 $is_question_postponed,
182 $user_post_solutions,
183 $show_specific_inline_feedback
186 $this->tpl->setVariable(
"QUESTION_OUTPUT", $test_output);
187 $this->tpl->setVariable(
"FORMACTION", $formaction);
208 $graphicalOutput = FALSE,
209 $result_output = FALSE,
210 $show_question_only = TRUE,
211 $show_feedback = FALSE,
212 $show_correct_solution = FALSE,
213 $show_manual_scoring = FALSE,
214 $show_question_text = TRUE
221 $user_solution = array();
222 if (($active_id > 0) && (!$show_correct_solution))
224 $solutions =& $this->
object->getSolutionValues($active_id,
$pass);
225 foreach ($solutions as $idx => $solution_value)
227 array_push($user_solution, $solution_value[
"value1"]);
233 foreach ($this->object->answers as $index => $answer)
235 $points_checked = $answer->getPointsChecked();
236 $points_unchecked = $answer->getPointsUnchecked();
237 if ($points_checked > $points_unchecked)
239 if ($points_checked > 0)
241 array_push($user_solution, $index);
248 include_once
"./Services/UICore/classes/class.ilTemplate.php";
249 $template =
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output_solution.html", TRUE, TRUE,
"Modules/TestQuestionPool");
250 $solutiontemplate =
new ilTemplate(
"tpl.il_as_tst_solution_output.html",TRUE, TRUE,
"Modules/TestQuestionPool");
251 foreach ($keys as $answer_id)
253 $answer = $this->
object->answers[$answer_id];
254 if (($active_id > 0) && (!$show_correct_solution))
256 if ($graphicalOutput)
261 foreach ($user_solution as $mc_solution)
263 if (strcmp($mc_solution, $answer_id) == 0)
270 if ($answer->getPointsChecked() > $answer->getPointsUnchecked())
281 if ($answer->getPointsChecked() > $answer->getPointsUnchecked())
292 $template->setCurrentBlock(
"icon_ok");
294 $template->setVariable(
"TEXT_OK", $this->lng->txt(
"answer_is_right"));
295 $template->parseCurrentBlock();
299 $template->setCurrentBlock(
"icon_ok");
301 $template->setVariable(
"TEXT_NOT_OK", $this->lng->txt(
"answer_is_wrong"));
302 $template->parseCurrentBlock();
306 if (strlen($answer->getImage()))
308 $template->setCurrentBlock(
"answer_image");
309 if ($this->object->getThumbSize())
311 $template->setVariable(
"ANSWER_IMAGE_URL", $this->object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
315 $template->setVariable(
"ANSWER_IMAGE_URL", $this->object->getImagePathWeb() . $answer->getImage());
317 $alt = $answer->getImage();
318 if (strlen($answer->getAnswertext()))
320 $alt = $answer->getAnswertext();
322 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
325 $template->parseCurrentBlock();
331 if ($this->object->getSpecificFeedbackSetting() == 2)
333 foreach ($user_solution as $mc_solution)
335 if (strcmp($mc_solution, $answer_id) == 0)
337 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
338 $this->object->getId(), $answer_id
342 $template->setCurrentBlock(
"feedback");
343 $template->setVariable(
"FEEDBACK", $this->object->prepareTextareaOutput( $fb,
true ));
344 $template->parseCurrentBlock();
350 if ($this->object->getSpecificFeedbackSetting() == 1)
352 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
353 $this->object->getId(), $answer_id
357 $template->setCurrentBlock(
"feedback");
358 $template->setVariable(
"FEEDBACK", $this->object->prepareTextareaOutput( $fb,
true ));
359 $template->parseCurrentBlock();
363 if ($this->object->getSpecificFeedbackSetting() == 3)
365 $answer = $this->
object->getAnswer($answer_id);
367 if ($answer->getPoints() > 0)
369 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
370 $this->object->getId(), $answer_id
374 $template->setCurrentBlock(
"feedback");
375 $template->setVariable(
"FEEDBACK", $this->object->prepareTextareaOutput( $fb,
true ));
376 $template->parseCurrentBlock();
382 $template->setCurrentBlock(
"answer_row");
383 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
387 $pointschecked = $this->
object->answers[$answer_id]->getPointsChecked();
388 $pointsunchecked = $this->
object->answers[$answer_id]->getPointsUnchecked();
389 $resulttextchecked = ($pointschecked == 1) || ($pointschecked == -1) ?
"%s " . $this->lng->txt(
"point") :
"%s " . $this->lng->txt(
"points");
390 $resulttextunchecked = ($pointsunchecked == 1) || ($pointsunchecked == -1) ?
"%s " . $this->lng->txt(
"point") :
"%s " . $this->lng->txt(
"points");
391 $template->setVariable(
"RESULT_OUTPUT", sprintf(
"(" . $this->lng->txt(
"checkbox_checked") .
" = $resulttextchecked, " . $this->lng->txt(
"checkbox_unchecked") .
" = $resulttextunchecked)", $pointschecked, $pointsunchecked));
393 foreach ($user_solution as $mc_solution)
395 if (strcmp($mc_solution, $answer_id) == 0)
398 $template->setVariable(
"SOLUTION_ALT", $this->lng->txt(
"checked"));
405 $template->setVariable(
"SOLUTION_ALT", $this->lng->txt(
"unchecked"));
407 $template->parseCurrentBlock();
409 $questiontext = $this->
object->getQuestion();
410 if ($show_question_text==
true)
412 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
414 $questionoutput = $template->get();
417 if (strlen($feedback)) $solutiontemplate->setVariable(
"FEEDBACK", $this->object->prepareTextareaOutput( $feedback ,
true ));
418 $solutiontemplate->setVariable(
"SOLUTION_OUTPUT", $questionoutput);
420 $solutionoutput = $solutiontemplate->get();
421 if (!$show_question_only)
424 $solutionoutput =
'<div class="ilc_question_Standard">'.$solutionoutput.
"</div>";
426 return $solutionoutput;
435 include_once
"./Services/UICore/classes/class.ilTemplate.php";
436 $template =
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output.html", TRUE, TRUE,
"Modules/TestQuestionPool");
437 foreach ($keys as $answer_id)
439 $answer = $this->
object->answers[$answer_id];
440 if (strlen($answer->getImage()))
442 if ($this->object->getThumbSize())
444 $template->setCurrentBlock(
"preview");
445 $template->setVariable(
"URL_PREVIEW", $this->object->getImagePathWeb() . $answer->getImage());
446 $template->setVariable(
"TEXT_PREVIEW", $this->lng->txt(
'preview'));
448 $template->setVariable(
"ANSWER_IMAGE_URL", $this->object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
449 list($width, $height, $type, $attr) = getimagesize($this->object->getImagePath() . $answer->getImage());
450 $alt = $answer->getImage();
451 if (strlen($answer->getAnswertext()))
453 $alt = $answer->getAnswertext();
455 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
458 $template->parseCurrentBlock();
462 $template->setCurrentBlock(
"answer_image");
463 $template->setVariable(
"ANSWER_IMAGE_URL", $this->object->getImagePathWeb() . $answer->getImage());
464 list($width, $height, $type, $attr) = getimagesize($this->object->getImagePath() . $answer->getImage());
465 $alt = $answer->getImage();
466 if (strlen($answer->getAnswertext()))
468 $alt = $answer->getAnswertext();
470 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
471 $template->setVariable(
"ATTR", $attr);
474 $template->parseCurrentBlock();
477 $template->setCurrentBlock(
"answer_row");
478 $template->setVariable(
"ANSWER_ID", $answer_id);
479 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
480 $template->parseCurrentBlock();
482 $questiontext = $this->
object->getQuestion();
483 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
484 $questionoutput = $template->get();
485 if (!$show_question_only)
490 return $questionoutput;
505 $is_postponed = FALSE,
506 $use_post_solutions = FALSE,
507 $show_feedback = FALSE
514 $user_solution = array();
518 include_once
"./Modules/Test/classes/class.ilObjTest.php";
523 $solutions =& $this->
object->getSolutionValues($active_id,
$pass);
524 foreach ($solutions as $idx => $solution_value)
526 array_push($user_solution, $solution_value[
"value1"]);
530 include_once
"./Services/UICore/classes/class.ilTemplate.php";
531 $template =
new ilTemplate(
"tpl.il_as_qpl_mc_mr_output.html", TRUE, TRUE,
"Modules/TestQuestionPool");
532 foreach ($keys as $answer_id)
534 $answer = $this->
object->answers[$answer_id];
535 if (strlen($answer->getImage()))
537 if ($this->object->getThumbSize())
539 $template->setCurrentBlock(
"preview");
540 $template->setVariable(
"URL_PREVIEW", $this->object->getImagePathWeb() . $answer->getImage());
541 $template->setVariable(
"TEXT_PREVIEW", $this->lng->txt(
'preview'));
543 $template->setVariable(
"ANSWER_IMAGE_URL", $this->object->getImagePathWeb() . $this->
object->getThumbPrefix() . $answer->getImage());
544 list($width, $height, $type, $attr) = getimagesize($this->object->getImagePath() . $answer->getImage());
545 $alt = $answer->getImage();
546 if (strlen($answer->getAnswertext()))
548 $alt = $answer->getAnswertext();
550 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
553 $template->parseCurrentBlock();
557 $template->setCurrentBlock(
"answer_image");
558 $template->setVariable(
"ANSWER_IMAGE_URL", $this->object->getImagePathWeb() . $answer->getImage());
559 list($width, $height, $type, $attr) = getimagesize($this->object->getImagePath() . $answer->getImage());
560 $alt = $answer->getImage();
561 if (strlen($answer->getAnswertext()))
563 $alt = $answer->getAnswertext();
565 $alt = preg_replace(
"/<[^>]*?>/",
"", $alt);
566 $template->setVariable(
"ATTR", $attr);
569 $template->parseCurrentBlock();
572 if ($show_feedback && $this->object->getSpecificFeedbackSetting() == 2)
574 foreach ($user_solution as $mc_solution)
576 if (strcmp($mc_solution, $answer_id) == 0)
578 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
579 $this->object->getId(), $answer_id
583 $template->setCurrentBlock(
"feedback");
584 $template->setVariable(
"FEEDBACK", $this->object->prepareTextareaOutput( $fb,
true ));
585 $template->parseCurrentBlock();
591 if ($show_feedback && $this->object->getSpecificFeedbackSetting() == 1)
593 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
594 $this->object->getId(), $answer_id
598 $template->setCurrentBlock(
"feedback");
599 $template->setVariable(
"FEEDBACK", $this->object->prepareTextareaOutput( $fb,
true ));
600 $template->parseCurrentBlock();
604 if ($show_feedback && $this->object->getSpecificFeedbackSetting() == 3)
606 $answer = $this->
object->getAnswer($answer_id);
608 if ($answer->getPoints() > 0)
610 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
611 $this->object->getId(), $answer_id
615 $template->setCurrentBlock(
"feedback");
616 $template->setVariable(
"FEEDBACK", $this->object->prepareTextareaOutput( $fb,
true ));
617 $template->parseCurrentBlock();
624 $template->setCurrentBlock(
"answer_row");
625 $template->setVariable(
"ANSWER_ID", $answer_id);
626 $template->setVariable(
"ANSWER_TEXT", $this->object->prepareTextareaOutput($answer->getAnswertext(), TRUE));
627 foreach ($user_solution as $mc_solution)
629 if (strcmp($mc_solution, $answer_id) == 0)
631 $template->setVariable(
"CHECKED_ANSWER",
" checked=\"checked\"");
634 $template->parseCurrentBlock();
636 $questiontext = $this->
object->getQuestion();
637 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
638 $questionoutput = $template->get();
639 $pageoutput = $this->
outQuestionPage(
"", $is_postponed, $active_id, $questionoutput);
650 global $rbacsystem, $ilTabs;
652 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id",
$_GET[
"q_id"]);
653 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
654 $q_type = $this->
object->getQuestionType();
658 $classname = $q_type .
"GUI";
659 $this->ctrl->setParameterByClass(strtolower($classname),
"sel_question_types", $q_type);
660 $this->ctrl->setParameterByClass(strtolower($classname),
"q_id",
$_GET[
"q_id"]);
665 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"]))
668 $ilTabs->addTarget(
"edit_page",
669 $this->ctrl->getLinkTargetByClass(
"ilAssQuestionPageGUI",
"edit"),
670 array(
"edit",
"insert",
"exec_pg"),
671 "",
"", $force_active);
675 $ilTabs->addTarget(
"preview",
676 $this->ctrl->getLinkTargetByClass(
"ilAssQuestionPageGUI",
"preview"),
678 "ilAssQuestionPageGUI",
"", $force_active);
680 $force_active =
false;
681 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"]))
684 if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname,
"editQuestion");
685 $force_active =
false;
687 $ilTabs->addTarget(
"edit_question",
689 array(
"editQuestion",
"save",
"saveEdit",
"addchoice",
"removechoice",
"removeimagechoice",
"uploadchoice",
"originalSyncForm"),
690 $classname,
"", $force_active);
701 $ilTabs->addTarget(
"solution_hint",
702 $this->ctrl->getLinkTargetByClass($classname,
"suggestedsolution"),
703 array(
"suggestedsolution",
"saveSuggestedSolution",
"outSolutionExplorer",
"cancel",
704 "addSuggestedSolution",
"cancelExplorer",
"linkChilds",
"removeSuggestedSolution" 714 $ilTabs->addTarget(
"statistics",
715 $this->ctrl->getLinkTargetByClass($classname,
"assessment"),
720 if ((
$_GET[
"calling_test"] > 0) || (
$_GET[
"test_ref_id"] > 0))
725 global $___test_express_mode;
727 if (!
$_GET[
'test_express_mode'] && !$___test_express_mode) {
728 $ilTabs->setBackTarget($this->lng->txt(
"backtocallingtest"),
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
732 $ilTabs->setBackTarget($this->lng->txt(
"backtocallingtest"), $link);
737 $ilTabs->setBackTarget($this->lng->txt(
"qpl"), $this->ctrl->getLinkTargetByClass(
"ilobjquestionpoolgui",
"questions"));
748 if (strcmp(
$_GET[
"activecommand"],
"directfeedback") == 0)
752 if (!is_array($this->choiceKeys))
754 $this->choiceKeys = array_keys($this->object->answers);
755 if ($this->object->getShuffle())
757 $this->choiceKeys = $this->
object->pcArrayShuffle($this->choiceKeys);
768 return $this->
object->prepareTextareaOutput($output, TRUE);
773 $this->
object->setShuffle(
$_POST[
"shuffle"] );
775 $this->
object->setSpecificFeedbackSetting(
$_POST[
'feedback_setting'] );
777 $this->
object->setMultilineAnswerSetting(
$_POST[
"types"] );
778 if (is_array(
$_POST[
'choice'][
'imagename'] ) &&
$_POST[
"types"] == 1)
780 $this->
object->isSingleline =
true;
785 $this->
object->isSingleline = (
$_POST[
"types"] == 0) ?
true :
false;
787 $this->
object->setThumbSize( (strlen(
$_POST[
"thumb_size"] )) ?
$_POST[
"thumb_size"] :
"" );
793 $this->
object->flushAnswers();
794 if ($this->object->isSingleline)
796 foreach (
$_POST[
'choice'][
'answer'] as $index => $answertext)
798 $picturefile =
$_POST[
'choice'][
'imagename'][$index];
799 $file_org_name = $_FILES[
'choice'][
'name'][
'image'][$index];
800 $file_temp_name = $_FILES[
'choice'][
'tmp_name'][
'image'][$index];
802 if (strlen( $file_temp_name ))
805 $suffix = strtolower( array_pop( explode(
".", $file_org_name ) ) );
806 if (in_array( $suffix, array(
"jpg",
"jpeg",
"png",
"gif" ) ))
809 $filename = $this->
object->createNewImageFileName( $file_org_name );
810 if ($this->object->setImageFile(
$filename, $file_temp_name ) == 0)
816 $this->
object->addAnswer( $answertext,
817 $_POST[
'choice'][
'points'][$index],
818 $_POST[
'choice'][
'points_unchecked'][$index],
826 foreach (
$_POST[
'choice'][
'answer'] as $index => $answer)
828 $answertext = $answer;
829 $this->
object->addAnswer( $answertext,
830 $_POST[
'choice'][
'points'][$index],
831 $_POST[
'choice'][
'points_unchecked'][$index],
843 $shuffle->setChecked( $this->object->getShuffle() );
844 $shuffle->setRequired( FALSE );
847 if ($this->object->getId())
850 $hidden->setValue( $this->object->getId() );
854 if (!$this->object->getSelfAssessmentEditingMode())
856 $isSingleline = ($this->
object->lastChange == 0 && !array_key_exists(
'types',
858 )) ? (($this->object->getMultilineAnswerSetting()) ?
false :
true) : $this->
object->isSingleline;
862 $types->setValue( ($isSingleline) ? 0 : 1 );
863 $types->setOptions( array(
864 0 => $this->lng->txt(
'answers_singleline' ),
865 1 => $this->lng->txt(
'answers_multiline' ),
874 $thumb_size =
new ilNumberInputGUI($this->lng->txt(
"thumb_size" ),
"thumb_size");
875 $thumb_size->
setSuffix($this->lng->txt(
"thumb_size_unit_pixel"));
876 $thumb_size->setMinValue( 20 );
877 $thumb_size->setDecimals( 0 );
878 $thumb_size->setSize( 6 );
879 $thumb_size->setInfo( $this->lng->txt(
'thumb_size_info' ) );
880 $thumb_size->setValue( $this->object->getThumbSize() );
881 $thumb_size->setRequired(
false );
883 return $isSingleline;
885 return $isSingleline;
891 include_once
"./Modules/TestQuestionPool/classes/class.ilMultipleChoiceWizardInputGUI.php";
894 $choices->setQuestionObject( $this->
object );
895 $isSingleline = ($this->
object->lastChange == 0 && !array_key_exists(
'types',
897 )) ? (($this->object->getMultilineAnswerSetting()) ?
false :
true) : $this->
object->isSingleline;
898 $choices->setSingleline( $isSingleline );
899 $choices->setAllowMove(
false );
900 if ($this->object->getSelfAssessmentEditingMode())
902 $choices->setSize( 40 );
903 $choices->setMaxLength( 800 );
905 if ($this->object->getAnswerCount() == 0)
906 $this->object->addAnswer(
"", 0, 0, 0 );
907 $choices->setValues( $this->object->getAnswers() );
936 return array(
'shuffle',
'types',
'thumb_size');
943 $multiplechoice_wizardinputgui->setDisableUpload(
true);
944 $multiplechoice_wizardinputgui->setDisableActions(
true);
945 $multiplechoice_wizardinputgui->setDisableText(
true);
960 foreach($relevant_answers as $answer)
962 $actives[$answer[
'active_fi']] = max($answer[
'pass'], $actives[$answer[
'pass']]);
964 $usercount = count($actives);
966 foreach($actives as $active)
968 $passcount += $active;
970 $passcount = $passcount + $usercount;
972 $tpl =
new ilTemplate(
'tpl.il_as_aggregated_answers_header.html',
true,
true,
"Modules/TestQuestionPool");
973 $tpl->setVariable(
'HEADERTEXT', $this->lng->txt(
'overview'));
974 $tpl->setVariable(
'NUMBER_OF_USERS_INFO', $this->lng->txt(
'number_of_users'));
975 $tpl->setVariable(
'NUMBER_OF_USERS', $usercount);
976 $tpl->setVariable(
'NUMBER_OF_PASSES_INFO', $this->lng->txt(
'number_of_passes'));
977 $tpl->setVariable(
'NUMBER_OF_PASSES', $passcount);
979 $header =
$tpl->get();
986 $this->object->getAnswers()
989 return $header . $overview . $variants ;
994 $aggregate = array();
995 foreach ($answers_defined_on_question as $answer)
997 $aggregated_info_for_answer = array();
998 $aggregated_info_for_answer[
'answertext'] = $answer->getAnswerText();
999 $aggregated_info_for_answer[
'count_checked'] = 0;
1001 foreach ($relevant_answers_chosen as $relevant_answer)
1003 if ($relevant_answer[
'value1'] == $answer->getOrder())
1005 $aggregated_info_for_answer[
'count_checked']++;
1008 $aggregated_info_for_answer[
'count_unchecked'] =
1009 ceil(count($relevant_answers_chosen) / count($answers_defined_on_question))
1010 - $aggregated_info_for_answer[
'count_checked'];
1012 $aggregate[] = $aggregated_info_for_answer;
1019 $variants = array();
1020 $passdata = array();
1021 foreach ($relevant_answers_chosen as $relevant_answer)
1023 $pass_ident = $relevant_answer[
'active_fi'].$relevant_answer[
'pass'];
1024 $answer = $passdata[$pass_ident];
1025 if (strlen($answer))
1027 $answer_elements = explode(
',', $answer);
1029 $answer_elements = array();
1031 $answer_elements[] = $relevant_answer[
'value1'];
1032 $passdata[$pass_ident] = implode(
',',$answer_elements);
1034 foreach($passdata as $passident => $behaviour)
1036 $variants[$behaviour]++;
1049 $tpl =
new ilTemplate(
'tpl.il_as_aggregated_answers_table.html',
true,
true,
"Modules/TestQuestionPool");
1050 $tpl->setVariable(
'OPTION_HEADER', $this->lng->txt(
'option') );
1051 $tpl->setVariable(
'COUNT_HEADER', $this->lng->txt(
'count') );
1052 $tpl->setVariable(
'AGGREGATION_HEADER', $this->lng->txt(
'aggregated_answers_header') );
1053 foreach ($aggregate as $line_data)
1055 $tpl->setCurrentBlock(
'aggregaterow' );
1056 $tpl->setVariable(
'OPTION', $line_data[
'answertext'] );
1057 $tpl->setVariable(
'COUNT', $line_data[
'count_checked'] );
1058 $tpl->parseCurrentBlock();
1065 $tpl =
new ilTemplate(
'tpl.il_as_aggregated_answers_table.html',
true,
true,
"Modules/TestQuestionPool" );
1066 $tpl->setVariable(
'OPTION_HEADER', $this->lng->txt(
'answer_variant' ) );
1067 $tpl->setVariable(
'COUNT_HEADER', $this->lng->txt(
'count' ) );
1068 $tpl->setVariable(
'AGGREGATION_HEADER', $this->lng->txt(
'aggregated_answers_variants' ) );
1069 foreach ($aggregate as
$options => $count)
1071 $tpl->setCurrentBlock(
'aggregaterow' );
1072 $optionstext = array();
1073 foreach (explode(
',',
$options ) as $option)
1075 $answer = $answers[$option];
1076 $optionstext[] = $answer->getAnswerText();
1078 $tpl->setVariable(
'OPTION', implode(
', ', $optionstext ) );
1079 $tpl->setVariable(
'COUNT', $count );
1080 $tpl->parseCurrentBlock();
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
writePostData()
Evaluates a posted edit form and writes the form data in the question object.
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question, working time.
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
editQuestion($checkonly=FALSE)
Creates an output of the edit form for the question.
_getPass($active_id)
Retrieves the actual pass of a given user for a given test.
getAfterParticipationSuppressionAnswerPostVars()
Returns a list of postvars which will be suppressed in the form output when used in scoring adjustmen...
getChoiceKeys()
Create the key index numbers for the array of choices.
removechoice()
Remove an answer.
getSpecificFeedbackOutput($active_id, $pass)
getAggregatedAnswersView($relevant_answers)
Returns an html string containing a question specific representation of the answers so far given in t...
getQuestionTemplate()
get question template
Class for multiple choice tests.
populateTaxonomyFormSection(ilPropertyFormGUI $form)
removeimagechoice()
Remove an image.
renderVariantsView($aggregate, $answers)
addchoice()
Add a new answer.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
populateAnswerSpecificFormPart(\ilPropertyFormGUI $form)
setQuestionTabs()
Sets the ILIAS tabs for this question type.
writeQuestionGenericPostData()
writeQuestionSpecificPostData($always=false)
Extracts the question specific values from $_POST and applies them to the data object.
static getReturnToPageLink($q_id=null)
if(!is_array($argv)) $options
getILIASPage($html="")
Returns the ILIAS Page around a question.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getTestOutput( $active_id, $pass=NULL, $is_postponed=FALSE, $use_post_solutions=FALSE, $show_feedback=FALSE)
populateQuestionSpecificFormPart(\ilPropertyFormGUI $form)
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.
special template class to simplify handling of ITX/PEAR
outQuestionForTest( $formaction, $active_id, $pass=NULL, $is_question_postponed=FALSE, $user_post_solutions=FALSE, $show_specific_inline_feedback=FALSE)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
writeAnswerSpecificPostData($always=false)
Extracts the answer specific values from $_POST and applies them to the data object.
Basic GUI class for assessment questions.
_getUsePreviousAnswers($active_id, $user_active_user_setting=false)
Returns if the previous results should be hidden for a learner.
static getHtmlPath($relative_path)
get url of path
aggregateAnswers($relevant_answers_chosen, $answers_defined_on_question)
getAfterParticipationSuppressionQuestionPostVars()
Returns a list of postvars which will be suppressed in the form output when used in scoring adjustmen...
getAnswerFeedbackOutput($active_id, $pass)
Returns the answer generic feedback depending on the results of the question.
Multiple choice question GUI representation.
__construct($id=-1)
assMultipleChoiceGUI constructor
saveTaxonomyAssignments()
renderAggregateView($aggregate)
uploadchoice()
Upload an image.
Interface ilGuiAnswerScoringAdjustable.
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page
getPreview($show_question_only=FALSE)
Interface ilGuiQuestionScoringAdjustable.
getSolutionOutput( $active_id, $pass=NULL, $graphicalOutput=FALSE, $result_output=FALSE, $show_question_only=TRUE, $show_feedback=FALSE, $show_correct_solution=FALSE, $show_manual_scoring=FALSE, $show_question_text=TRUE)
Get the question solution output.
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
aggregateAnswerVariants($relevant_answers_chosen)