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 include_once
"./Modules/TestQuestionPool/classes/class.assMatchingQuestion.php";
42 $this->
object->loadFromDb($id);
55 $hasErrors = (!$always) ? $this->
editQuestion(
true) :
false;
58 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
71 $this->
object->flushMatchingPairs();
72 $this->
object->flushTerms();
73 $this->
object->flushDefinitions();
76 require_once
'./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php';
77 foreach (
$_POST[
'terms'][
'answer'] as $index => $answer)
80 if (strlen( $_FILES[
'terms'][
'name'][
'image'][$index] ))
83 $name = $_FILES[
'terms'][
'name'][
'image'][$index];
84 if ($this->object->setImageFile( $_FILES[
'terms'][
'tmp_name'][
'image'][$index],
85 $this->object->getEncryptedFilename( $name )
89 $filename = $this->
object->getEncryptedFilename( $name );
100 require_once
'./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php';
101 foreach (
$_POST[
'definitions'][
'answer'] as $index => $answer)
104 if (strlen( $_FILES[
'definitions'][
'name'][
'image'][$index] ))
107 $name = $_FILES[
'definitions'][
'name'][
'image'][$index];
108 if ($this->object->setImageFile( $_FILES[
'definitions'][
'tmp_name'][
'image'][$index],
109 $this->object->getEncryptedFilename( $name )
113 $filename = $this->
object->getEncryptedFilename( $name );
120 $this->
object->addDefinition(
126 if (is_array(
$_POST[
'pairs'][
'points'] ))
128 require_once
'./Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php';
129 foreach (
$_POST[
'pairs'][
'points'] as $index => $points)
131 $term_id =
$_POST[
'pairs'][
'term'][$index];
132 $definition_id =
$_POST[
'pairs'][
'definition'][$index];
133 $this->
object->addMatchingPair( $this->object->getTermWithIdentifier( $term_id ),
134 $this->
object->getDefinitionWithIdentifier( $definition_id ),
143 if (!$this->object->getSelfAssessmentEditingMode())
145 $this->
object->setShuffle(
$_POST[
"shuffle"] );
149 $this->
object->setShuffle( 1 );
151 $this->
object->setThumbGeometry(
$_POST[
"thumb_geometry"] );
152 $this->
object->setMatchingMode(
$_POST[
'matching_mode']);
164 $position = key(
$_POST[
'cmd'][
'removeimageterms']);
165 $this->
object->removeTermImage($position);
178 $position = key(
$_POST[
'cmd'][
'removeimagedefinitions']);
179 $this->
object->removeDefinitionImage($position);
186 $position = key(
$_POST[
"cmd"][
"addterms"]);
187 $this->
object->insertTerm($position+1);
194 $position = key(
$_POST[
"cmd"][
"removeterms"]);
195 $this->
object->deleteTerm($position);
202 $position = key(
$_POST[
"cmd"][
"adddefinitions"]);
203 $this->
object->insertDefinition($position+1);
210 $position = key(
$_POST[
"cmd"][
"removedefinitions"]);
211 $this->
object->deleteDefinition($position);
218 $position = key(
$_POST[
"cmd"][
"addpairs"]);
219 $this->
object->insertMatchingPair($position+1);
226 $position = key(
$_POST[
"cmd"][
"removepairs"]);
227 $this->
object->deleteMatchingPair($position);
236 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
238 $form->setFormAction($this->ctrl->getFormAction($this));
240 $form->setMultipart(
true);
241 $form->setTableWidth(
"100%");
242 $form->setId(
"matching");
255 $form->setValuesByPost();
256 $errors = !$form->checkInput();
257 $form->setValuesByPost();
261 $terms = $form->getItemByPostVar(
'terms');
262 $terms->setAlert($this->lng->txt(
"msg_number_of_terms_too_low"));
265 if (
$errors) $checkonly =
false;
268 if (!$checkonly) $this->tpl->setVariable(
"QUESTION_DATA", $form->getHTML());
289 $numDefinitions = count($form->
getItemByPostVar(
'definitions')->getValues());
291 if($numTerms >= $numDefinitions)
302 include_once
"./Modules/TestQuestionPool/classes/class.ilMatchingWizardInputGUI.php";
304 if ($this->object->getSelfAssessmentEditingMode())
309 $definitions->setRequired(
true );
310 $definitions->setQuestionObject( $this->
object );
311 $definitions->setTextName( $this->lng->txt(
'definition_text' ) );
312 $definitions->setImageName( $this->lng->txt(
'definition_image' ) );
313 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingDefinition.php";
314 if (!count( $this->object->getDefinitions() ))
318 $definitionvalues = $this->
object->getDefinitions();
319 $definitions->setValues( $definitionvalues );
320 $definitions->checkInput();
321 $form->
addItem( $definitions );
324 include_once
"./Modules/TestQuestionPool/classes/class.ilMatchingWizardInputGUI.php";
326 if ($this->object->getSelfAssessmentEditingMode())
328 $terms->setRequired(
true );
329 $terms->setQuestionObject( $this->
object );
330 $terms->setTextName( $this->lng->txt(
'term_text' ) );
331 $terms->setImageName( $this->lng->txt(
'term_image' ) );
332 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingTerm.php";
333 if (!count( $this->object->getTerms() ))
335 $termvalues = $this->
object->getTerms();
336 $terms->setValues( $termvalues );
337 $terms->checkInput();
341 include_once
"./Modules/TestQuestionPool/classes/class.ilMatchingPairWizardInputGUI.php";
344 $pairs->setTerms( $this->object->getTerms() );
345 $pairs->setDefinitions( $this->object->getDefinitions() );
346 include_once
"./Modules/TestQuestionPool/classes/class.assAnswerMatchingPair.php";
347 if (count( $this->object->getMatchingPairs() ) == 0)
349 $this->
object->addMatchingPair(
new assAnswerMatchingPair($termvalues[0], $definitionvalues[0], 0) );
351 $pairs->setPairs( $this->object->getMatchingPairs() );
361 $hidden->setValue($matchingtype);
364 if (!$this->object->getSelfAssessmentEditingMode())
367 $shuffle =
new ilSelectInputGUI($this->lng->txt(
"shuffle_answers" ),
"shuffle");
368 $shuffle_options = array(
369 0 => $this->lng->txt(
"no" ),
370 1 => $this->lng->txt(
"matching_shuffle_terms_definitions" ),
371 2 => $this->lng->txt(
"matching_shuffle_terms" ),
372 3 => $this->lng->txt(
"matching_shuffle_definitions" )
375 $shuffle->setValue($this->object->getShuffle() != null ? $this->
object->getShuffle() : 1);
376 $shuffle->setRequired( FALSE );
379 $geometry =
new ilNumberInputGUI($this->lng->txt(
"thumb_geometry" ),
"thumb_geometry");
380 $geometry->
setValue( $this->object->getThumbGeometry() );
381 $geometry->setRequired(
true );
382 $geometry->setMaxLength( 6 );
383 $geometry->setMinValue( 20 );
384 $geometry->setSize( 6 );
385 $geometry->setInfo( $this->lng->txt(
"thumb_geometry_info" ) );
390 $mode =
new ilRadioGroupInputGUI($this->lng->txt(
'qpl_qst_inp_matching_mode'),
'matching_mode');
396 $mode->addOption($modeONEonONE);
401 $mode->addOption($modeALLonALL);
403 $mode->
setValue($this->object->getMatchingMode());
424 $graphicalOutput = FALSE,
425 $result_output = FALSE,
426 $show_question_only = TRUE,
427 $show_feedback = FALSE,
428 $show_correct_solution = FALSE,
429 $show_manual_scoring = FALSE,
430 $show_question_text = TRUE
434 include_once
"./Services/UICore/classes/class.ilTemplate.php";
435 $template =
new ilTemplate(
"tpl.il_as_qpl_matching_output_solution.html", TRUE, TRUE,
"Modules/TestQuestionPool");
436 $solutiontemplate =
new ilTemplate(
"tpl.il_as_tst_solution_output.html",TRUE, TRUE,
"Modules/TestQuestionPool");
438 $solutions = array();
439 if (($active_id > 0) && (!$show_correct_solution))
441 include_once
"./Modules/Test/classes/class.ilObjTest.php";
442 $solutions =& $this->
object->getSolutionValues($active_id,
$pass);
443 $solution_script .=
"";
447 foreach ($this->object->getMaximumScoringMatchingPairs() as $pair)
449 $solutions[] = array(
450 "value1" => $pair->term->identifier,
451 "value2" => $pair->definition->identifier,
452 'points' => $pair->points
459 foreach ($solutions as $solution)
461 $definition = $this->
object->getDefinitionWithIdentifier($solution[
'value2']);
462 $term = $this->
object->getTermWithIdentifier($solution[
'value1']);
463 $points = $solution[
'points'];
465 if (is_object($definition))
467 if (strlen($definition->picture))
469 if( strlen($definition->text) )
471 $template->setCurrentBlock(
'definition_image_text');
473 $template->parseCurrentBlock();
476 $template->setCurrentBlock(
'definition_image');
477 $template->setVariable(
'ANSWER_IMAGE_URL', $this->object->getImagePathWeb() . $this->
object->getThumbPrefix() . $definition->picture);
480 $template->setVariable(
'URL_PREVIEW', $this->object->getImagePathWeb() . $definition->picture);
481 $template->setVariable(
"TEXT_PREVIEW", $this->lng->txt(
'preview'));
483 $template->parseCurrentBlock();
487 $template->setCurrentBlock(
'definition_text');
488 $template->setVariable(
"DEFINITION", $this->object->prepareTextareaOutput($definition->text, TRUE));
489 $template->parseCurrentBlock();
492 if (is_object($term))
494 if (strlen($term->picture))
496 if( strlen($term->text) )
498 $template->setCurrentBlock(
'term_image_text');
500 $template->parseCurrentBlock();
503 $template->setCurrentBlock(
'term_image');
504 $template->setVariable(
'ANSWER_IMAGE_URL', $this->object->getImagePathWeb() . $this->
object->getThumbPrefix() . $term->picture);
507 $template->setVariable(
'URL_PREVIEW', $this->object->getImagePathWeb() . $term->picture);
508 $template->setVariable(
"TEXT_PREVIEW", $this->lng->txt(
'preview'));
510 $template->parseCurrentBlock();
514 $template->setCurrentBlock(
'term_text');
515 $template->setVariable(
"TERM", $this->object->prepareTextareaOutput($term->text, TRUE));
516 $template->parseCurrentBlock();
520 if (($active_id > 0) && (!$show_correct_solution))
522 if ($graphicalOutput)
526 foreach ($this->object->getMatchingPairs() as $pair)
536 $template->setCurrentBlock(
"icon_ok");
538 $template->setVariable(
"TEXT_OK", $this->lng->txt(
"answer_is_right"));
539 $template->parseCurrentBlock();
543 $template->setCurrentBlock(
"icon_ok");
545 $template->setVariable(
"TEXT_NOT_OK", $this->lng->txt(
"answer_is_wrong"));
546 $template->parseCurrentBlock();
553 $resulttext = ($points == 1) ?
"(%s " . $this->lng->txt(
"point") .
")" :
"(%s " . $this->lng->txt(
"points") .
")";
554 $template->setCurrentBlock(
"result_output");
555 $template->setVariable(
"RESULT_OUTPUT", sprintf($resulttext, $points));
556 $template->parseCurrentBlock();
559 $template->setCurrentBlock(
"row");
560 $template->setVariable(
"TEXT_MATCHES", $this->lng->txt(
"matches"));
561 $template->parseCurrentBlock();
564 $questiontext = $this->
object->getQuestion();
565 if ($show_question_text==
true)
567 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($questiontext, TRUE));
570 $questionoutput = $template->get();
576 $feedback .= strlen($fb) ? $fb :
'';
579 $feedback .= strlen($fb) ? $fb :
'';
581 if (strlen($feedback)) $solutiontemplate->setVariable(
"FEEDBACK", $this->object->prepareTextareaOutput($feedback,
true));
583 $solutiontemplate->setVariable(
"SOLUTION_OUTPUT", $questionoutput);
585 $solutionoutput = $solutiontemplate->get();
586 if (!$show_question_only)
591 return $solutionoutput;
594 public function getPreview($show_question_only = FALSE, $showInlineFeedback =
false)
598 $this->tpl->addJavaScript(
'Modules/TestQuestionPool/js/jquery-ui-1-10-3-fixed.js');
599 $this->tpl->addJavaScript(
'Modules/TestQuestionPool/js/ilMatchingQuestion.js');
602 $template =
new ilTemplate(
"tpl.il_as_qpl_matching_output.html", TRUE, TRUE,
"Modules/TestQuestionPool");
604 foreach($solutions as $defId => $terms)
606 foreach($terms as $termId)
608 $template->setCurrentBlock(
"matching_data");
609 $template->setVariable(
"DEFINITION_ID", $defId);
610 $template->setVariable(
"TERM_ID", $termId);
611 $template->parseCurrentBlock();
616 $terms = $this->
object->getTerms();
617 $definitions = $this->
object->getDefinitions();
618 switch ($this->object->getShuffle())
621 $terms = $this->
object->pcArrayShuffle($terms);
622 $definitions = $this->
object->pcArrayShuffle($definitions);
625 $terms = $this->
object->pcArrayShuffle($terms);
628 $definitions = $this->
object->pcArrayShuffle($definitions);
634 foreach ($definitions as $definition)
636 if (strlen($definition->picture))
638 $template->setCurrentBlock(
"definition_picture");
639 $template->setVariable(
"DEFINITION_ID", $definition->identifier);
640 $template->setVariable(
"IMAGE_HREF", $this->object->getImagePathWeb() . $definition->picture);
641 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $definition->picture;
642 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $definition->picture;
643 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
644 $template->setVariable(
"THUMBNAIL_HREF", $thumbweb);
645 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"image"));
646 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"image"));
647 $template->setVariable(
"TEXT_DEFINITION", (strlen($definition->text)) ? $this->object->prepareTextareaOutput($definition->text, TRUE) :
'');
648 $template->setVariable(
"TEXT_PREVIEW", $this->lng->txt(
'preview'));
650 $template->parseCurrentBlock();
654 $template->setCurrentBlock(
"definition_text");
655 $template->setVariable(
"DEFINITION", $this->object->prepareTextareaOutput($definition->text, TRUE));
656 $template->parseCurrentBlock();
659 $template->setCurrentBlock(
"droparea");
660 $template->setVariable(
"ID_DROPAREA", $definition->identifier);
661 $template->setVariable(
"QUESTION_ID", $this->object->getId());
662 $template->parseCurrentBlock();
664 $template->setCurrentBlock(
"definition_data");
665 $template->setVariable(
"DEFINITION_ID", $definition->identifier);
666 $template->parseCurrentBlock();
671 foreach ($terms as $term)
673 if (strlen($term->picture))
675 $template->setCurrentBlock(
"term_picture");
676 $template->setVariable(
"TERM_ID", $term->identifier);
677 $template->setVariable(
"IMAGE_HREF", $this->object->getImagePathWeb() . $term->picture);
678 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $term->picture;
679 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $term->picture;
680 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
681 $template->setVariable(
"THUMBNAIL_HREF", $thumbweb);
682 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"image"));
683 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"image"));
684 $template->setVariable(
"TEXT_PREVIEW", $this->lng->txt(
'preview'));
685 $template->setVariable(
"TEXT_TERM", (strlen($term->text)) ? $this->object->prepareTextareaOutput($term->text, TRUE) :
'');
687 $template->parseCurrentBlock();
691 $template->setCurrentBlock(
"term_text");
692 $template->setVariable(
"TERM_TEXT", $this->object->prepareTextareaOutput($term->text, TRUE));
693 $template->parseCurrentBlock();
695 $template->setCurrentBlock(
"draggable");
696 $template->setVariable(
"ID_DRAGGABLE", $term->identifier);
697 $template->parseCurrentBlock();
699 $template->setCurrentBlock(
"term_data");
700 $template->setVariable(
"TERM_ID", $term->identifier);
701 $template->parseCurrentBlock();
704 $template->setVariable(
'MATCHING_MODE', $this->object->getMatchingMode());
706 $template->setVariable(
"RESET_BUTTON", $this->lng->txt(
"reset_terms"));
708 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
710 $questionoutput = $template->get();
712 if (!$show_question_only)
718 return $questionoutput;
726 protected function sortDefinitionsBySolution(array $solution, array $definitions)
729 $handled_defintions = array();
730 foreach($solution as $solution_values)
732 $id = $solution_values[
'value2'];
733 if(!isset($handled_defintions[$id]))
735 $neworder[] = $this->
object->getDefinitionWithIdentifier($id);
736 $handled_defintions[$id] = $id;
740 foreach($definitions as $definition)
745 if(!isset($handled_defintions[$definition->identifier]))
747 $neworder[] = $definition;
756 $this->tpl->addJavaScript(
'Modules/TestQuestionPool/js/jquery-ui-1-10-3-fixed.js');
757 $this->tpl->addJavaScript(
'Modules/TestQuestionPool/js/ilMatchingQuestion.js');
760 $template =
new ilTemplate(
"tpl.il_as_qpl_matching_output.html",
true,
true,
"Modules/TestQuestionPool");
765 include_once
"./Modules/Test/classes/class.ilObjTest.php";
770 if (is_array($user_post_solution))
772 $solutions = array();
773 foreach ($user_post_solution[
'matching'][$this->object->getId()] as $definition => $term)
775 array_push($solutions, array(
"value1" => $term,
"value2" => $definition));
780 $solutions =& $this->
object->getSolutionValues($active_id,
$pass);
784 foreach ($solutions as $idx => $solution_value)
786 if (($solution_value[
"value2"] > -1) && ($solution_value[
"value1"] > -1))
788 $template->setCurrentBlock(
"matching_data");
789 $template->setVariable(
"TERM_ID", $solution_value[
"value1"]);
790 $template->setVariable(
"DEFINITION_ID", $solution_value[
"value2"]);
791 $template->parseCurrentBlock();
798 $terms = $this->
object->getTerms();
799 $definitions = $this->
object->getDefinitions();
800 switch ($this->object->getShuffle())
803 $terms = $this->
object->pcArrayShuffle($terms);
804 if (count($solutions))
806 $definitions = $this->sortDefinitionsBySolution($solutions, $definitions);
810 $definitions = $this->
object->pcArrayShuffle($definitions);
814 $terms = $this->
object->pcArrayShuffle($terms);
817 if (count($solutions))
819 $definitions = $this->sortDefinitionsBySolution($solutions, $definitions);
823 $definitions = $this->
object->pcArrayShuffle($definitions);
830 foreach ($definitions as $definition)
832 if (strlen($definition->picture))
834 $template->setCurrentBlock(
"definition_picture");
835 $template->setVariable(
"DEFINITION_ID", $definition->identifier);
836 $template->setVariable(
"IMAGE_HREF", $this->object->getImagePathWeb() . $definition->picture);
837 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $definition->picture;
838 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $definition->picture;
839 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
840 $template->setVariable(
"THUMBNAIL_HREF", $thumbweb);
841 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"image"));
842 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"image"));
843 $template->setVariable(
"TEXT_DEFINITION", (strlen($definition->text)) ?
ilUtil::prepareFormOutput($definition->text) :
'');
844 $template->setVariable(
"TEXT_PREVIEW", $this->lng->txt(
'preview'));
846 $template->parseCurrentBlock();
850 $template->setCurrentBlock(
"definition_text");
851 $template->setVariable(
"DEFINITION", $this->object->prepareTextareaOutput($definition->text,
true));
852 $template->parseCurrentBlock();
855 $template->setCurrentBlock(
"droparea");
856 $template->setVariable(
"ID_DROPAREA", $definition->identifier);
857 $template->setVariable(
"QUESTION_ID", $this->object->getId());
858 $template->parseCurrentBlock();
860 $template->setCurrentBlock(
"definition_data");
861 $template->setVariable(
"DEFINITION_ID", $definition->identifier);
862 $template->parseCurrentBlock();
867 foreach ($terms as $term)
869 if (strlen($term->picture))
871 $template->setCurrentBlock(
"term_picture");
872 $template->setVariable(
"TERM_ID", $term->identifier);
873 $template->setVariable(
"IMAGE_HREF", $this->object->getImagePathWeb() . $term->picture);
874 $thumbweb = $this->
object->getImagePathWeb() . $this->
object->getThumbPrefix() . $term->picture;
875 $thumb = $this->
object->getImagePath() . $this->
object->getThumbPrefix() . $term->picture;
876 if (!@file_exists($thumb)) $this->
object->rebuildThumbnails();
877 $template->setVariable(
"THUMBNAIL_HREF", $thumbweb);
878 $template->setVariable(
"THUMB_ALT", $this->lng->txt(
"image"));
879 $template->setVariable(
"THUMB_TITLE", $this->lng->txt(
"image"));
880 $template->setVariable(
"TEXT_PREVIEW", $this->lng->txt(
'preview'));
883 $template->parseCurrentBlock();
887 $template->setCurrentBlock(
"term_text");
888 $template->setVariable(
"TERM_TEXT", $this->object->prepareTextareaOutput($term->text,
true));
889 $template->parseCurrentBlock();
891 $template->setCurrentBlock(
"draggable");
892 $template->setVariable(
"ID_DRAGGABLE", $term->identifier);
893 $template->parseCurrentBlock();
895 $template->setCurrentBlock(
'term_data');
896 $template->setVariable(
'TERM_ID', $term->identifier);
897 $template->parseCurrentBlock();
900 $template->setVariable(
'MATCHING_MODE', $this->object->getMatchingMode());
902 $template->setVariable(
"RESET_BUTTON", $this->lng->txt(
"reset_terms"));
904 $template->setVariable(
"QUESTIONTEXT", $this->object->prepareTextareaOutput($this->object->getQuestion(), TRUE));
906 return $this->
outQuestionPage(
"", $is_postponed, $active_id, $template->get());
930 global $rbacsystem, $ilTabs;
932 $ilTabs->clearTargets();
934 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id",
$_GET[
"q_id"]);
935 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
936 $q_type = $this->
object->getQuestionType();
940 $classname = $q_type .
"GUI";
941 $this->ctrl->setParameterByClass(strtolower($classname),
"sel_question_types", $q_type);
942 $this->ctrl->setParameterByClass(strtolower($classname),
"q_id",
$_GET[
"q_id"]);
947 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"]))
950 $ilTabs->addTarget(
"edit_page",
951 $this->ctrl->getLinkTargetByClass(
"ilAssQuestionPageGUI",
"edit"),
952 array(
"edit",
"insert",
"exec_pg"),
953 "",
"", $force_active);
959 $force_active =
false;
960 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"]))
963 if ($classname) $url = $this->ctrl->getLinkTargetByClass($classname,
"editQuestion");
965 $ilTabs->addTarget(
"edit_question",
967 array(
"editQuestion",
"save",
"saveEdit",
"removeimageterms",
"uploadterms",
"removeimagedefinitions",
"uploaddefinitions",
968 "addpairs",
"removepairs",
"addterms",
"removeterms",
"adddefinitions",
"removedefinitions",
"originalSyncForm"),
969 $classname,
"", $force_active);
984 $ilTabs->addTarget(
"statistics",
985 $this->ctrl->getLinkTargetByClass($classname,
"assessment"),
995 $matches = array_values($this->object->getMaximumScoringMatchingPairs());
997 if( !$this->object->feedbackOBJ->specificAnswerFeedbackExists($matches) )
1002 $feedback =
'<table class="test_specific_feedback"><tbody>';
1004 foreach ($matches as $idx => $ans)
1006 $fb = $this->
object->feedbackOBJ->getSpecificAnswerFeedbackTestPresentation(
1007 $this->object->getId(), $idx
1009 $feedback .=
'<tr><td>"' . $ans->definition->text .
'" ' . $this->lng->txt(
"matches") .
' "';
1010 $feedback .= $ans->term->text .
'"</td><td>';
1011 $feedback .= $fb .
'</td> </tr>';
1014 $feedback .=
'</tbody></table>';
1015 return $this->
object->prepareTextareaOutput($feedback, TRUE);
1061 if( !($pair->points > 0) )
1066 if( !is_object($term) )
1071 if( $pair->definition->identifier != $definition->identifier )
1076 if( $pair->term->identifier != $term->identifier )