4require_once 
'./Modules/Test/classes/inc.AssessmentConstants.php';
 
    5require_once 
'Modules/Test/classes/class.ilTestExpressPage.php';
 
    6require_once 
'Modules/TestQuestionPool/exceptions/class.ilTestQuestionPoolException.php';
 
    7require_once 
'Modules/Test/classes/class.ilTestExpressPage.php';
 
    8require_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');");
 
  185        echo $this->
getHeaderAction() . $DIC->ui()->mainTemplate()->getOnLoadCodeForAsynch();
 
  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');
 
  216        $notesGUI->enablePublicNotes(
true);
 
  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()
 
  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");
 
  622        $page_gui->setQuestionHTML(array($this->object->getId() => 
$html));
 
  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");
 
  654        $page_gui->setOutputMode(
"presentation");
 
  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'];
 
  770                require_once 
'Services/Link/classes/class.ilLink.php';
 
  775            if ($_REQUEST[
'test_express_mode']) {
 
  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'];
 
  797                require_once 
'Services/Link/classes/class.ilLink.php';
 
  802            if ($_REQUEST[
'test_express_mode']) {
 
  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"]) {
 
  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';
 
  891                    $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
  893                    include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
  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']) {
 
  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();
 
  998                    $ilPluginAdmin = 
$DIC[
'ilPluginAdmin'];
 
 1000                    include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
 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']
 
 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()) {
 
 1257            $duration->setShowHours(
true);
 
 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");
 
 1278            $ni->setValue($nr_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'));
 
 1310            $form->addItem($sectHeader);
 
 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";
 
 1320                $taxSelect->setTitle($label);
 
 1322                require_once 
'Services/Taxonomy/classes/class.ilTaxNodeAssignment.php';
 
 1324                $assignedNodes = $taxNodeAssignments->getAssignmentsOfItem($this->object->getId());
 
 1326                $taxSelect->setValue(array_map(
function ($assignedNode) {
 
 1327                    return $assignedNode[
'node_id'];
 
 1328                }, $assignedNodes));
 
 1329                $form->addItem($taxSelect);
 
 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"])) {
 
 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> ");
 
 1497            } elseif ((strcmp($solution_array[
"type"], 
"file") == 0) && (is_array($solution_array[
"value"]))) {
 
 1498                $href = $this->
object->getSuggestedSolutionPathWeb() . $solution_array[
"value"][
"name"];
 
 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> ");
 
 1504            $template->setVariable(
"TEXT_TYPE", $this->lng->txt(
"type"));
 
 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");
 
 1515                $file->setRequired(
true);
 
 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) {
 
 1618                $solutiontype->addOption(
new ilRadioOption($opt_caption, $opt_value));
 
 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);
 
 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));
 
 1653        $exp->setExpand(
$_GET[
'expand_sol'] ? 
$_GET[
'expand_sol'] : $parent_ref_id);
 
 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());
 
 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']))
 
 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'));
 
 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'));
 
 1908        $reflectionClass = 
new ReflectionClass($guiClassName);
 
 1912        if ($reflectionClass instanceof ReflectionClass) {
 
 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';
 
 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':
 
 2081            case 'ilassquestionhintgui':
 
 2083                require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintGUI.php';
 
 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
 
 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);
 
An exception for terminatinating execution or to throw for unit testing.
Basic GUI class for assessment questions.
const FORM_ENCODING_MULTIPART
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...
isRenderPurposeInputValue()
populateTaxonomyFormSection(ilPropertyFormGUI $form)
addNewIdListener(&$a_object, $a_method, $a_parameters="")
Add a listener that is notified with the new question ID, when a new question is saved.
getGenericFeedbackOutputForIncorrectSolution()
callNewIdListeners($a_new_id)
Call the new id listeners.
getGenericFeedbackOutputForCorrectSolution()
saveCorrectionsFormProperties(ilPropertyFormGUI $form)
const SESSION_PREVIEW_DATA_BASE_INDEX
writePostData($always=false)
Evaluates a posted edit form and writes the form data in the question object.
getContextPath($cont_obj, $a_endnode_id, $a_startnode_id=1)
get context path in content object tree
setErrorMessage($errormessage)
const RENDER_PURPOSE_DEMOPLAY
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)
const PRESENTATION_CONTEXT_TEST
getQuestionType()
Returns the question type string.
$questionHeaderBlockBuilder
static _getClassNameForQType($q_type)
getType()
needed for page editor compliance
setEditContext($editContext)
addTab_QuestionHints(ilTabsGUI $tabs)
adds the hints tab to ilTabsGUI
setNavigationGUI($navigationGUI)
hasIntermediateSolution($activeId, $passIndex)
Check if the question has an intermediate solution.
setTargetGuiClass($targetGuiClass)
isRenderPurposePrintPdf()
writeQuestionGenericPostData()
setQuestionCount($a_question_count)
getAnswerFrequencyTableGUI($parentGui, $parentCmd, $relevantAnswers, $questionIndex)
populateJavascriptFilesRequiredForWorkForm(ilTemplate $tpl)
addQuestionFormCommandButtons($form)
Add the command buttons of a question properties form.
getBasicEditQuestionTabCommands()
getILIASPage($html="")
Returns the ILIAS Page around a question.
const RENDER_PURPOSE_PLAYBACK
isPreviousSolutionPrefilled()
getQuestionTemplate()
get question template
& createQuestionGUI($question_type, $question_id=-1)
Creates a question gui representation.
setTaxonomyIds($taxonomyIds)
originalSyncForm($return_to="", $return_to_feedback='')
getAsValueAttribute($a_value)
Returns a HTML value attribute.
setPreviewSession($previewSession)
setTargetGui($linkTargetGui)
populateCorrectionsFormProperties(ilPropertyFormGUI $form)
getAdditionalEditQuestionCommands()
$previousSolutionPrefilled
const FORM_ENCODING_URLENCODE
isRenderPurposePlayback()
const RENDER_PURPOSE_PRINT_PDF
saveReturn()
save question
prepareReprintableCorrectionsForm(ilPropertyFormGUI $form)
addTab_SuggestedSolution(ilTabsGUI $tabs, $classname)
outQuestionForTest( $formaction, $active_id, $pass, $is_question_postponed=false, $user_post_solutions=false, $show_specific_inline_feedback=false)
getQuestionHeaderBlockBuilder()
const EDIT_CONTEXT_ADJUSTMENT
setAdjustmentEditContext()
getTestOutput( $active_id, $pass, $is_question_postponed, $user_post_solutions, $show_specific_inline_feedback)
$use_intermediate_solution
outQuestionPage($a_temp_var, $a_postponed=false, $active_id="", $html="", $inlineFeedbackEnabled=false)
output question page
const EDIT_CONTEXT_AUTHORING
const RENDER_PURPOSE_PREVIEW
renderPurposeSupportsFormHtml()
getUseIntermediateSolution()
Get if intermediate solution should be used for solution output.
static _getGUIClassNameForId($a_q_id)
saveTaxonomyAssignments()
setPresentationContext($presentationContext)
getAnswersFrequency($relevantAnswers, $questionIndex)
setQuestionHeaderBlockBuilder($questionHeaderBlockBuilder)
addErrorMessage($errormessage)
isAnswerFreuqencyStatisticSupported()
suggestedsolution()
Allows to add suggested solutions for questions.
buildBasicEditFormObject()
const PRESENTATION_CONTEXT_RESULTS
getPreviousSolutionProvidedMessage()
getEditQuestionTabCommands()
completeTestOutputFormAction($formAction, $active_id, $pass)
getSpecificFeedbackOutput($userSolution)
Returns the answer specific feedback for the question.
supportsIntermediateSolutionOutput()
Question type specific support of intermediate solution output The function getSolutionOutput respect...
addBackTab(ilTabsGUI $ilTabs)
setUseIntermediateSolution($use)
getUseUnchangedAnswerCheckboxHtml()
const RENDER_PURPOSE_INPUT_VALUE
setPreviousSolutionPrefilled($previousSolutionPrefilled)
isTestPresentationContext()
isRenderPurposeDemoplay()
__construct()
assQuestionGUI constructor
setRenderPurpose($renderPurpose)
hasCorrectSolution($activeId, $passIndex)
addTab_QuestionFeedback(ilTabsGUI $tabs)
adds the feedback tab to ilTabsGUI
addBasicQuestionFormProperties($form)
Add basic question form properties: assessment: title, author, description, question,...
addTab_QuestionPreview(ilTabsGUI $tabsGUI)
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...
isAdjustmentEditContext()
setQuestionActionCmd($questionActionCmd)
executeCommand()
execute command
getPreview($show_question_only=false, $showInlineFeedback=false)
hasInlineFeedback()
this method can be overwritten per question type
$sequence_no
sequence number in test
$question_count
question count in test
getAnswerFeedbackOutput($active_id, $pass)
Returns the answer generic feedback depending on the results of the question.
getPreviousSolutionConfirmationCheckboxHtml()
getGenericFeedbackOutput($active_id, $pass)
Returns the answer specific feedback for the question.
static getFeedbackClassNameByQuestionType($questionType)
static _getQuestionTypeName($type_tag)
Return the translation for a given question type tag.
static _questionExistsInTest($question_id, $test_id)
static _getInternalLinkHref($target="")
static getGuiClassNameByQuestionType($questionType)
const ADDITIONAL_CONTENT_EDITING_MODE_PAGE_OBJECT
constant for additional content editing mode "pageobject"
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
static _isWriteable($question_id, $user_id)
Returns true if the question is writeable by a certain user.
const CMD_SHOW
command constants
const CMD_SHOW_LIST
command constants
const TAB_ID_QUESTION_PREVIEW
Class ilCommonActionDispatcherGUI.
static getPageList($lm_id)
static
static _getLink($a_ref_id, $a_type='', $a_params=array(), $append="")
static initJavascript($a_ajax_url, $a_type=IL_NOTE_PRIVATE, ilTemplate $a_main_tpl=null)
Init javascript.
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
Class ilObjContentObjectGUI.
static getManualFeedback($active_id, $question_id, $pass)
Retrieves the manual feedback for a question in a test.
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
static _lookupType($a_id, $a_reference=false)
lookup object type
Class ilQuestionUsagesTableGUI.
Class ilQuestionInternalLinkSelectionTableGUI.
Class ilQuestionUsagesTableGUI.
This class represents an option in a radio group.
addTarget( $a_text, $a_link, $a_cmd="", $a_cmdClass="", $a_frame="", $a_activate=false, $a_dir_text=false)
setBackTarget($a_title, $a_target, $a_frame="")
back target for upper context
Taxonomy node <-> item assignment.
special template class to simplify handling of ITX/PEAR
static getReturnToPageLink($q_id=null)
This class represents a text area property in a property form.
This class represents a text property in a property form.
static stripOnlySlashes($a_str)
strip slashes if magic qoutes is enabled
static redirect($a_script)
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static makeDirParents($a_dir)
Create a new directory and all parent directories.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms @access public
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
if(!empty($this->data['faventry'])) $tabs
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
if(empty($password)) $table
if(isset($_POST['submit'])) $form
foreach($_POST as $key=> $value) $res