4 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
5 require_once
'Modules/Test/classes/class.ilTestExpressPage.php';
6 require_once
'Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
7 require_once
'Modules/Test/classes/class.ilTestExpressPage.php';
8 require_once
'Modules/Test/classes/class.ilObjAssessmentFolder.php';
127 $this->ctrl->saveParameter($this,
"q_id");
128 $this->ctrl->saveParameter($this,
"prev_qid");
129 $this->ctrl->saveParameter($this,
"calling_test");
130 $this->ctrl->saveParameter($this,
"calling_consumer");
131 $this->ctrl->saveParameter($this,
"consumer_context");
132 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'test_express_mode');
133 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'calling_consumer');
134 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'consumer_context');
135 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'test_express_mode');
136 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'calling_consumer');
137 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'consumer_context');
139 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
140 $this->errormessage = $this->lng->txt(
"fill_out_all_required_fields");
142 $this->selfassessmenteditingmode =
false;
143 $this->new_id_listeners = array();
144 $this->new_id_listener_cnt = 0;
146 $this->navigationGUI = null;
163 $DIC->ui()->mainTemplate()->setVariable(
168 $notesUrl = $this->ctrl->getLinkTargetByClass(
169 array(
"ilcommonactiondispatchergui",
"ilnotegui"),
178 $redrawActionsUrl = $DIC->ctrl()->getLinkTarget($this,
'redrawHeaderAction',
'',
true);
179 $DIC->ui()->mainTemplate()->addOnLoadCode(
"il.Object.setRedrawAHUrl('$redrawActionsUrl');");
193 $ilObjDataCache = $DIC[
'ilObjDataCache'];
195 $parentObjType = $ilObjDataCache->lookupType($this->object->getObjId());
202 $this->
object->getObjId()
205 $dispatcher->
setSubObject(
"quest", $this->object->getId());
207 $ha = $dispatcher->initHeaderAction();
208 $ha->enableComments(
true,
false);
210 return $ha->getHeaderAction($DIC->ui()->mainTemplate());
215 $notesGUI =
new ilNoteGUI($this->object->getObjId(), $this->
object->getId(),
'quest');
217 $notesGUI->enablePublicNotesDeletion(
true);
219 return $notesGUI->getNotesHTML();
228 $ilHelp = $DIC[
'ilHelp'];
229 $ilHelp->setScreenIdComponent(
'qpl');
231 $cmd = $this->ctrl->getCmd(
"editQuestion");
232 $next_class = $this->ctrl->getNextClass($this);
236 switch ($next_class) {
237 case 'ilformpropertydispatchgui':
240 require_once
'Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
243 return $this->ctrl->forwardCommand($form_prop_dispatch);
247 $ret = $this->$cmd();
459 if (is_object($this->
object)) {
488 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionCumulatedStatisticsTableGUI.php';
491 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionUsagesTableGUI.php';
494 $tpl->setContent(implode(
'<br />', array(
495 $stats_table->getHTML(),
496 $usage_table->getHTML()
513 $ilDB = $DIC[
'ilDB'];
516 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
518 if ((!$question_type)
and ($question_id > 0)) {
522 if (strlen($question_type) == 0) {
529 $question =
new $question_type_gui();
532 $question->object->feedbackOBJ =
new $feedbackObjectClassname($question->object,
$ilCtrl,
$ilDB,
$lng);
534 if ($question_id > 0) {
535 $question->object->loadFromDb($question_id);
546 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
547 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
558 return $q_type .
"GUI";
575 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
581 $tpl->
addJavaScript(
'Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
590 if (!$this->tpl->blockExists(
'content')) {
591 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.il_as_qpl_content.html",
"Modules/TestQuestionPool");
594 if (!$this->tpl->blockExists(
'statusline')) {
595 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
598 if (!$this->tpl->blockExists(
'adm_content')) {
599 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_question.html",
"Modules/TestQuestionPool");
609 $this->tpl->setVariable(
"QUESTION_DATA",
$form->getHTML());
620 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
623 $presentation = $page_gui->presentation();
624 $presentation = preg_replace(
"/src=\"\\.\\//ims",
"src=\"" . ILIAS_HTTP_PATH .
"/", $presentation);
625 return $presentation;
631 public function outQuestionPage($a_temp_var, $a_postponed =
false, $active_id =
"",
$html =
"", $inlineFeedbackEnabled =
false)
635 if ($this->object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
643 ($this->
object->getTestPresentationConfig()->isUnchangedAnswerPossible()) {
649 $this->lng->loadLanguageModule(
"content");
652 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
655 $page_gui->setTemplateTargetVar($a_temp_var);
659 $page_gui->setQuestionActionsHTML($this->
getNavigationGUI()->getActionsHTML());
668 $page_gui->setQuestionHTML(array($this->object->getId() =>
$html));
672 $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
673 $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
676 return $page_gui->presentation();
683 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'Modules/TestQuestionPool');
684 $tpl->setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
693 return $this->lng->txt(
'use_previous_solution_advice');
698 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'Modules/TestQuestionPool');
700 $tpl->setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->lng->txt(
'use_previous_solution'));
711 if (
$_GET[
"calling_test"]) {
714 } elseif (
$_GET[
"test_ref_id"]) {
718 if (
$_GET[
"q_id"] > 0) {
719 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id",
$_GET[
"q_id"]);
720 $this->ctrl->redirectByClass(
"ilAssQuestionPageGUI",
"edit");
722 $this->ctrl->redirectByClass(
"ilobjquestionpoolgui",
"questions");
733 if (strlen($return_to)) {
734 $this->ctrl->setParameter($this,
"return_to", $return_to);
735 } elseif ($_REQUEST[
'return_to']) {
736 $this->ctrl->setParameter($this,
"return_to", $_REQUEST[
'return_to']);
738 if (strlen($return_to_feedback)) {
739 $this->ctrl->setParameter($this,
'return_to_fb',
'true');
742 $this->ctrl->saveParameter($this,
'test_express_mode');
744 $template =
new ilTemplate(
"tpl.il_as_qpl_sync_original.html",
true,
true,
"Modules/TestQuestionPool");
745 $template->setVariable(
"BUTTON_YES", $this->lng->txt(
"yes"));
746 $template->setVariable(
"BUTTON_NO", $this->lng->txt(
"no"));
747 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
748 $template->setVariable(
"TEXT_SYNC", $this->lng->txt(
"confirm_sync_questions"));
749 $this->tpl->setVariable(
"ADM_CONTENT",
$template->get());
754 $original_id = $this->
object->original_id;
756 $this->
object->syncWithOriginal();
758 if (strlen(
$_GET[
"return_to"])) {
759 $this->ctrl->redirect($this,
$_GET[
"return_to"]);
761 if (strlen($_REQUEST[
"return_to_fb"])) {
762 $this->ctrl->redirectByClass(
'ilAssQuestionFeedbackEditingGUI',
'showFeedbackForm');
764 if (isset(
$_GET[
'calling_consumer']) && (
int)
$_GET[
'calling_consumer']) {
765 $ref_id = (int) $_GET[
'calling_consumer'];
768 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET[
'consumer_context']));
770 require_once
'Services/Link/classes/class.ilLink.php';
773 $_GET[
"ref_id"] = $_GET[
"calling_test"];
775 if ($_REQUEST[
'test_express_mode']) {
778 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET[
"calling_test"]);
785 if (strlen(
$_GET[
"return_to"])) {
786 $this->ctrl->redirect($this,
$_GET[
"return_to"]);
788 if (strlen($_REQUEST[
'return_to_fb'])) {
789 $this->ctrl->redirectByClass(
'ilAssQuestionFeedbackEditingGUI',
'showFeedbackForm');
791 if (isset(
$_GET[
'calling_consumer']) && (
int)
$_GET[
'calling_consumer']) {
792 $ref_id = (int) $_GET[
'calling_consumer'];
795 ilUtil::redirect($consumer->getQuestionEditingFormBackTarget($_GET[
'consumer_context']));
797 require_once
'Services/Link/classes/class.ilLink.php';
800 $_GET[
"ref_id"] = $_GET[
"calling_test"];
802 if ($_REQUEST[
'test_express_mode']) {
805 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET[
"calling_test"]);
820 $ilUser->setPref(
"tst_lastquestiontype", $this->object->getQuestionType());
821 $ilUser->writePref(
"tst_lastquestiontype", $this->object->getQuestionType());
822 $this->
object->saveToDb();
823 $originalexists = $this->
object->_questionExists($this->object->original_id);
824 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
826 $this->ctrl->redirect($this,
"originalSyncForm");
827 } elseif (
$_GET[
"calling_test"]) {
831 } elseif (
$_GET[
"test_ref_id"]) {
833 $tree = $DIC[
'tree'];
834 $ilDB = $DIC[
'ilDB'];
835 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
837 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
841 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
844 $test->insertQuestion($testQuestionSetConfigFactory->getQuestionSetConfig(), $this->
object->getId());
848 $this->ctrl->setParameter($this,
"q_id", $this->object->getId());
849 $this->editQuestion();
850 if (strcmp(
$_SESSION[
"info"],
"") != 0) {
851 ilUtil::sendSuccess(
$_SESSION[
"info"] .
"<br />" . $this->lng->txt(
"msg_obj_modified"),
false);
853 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
false);
855 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id", $this->object->getId());
856 $this->ctrl->redirectByClass(
"ilAssQuestionPageGUI",
"edit");
868 $old_id =
$_GET[
"q_id"];
872 $ilUser->setPref(
"tst_lastquestiontype", $this->object->getQuestionType());
873 $ilUser->writePref(
"tst_lastquestiontype", $this->object->getQuestionType());
874 $this->
object->saveToDb();
875 $originalexists = $this->
object->_questionExistsInPool($this->object->original_id);
878 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
880 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
881 $this->ctrl->setParameter($this,
'return_to',
'editQuestion');
882 $this->ctrl->redirect($this,
"originalSyncForm");
884 } elseif ($_GET[
"calling_test"]) {
885 require_once
'Modules/Test/classes/class.ilObjTest.php';
889 $tree = $DIC[
'tree'];
890 $ilDB = $DIC[
'ilDB'];
891 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
893 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
894 $_GET[
"ref_id"] = $_GET[
"calling_test"];
897 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
900 $new_id =
$test->insertQuestion(
901 $testQuestionSetConfigFactory->getQuestionSetConfig(),
902 $this->
object->getId()
905 if (isset($_REQUEST[
'prev_qid'])) {
906 $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST[
'prev_qid']);
909 $this->ctrl->setParameter($this,
'q_id', $new_id);
910 $this->ctrl->setParameter($this,
'calling_test', $_GET[
'calling_test']);
911 #$this->ctrl->setParameter($this, 'test_ref_id', false); 913 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
914 $this->ctrl->redirect($this,
'editQuestion');
918 if ($this->object->getId() != $old_id) {
920 $this->ctrl->setParameterByClass($_GET[
"cmdClass"],
"q_id", $this->object->getId());
921 $this->ctrl->setParameterByClass($_GET[
"cmdClass"],
"sel_question_types", $_GET[
"sel_question_types"]);
922 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
928 if ($_REQUEST[
'prev_qid']) {
931 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
933 $test->moveQuestionAfter($_REQUEST[
'prev_qid'], $this->object->getId());
935 if ( $_REQUEST[
'express_mode']) {
937 $tree = $DIC[
'tree'];
938 $ilDB = $DIC[
'ilDB'];
939 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
941 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
944 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
947 $test->insertQuestion(
948 $testQuestionSetConfigFactory->getQuestionSetConfig(),
949 $this->
object->getId()
952 require_once
'Modules/Test/classes/class.ilTestExpressPage.php';
953 $_REQUEST[
'q_id'] = $this->
object->getId();
957 $this->ctrl->redirectByClass($_GET[
"cmdClass"],
"editQuestion");
959 if (strcmp(
$_SESSION[
"info"],
"") != 0) {
960 ilUtil::sendSuccess(
$_SESSION[
"info"] .
"<br />" . $this->lng->txt(
"msg_obj_modified"),
true);
962 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
964 $this->ctrl->redirect($this,
'editQuestion');
976 $old_id =
$_GET[
"q_id"];
979 $ilUser->setPref(
"tst_lastquestiontype", $this->object->getQuestionType());
980 $ilUser->writePref(
"tst_lastquestiontype", $this->object->getQuestionType());
981 $this->
object->saveToDb();
982 $originalexists = $this->
object->_questionExistsInPool($this->object->original_id);
983 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
985 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
986 $this->ctrl->setParameter($this,
'test_express_mode', $_REQUEST[
'test_express_mode']);
987 $this->ctrl->redirect($this,
"originalSyncForm");
989 } elseif ($_GET[
"calling_test"]) {
990 require_once
'Modules/Test/classes/class.ilObjTest.php';
992 #var_dump(assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId())); 993 $q_id = $this->
object->getId();
996 $tree = $DIC[
'tree'];
997 $ilDB = $DIC[
'ilDB'];
998 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
1000 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
1001 $_GET[
"ref_id"] = $_GET[
"calling_test"];
1004 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
1007 $new_id =
$test->insertQuestion(
1008 $testQuestionSetConfigFactory->getQuestionSetConfig(),
1009 $this->
object->getId()
1013 if (isset($_REQUEST[
'prev_qid'])) {
1014 $test->moveQuestionAfter($this->object->getId() + 1, $_REQUEST[
'prev_qid']);
1017 $this->ctrl->setParameter($this,
'q_id', $new_id);
1018 $this->ctrl->setParameter($this,
'calling_test', $_GET[
'calling_test']);
1019 #$this->ctrl->setParameter($this, 'test_ref_id', false); 1021 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
1023 $_REQUEST[
'test_express_mode']
1027 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET[
"calling_test"]);
1030 if ($this->object->getId() != $old_id) {
1032 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
1033 $this->ctrl->redirectByClass(
"ilobjquestionpoolgui",
"questions");
1035 if (strcmp(
$_SESSION[
"info"],
"") != 0) {
1036 ilUtil::sendSuccess(
$_SESSION[
"info"] .
"<br />" . $this->lng->txt(
"msg_obj_modified"),
true);
1038 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
1040 $this->ctrl->redirectByClass(
"ilobjquestionpoolgui",
"questions");
1051 $this->
object->saveToDb();
1052 $this->ctrl->setParameter($this,
"q_id", $this->object->getId());
1053 $this->editQuestion();
1066 $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
1069 for (
$i = 1;
$i < (count($tmpPath) - 1);
$i++) {
1074 $path .= $tmpPath[
$i][
"title"];
1082 $this->sequence_no = $nr;
1092 $this->question_count = $a_question_count;
1112 $this->errormessage .= ((strlen($this->errormessage)) ?
"<br />" :
"") .
$errormessage;
1129 return $this->
object->getQuestionType();
1142 if (strlen($a_value)) {
1143 $result =
" value=\"$a_value\" ";
1155 $cnt = $this->new_id_listener_cnt;
1156 $this->new_id_listeners[$cnt][
"object"] = &$a_object;
1157 $this->new_id_listeners[$cnt][
"method"] = $a_method;
1158 $this->new_id_listeners[$cnt][
"parameters"] = $a_parameters;
1159 $this->new_id_listener_cnt++;
1167 for (
$i = 0;
$i < $this->new_id_listener_cnt;
$i++) {
1168 $this->new_id_listeners[
$i][
"parameters"][
"new_id"] = $a_new_id;
1169 $object = &$this->new_id_listeners[
$i][
"object"];
1170 $method = $this->new_id_listeners[
$i][
"method"];
1171 $parameters = $this->new_id_listeners[
$i][
"parameters"];
1176 $object->$method($parameters);
1186 if (!$this->object->getSelfAssessmentEditingMode()) {
1187 $form->addCommandButton(
"saveReturn", $this->lng->txt(
"save_return"));
1189 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
1202 $title->setMaxLength(100);
1203 $title->setValue($this->object->getTitle());
1204 $title->setRequired(
true);
1207 if (!$this->object->getSelfAssessmentEditingMode()) {
1209 $author =
new ilTextInputGUI($this->lng->txt(
"author"),
"author");
1210 $author->
setValue($this->object->getAuthor());
1211 $author->setRequired(
true);
1212 $form->addItem($author);
1223 if (trim($author) ==
"") {
1226 $hi->setValue($author);
1227 $form->addItem($hi);
1232 $question->
setValue($this->object->getQuestion());
1233 $question->setRequired(
true);
1234 $question->setRows(10);
1235 $question->setCols(80);
1237 if (!$this->object->getSelfAssessmentEditingMode()) {
1239 $question->setUseRte(
true);
1240 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1242 $question->addPlugin(
"latex");
1243 $question->addButton(
"latex");
1244 $question->addButton(
"pastelatex");
1245 $question->setRTESupport($this->object->getId(),
"qpl",
"assessment");
1248 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
1250 $question->setUseTagsForRteOnly(
false);
1252 $form->addItem($question);
1254 if (!$this->object->getSelfAssessmentEditingMode()) {
1258 $duration->setShowMinutes(
true);
1259 $duration->setShowSeconds(
true);
1260 $ewt = $this->
object->getEstimatedWorkingTime();
1261 $duration->setHours($ewt[
"h"]);
1262 $duration->setMinutes($ewt[
"m"]);
1263 $duration->setSeconds($ewt[
"s"]);
1264 $duration->setRequired(
false);
1265 $form->addItem($duration);
1268 if (strlen($this->object->getNrOfTries())) {
1269 $nr_tries = $this->
object->getNrOfTries();
1271 $nr_tries = $this->
object->getDefaultNrOfTries();
1273 if ($nr_tries < 1) {
1277 $ni =
new ilNumberInputGUI($this->lng->txt(
"qst_nr_of_tries"),
"nr_of_tries");
1279 $ni->setMinValue(0);
1281 $ni->setMaxLength(5);
1282 $form->addItem($ni);
1289 require_once
'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
1292 $postvar =
"tax_node_assign_$taxonomyId";
1296 $tax_node_assign->saveInput(
"qpl", $this->object->getObjId(),
"quest", $this->
object->getId());
1305 require_once
'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php';
1306 ilOverlayGUI::initJavaScript();
1309 $sectHeader->setTitle($this->lng->txt(
'qpl_qst_edit_form_taxonomy_section'));
1312 require_once
'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
1316 $label = sprintf($this->lng->txt(
'qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
1317 $postvar =
"tax_node_assign_$taxonomyId";
1322 require_once
'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
1326 $taxSelect->setValue(array_map(
function ($assignedNode) {
1327 return $assignedNode[
'node_id'];
1328 }, $assignedNodes));
1360 include_once
"./Modules/Test/classes/class.ilObjTest.php";
1362 if (strlen($manual_feedback)) {
1363 return $manual_feedback;
1365 $correct_feedback = $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
true);
1366 $incorrect_feedback = $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
false);
1367 if (strlen($correct_feedback . $incorrect_feedback)) {
1368 $reached_points = $this->
object->calculateReachedPoints($active_id,
$pass);
1369 $max_points = $this->
object->getMaximumPoints();
1370 if ($reached_points == $max_points) {
1373 $output = $incorrect_feedback;
1376 return $this->
object->prepareTextareaOutput(
$output,
true);
1381 return $this->
object->prepareTextareaOutput(
1382 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
true),
1389 return $this->
object->prepareTextareaOutput(
1390 $this->object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
false),
1409 $count = $this->
object->isInUse();
1411 if ($this->object->_questionExistsInPool($this->object->getId()) && $count) {
1413 $rbacsystem = $DIC[
'rbacsystem'];
1414 if ($rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"])) {
1415 ilUtil::sendInfo(sprintf($this->lng->txt(
"qpl_question_is_in_use"), $count));
1437 $ilAccess = $DIC[
'ilAccess'];
1439 $save = (is_array(
$_POST[
"cmd"]) && array_key_exists(
"suggestedsolution",
$_POST[
"cmd"])) ?
true :
false;
1441 if ($save &&
$_POST[
"deleteSuggestedSolution"] == 1) {
1442 $this->
object->deleteSuggestedSolutions();
1443 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
1444 $this->ctrl->redirect($this,
"suggestedsolution");
1448 $solution_array = $this->
object->getSuggestedSolution(0);
1450 "lm" => $this->lng->txt(
"obj_lm"),
1451 "st" => $this->lng->txt(
"obj_st"),
1452 "pg" => $this->lng->txt(
"obj_pg"),
1453 "git" => $this->lng->txt(
"glossary_term"),
1454 "file" => $this->lng->txt(
"fileDownload"),
1455 "text" => $this->lng->txt(
"solutionText")
1458 if ((strcmp(
$_POST[
"solutiontype"],
"file") == 0) && (strcmp($solution_array[
"type"],
"file") != 0)) {
1459 $solution_array = array(
1462 } elseif ((strcmp(
$_POST[
"solutiontype"],
"text") == 0) && (strcmp($solution_array[
"type"],
"text") != 0)) {
1466 $solution_array = array(
1472 if ($save && strlen(
$_POST[
"filename"])) {
1473 $solution_array[
"value"][
"filename"] =
$_POST[
"filename"];
1475 if ($save && strlen(
$_POST[
"solutiontext"])) {
1476 $solution_array[
"value"] =
$_POST[
"solutiontext"];
1478 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1479 if (count($solution_array)) {
1481 $form->setFormAction($this->ctrl->getFormAction($this));
1482 $form->setTitle($this->lng->txt(
"solution_hint"));
1483 $form->setMultipart(
true);
1484 $form->setTableWidth(
"100%");
1485 $form->setId(
"suggestedsolutiondisplay");
1488 include_once
"./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php";
1490 $template =
new ilTemplate(
"tpl.il_as_qpl_suggested_solution_input_presentation.html",
true,
true,
"Modules/TestQuestionPool");
1491 if (strlen($solution_array[
"internal_link"])) {
1493 $template->setCurrentBlock(
"preview");
1494 $template->setVariable(
"TEXT_SOLUTION", $this->lng->txt(
"suggested_solution"));
1495 $template->setVariable(
"VALUE_SOLUTION",
" <a href=\"$href\" target=\"content\">" . $this->lng->txt(
"view") .
"</a> ");
1496 $template->parseCurrentBlock();
1497 } elseif ((strcmp($solution_array[
"type"],
"file") == 0) && (is_array($solution_array[
"value"]))) {
1498 $href = $this->
object->getSuggestedSolutionPathWeb() . $solution_array[
"value"][
"name"];
1499 $template->setCurrentBlock(
"preview");
1500 $template->setVariable(
"TEXT_SOLUTION", $this->lng->txt(
"suggested_solution"));
1501 $template->setVariable(
"VALUE_SOLUTION",
" <a href=\"$href\" target=\"content\">" .
ilUtil::prepareFormOutput((strlen($solution_array[
"value"][
"filename"])) ? $solution_array[
"value"][
"filename"] : $solution_array[
"value"][
"name"]) .
"</a> ");
1502 $template->parseCurrentBlock();
1504 $template->setVariable(
"TEXT_TYPE", $this->lng->txt(
"type"));
1505 $template->setVariable(
"VALUE_TYPE",
$options[$solution_array[
"type"]]);
1506 $title->setHtml($template->get());
1508 $deletesolution->setOptionTitle($this->lng->txt(
"deleteSuggestedSolution"));
1509 $title->addSubItem($deletesolution);
1512 if (strcmp($solution_array[
"type"],
"file") == 0) {
1514 $file =
new ilFileInputGUI($this->lng->txt(
"fileDownload"),
"file");
1516 $file->enableFileNameSelection(
"filename");
1518 if ($_FILES[
"file"][
"tmp_name"] && $file->checkInput()) {
1519 if (!file_exists($this->object->getSuggestedSolutionPath())) {
1523 $res = ilUtil::moveUploadedFile($_FILES[
"file"][
"tmp_name"], $_FILES[
"file"][
"name"], $this->object->getSuggestedSolutionPath() . $_FILES[
"file"][
"name"]);
1528 if (is_array($solution_array[
"value"])) {
1529 @unlink($this->object->getSuggestedSolutionPath() . $solution_array[
"value"][
"name"]);
1531 $file->setValue($_FILES[
"file"][
"name"]);
1532 $this->
object->saveSuggestedSolution(
"file",
"", 0, array(
"name" => $_FILES[
"file"][
"name"],
"type" => $_FILES[
"file"][
"type"],
"size" => $_FILES[
"file"][
"size"],
"filename" =>
$_POST[
"filename"]));
1533 $originalexists = $this->
object->_questionExistsInPool($this->object->original_id);
1537 ilUtil::sendSuccess($this->lng->txt(
"suggested_solution_added_successfully"),
true);
1538 $this->ctrl->redirect($this,
"suggestedsolution");
1545 if (is_array($solution_array[
"value"])) {
1546 $file->setValue($solution_array[
"value"][
"name"]);
1547 $file->setFilename((strlen($solution_array[
"value"][
"filename"])) ? $solution_array[
"value"][
"filename"] : $solution_array[
"value"][
"name"]);
1550 $form->addItem($file);
1552 $hidden->setValue(
"file");
1553 $form->addItem($hidden);
1554 } elseif (strcmp($solution_array[
"type"],
"text") == 0) {
1555 $solutionContent = $solution_array[
'value'];
1556 $solutionContent = $this->
object->fixSvgToPng($solutionContent);
1557 $solutionContent = $this->
object->fixUnavailableSkinImageSources($solutionContent);
1559 $question->
setValue($this->object->prepareTextareaOutput($solutionContent));
1560 $question->setRequired(
true);
1561 $question->setRows(10);
1562 $question->setCols(80);
1563 $question->setUseRte(
true);
1564 $question->addPlugin(
"latex");
1565 $question->addButton(
"latex");
1566 $question->setRTESupport($this->object->getId(),
"qpl",
"assessment");
1568 $hidden->setValue(
"text");
1569 $form->addItem($hidden);
1570 $form->addItem($question);
1572 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
'ref_id'])) {
1573 $form->addCommandButton(
'showSuggestedSolution', $this->lng->txt(
'cancel'));
1574 $form->addCommandButton(
'suggestedsolution', $this->lng->txt(
'save'));
1578 if (
$form->checkInput()) {
1579 switch ($solution_array[
"type"]) {
1581 $this->
object->saveSuggestedSolution(
"file",
"", 0, array(
1582 "name" => $solution_array[
"value"][
"name"],
1583 "type" => $solution_array[
"value"][
"type"],
1584 "size" => $solution_array[
"value"][
"size"],
1585 "filename" =>
$_POST[
"filename"]
1589 $this->
object->saveSuggestedSolution(
"text",
"", 0, $solution_array[
"value"]);
1592 $originalexists = $this->
object->_questionExistsInPool($this->object->original_id);
1596 ilUtil::sendSuccess($this->lng->txt(
"msg_obj_modified"),
true);
1597 $this->ctrl->redirect($this,
"suggestedsolution");
1605 $savechange = (strcmp($this->ctrl->getCmd(),
"saveSuggestedSolution") == 0) ? true :
false;
1608 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
'ref_id'])) {
1610 $formchange->setFormAction($this->ctrl->getFormAction($this));
1611 $formchange->setTitle((count($solution_array)) ? $this->lng->txt(
"changeSuggestedSolution") : $this->lng->txt(
"addSuggestedSolution"));
1612 $formchange->setMultipart(
false);
1613 $formchange->setTableWidth(
"100%");
1614 $formchange->setId(
"suggestedsolution");
1616 $solutiontype =
new ilRadioGroupInputGUI($this->lng->txt(
"suggestedSolutionType"),
"solutiontype");
1617 foreach (
$options as $opt_value => $opt_caption) {
1620 if (count($solution_array)) {
1621 $solutiontype->setValue($solution_array[
"type"]);
1623 $solutiontype->setRequired(
true);
1624 $formchange->addItem($solutiontype);
1626 $formchange->addCommandButton(
"saveSuggestedSolution", $this->lng->txt(
"select"));
1629 $formchange->checkInput();
1631 $changeoutput = $formchange->getHTML();
1634 $this->tpl->setVariable(
"ADM_CONTENT", $changeoutput .
$output);
1640 $tree = $DIC[
'tree'];
1642 include_once(
"./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1644 $search =
$_GET[
"search_link_type"];
1645 $this->ctrl->setParameter($this,
"link_new_type",
$type);
1646 $this->ctrl->setParameter($this,
"search_link_type", $search);
1647 $this->ctrl->saveParameter($this, array(
"subquestion_index",
"link_new_type",
"search_link_type"));
1651 $parent_ref_id =
$tree->getParentId(
$_GET[
"ref_id"]);
1652 $exp =
new ilSolutionExplorer($this->ctrl->getLinkTarget($this,
'suggestedsolution'), get_class($this));
1654 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'outSolutionExplorer'));
1655 $exp->setTargetGet(
"ref_id");
1656 $exp->setRefId(
$_GET[
"ref_id"]);
1657 $exp->addFilter(
$type);
1658 $exp->setSelectableType(
$type);
1659 if (isset(
$_GET[
'expandCurrentPath']) &&
$_GET[
'expandCurrentPath']) {
1660 $exp->expandPathByRefId($parent_ref_id);
1666 $template =
new ilTemplate(
"tpl.il_as_qpl_explorer.html",
true,
true,
"Modules/TestQuestionPool");
1667 $template->setVariable(
"EXPLORER_TREE", $exp->getOutput());
1668 $template->setVariable(
"BUTTON_CANCEL", $this->lng->txt(
"cancel"));
1669 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"suggestedsolution"));
1670 $this->tpl->setVariable(
"ADM_CONTENT",
$template->get());
1676 $tree = $DIC[
'tree'];
1678 include_once(
"./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1679 switch (
$_POST[
"solutiontype"]) {
1704 if (isset(
$_POST[
'solutiontype'])) {
1705 $this->ctrl->setParameter($this,
'expandCurrentPath', 1);
1707 $this->ctrl->setParameter($this,
"link_new_type",
$type);
1708 $this->ctrl->setParameter($this,
"search_link_type", $search);
1709 $this->ctrl->redirect($this,
"outSolutionExplorer");
1714 $this->ctrl->redirect($this,
"suggestedsolution");
1719 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1720 require_once
'Modules/LearningModule/classes/class.ilLMPageObject.php';
1721 require_once
'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1723 $this->ctrl->setParameter($this,
'q_id', $this->object->getId());
1726 $cont_obj = $cont_obj_gui->object;
1728 $shownpages = array();
1729 $tree = $cont_obj->getLMTree();
1730 $chapters =
$tree->getSubtree(
$tree->getNodeData(
$tree->getRootId()));
1734 foreach ($chapters as $chapter) {
1735 $chapterpages =
$tree->getChildsByType($chapter[
'obj_id'],
'pg');
1736 foreach ($chapterpages as $page) {
1737 if ($page[
'type'] ==
$_GET[
'search_link_type']) {
1738 array_push($shownpages, $page[
'obj_id']);
1740 if (
$tree->isInTree($page[
'obj_id'])) {
1746 $this->ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1748 'title' => $page[
'title'],
1750 'text_add' => $this->lng->txt(
'add'),
1751 'href_add' => $this->ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1756 foreach ($pages as $page) {
1757 if (!in_array($page[
'obj_id'], $shownpages)) {
1758 $this->ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1760 'title' => $page[
'title'],
1761 'description' =>
'---',
1762 'text_add' => $this->lng->txt(
'add'),
1763 'href_add' => $this->ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1768 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1773 $this->tpl->setContent(
$table->getHTML());
1778 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1779 require_once
'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1781 $this->ctrl->setParameter($this,
'q_id', $this->object->getId());
1784 $cont_obj = $cont_obj_gui->object;
1785 $ctree = $cont_obj->getLMTree();
1786 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1790 foreach (
$nodes as $node) {
1791 if ($node[
'type'] ==
$_GET[
'search_link_type']) {
1792 $this->ctrl->setParameter($this, $node[
'type'], $node[
'obj_id']);
1794 'title' => $node[
'title'],
1795 'description' =>
'',
1796 'text_add' => $this->lng->txt(
'add'),
1797 'href_add' => $this->ctrl->getLinkTarget($this,
'add' . strtoupper($node[
'type']))
1804 $table->setData(
$rows);
1806 $this->tpl->setContent($table->getHTML());
1811 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1812 require_once
'Modules/Glossary/classes/class.ilObjGlossary.php';
1814 $this->ctrl->setParameter($this,
'q_id', $this->object->getId());
1817 $terms = $glossary->getTermList();
1821 foreach ($terms as $term) {
1822 $this->ctrl->setParameter($this,
'git', $term[
'id']);
1824 'title' => $term[
'term'],
1825 'description' =>
'',
1826 'text_add' => $this->lng->txt(
'add'),
1827 'href_add' => $this->ctrl->getLinkTarget($this,
'addGIT')
1832 $table->setTitle($this->lng->txt(
'glossary_term'));
1833 $table->setData(
$rows);
1835 $this->tpl->setContent($table->getHTML());
1840 $this->ctrl->saveParameter($this, array(
"subquestion_index",
"link_new_type",
"search_link_type"));
1841 switch (
$_GET[
"search_link_type"]) {
1852 $subquestion_index = (
$_GET[
"subquestion_index"] > 0) ?
$_GET[
"subquestion_index"] : 0;
1853 $this->
object->saveSuggestedSolution(
"lm",
"il__lm_" .
$_GET[
"source_id"], $subquestion_index);
1854 ilUtil::sendSuccess($this->lng->txt(
"suggested_solution_added_successfully"),
true);
1855 $this->ctrl->redirect($this,
"suggestedsolution");
1862 $subquestion_index = 0;
1863 if (strlen(
$_GET[
"subquestion_index"]) &&
$_GET[
"subquestion_index"] >= 0) {
1864 $subquestion_index =
$_GET[
"subquestion_index"];
1866 $this->
object->saveSuggestedSolution(
"pg",
"il__pg_" .
$_GET[
"pg"], $subquestion_index);
1867 ilUtil::sendSuccess($this->lng->txt(
"suggested_solution_added_successfully"),
true);
1868 $this->ctrl->redirect($this,
"suggestedsolution");
1873 $subquestion_index = 0;
1874 if (strlen(
$_GET[
"subquestion_index"]) &&
$_GET[
"subquestion_index"] >= 0) {
1875 $subquestion_index =
$_GET[
"subquestion_index"];
1877 $this->
object->saveSuggestedSolution(
"st",
"il__st_" .
$_GET[
"st"], $subquestion_index);
1878 ilUtil::sendSuccess($this->lng->txt(
"suggested_solution_added_successfully"),
true);
1879 $this->ctrl->redirect($this,
"suggestedsolution");
1884 $subquestion_index = 0;
1885 if (strlen(
$_GET[
"subquestion_index"]) &&
$_GET[
"subquestion_index"] >= 0) {
1886 $subquestion_index =
$_GET[
"subquestion_index"];
1888 $this->
object->saveSuggestedSolution(
"git",
"il__git_" .
$_GET[
"git"], $subquestion_index);
1889 ilUtil::sendSuccess($this->lng->txt(
"suggested_solution_added_successfully"),
true);
1890 $this->ctrl->redirect($this,
"suggestedsolution");
1895 return in_array($this->ctrl->getCmd(), array(
'save',
'saveEdit',
'saveReturn'));
1913 $commands = array();
1915 foreach ($reflectionClass->getConstants() as $constName => $constValue) {
1916 if (substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin) {
1917 $commands[] = $constValue;
1928 $rbacsystem = $DIC[
'rbacsystem'];
1929 $ilTabs = $DIC[
'ilTabs'];
1931 $ilTabs->clearTargets();
1933 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id",
$_GET[
"q_id"]);
1934 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1935 $q_type = $this->
object->getQuestionType();
1937 if (strlen($q_type)) {
1938 $classname = $q_type .
"GUI";
1939 $this->ctrl->setParameterByClass(strtolower($classname),
"sel_question_types", $q_type);
1940 $this->ctrl->setParameterByClass(strtolower($classname),
"q_id",
$_GET[
"q_id"]);
1943 if (
$_GET[
"q_id"]) {
1944 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"])) {
1948 $this->ctrl->getLinkTargetByClass(
"ilAssQuestionPageGUI",
"edit"),
1949 array(
"edit",
"insert",
"exec_pg"),
1958 $force_active =
false;
1959 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"])) {
1962 $url = $this->ctrl->getLinkTargetByClass($classname,
"editQuestion");
1964 $force_active =
false;
1986 if (
$_GET[
"q_id"]) {
1989 $this->ctrl->getLinkTargetByClass($classname,
"assessment"),
1990 array(
"assessment"),
2001 if (
$_GET[
"q_id"]) {
2003 "suggested_solution",
2004 $this->ctrl->getLinkTargetByClass($classname,
"suggestedsolution"),
2005 array(
"suggestedsolution",
"saveSuggestedSolution",
"outSolutionExplorer",
"cancel",
2006 "addSuggestedSolution",
"cancelExplorer",
"linkChilds",
"removeSuggestedSolution" 2021 return array(
'editQuestion',
'save',
'saveEdit',
'originalSyncForm');
2040 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
2041 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionFeedbackEditingGUI');
2045 $tabs->
addTarget(
'tst_feedback', $tabLink, $tabCommands,
$ilCtrl->getCmdClass(),
'');
2059 $tabs->
addTarget(
'units',
$ilCtrl->getLinkTargetByClass(
'ilLocalUnitConfigurationGUI',
''),
'',
'illocalunitconfigurationgui');
2073 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
2075 switch (
$ilCtrl->getCmdClass()) {
2076 case 'ilassquestionhintsgui':
2078 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionHintsGUI');
2081 case 'ilassquestionhintgui':
2083 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
2084 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionHintGUI');
2089 $tabCommands = array();
2094 $tabs->
addTarget(
'tst_question_hints_tab', $tabLink, $tabCommands,
$ilCtrl->getCmdClass(),
'');
2099 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
2105 array(
'ilAssQuestionPreviewGUI')
2112 $graphicalOutput =
false,
2113 $result_output =
false,
2114 $show_question_only =
true,
2115 $show_feedback =
false,
2116 $show_correct_solution =
false,
2117 $show_manual_scoring =
false,
2118 $show_question_text =
true 2139 $result = $this->
object->lookupForExistingSolutions($activeId, $passIndex);
2140 return (
$result[
'intermediate']);
2149 $this->use_intermediate_solution = (bool) $use;
2163 $reachedPoints = $this->
object->getAdjustedReachedPoints($activeId, $passIndex,
true);
2164 $maximumPoints = $this->
object->getMaximumPoints();
2166 return $reachedPoints == $maximumPoints;
2171 return $this->
object->isAutosaveable();
2176 $this->
object->setTitle(
$_POST[
"title"]);
2177 $this->
object->setAuthor(
$_POST[
"author"]);
2178 $this->
object->setComment(
$_POST[
"comment"]);
2179 if ($this->object->getSelfAssessmentEditingMode()) {
2180 $this->
object->setNrOfTries(
$_POST[
'nr_of_tries']);
2183 $this->
object->setEstimatedWorkingTime(
2184 $_POST[
"Estimated"][
"hh"],
2185 $_POST[
"Estimated"][
"mm"],
2186 $_POST[
"Estimated"][
"ss"]
2190 abstract public function getPreview($show_question_only =
false, $showInlineFeedback =
false);
2206 $is_question_postponed =
false,
2207 $user_post_solutions =
false,
2208 $show_specific_inline_feedback =
false 2215 $is_question_postponed,
2216 $user_post_solutions,
2217 $show_specific_inline_feedback
2222 $this->tpl->setVariable(
"QUESTION_OUTPUT", $test_output);
2223 $this->tpl->setVariable(
"FORMACTION", $formaction);
2225 $this->tpl->setVariable(
"FORM_TIMESTAMP", time());
2243 $is_question_postponed,
2244 $user_post_solutions,
2245 $show_specific_inline_feedback
2250 return self::FORM_ENCODING_URLENCODE;
2258 if ((
$_GET[
"calling_test"] > 0) || (
$_GET[
"test_ref_id"] > 0)) {
2259 $ref_id =
$_GET[
"calling_test"];
2260 if (strlen($ref_id) == 0) {
2261 $ref_id =
$_GET[
"test_ref_id"];
2264 if (!
$_GET[
'test_express_mode'] && !
$GLOBALS[
'___test_express_mode']) {
2265 $ilTabs->
setBackTarget($this->lng->txt(
"backtocallingtest"),
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
2268 $ilTabs->
setBackTarget($this->lng->txt(
"backtocallingtest"), $link);
2270 } elseif (isset(
$_GET[
'calling_consumer']) && (
int)
$_GET[
'calling_consumer']) {
2271 $ref_id = (int) $_GET[
'calling_consumer'];
2274 $ilTabs->
setBackTarget($consumer->getQuestionEditingFormBackTargetLabel(), $consumer->getQuestionEditingFormBackTarget($_GET[
'consumer_context']));
2276 require_once
'Services/Link/classes/class.ilLink.php';
2280 $ilTabs->
setBackTarget($this->lng->txt(
"qpl"), $this->ctrl->getLinkTargetByClass(
"ilobjquestionpoolgui",
"questions"));
2310 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
2313 $form->setFormAction($this->ctrl->getFormAction($this));
2318 $form->setTableWidth(
'100%');
2320 $form->setMultipart(
true);
2337 $errors = $this->editQuestion(
true);
2346 return '<div id="focus"></div>';
2373 require_once
'Modules/TestQuestionPool/classes/tables/class.ilAnswerFrequencyStatisticTableGUI.php';
2376 $table->setQuestionIndex($questionIndex);
isTestPresentationContext()
hasIntermediateSolution($activeId, $passIndex)
Check if the question has an intermediate solution.
static makeDirParents($a_dir)
Create a new directory and all parent directories.
setQuestionActionCmd($questionActionCmd)
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
hasCorrectSolution($activeId, $passIndex)
getAssignmentsOfItem($a_item_id)
Get assignments for item.
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
saveCorrectionsFormProperties(ilPropertyFormGUI $form)
This class represents an option in a radio group.
getTestOutput( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
Taxonomy node <-> item assignment.
static _includeClass($question_type, $gui=0)
Include the php class file for a given question type.
getAnswersFrequency($relevantAnswers, $questionIndex)
getSpecificFeedbackOutput($userSolution)
Returns the answer specific feedback for the question.
static getQuestionTypeFromDb($question_id)
get question type for question id
getPreview($show_question_only=false, $showInlineFeedback=false)
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question, working time.
getPreviousSolutionConfirmationCheckboxHtml()
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
suggestedsolution()
Allows to add suggested solutions for questions.
static _getGUIClassNameForId($a_q_id)
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.
$question_count
question count in test
addErrorMessage($errormessage)
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
__construct()
assQuestionGUI constructor
getEditQuestionTabCommands()
static initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE, ilTemplate $a_main_tpl=null)
Init javascript.
const SESSION_PREVIEW_DATA_BASE_INDEX
buildBasicEditFormObject()
setPresentationContext($presentationContext)
setPreviousSolutionPrefilled($previousSolutionPrefilled)
getBasicEditQuestionTabCommands()
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
setValue($a_value)
Set Value.
setQuestionHeaderBlockBuilder($questionHeaderBlockBuilder)
getGenericFeedbackOutputForCorrectSolution()
setTaxonomyIds($taxonomyIds)
setRenderPurpose($renderPurpose)
callNewIdListeners($a_new_id)
Call the new id listeners.
getUseUnchangedAnswerCheckboxHtml()
addTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
hasInlineFeedback()
this method can be overwritten per question type
getQuestionTemplate()
get question template
Class ilQuestionUsagesTableGUI.
enablePublicNotes($a_enable=true)
enable public notes
isRenderPurposePlayback()
setEditContext($editContext)
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
isAnswerFreuqencyStatisticSupported()
populateTaxonomyFormSection(ilPropertyFormGUI $form)
getUseIntermediateSolution()
Get if intermediate solution should be used for solution output.
const CMD_SHOW_LIST
command constants
const CMD_SHOW
command constants
$use_intermediate_solution
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
prepareReprintableCorrectionsForm(ilPropertyFormGUI $form)
$sequence_no
sequence number in test
static _getInternalLinkHref($target="")
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
populateJavascriptFilesRequiredForWorkForm(ilTemplate $tpl)
getType()
needed for page editor compliance
static getCommandsFromClassConstants($guiClassName, $cmdConstantNameBegin='CMD_')
extracts values of all constants of given class with given prefix as array can be used to get all pos...
populateCorrectionsFormProperties(ilPropertyFormGUI $form)
& createQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation.
writeQuestionGenericPostData()
foreach($_POST as $key=> $value) $res
const PRESENTATION_CONTEXT_RESULTS
static getReturnToPageLink($q_id=null)
if(isset($_POST['submit'])) $form
addJavaScript($a_js_file, $a_add_version_parameter=true, $a_batch=2)
Add a javascript file that should be included in the header.
isRenderPurposeDemoplay()
setAdjustmentEditContext()
getILIASPage($html="")
Returns the ILIAS Page around a question.
static _getQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation and returns the alias to the question gui note: please do not u...
static getManualFeedback($active_id, $question_id, $pass)
Retrieves the manual feedback for a question in a test.
const FORM_ENCODING_MULTIPART
special template class to simplify handling of ITX/PEAR
This class represents a text property in a property form.
originalSyncForm($return_to="", $return_to_feedback='')
addNewIdListener(&$a_object, $a_method, $a_parameters="")
Add a listener that is notified with the new question ID, when a new question is saved.
isAdjustmentEditContext()
const EDIT_CONTEXT_ADJUSTMENT
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
isRenderPurposeInputValue()
const RENDER_PURPOSE_DEMOPLAY
setTargetGui($linkTargetGui)
getContextPath($cont_obj, $a_endnode_id, $a_startnode_id=1)
get context path in content object tree
getQuestionType()
Returns the question type string.
setUseIntermediateSolution($use)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
setTargetGuiClass($targetGuiClass)
Basic GUI class for assessment questions.
setErrorMessage($errormessage)
const EDIT_CONTEXT_AUTHORING
static _lookupType($a_id, $a_reference=false)
lookup object type
const PRESENTATION_CONTEXT_TEST
static _getClassNameForQType($q_type)
$previousSolutionPrefilled
completeTestOutputFormAction($formAction, $active_id, $pass)
supportsIntermediateSolutionOutput()
Question type specific support of intermediate solution output The function getSolutionOutput respect...
getPreviousSolutionProvidedMessage()
executeCommand()
execute command
static _questionExistsInTest($question_id, $test_id)
getAnswerFeedbackOutput($active_id, $pass)
Returns the answer generic feedback depending on the results of the question.
const FORM_ENCODING_URLENCODE
if(!empty($this->data['faventry'])) $tabs
const RENDER_PURPOSE_PLAYBACK
Class ilQuestionInternalLinkSelectionTableGUI.
getGenericFeedbackOutputForIncorrectSolution()
saveTaxonomyAssignments()
Class ilQuestionUsagesTableGUI.
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
output question page
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
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)
getAdditionalEditQuestionCommands()
This class represents a text area property in a property form.
addBackTab(ilTabsGUI $ilTabs)
outQuestionForTest( $formaction, $active_id, $pass, $is_question_postponed=false, $user_post_solutions=false, $show_specific_inline_feedback=false)
setPreviewSession($previewSession)
getQuestionHeaderBlockBuilder()
Class ilObjContentObjectGUI.
const RENDER_PURPOSE_PRINT_PDF
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
isRenderPurposePrintPdf()
$questionHeaderBlockBuilder
static getGuiClassNameByQuestionType($questionType)
isPreviousSolutionPrefilled()
if(empty($password)) $table
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
static getPageList($lm_id)
static
getAsValueAttribute($a_value)
Returns a HTML value attribute.
setValue($a_value)
Set Value.
static redirect($a_script)
const RENDER_PURPOSE_INPUT_VALUE
const RENDER_PURPOSE_PREVIEW
static getFeedbackClassNameByQuestionType($questionType)
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
Class ilCommonActionDispatcherGUI.
getAnswerFrequencyTableGUI($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
setSubObject($a_sub_obj_type, $a_sub_obj_id)
Set sub object attributes.
saveReturn()
save question
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
const TAB_ID_QUESTION_PREVIEW
setQuestionHTML($question_html)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
setQuestionCount($a_question_count)
renderPurposeSupportsFormHtml()
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
setNavigationGUI($navigationGUI)