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';
118 $this->ctrl->saveParameter($this,
"q_id");
119 $this->ctrl->saveParameter($this,
"prev_qid");
120 $this->ctrl->saveParameter($this,
"calling_test");
121 $this->ctrl->saveParameter($this,
"calling_consumer");
122 $this->ctrl->saveParameter($this,
"consumer_context");
123 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'test_express_mode');
124 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'calling_consumer');
125 $this->ctrl->saveParameterByClass(
'ilAssQuestionPageGUI',
'consumer_context');
126 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'test_express_mode');
127 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'calling_consumer');
128 $this->ctrl->saveParameterByClass(
'ilobjquestionpoolgui',
'consumer_context');
130 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
131 $this->errormessage = $this->lng->txt(
"fill_out_all_required_fields");
133 $this->selfassessmenteditingmode =
false;
134 $this->new_id_listeners =
array();
135 $this->new_id_listener_cnt = 0;
137 $this->navigationGUI = null;
146 $ilHelp = $DIC[
'ilHelp'];
147 $ilHelp->setScreenIdComponent(
'qpl');
149 $cmd = $this->ctrl->getCmd(
"editQuestion");
150 $next_class = $this->ctrl->getNextClass($this);
154 switch ($next_class) {
155 case 'ilformpropertydispatchgui':
158 require_once
'Services/Form/classes/class.ilFormPropertyDispatchGUI.php';
161 return $this->ctrl->forwardCommand($form_prop_dispatch);
165 $ret = $this->$cmd();
377 if (is_object($this->
object)) {
405 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionCumulatedStatisticsTableGUI.php';
408 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionUsagesTableGUI.php';
411 $tpl->setContent(implode(
'<br />',
array(
412 $stats_table->getHTML(),
413 $usage_table->getHTML()
430 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
432 if ((!$question_type) and ($question_id > 0)) {
436 if (strlen($question_type) == 0) {
443 $question =
new $question_type_gui();
446 $question->object->feedbackOBJ =
new $feedbackObjectClassname($question->object, $ilCtrl, $ilDB, $lng);
448 if ($question_id > 0) {
449 $question->object->loadFromDb($question_id);
460 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
461 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
472 return $q_type .
"GUI";
489 include_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
495 $tpl->
addJavaScript(
'Modules/TestQuestionPool/js/ilAssMultipleChoice.js');
504 if (!$this->tpl->blockExists(
'content')) {
505 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.il_as_qpl_content.html",
"Modules/TestQuestionPool");
508 if (!$this->tpl->blockExists(
'statusline')) {
509 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
512 if (!$this->tpl->blockExists(
'adm_content')) {
513 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_question.html",
"Modules/TestQuestionPool");
523 $this->tpl->setVariable(
"QUESTION_DATA",
$form->getHTML());
534 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
537 $page_gui->setOutputMode(
"presentation");
538 $presentation = $page_gui->presentation();
539 $presentation = preg_replace(
"/src=\"\\.\\//ims",
"src=\"" . ILIAS_HTTP_PATH .
"/", $presentation);
540 return $presentation;
550 if ($this->
object->getTestPresentationConfig()->isSolutionInitiallyPrefilled()) {
558 ($this->
object->getTestPresentationConfig()->isUnchangedAnswerPossible()) {
564 $this->lng->loadLanguageModule(
"content");
567 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
570 $page_gui->setTemplateTargetVar($a_temp_var);
574 $page_gui->setQuestionActionsHTML($this->
getNavigationGUI()->getActionsHTML());
583 $page_gui->setPresentationTitle($this->questionHeaderBlockBuilder->getPresentationTitle());
584 $page_gui->setQuestionInfoHTML($this->questionHeaderBlockBuilder->getQuestionInfoHTML());
587 return $page_gui->presentation();
594 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'Modules/TestQuestionPool');
595 $tpl->setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->
object->getTestPresentationConfig()->getUseUnchangedAnswerLabel());
604 return $this->lng->txt(
'use_previous_solution_advice');
609 $tpl =
new ilTemplate(
'tpl.tst_question_additional_behaviour_checkbox.html',
true,
true,
'Modules/TestQuestionPool');
611 $tpl->setVariable(
'TXT_FORCE_FORM_DIFF_LABEL', $this->lng->txt(
'use_previous_solution'));
622 if (
$_GET[
"calling_test"]) {
625 } elseif (
$_GET[
"test_ref_id"]) {
629 if (
$_GET[
"q_id"] > 0) {
630 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id",
$_GET[
"q_id"]);
631 $this->ctrl->redirectByClass(
"ilAssQuestionPageGUI",
"edit");
633 $this->ctrl->redirectByClass(
"ilobjquestionpoolgui",
"questions");
644 if (strlen($return_to)) {
645 $this->ctrl->setParameter($this,
"return_to", $return_to);
646 } elseif ($_REQUEST[
'return_to']) {
647 $this->ctrl->setParameter($this,
"return_to", $_REQUEST[
'return_to']);
649 if (strlen($return_to_feedback)) {
650 $this->ctrl->setParameter($this,
'return_to_fb',
'true');
653 $this->ctrl->saveParameter($this,
'test_express_mode');
655 $template =
new ilTemplate(
"tpl.il_as_qpl_sync_original.html",
true,
true,
"Modules/TestQuestionPool");
656 $template->setVariable(
"BUTTON_YES", $this->lng->txt(
"yes"));
657 $template->setVariable(
"BUTTON_NO", $this->lng->txt(
"no"));
658 $template->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
659 $template->setVariable(
"TEXT_SYNC", $this->lng->txt(
"confirm_sync_questions"));
660 $this->tpl->setVariable(
"ADM_CONTENT",
$template->get());
665 $original_id = $this->
object->original_id;
667 $this->
object->syncWithOriginal();
669 if (strlen(
$_GET[
"return_to"])) {
670 $this->ctrl->redirect($this,
$_GET[
"return_to"]);
672 if (strlen($_REQUEST[
"return_to_fb"])) {
673 $this->ctrl->redirectByClass(
'ilAssQuestionFeedbackEditingGUI',
'showFeedbackForm');
675 if (isset(
$_GET[
'calling_consumer']) && (
int)
$_GET[
'calling_consumer']) {
676 $ref_id = (int) $_GET[
'calling_consumer'];
681 require_once
'Services/Link/classes/class.ilLink.php';
684 $_GET[
"ref_id"] = $_GET[
"calling_test"];
686 if ($_REQUEST[
'test_express_mode']) {
689 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET[
"calling_test"]);
696 if (strlen(
$_GET[
"return_to"])) {
697 $this->ctrl->redirect($this,
$_GET[
"return_to"]);
699 if (strlen($_REQUEST[
'return_to_fb'])) {
700 $this->ctrl->redirectByClass(
'ilAssQuestionFeedbackEditingGUI',
'showFeedbackForm');
702 if (isset(
$_GET[
'calling_consumer']) && (
int)
$_GET[
'calling_consumer']) {
703 $ref_id = (int) $_GET[
'calling_consumer'];
708 require_once
'Services/Link/classes/class.ilLink.php';
711 $_GET[
"ref_id"] = $_GET[
"calling_test"];
713 if ($_REQUEST[
'test_express_mode']) {
716 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET[
"calling_test"]);
730 $ilUser->setPref(
"tst_lastquestiontype", $this->
object->getQuestionType());
731 $ilUser->writePref(
"tst_lastquestiontype", $this->
object->getQuestionType());
732 $this->
object->saveToDb();
733 $originalexists = $this->
object->_questionExists($this->
object->original_id);
734 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
736 $this->ctrl->redirect($this,
"originalSyncForm");
737 } elseif (
$_GET[
"calling_test"]) {
741 } elseif (
$_GET[
"test_ref_id"]) {
742 global $tree,
$ilDB, $ilPluginAdmin;
744 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
748 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
751 $test->insertQuestion($testQuestionSetConfigFactory->getQuestionSetConfig(), $this->
object->getId());
755 $this->ctrl->setParameter($this,
"q_id", $this->
object->getId());
756 $this->editQuestion();
757 if (strcmp(
$_SESSION[
"info"],
"") != 0) {
762 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id", $this->
object->getId());
763 $this->ctrl->redirectByClass(
"ilAssQuestionPageGUI",
"edit");
774 $old_id =
$_GET[
"q_id"];
778 $ilUser->setPref(
"tst_lastquestiontype", $this->
object->getQuestionType());
779 $ilUser->writePref(
"tst_lastquestiontype", $this->
object->getQuestionType());
780 $this->
object->saveToDb();
781 $originalexists = $this->
object->_questionExistsInPool($this->
object->original_id);
784 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
787 $this->ctrl->setParameter($this,
'return_to',
'editQuestion');
788 $this->ctrl->redirect($this,
"originalSyncForm");
790 } elseif ($_GET[
"calling_test"]) {
791 require_once
'Modules/Test/classes/class.ilObjTest.php';
794 global $tree,
$ilDB, $ilPluginAdmin;
796 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
797 $_GET[
"ref_id"] = $_GET[
"calling_test"];
800 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
803 $new_id =
$test->insertQuestion(
804 $testQuestionSetConfigFactory->getQuestionSetConfig(),
805 $this->
object->getId()
808 if (isset($_REQUEST[
'prev_qid'])) {
809 $test->moveQuestionAfter($this->
object->getId() + 1, $_REQUEST[
'prev_qid']);
812 $this->ctrl->setParameter($this,
'q_id', $new_id);
813 $this->ctrl->setParameter($this,
'calling_test', $_GET[
'calling_test']);
814 #$this->ctrl->setParameter($this, 'test_ref_id', false); 817 $this->ctrl->redirect($this,
'editQuestion');
821 if ($this->
object->getId() != $old_id) {
823 $this->ctrl->setParameterByClass($_GET[
"cmdClass"],
"q_id", $this->
object->getId());
824 $this->ctrl->setParameterByClass($_GET[
"cmdClass"],
"sel_question_types", $_GET[
"sel_question_types"]);
831 if ($_REQUEST[
'prev_qid']) {
834 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
836 $test->moveQuestionAfter($_REQUEST[
'prev_qid'], $this->
object->getId());
838 if ( $_REQUEST[
'express_mode']) {
839 global $tree,
$ilDB, $ilPluginAdmin;
841 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
844 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
847 $test->insertQuestion(
848 $testQuestionSetConfigFactory->getQuestionSetConfig(),
849 $this->
object->getId()
852 require_once
'Modules/Test/classes/class.ilTestExpressPage.php';
853 $_REQUEST[
'q_id'] = $this->
object->getId();
857 $this->ctrl->redirectByClass($_GET[
"cmdClass"],
"editQuestion");
859 if (strcmp(
$_SESSION[
"info"],
"") != 0) {
864 $this->ctrl->redirect($this,
'editQuestion');
875 $old_id =
$_GET[
"q_id"];
878 $ilUser->setPref(
"tst_lastquestiontype", $this->
object->getQuestionType());
879 $ilUser->writePref(
"tst_lastquestiontype", $this->
object->getQuestionType());
880 $this->
object->saveToDb();
881 $originalexists = $this->
object->_questionExistsInPool($this->
object->original_id);
882 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
885 $this->ctrl->setParameter($this,
'test_express_mode', $_REQUEST[
'test_express_mode']);
886 $this->ctrl->redirect($this,
"originalSyncForm");
888 } elseif ($_GET[
"calling_test"]) {
889 require_once
'Modules/Test/classes/class.ilObjTest.php';
891 #var_dump(assQuestion::_questionExistsInTest($this->object->getId(), $test->getTestId())); 892 $q_id = $this->
object->getId();
894 global $tree,
$ilDB, $ilPluginAdmin;
896 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
897 $_GET[
"ref_id"] = $_GET[
"calling_test"];
900 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
903 $new_id =
$test->insertQuestion(
904 $testQuestionSetConfigFactory->getQuestionSetConfig(),
905 $this->
object->getId()
909 if (isset($_REQUEST[
'prev_qid'])) {
910 $test->moveQuestionAfter($this->
object->getId() + 1, $_REQUEST[
'prev_qid']);
913 $this->ctrl->setParameter($this,
'q_id', $new_id);
914 $this->ctrl->setParameter($this,
'calling_test', $_GET[
'calling_test']);
915 #$this->ctrl->setParameter($this, 'test_ref_id', false); 919 $_REQUEST[
'test_express_mode']
923 ilUtil::redirect(
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=" . $_GET[
"calling_test"]);
926 if ($this->
object->getId() != $old_id) {
929 $this->ctrl->redirectByClass(
"ilobjquestionpoolgui",
"questions");
931 if (strcmp(
$_SESSION[
"info"],
"") != 0) {
936 $this->ctrl->redirectByClass(
"ilobjquestionpoolgui",
"questions");
947 $this->
object->saveToDb();
948 $this->ctrl->setParameter($this,
"q_id", $this->
object->getId());
949 $this->editQuestion();
962 $tmpPath = $cont_obj->getLMTree()->getPathFull($a_endnode_id, $a_startnode_id);
965 for (
$i = 1;
$i < (count($tmpPath) - 1);
$i++) {
970 $path .= $tmpPath[
$i][
"title"];
978 $this->sequence_no = $nr;
988 $this->question_count = $a_question_count;
1008 $this->errormessage .= ((strlen($this->errormessage)) ?
"<br />" :
"") .
$errormessage;
1025 return $this->
object->getQuestionType();
1038 if (strlen($a_value)) {
1039 $result =
" value=\"$a_value\" ";
1051 $cnt = $this->new_id_listener_cnt;
1052 $this->new_id_listeners[$cnt][
"object"] =&$a_object;
1053 $this->new_id_listeners[$cnt][
"method"] = $a_method;
1054 $this->new_id_listeners[$cnt][
"parameters"] = $a_parameters;
1055 $this->new_id_listener_cnt++;
1063 for (
$i=0;
$i<$this->new_id_listener_cnt;
$i++) {
1064 $this->new_id_listeners[
$i][
"parameters"][
"new_id"] = $a_new_id;
1065 $object =&$this->new_id_listeners[
$i][
"object"];
1066 $method = $this->new_id_listeners[
$i][
"method"];
1067 $parameters = $this->new_id_listeners[
$i][
"parameters"];
1072 $object->$method($parameters);
1082 if (!$this->
object->getSelfAssessmentEditingMode()) {
1083 $form->addCommandButton(
"saveReturn", $this->lng->txt(
"save_return"));
1085 $form->addCommandButton(
"save", $this->lng->txt(
"save"));
1098 $title->setMaxLength(100);
1100 $title->setRequired(
true);
1103 if (!$this->
object->getSelfAssessmentEditingMode()) {
1105 $author =
new ilTextInputGUI($this->lng->txt(
"author"),
"author");
1107 $author->setRequired(
true);
1108 $form->addItem($author);
1119 if (trim($author) ==
"") {
1122 $hi->setValue($author);
1123 $form->addItem($hi);
1129 $question->setRequired(
true);
1130 $question->setRows(10);
1131 $question->setCols(80);
1133 if (!$this->
object->getSelfAssessmentEditingMode()) {
1135 $question->setUseRte(
true);
1136 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
1138 $question->addPlugin(
"latex");
1139 $question->addButton(
"latex");
1140 $question->addButton(
"pastelatex");
1141 $question->setRTESupport($this->
object->getId(),
"qpl",
"assessment");
1144 require_once
'Modules/TestQuestionPool/classes/questions/class.ilAssSelfAssessmentQuestionFormatter.php';
1146 $question->setUseTagsForRteOnly(
false);
1148 $form->addItem($question);
1150 if (!$this->
object->getSelfAssessmentEditingMode()) {
1154 $duration->setShowMinutes(
true);
1155 $duration->setShowSeconds(
true);
1156 $ewt = $this->
object->getEstimatedWorkingTime();
1157 $duration->setHours($ewt[
"h"]);
1158 $duration->setMinutes($ewt[
"m"]);
1159 $duration->setSeconds($ewt[
"s"]);
1160 $duration->setRequired(
false);
1161 $form->addItem($duration);
1164 if (strlen($this->
object->getNrOfTries())) {
1165 $nr_tries = $this->
object->getNrOfTries();
1167 $nr_tries = $this->
object->getDefaultNrOfTries();
1169 if ($nr_tries < 1) {
1173 $ni =
new ilNumberInputGUI($this->lng->txt(
"qst_nr_of_tries"),
"nr_of_tries");
1175 $ni->setMinValue(0);
1177 $ni->setMaxLength(5);
1178 $form->addItem($ni);
1185 require_once
'Services/Taxonomy/classes/class.ilTaxAssignInputGUI.php';
1188 $postvar =
"tax_node_assign_$taxonomyId";
1192 $tax_node_assign->saveInput(
"qpl", $this->
object->getObjId(),
"quest", $this->
object->getId());
1201 require_once
'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php';
1202 ilOverlayGUI::initJavaScript();
1205 $sectHeader->setTitle($this->lng->txt(
'qpl_qst_edit_form_taxonomy_section'));
1208 require_once
'Services/Taxonomy/classes/class.ilTaxSelectInputGUI.php';
1212 $label = sprintf($this->lng->txt(
'qpl_qst_edit_form_taxonomy'), $taxonomy->getTitle());
1213 $postvar =
"tax_node_assign_$taxonomyId";
1218 require_once
'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
1222 $taxSelect->setValue(array_map(
function ($assignedNode) {
1223 return $assignedNode[
'node_id'];
1224 }, $assignedNodes));
1256 include_once
"./Modules/Test/classes/class.ilObjTest.php";
1258 if (strlen($manual_feedback)) {
1259 return $manual_feedback;
1261 $correct_feedback = $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->
object->getId(),
true);
1262 $incorrect_feedback = $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->
object->getId(),
false);
1263 if (strlen($correct_feedback . $incorrect_feedback)) {
1264 $reached_points = $this->
object->calculateReachedPoints($active_id,
$pass);
1265 $max_points = $this->
object->getMaximumPoints();
1266 if ($reached_points == $max_points) {
1269 $output = $incorrect_feedback;
1272 return $this->
object->prepareTextareaOutput(
$output,
true);
1277 return $this->
object->prepareTextareaOutput(
1278 $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
true),
1285 return $this->
object->prepareTextareaOutput(
1286 $this->
object->feedbackOBJ->getGenericFeedbackTestPresentation($this->object->getId(),
false),
1306 $count = $this->
object->isInUse();
1308 if ($this->
object->_questionExistsInPool($this->object->getId()) && $count) {
1310 if ($rbacsystem->checkAccess(
"write",
$_GET[
"ref_id"])) {
1311 ilUtil::sendInfo(sprintf($this->lng->txt(
"qpl_question_is_in_use"), $count));
1333 $save = (is_array(
$_POST[
"cmd"]) && array_key_exists(
"suggestedsolution",
$_POST[
"cmd"])) ?
true :
false;
1335 if ($save &&
$_POST[
"deleteSuggestedSolution"] == 1) {
1336 $this->
object->deleteSuggestedSolutions();
1338 $this->ctrl->redirect($this,
"suggestedsolution");
1342 $solution_array = $this->
object->getSuggestedSolution(0);
1344 "lm" => $this->lng->txt(
"obj_lm"),
1345 "st" => $this->lng->txt(
"obj_st"),
1346 "pg" => $this->lng->txt(
"obj_pg"),
1347 "git" => $this->lng->txt(
"glossary_term"),
1348 "file" => $this->lng->txt(
"fileDownload"),
1349 "text" => $this->lng->txt(
"solutionText")
1352 if ((strcmp(
$_POST[
"solutiontype"],
"file") == 0) && (strcmp($solution_array[
"type"],
"file") != 0)) {
1353 $solution_array =
array(
1356 } elseif ((strcmp(
$_POST[
"solutiontype"],
"text") == 0) && (strcmp($solution_array[
"type"],
"text") != 0)) {
1360 $solution_array =
array(
1366 if ($save && strlen(
$_POST[
"filename"])) {
1367 $solution_array[
"value"][
"filename"] =
$_POST[
"filename"];
1369 if ($save && strlen(
$_POST[
"solutiontext"])) {
1370 $solution_array[
"value"] =
$_POST[
"solutiontext"];
1372 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
1373 if (count($solution_array)) {
1375 $form->setFormAction($this->ctrl->getFormAction($this));
1376 $form->setTitle($this->lng->txt(
"solution_hint"));
1377 $form->setMultipart(
true);
1378 $form->setTableWidth(
"100%");
1379 $form->setId(
"suggestedsolutiondisplay");
1382 include_once
"./Modules/TestQuestionPool/classes/class.ilSolutionTitleInputGUI.php";
1384 $template =
new ilTemplate(
"tpl.il_as_qpl_suggested_solution_input_presentation.html",
true,
true,
"Modules/TestQuestionPool");
1385 if (strlen($solution_array[
"internal_link"])) {
1387 $template->setCurrentBlock(
"preview");
1388 $template->setVariable(
"TEXT_SOLUTION", $this->lng->txt(
"suggested_solution"));
1389 $template->setVariable(
"VALUE_SOLUTION",
" <a href=\"$href\" target=\"content\">" . $this->lng->txt(
"view") .
"</a> ");
1390 $template->parseCurrentBlock();
1391 } elseif ((strcmp($solution_array[
"type"],
"file") == 0) && (is_array($solution_array[
"value"]))) {
1392 $href = $this->
object->getSuggestedSolutionPathWeb() . $solution_array[
"value"][
"name"];
1393 $template->setCurrentBlock(
"preview");
1394 $template->setVariable(
"TEXT_SOLUTION", $this->lng->txt(
"suggested_solution"));
1395 $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> ");
1396 $template->parseCurrentBlock();
1398 $template->setVariable(
"TEXT_TYPE", $this->lng->txt(
"type"));
1399 $template->setVariable(
"VALUE_TYPE",
$options[$solution_array[
"type"]]);
1400 $title->setHtml($template->get());
1402 $deletesolution->setOptionTitle($this->lng->txt(
"deleteSuggestedSolution"));
1403 $title->addSubItem($deletesolution);
1406 if (strcmp($solution_array[
"type"],
"file") == 0) {
1409 $file->setRequired(
true);
1410 $file->enableFileNameSelection(
"filename");
1412 if ($_FILES[
"file"][
"tmp_name"] &&
$file->checkInput()) {
1413 if (!file_exists($this->
object->getSuggestedSolutionPath())) {
1417 $res = ilUtil::moveUploadedFile($_FILES[
"file"][
"tmp_name"], $_FILES[
"file"][
"name"], $this->
object->getSuggestedSolutionPath() . $_FILES[
"file"][
"name"]);
1422 if (is_array($solution_array[
"value"])) {
1423 @unlink($this->
object->getSuggestedSolutionPath() . $solution_array[
"value"][
"name"]);
1425 $file->setValue($_FILES[
"file"][
"name"]);
1426 $this->
object->saveSuggestedSolution(
"file",
"", 0,
array(
"name" => $_FILES[
"file"][
"name"],
"type" => $_FILES[
"file"][
"type"],
"size" => $_FILES[
"file"][
"size"],
"filename" =>
$_POST[
"filename"]));
1427 $originalexists = $this->
object->_questionExistsInPool($this->
object->original_id);
1432 $this->ctrl->redirect($this,
"suggestedsolution");
1439 if (is_array($solution_array[
"value"])) {
1440 $file->setValue($solution_array[
"value"][
"name"]);
1441 $file->setFilename((strlen($solution_array[
"value"][
"filename"])) ? $solution_array[
"value"][
"filename"] : $solution_array[
"value"][
"name"]);
1446 $hidden->setValue(
"file");
1447 $form->addItem($hidden);
1448 } elseif (strcmp($solution_array[
"type"],
"text") == 0) {
1449 $solutionContent = $solution_array[
'value'];
1450 $solutionContent = $this->
object->fixSvgToPng($solutionContent);
1451 $solutionContent = $this->
object->fixUnavailableSkinImageSources($solutionContent);
1453 $question->
setValue($this->
object->prepareTextareaOutput($solutionContent));
1454 $question->setRequired(
true);
1455 $question->setRows(10);
1456 $question->setCols(80);
1457 $question->setUseRte(
true);
1458 $question->addPlugin(
"latex");
1459 $question->addButton(
"latex");
1460 $question->setRTESupport($this->
object->getId(),
"qpl",
"assessment");
1462 $hidden->setValue(
"text");
1463 $form->addItem($hidden);
1464 $form->addItem($question);
1466 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
'ref_id'])) {
1467 $form->addCommandButton(
'showSuggestedSolution', $this->lng->txt(
'cancel'));
1468 $form->addCommandButton(
'suggestedsolution', $this->lng->txt(
'save'));
1472 if (
$form->checkInput()) {
1473 switch ($solution_array[
"type"]) {
1475 $this->
object->saveSuggestedSolution(
"file",
"", 0,
array(
1476 "name" => $solution_array[
"value"][
"name"],
1477 "type" => $solution_array[
"value"][
"type"],
1478 "size" => $solution_array[
"value"][
"size"],
1479 "filename" =>
$_POST[
"filename"]
1483 $this->
object->saveSuggestedSolution(
"text",
"", 0, $solution_array[
"value"]);
1486 $originalexists = $this->
object->_questionExistsInPool($this->
object->original_id);
1491 $this->ctrl->redirect($this,
"suggestedsolution");
1499 $savechange = (strcmp($this->ctrl->getCmd(),
"saveSuggestedSolution") == 0) ? true :
false;
1502 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
'ref_id'])) {
1504 $formchange->setFormAction($this->ctrl->getFormAction($this));
1505 $formchange->setTitle((count($solution_array)) ? $this->lng->txt(
"changeSuggestedSolution") : $this->lng->txt(
"addSuggestedSolution"));
1506 $formchange->setMultipart(
false);
1507 $formchange->setTableWidth(
"100%");
1508 $formchange->setId(
"suggestedsolution");
1510 $solutiontype =
new ilRadioGroupInputGUI($this->lng->txt(
"suggestedSolutionType"),
"solutiontype");
1511 foreach (
$options as $opt_value => $opt_caption) {
1514 if (count($solution_array)) {
1515 $solutiontype->setValue($solution_array[
"type"]);
1517 $solutiontype->setRequired(
true);
1518 $formchange->addItem($solutiontype);
1520 $formchange->addCommandButton(
"saveSuggestedSolution", $this->lng->txt(
"select"));
1523 $formchange->checkInput();
1525 $changeoutput = $formchange->getHTML();
1528 $this->tpl->setVariable(
"ADM_CONTENT", $changeoutput .
$output);
1535 include_once(
"./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1537 $search =
$_GET[
"search_link_type"];
1538 $this->ctrl->setParameter($this,
"link_new_type",
$type);
1539 $this->ctrl->setParameter($this,
"search_link_type", $search);
1540 $this->ctrl->saveParameter($this,
array(
"subquestion_index",
"link_new_type",
"search_link_type"));
1544 $parent_ref_id = $tree->getParentId(
$_GET[
"ref_id"]);
1545 $exp =
new ilSolutionExplorer($this->ctrl->getLinkTarget($this,
'suggestedsolution'), get_class($this));
1547 $exp->setExpandTarget($this->ctrl->getLinkTarget($this,
'outSolutionExplorer'));
1548 $exp->setTargetGet(
"ref_id");
1549 $exp->setRefId(
$_GET[
"ref_id"]);
1550 $exp->addFilter(
$type);
1551 $exp->setSelectableType(
$type);
1552 if (isset(
$_GET[
'expandCurrentPath']) &&
$_GET[
'expandCurrentPath']) {
1553 $exp->expandPathByRefId($parent_ref_id);
1559 $template =
new ilTemplate(
"tpl.il_as_qpl_explorer.html",
true,
true,
"Modules/TestQuestionPool");
1560 $template->setVariable(
"EXPLORER_TREE", $exp->getOutput());
1561 $template->setVariable(
"BUTTON_CANCEL", $this->lng->txt(
"cancel"));
1562 $template->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this,
"suggestedsolution"));
1563 $this->tpl->setVariable(
"ADM_CONTENT",
$template->get());
1570 include_once(
"./Modules/TestQuestionPool/classes/class.ilSolutionExplorer.php");
1571 switch (
$_POST[
"solutiontype"]) {
1596 if (isset(
$_POST[
'solutiontype'])) {
1597 $this->ctrl->setParameter($this,
'expandCurrentPath', 1);
1599 $this->ctrl->setParameter($this,
"link_new_type",
$type);
1600 $this->ctrl->setParameter($this,
"search_link_type", $search);
1601 $this->ctrl->redirect($this,
"outSolutionExplorer");
1606 $this->ctrl->redirect($this,
"suggestedsolution");
1611 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1612 require_once
'Modules/LearningModule/classes/class.ilLMPageObject.php';
1613 require_once
'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1615 $this->ctrl->setParameter($this,
'q_id', $this->
object->getId());
1618 $cont_obj = $cont_obj_gui->object;
1620 $shownpages =
array();
1621 $tree = $cont_obj->getLMTree();
1622 $chapters = $tree->getSubtree($tree->getNodeData($tree->getRootId()));
1626 foreach ($chapters as $chapter) {
1627 $chapterpages = $tree->getChildsByType($chapter[
'obj_id'],
'pg');
1628 foreach ($chapterpages as $page) {
1629 if ($page[
'type'] ==
$_GET[
'search_link_type']) {
1630 array_push($shownpages, $page[
'obj_id']);
1632 if ($tree->isInTree($page[
'obj_id'])) {
1638 $this->ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1640 'title' => $page[
'title'],
1642 'text_add' => $this->lng->txt(
'add'),
1643 'href_add' => $this->ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1648 foreach ($pages as $page) {
1649 if (!in_array($page[
'obj_id'], $shownpages)) {
1650 $this->ctrl->setParameter($this, $page[
'type'], $page[
'obj_id']);
1652 'title' => $page[
'title'],
1653 'description' =>
'---',
1654 'text_add' => $this->lng->txt(
'add'),
1655 'href_add' => $this->ctrl->getLinkTarget($this,
'add' . strtoupper($page[
'type']))
1660 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1665 $this->tpl->setContent(
$table->getHTML());
1670 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1671 require_once
'Modules/LearningModule/classes/class.ilObjContentObjectGUI.php';
1673 $this->ctrl->setParameter($this,
'q_id', $this->
object->getId());
1676 $cont_obj = $cont_obj_gui->object;
1677 $ctree = $cont_obj->getLMTree();
1678 $nodes = $ctree->getSubtree($ctree->getNodeData($ctree->getRootId()));
1682 foreach ($nodes as $node) {
1683 if ($node[
'type'] ==
$_GET[
'search_link_type']) {
1684 $this->ctrl->setParameter($this, $node[
'type'], $node[
'obj_id']);
1686 'title' => $node[
'title'],
1687 'description' =>
'',
1688 'text_add' => $this->lng->txt(
'add'),
1689 'href_add' => $this->ctrl->getLinkTarget($this,
'add' . strtoupper($node[
'type']))
1696 $table->setData(
$rows);
1698 $this->tpl->setContent($table->getHTML());
1703 require_once
'Modules/TestQuestionPool/classes/tables/class.ilQuestionInternalLinkSelectionTableGUI.php';
1704 require_once
'Modules/Glossary/classes/class.ilObjGlossary.php';
1706 $this->ctrl->setParameter($this,
'q_id', $this->
object->getId());
1709 $terms = $glossary->getTermList();
1713 foreach ($terms as $term) {
1714 $this->ctrl->setParameter($this,
'git', $term[
'id']);
1716 'title' => $term[
'term'],
1717 'description' =>
'',
1718 'text_add' => $this->lng->txt(
'add'),
1719 'href_add' => $this->ctrl->getLinkTarget($this,
'addGIT')
1724 $table->setTitle($this->lng->txt(
'glossary_term'));
1725 $table->setData(
$rows);
1727 $this->tpl->setContent($table->getHTML());
1732 $this->ctrl->saveParameter($this,
array(
"subquestion_index",
"link_new_type",
"search_link_type"));
1733 switch (
$_GET[
"search_link_type"]) {
1744 $subquestion_index = (
$_GET[
"subquestion_index"] > 0) ?
$_GET[
"subquestion_index"] : 0;
1745 $this->
object->saveSuggestedSolution(
"lm",
"il__lm_" .
$_GET[
"source_id"], $subquestion_index);
1747 $this->ctrl->redirect($this,
"suggestedsolution");
1754 $subquestion_index = 0;
1755 if (strlen(
$_GET[
"subquestion_index"]) &&
$_GET[
"subquestion_index"] >= 0) {
1756 $subquestion_index =
$_GET[
"subquestion_index"];
1758 $this->
object->saveSuggestedSolution(
"pg",
"il__pg_" .
$_GET[
"pg"], $subquestion_index);
1760 $this->ctrl->redirect($this,
"suggestedsolution");
1765 $subquestion_index = 0;
1766 if (strlen(
$_GET[
"subquestion_index"]) &&
$_GET[
"subquestion_index"] >= 0) {
1767 $subquestion_index =
$_GET[
"subquestion_index"];
1769 $this->
object->saveSuggestedSolution(
"st",
"il__st_" .
$_GET[
"st"], $subquestion_index);
1771 $this->ctrl->redirect($this,
"suggestedsolution");
1776 $subquestion_index = 0;
1777 if (strlen(
$_GET[
"subquestion_index"]) &&
$_GET[
"subquestion_index"] >= 0) {
1778 $subquestion_index =
$_GET[
"subquestion_index"];
1780 $this->
object->saveSuggestedSolution(
"git",
"il__git_" .
$_GET[
"git"], $subquestion_index);
1782 $this->ctrl->redirect($this,
"suggestedsolution");
1787 return in_array($this->ctrl->getCmd(),
array(
'save',
'saveEdit',
'saveReturn'));
1805 $commands =
array();
1807 foreach ($reflectionClass->getConstants() as $constName => $constValue) {
1808 if (substr($constName, 0, strlen($cmdConstantNameBegin)) == $cmdConstantNameBegin) {
1809 $commands[] = $constValue;
1819 global $rbacsystem, $ilTabs;
1821 $ilTabs->clearTargets();
1823 $this->ctrl->setParameterByClass(
"ilAssQuestionPageGUI",
"q_id",
$_GET[
"q_id"]);
1824 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1825 $q_type = $this->
object->getQuestionType();
1827 if (strlen($q_type)) {
1828 $classname = $q_type .
"GUI";
1829 $this->ctrl->setParameterByClass(strtolower($classname),
"sel_question_types", $q_type);
1830 $this->ctrl->setParameterByClass(strtolower($classname),
"q_id",
$_GET[
"q_id"]);
1833 if (
$_GET[
"q_id"]) {
1834 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"])) {
1838 $this->ctrl->getLinkTargetByClass(
"ilAssQuestionPageGUI",
"edit"),
1839 array(
"edit",
"insert",
"exec_pg"),
1848 $force_active =
false;
1849 if ($rbacsystem->checkAccess(
'write',
$_GET[
"ref_id"])) {
1852 $url = $this->ctrl->getLinkTargetByClass($classname,
"editQuestion");
1854 $force_active =
false;
1876 if (
$_GET[
"q_id"]) {
1879 $this->ctrl->getLinkTargetByClass($classname,
"assessment"),
1880 array(
"assessment"),
1891 if (
$_GET[
"q_id"]) {
1893 "suggested_solution",
1894 $this->ctrl->getLinkTargetByClass($classname,
"suggestedsolution"),
1895 array(
"suggestedsolution",
"saveSuggestedSolution",
"outSolutionExplorer",
"cancel",
1896 "addSuggestedSolution",
"cancelExplorer",
"linkChilds",
"removeSuggestedSolution" 1911 return array(
'editQuestion',
'save',
'saveEdit',
'originalSyncForm');
1929 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
1930 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionFeedbackEditingGUI');
1934 $tabs->
addTarget(
'tst_feedback', $tabLink, $tabCommands, $ilCtrl->getCmdClass(),
'');
1947 $tabs->
addTarget(
'units', $ilCtrl->getLinkTargetByClass(
'ilLocalUnitConfigurationGUI',
''),
'',
'illocalunitconfigurationgui');
1960 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
1962 switch ($ilCtrl->getCmdClass()) {
1963 case 'ilassquestionhintsgui':
1965 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionHintsGUI');
1968 case 'ilassquestionhintgui':
1970 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
1971 $tabCommands = self::getCommandsFromClassConstants(
'ilAssQuestionHintGUI');
1976 $tabCommands =
array();
1981 $tabs->
addTarget(
'tst_question_hints_tab', $tabLink, $tabCommands, $ilCtrl->getCmdClass(),
'');
1986 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
1992 array(
'ilAssQuestionPreviewGUI')
1999 $graphicalOutput =
false,
2000 $result_output =
false,
2001 $show_question_only =
true,
2002 $show_feedback =
false,
2003 $show_correct_solution =
false,
2004 $show_manual_scoring =
false,
2005 $show_question_text =
true 2010 $reachedPoints = $this->
object->getAdjustedReachedPoints($activeId, $passIndex,
true);
2011 $maximumPoints = $this->
object->getMaximumPoints();
2013 return $reachedPoints == $maximumPoints;
2018 return $this->
object->isAutosaveable();
2023 $this->
object->setTitle(
$_POST[
"title"]);
2024 $this->
object->setAuthor(
$_POST[
"author"]);
2025 $this->
object->setComment(
$_POST[
"comment"]);
2026 if ($this->
object->getSelfAssessmentEditingMode()) {
2027 $this->
object->setNrOfTries(
$_POST[
'nr_of_tries']);
2030 $this->
object->setEstimatedWorkingTime(
2031 $_POST[
"Estimated"][
"hh"],
2032 $_POST[
"Estimated"][
"mm"],
2033 $_POST[
"Estimated"][
"ss"]
2037 abstract public function getPreview($show_question_only =
false, $showInlineFeedback =
false);
2053 $is_question_postponed =
false,
2054 $user_post_solutions =
false,
2055 $show_specific_inline_feedback =
false 2062 $is_question_postponed,
2063 $user_post_solutions,
2064 $show_specific_inline_feedback
2069 $this->tpl->setVariable(
"QUESTION_OUTPUT", $test_output);
2070 $this->tpl->setVariable(
"FORMACTION", $formaction);
2072 $this->tpl->setVariable(
"FORM_TIMESTAMP",
time());
2090 $is_question_postponed,
2091 $user_post_solutions,
2092 $show_specific_inline_feedback
2097 return self::FORM_ENCODING_URLENCODE;
2105 if ((
$_GET[
"calling_test"] > 0) || (
$_GET[
"test_ref_id"] > 0)) {
2106 $ref_id =
$_GET[
"calling_test"];
2107 if (strlen($ref_id) == 0) {
2108 $ref_id =
$_GET[
"test_ref_id"];
2111 if (!
$_GET[
'test_express_mode'] && !
$GLOBALS[
'___test_express_mode']) {
2112 $ilTabs->
setBackTarget($this->lng->txt(
"backtocallingtest"),
"ilias.php?baseClass=ilObjTestGUI&cmd=questions&ref_id=$ref_id");
2115 $ilTabs->
setBackTarget($this->lng->txt(
"backtocallingtest"), $link);
2117 } elseif (isset(
$_GET[
'calling_consumer']) && (
int)
$_GET[
'calling_consumer']) {
2118 $ref_id = (int) $_GET[
'calling_consumer'];
2123 require_once
'Services/Link/classes/class.ilLink.php';
2127 $ilTabs->
setBackTarget($this->lng->txt(
"qpl"), $this->ctrl->getLinkTargetByClass(
"ilobjquestionpoolgui",
"questions"));
2157 require_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
2160 $form->setFormAction($this->ctrl->getFormAction($this));
2165 $form->setTableWidth(
'100%');
2167 $form->setMultipart(
true);
2183 $errors = $this->editQuestion(
true);
isTestPresentationContext()
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
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)
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.
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()
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.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
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)
getQuestionTemplate()
get question template
Class ilQuestionUsagesTableGUI.
isRenderPurposePlayback()
setEditContext($editContext)
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
populateTaxonomyFormSection(ilPropertyFormGUI $form)
const CMD_SHOW_LIST
command constants
const CMD_SHOW
command constants
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
$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...
if(!is_dir( $entity_dir)) exit("Fatal Error ([A-Za-z0-9]+)\+" &#(? foreach( $entity_files as $file) $output
& 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.
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
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
const PRESENTATION_CONTEXT_TEST
static _getClassNameForQType($q_type)
$previousSolutionPrefilled
completeTestOutputFormAction($formAction, $active_id, $pass)
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.
Create new PHPExcel object
obj_idprivate
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)
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="")
output question page
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
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="")
saveReturn()
save question
getSpecificFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
setExpand($a_node_id)
set the expand option this value is stored in a SESSION variable to save it different view (lo view...
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
setOutputMode($a_mode=IL_PAGE_PRESENTATION)
Set Output Mode.
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
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)