4 require_once
'./Modules/Test/exceptions/class.ilTestException.php';
5 require_once
'./Services/Object/classes/class.ilObjectGUI.php';
6 require_once
'./Modules/Test/classes/inc.AssessmentConstants.php';
7 require_once
'./Modules/Test/classes/class.ilObjAssessmentFolderGUI.php';
8 require_once
'./Modules/Test/classes/class.ilObjAssessmentFolder.php';
9 require_once
'./Modules/Test/classes/class.ilTestExpressPage.php';
49 'ilpublicuserprofilegui',
'ilobjportfoliogui'
74 $lng->loadLanguageModule(
"assessment");
77 $this->ctrl->saveParameter($this, array(
"ref_id",
"test_ref_id",
"calling_test",
"test_express_mode",
"q_id"));
82 require_once
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
85 require_once
'Modules/Test/classes/class.ilTestPlayerFactory.php';
88 require_once
'Modules/Test/classes/class.ilTestSessionFactory.php';
91 require_once
'Modules/Test/classes/class.ilTestSequenceFactory.php';
101 global $ilAccess, $ilNavigationHistory,
$ilCtrl,
$ilErr,
$tpl,
$lng, $ilTabs, $ilPluginAdmin,
$ilDB,
$tree,
$ilias,
$ilUser;
103 if((!$ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])))
105 $ilias->raiseError($this->lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
108 $cmd = $this->ctrl->getCmd(
"infoScreen");
110 $cmdsDisabledDueToOfflineStatus = array(
111 'resumePlayer',
'resumePlayer',
'outUserResultsOverview',
'outUserListOfAnswerPasses'
114 if(!$this->
getCreationMode() && !$this->object->isOnline() && in_array(
$cmd, $cmdsDisabledDueToOfflineStatus))
119 $next_class = $this->ctrl->getNextClass($this);
120 $this->ctrl->setReturn($this,
"infoScreen");
122 if(method_exists($this->
object,
"getTestStyleLocation")) $this->tpl->addCss($this->object->getTestStyleLocation(
"output"),
"screen");
126 $ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])
129 $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
130 "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" .
$_GET[
"ref_id"],
"tst");
135 if(IS_PAYMENT_ENABLED)
137 require_once
'Services/Payment/classes/class.ilPaymentObject.php';
141 $this->tpl->getStandardTemplate();
143 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
145 $ret = $this->ctrl->forwardCommand($pp);
155 global $___prev_question_id;
156 $___prev_question_id =
$_REQUEST[
'prev_qid'];
157 $this->ctrl->setParameter($this,
'prev_qid',
$_REQUEST[
'prev_qid']);
160 if( !$this->
getCreationMode() && $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken() )
162 if( !$this->testQuestionSetConfigFactory->getQuestionSetConfig()->isValidRequestOnBrokenQuestionSetDepencies($next_class,
$cmd) )
164 $this->ctrl->redirectByClass(
'ilObjTestGUI',
'infoScreen');
170 case 'iltestexportgui':
171 if(!$ilAccess->checkAccess(
'write',
'', $this->ref_id))
173 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->WARNING);
178 require_once
'Modules/Test/classes/class.ilTestExportGUI.php';
182 case "ilinfoscreengui":
187 case 'ilmdeditorgui':
188 if(!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
190 $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->WARNING);
195 require_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
196 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
197 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
199 $this->ctrl->forwardCommand($md_gui);
202 case "iltestplayerfixedquestionsetgui":
203 require_once
"./Modules/Test/classes/class.ilTestPlayerFixedQuestionSetGUI.php";
206 $this->ctrl->forwardCommand($output_gui);
209 case "iltestplayerrandomquestionsetgui":
210 require_once
"./Modules/Test/classes/class.ilTestPlayerRandomQuestionSetGUI.php";
213 $this->ctrl->forwardCommand($output_gui);
216 case "iltestplayerdynamicquestionsetgui":
217 require_once
"./Modules/Test/classes/class.ilTestPlayerDynamicQuestionSetGUI.php";
220 $this->ctrl->forwardCommand($output_gui);
223 case "iltestevaluationgui":
226 include_once
"./Modules/Test/classes/class.ilTestEvaluationGUI.php";
228 $this->ctrl->forwardCommand($evaluation_gui);
231 case "iltestservicegui":
234 require_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
236 $this->ctrl->forwardCommand($serviceGUI);
239 case 'ilpermissiongui':
242 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
244 $ret =& $this->ctrl->forwardCommand($perm_gui);
247 case "illearningprogressgui":
250 require_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
252 $this->ctrl->forwardCommand($new_gui);
256 case "ilcertificategui":
259 require_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
260 require_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
262 $this->ctrl->forwardCommand($output_gui);
265 case "iltestscoringgui":
268 require_once
"./Modules/Test/classes/class.ilTestScoringGUI.php";
270 $this->ctrl->forwardCommand($output_gui);
273 case 'ilmarkschemagui':
274 if(!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId()))
277 $this->ctrl->redirect($this,
'infoScreen');
281 require_once
'Modules/Test/classes/class.ilMarkSchemaGUI.php';
283 $this->ctrl->forwardCommand($mark_schema_gui);
286 case 'iltestscoringbyquestionsgui':
289 include_once
'Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php';
291 $this->ctrl->forwardCommand($output_gui);
294 case 'ilobjtestsettingsgeneralgui':
297 require_once
'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
299 $this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $ilUser, $this
301 $this->ctrl->forwardCommand($gui);
304 case 'ilobjtestsettingsscoringresultsgui':
307 require_once
'Modules/Test/classes/class.ilObjTestSettingsScoringResultsGUI.php';
309 $this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $this
311 $this->ctrl->forwardCommand($gui);
314 case 'ilobjtestdynamicquestionsetconfiggui':
317 require_once
'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfigGUI.php';
319 $this->ctrl->forwardCommand($gui);
322 case 'iltestrandomquestionsetconfiggui':
325 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetConfigGUI.php';
327 $this->ctrl->forwardCommand($gui);
330 case 'iltestskilladministrationgui':
333 require_once
'Modules/Test/classes/class.ilTestSkillAdministrationGUI.php';
334 $gui =
new ilTestSkillAdministrationGUI($ilias, $this->ctrl, $ilAccess, $ilTabs, $this->tpl, $this->lng, $ilDB, $this->
object, $this->ref_id);
335 $this->ctrl->forwardCommand($gui);
338 case 'iltestskillevaluationgui':
341 require_once
'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php';
343 $this->ctrl->forwardCommand($gui);
346 case 'ilobjectcopygui':
349 require_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
352 $this->ctrl->forwardCommand($cp);
355 case 'ilrepositorysearchgui':
358 require_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
360 $rep_search->setCallback($this,
361 'addParticipantsObject',
366 $this->ctrl->setReturn($this,
'participants');
367 $ret =& $this->ctrl->forwardCommand($rep_search);
368 $this->tabs_gui->setTabActive(
'participants');
371 case 'ilpageeditorgui':
372 case 'iltestexpresspageobjectgui':
374 require_once
'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php';
376 $incompleteQuestionPurger->setOwnerId($ilUser->getId());
377 $incompleteQuestionPurger->purge();
384 if(!$qid || $qid ==
'Array')
386 $questions = $this->
object->getQuestionTitlesAndIndexes();
387 if(!is_array($questions))
388 $questions = array();
390 $keys = array_keys($questions);
394 $_GET[
'q_id'] = $qid;
399 if(!in_array(
$cmd, array(
'addQuestion',
'browseForQuestions')))
404 if(!$qid || in_array(
$cmd, array(
'insertQuestions',
'browseForQuestions')))
406 require_once
"./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
409 $ret =& $this->ctrl->forwardCommand($pageObject);
412 require_once
"./Services/Style/classes/class.ilObjStyleSheet.php";
413 $this->tpl->setCurrentBlock(
"ContentStyle");
414 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
416 $this->tpl->parseCurrentBlock();
419 $this->tpl->setCurrentBlock(
"SyntaxStyle");
420 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
422 $this->tpl->parseCurrentBlock();
423 require_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
428 $this->ctrl->setParameterByClass(
'iltestexpresspageobjectgui',
'q_id',
'');
429 $this->ctrl->redirectByClass(
'iltestexpresspageobjectgui', $this->ctrl->getCmd());
432 $q_gui->outAdditionalOutput();
433 $q_gui->object->setObjId($this->object->getId());
435 $q_gui->setTargetGuiClass(null);
436 $q_gui->setQuestionActionCmd(null);
438 $question = $q_gui->object;
439 $this->ctrl->saveParameter($this,
"q_id");
441 #$this->lng->loadLanguageModule("content");
442 $this->ctrl->setReturnByClass(
"ilTestExpressPageObjectGUI",
"view");
443 $this->ctrl->setReturn($this,
"questions");
445 require_once
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
446 require_once
"./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
450 $page_gui->setEditPreview(
true);
451 $page_gui->setEnabledTabs(
false);
452 if(strlen($this->ctrl->getCmd()) == 0)
454 $this->ctrl->setCmdClass(get_class($page_gui));
455 $this->ctrl->setCmd(
"preview");
458 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
459 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
461 $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ?
"edit" :
'preview');
463 $page_gui->setHeader($question->getTitle());
464 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this,
"downloadFile"));
465 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this,
"fullscreen"));
466 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
467 $page_gui->setPresentationTitle($question->getTitle() .
' ['. $this->lng->txt(
'question_id_short') .
': ' . $question->getId() .
']');
468 $ret =& $this->ctrl->forwardCommand($page_gui);
471 $ilTabs->activateTab(
'assQuestions');
473 $this->tpl->setContent(
$ret);
476 case 'ilassquestionpreviewgui':
480 $this->ctrl->saveParameter($this,
"q_id");
482 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionPreviewGUI.php';
485 $gui->initQuestion((
int)
$_GET[
'q_id'], $this->object->getId());
486 $gui->initPreviewSettings($this->object->getRefId());
487 $gui->initPreviewSession($ilUser->getId(), (int)$_GET[
'q_id']);
488 $gui->initHintTracking();
489 $gui->initStyleSheets();
491 $this->ctrl->forwardCommand($gui);
495 case 'ilassquestionpagegui':
496 require_once
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
500 $this->ctrl->setParameter($this,
'prev_qid',
$_REQUEST[
'prev_qid']);
506 $_GET[
'calling_test'] = $this->
object->getRefId();
507 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
508 $this->tpl->setCurrentBlock(
"ContentStyle");
509 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
511 $this->tpl->parseCurrentBlock();
514 $this->tpl->setCurrentBlock(
"SyntaxStyle");
515 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
517 $this->tpl->parseCurrentBlock();
518 require_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
520 $q_gui->setQuestionTabs();
521 $q_gui->outAdditionalOutput();
522 $q_gui->object->setObjId($this->object->getId());
523 $question =& $q_gui->object;
524 $this->ctrl->saveParameter($this,
"q_id");
525 $this->lng->loadLanguageModule(
"content");
526 $this->ctrl->setReturnByClass(
"ilAssQuestionPageGUI",
"view");
527 $this->ctrl->setReturn($this,
"questions");
529 $page_gui->setEditPreview(
true);
530 if(strlen($this->ctrl->getCmd()) == 0)
532 $this->ctrl->setCmdClass(get_class($page_gui));
533 $this->ctrl->setCmd(
"preview");
535 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
536 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
537 $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ?
"edit" :
'preview');
538 $page_gui->setHeader($question->getTitle());
539 $page_gui->setPresentationTitle($question->getTitle() .
' ['. $this->lng->txt(
'question_id_short') .
': ' . $question->getId() .
']');
540 $ret =& $this->ctrl->forwardCommand($page_gui);
541 $this->tpl->setContent(
$ret);
544 case 'ilassspecfeedbackpagegui':
545 require_once
"./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php";
547 $this->ctrl->forwardCommand($pg_gui);
550 case 'ilassgenfeedbackpagegui':
551 require_once
"./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php";
553 $this->ctrl->forwardCommand($pg_gui);
556 case 'illocalunitconfigurationgui':
560 $this->ctrl->setReturn($this,
"questions");
563 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
565 $questionGUI->object->setObjId($this->object->getId());
566 $questionGUI->setQuestionTabs();
568 require_once
'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
569 require_once
'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
573 $this->ctrl->forwardCommand($gui);
576 case "ilcommonactiondispatchergui":
577 require_once
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
579 $this->ctrl->forwardCommand($gui);
582 case 'ilassquestionhintsgui':
587 $this->ctrl->setReturn($this,
"questions");
590 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
592 $questionGUI->object->setObjId($this->object->getId());
593 $questionGUI->setQuestionTabs();
596 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
598 $ilCtrl->forwardCommand($gui);
602 case 'ilassquestionfeedbackeditinggui':
607 $this->ctrl->setReturn($this,
"questions");
610 require_once
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
612 $questionGUI->object->setObjId($this->object->getId());
613 $questionGUI->setQuestionTabs();
616 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
618 $ilCtrl->forwardCommand($gui);
622 case 'iltesttoplistgui':
624 require_once
'./Modules/Test/classes/class.ilTestToplistGUI.php';
626 $this->ctrl->forwardCommand($gui);
629 case 'ilscoringadjustmentgui':
631 require_once
'./Modules/Test/classes/class.ilScoringAdjustmentGUI.php';
633 $this->ctrl->forwardCommand($gui);
640 if((strcmp(
$cmd,
"properties") == 0) && ($_GET[
"browse"]))
645 if((strcmp(
$cmd,
"properties") == 0) && ($_GET[
"up"] || $_GET[
"down"]))
657 global $___prev_question_id;
658 $___prev_question_id =
$_REQUEST[
'prev_qid'];
659 $this->ctrl->setParameterByClass(
'ilassquestionpagegui',
'prev_qid',
$_REQUEST[
'prev_qid']);
660 $this->ctrl->setParameterByClass($_GET[
'sel_question_types'] .
'gui',
'prev_qid',
$_REQUEST[
'prev_qid']);
662 $this->create_question_mode =
true;
665 $this->ctrl->setReturn($this,
"questions");
666 require_once
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
668 $q_gui->object->setObjId($this->object->getId());
669 if(!$_GET[
'sel_question_types'])
673 $qType = $_GET[
'sel_question_types'];
675 $this->ctrl->setParameterByClass($qType .
"GUI",
'prev_qid',
$_REQUEST[
'prev_qid']);
676 $this->ctrl->setParameterByClass($qType .
"GUI",
'test_ref_id',
$_REQUEST[
'ref_id']);
677 $this->ctrl->setParameterByClass($qType .
"GUI",
'q_id',
$_REQUEST[
'q_id']);
679 $this->ctrl->setParameterByClass($qType .
"GUI",
'test_express_mode', 1);
681 #global $___test_express_mode;
682 #$___test_express_mode = true;
683 if(!$q_gui->isSaveCommand())
684 $_GET[
'calling_test'] = $this->object->getRefId();
686 $q_gui->setQuestionTabs();
687 #unset($___test_express_mode);
688 $ret =& $this->ctrl->forwardCommand($q_gui);
691 if ( !in_array(strtolower(
$_GET[
"baseClass"]), array(
'iladministrationgui',
'ilrepositorygui')) &&
700 switch( $this->object->getQuestionSetType() )
703 $this->ctrl->redirectByClass(
'ilTestExpressPageObjectGUI',
'showPage');
706 $this->ctrl->redirectByClass(
'ilTestRandomQuestionSetConfigGUI');
709 $this->ctrl->redirectByClass(
'ilObjTestDynamicQuestionSetConfigGUI');
721 public function createUserResults($show_pass_details, $show_answers, $show_reached_points, $show_user_results)
723 global $ilTabs,
$ilDB;
725 $ilTabs->setBackTarget(
726 $this->lng->txt(
'back'), $this->ctrl->getLinkTarget($this,
'participants')
729 $template =
new ilTemplate(
"tpl.il_as_tst_participants_result_output.html", TRUE, TRUE,
"Modules/Test");
731 require_once
'Modules/Test/classes/toolbars/class.ilTestResultsToolbarGUI.php';
734 $this->ctrl->setParameter($this,
'pdf',
'1');
735 $toolbar->setPdfExportLinkTarget( $this->ctrl->getLinkTarget($this, $this->ctrl->getCmd()) );
736 $this->ctrl->setParameter($this,
'pdf',
'');
740 if( isset(
$_GET[
'show_best_solutions']) )
742 $_SESSION[
'tst_results_show_best_solutions'] =
true;
744 elseif( isset(
$_GET[
'hide_best_solutions']) )
746 $_SESSION[
'tst_results_show_best_solutions'] =
false;
748 elseif( !isset(
$_SESSION[
'tst_results_show_best_solutions']) )
750 $_SESSION[
'tst_results_show_best_solutions'] =
false;
753 if(
$_SESSION[
'tst_results_show_best_solutions'] )
755 $this->ctrl->setParameter($this,
'hide_best_solutions',
'1');
756 $toolbar->setHideBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'showUserAnswers'));
757 $this->ctrl->setParameter($this,
'hide_best_solutions',
'');
761 $this->ctrl->setParameter($this,
'show_best_solutions',
'1');
762 $toolbar->setShowBestSolutionsLinkTarget($this->ctrl->getLinkTarget($this,
'showUserAnswers'));
763 $this->ctrl->setParameterByClass(
'',
'show_best_solutions',
'');
767 require_once
'Modules/Test/classes/class.ilTestParticipantData.php';
769 if( $this->object->getFixedParticipants() )
771 $participantData->setUserIds($show_user_results);
775 $participantData->setActiveIds($show_user_results);
777 $participantData->load($this->object->getTestId());
778 $toolbar->setParticipantSelectorOptions($participantData->getOptionArray($show_user_results));
781 $template->setVariable(
'RESULTS_TOOLBAR', $this->ctrl->getHTML($toolbar));
783 include_once
"./Modules/Test/classes/class.ilTestServiceGUI.php";
785 $serviceGUI->setParticipantData($participantData);
788 foreach ($show_user_results as $key => $active_id)
792 if ($this->object->getFixedParticipants())
794 $active_id = $this->
object->getActiveIdOfUser( $active_id );
798 $results = $serviceGUI->getResultsOfUserOutput(
799 $this->testSessionFactory->getSession( $active_id ),
801 $this->
object->_getResultPass( $active_id ),
809 if ($count < count( $show_user_results ))
811 $template->touchBlock(
"break" );
813 $template->setCurrentBlock(
"user_result" );
814 $template->setVariable(
"USER_RESULT",
$results );
815 $template->parseCurrentBlock();
820 require_once
'class.ilTestPDFGenerator.php';
834 require_once
'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
850 $this->tpl->getStandardTemplate();
862 require_once
'Services/WebDAV/classes/class.ilDAVServer.php';
872 $this->ctrl->redirect($this,
"infoScreen");
877 $this->ctrl->redirectByClass(
"iltestevaluationgui",
"outEvaluation");
886 if($form->checkInput())
888 $this->ctrl->setParameter($this,
"new_type", $this->type);
893 $form->setValuesByPost();
894 $this->tpl->setContent($form->getHTML());
899 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
901 $defaults = $tst->getAvailableDefaults();
902 if (count($defaults))
904 foreach ($defaults as
$row)
906 $a_options[
"tstdef_".$row[
"test_defaults_id"]] = array($row[
"name"],
907 $this->lng->txt(
"tst_default_settings"));
912 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
916 foreach($templates as $item)
918 $a_options[
"tsttpl_".$item[
"id"]] = array($item[
"title"],
919 nl2br(trim($item[
"description"])));
933 $testDefaultsId = $tstdef;
935 $a_new_object->applyDefaults($testDefaults);
941 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
944 $template_settings = $template->getSettings();
945 if($template_settings)
950 $a_new_object->setTemplate($template_id);
953 $a_new_object->saveToDb();
957 $this->ctrl->setParameter($this,
'ref_id', $a_new_object->
getRefId());
958 $this->ctrl->redirectByClass(
'ilObjTestSettingsGeneralGUI');
963 include_once
"./Services/Utilities/classes/class.ilUtil.php";
964 $path = $this->tree->getPathFull($this->object->getRefID());
973 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
979 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
984 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
985 $full_path = $basedir.
"/".$_FILES[
"xmldoc"][
"name"];
992 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
998 if(!is_file($qti_file))
1007 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
1009 $result = $qtiParser->startParsing();
1010 $founditems =& $qtiParser->getFoundItems();
1012 if (count($founditems) == 0)
1026 foreach ($founditems as $item)
1028 if (strlen($item[
"type"]))
1048 $_SESSION[
"tst_import_results_file"] = $results_file;
1049 $_SESSION[
"tst_import_xml_file"] = $xml_file;
1050 $_SESSION[
"tst_import_qti_file"] = $qti_file;
1051 $_SESSION[
"tst_import_subdir"] = $subdir;
1053 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.tst_import_verification.html",
"Modules/Test");
1054 $row_class = array(
"tblrow1",
"tblrow2");
1056 foreach ($founditems as $item)
1058 $this->tpl->setCurrentBlock(
"verification_row");
1059 $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
1060 $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
1061 $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
1062 include_once
"./Services/QTI/classes/class.ilQTIItem.php";
1063 switch ($item[
"type"])
1065 case "MULTIPLE CHOICE QUESTION":
1068 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assMultipleChoice"));
1070 case "SINGLE CHOICE QUESTION":
1072 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assSingleChoice"));
1076 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assKprimChoice"));
1078 case "NUMERIC QUESTION":
1080 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assNumeric"));
1082 case "TEXTSUBSET QUESTION":
1084 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextSubset"));
1086 case "CLOZE QUESTION":
1088 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assClozeTest"));
1090 case "IMAGE MAP QUESTION":
1092 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assImagemapQuestion"));
1094 case "JAVA APPLET QUESTION":
1096 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assJavaApplet"));
1098 case "MATCHING QUESTION":
1100 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assMatchingQuestion"));
1102 case "ORDERING QUESTION":
1104 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assOrderingQuestion"));
1106 case "TEXT QUESTION":
1108 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextQuestion"));
1111 $this->tpl->parseCurrentBlock();
1118 $this->tpl->setCurrentBlock(
"adm_content");
1119 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
1120 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
1121 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"tst_import_verify_found_questions"));
1122 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_tst"));
1123 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
1125 $this->tpl->setVariable(
"QUESTIONPOOL_ID", $QplOrTstID);
1126 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
1127 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
1128 $this->tpl->parseCurrentBlock();
1136 include_once
"./Modules/Test/classes/class.ilObjTest.php";
1140 $newObj->setType(
$_GET[
"new_type"]);
1142 $newObj->setTitle(
"dummy");
1144 $newObj->setDescription(
"test import");
1146 $newObj->create(
true);
1148 $newObj->createReference();
1150 $newObj->putInTree(
$_GET[
"ref_id"]);
1152 $newObj->setPermissions(
$_GET[
"ref_id"]);
1154 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
1156 $newObj->mark_schema->flush();
1159 include_once
"./Services/QTI/classes/class.ilQTIParser.php";
1163 if (
$_POST[
"qpl_id"] ==
"-1")
1165 $qpl_id = $newObj->id;
1169 $qpl_id =
$_POST[
"qpl_id"];
1173 $qtiParser->setTestObject($newObj);
1174 $result = $qtiParser->startParsing();
1175 $newObj->saveToDb();
1178 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
1180 $contParser->setQuestionMapping($qtiParser->getImportMapping());
1181 $contParser->startParsing();
1184 if (@file_exists(
$_SESSION[
"tst_import_results_file"]))
1186 include_once (
"./Modules/Test/classes/class.ilTestResultsImportParser.php");
1195 $newObj->updateMetaData();
1198 "&baseClass=ilObjTestGUI");
1218 include_once(
"./Modules/File/classes/class.ilObjFile.php");
1220 $fileObj->sendFile();
1229 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
1231 $page_gui->showMediaFullscreen();
1240 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
1242 $pg_obj->send_paragraph (
$_GET[
"par_id"],
$_GET[
"downloadtitle"]);
1279 $this->ctrl->redirect($this,
"questions");
1293 $parent_ref = $tree->getParentId($this->object->getRefId());
1294 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
1296 $qpl->setType(
"qpl");
1297 $qpl->setTitle($name);
1298 $qpl->setDescription($description);
1300 $qpl->createReference();
1301 $qpl->putInTree($parent_ref);
1302 $qpl->setPermissions($parent_ref);
1305 return $qpl->getRefId();
1315 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_select.html",
"Modules/Test");
1316 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE);
1317 $this->tpl->setCurrentBlock(
"option");
1318 $this->tpl->setVariable(
"VALUE_OPTION",
"0");
1319 $this->tpl->setVariable(
"TEXT_OPTION", $this->lng->txt(
"all_available_question_pools"));
1320 $this->tpl->parseCurrentBlock();
1321 foreach ($questionpools as $key => $value)
1323 $this->tpl->setCurrentBlock(
"option");
1324 $this->tpl->setVariable(
"VALUE_OPTION", $key);
1325 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
1326 $this->tpl->parseCurrentBlock();
1328 $this->tpl->setCurrentBlock(
"hidden");
1329 $this->tpl->setVariable(
"HIDDEN_NAME",
"sel_question_types");
1330 $this->tpl->setVariable(
"HIDDEN_VALUE",
$_POST[
"sel_question_types"]);
1331 $this->tpl->parseCurrentBlock();
1332 $this->tpl->setCurrentBlock(
"adm_content");
1333 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1334 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_random_select_questionpool"));
1335 $this->tpl->setVariable(
"TXT_NR_OF_QUESTIONS", $this->lng->txt(
"tst_random_nr_of_questions"));
1336 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
1337 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1338 $this->tpl->parseCurrentBlock();
1350 $this->ctrl->redirect($this,
"questions");
1363 $question_array = $this->
object->randomSelectQuestions(
$_POST[
"nr_of_questions"],
$_POST[
"sel_qpl"]);
1364 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_random_question_offer.html",
"Modules/Test");
1365 $color_class = array(
"tblrow1",
"tblrow2");
1367 $questionpools =& $this->
object->getAvailableQuestionpools(
true);
1368 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1369 foreach ($question_array as $question_id)
1371 $dataset = $this->
object->getQuestionDataset($question_id);
1372 $this->tpl->setCurrentBlock(
"QTab");
1373 $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
1374 $this->tpl->setVariable(
"QUESTION_TITLE", $dataset->title);
1375 $this->tpl->setVariable(
"QUESTION_COMMENT", $dataset->description);
1377 $this->tpl->setVariable(
"QUESTION_AUTHOR", $dataset->author);
1378 $this->tpl->setVariable(
"QUESTION_POOL", $questionpools[$dataset->obj_fi][
"title"]);
1379 $this->tpl->parseCurrentBlock();
1382 if (count($question_array) == 0)
1384 $this->tpl->setCurrentBlock(
"Emptytable");
1385 $this->tpl->setVariable(
"TEXT_NO_QUESTIONS_AVAILABLE", $this->lng->txt(
"no_questions_available"));
1386 $this->tpl->parseCurrentBlock();
1390 $this->tpl->setCurrentBlock(
"Selectionbuttons");
1391 $this->tpl->setVariable(
"BTN_YES", $this->lng->txt(
"random_accept_sample"));
1392 $this->tpl->setVariable(
"BTN_NO", $this->lng->txt(
"random_another_sample"));
1393 $this->tpl->parseCurrentBlock();
1395 $chosen_questions = join($question_array,
",");
1396 $this->tpl->setCurrentBlock(
"adm_content");
1397 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
1398 $this->tpl->setVariable(
"QUESTION_TITLE", $this->lng->txt(
"tst_question_title"));
1399 $this->tpl->setVariable(
"QUESTION_COMMENT", $this->lng->txt(
"description"));
1400 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"tst_question_type"));
1401 $this->tpl->setVariable(
"QUESTION_AUTHOR", $this->lng->txt(
"author"));
1402 $this->tpl->setVariable(
"QUESTION_POOL", $this->lng->txt(
"qpl"));
1403 $this->tpl->setVariable(
"VALUE_CHOSEN_QUESTIONS", $chosen_questions);
1404 $this->tpl->setVariable(
"VALUE_QUESTIONPOOL_SELECTION",
$_POST[
"sel_qpl"]);
1405 $this->tpl->setVariable(
"VALUE_NR_OF_QUESTIONS",
$_POST[
"nr_of_questions"]);
1406 $this->tpl->setVariable(
"TEXT_QUESTION_OFFER", $this->lng->txt(
"tst_question_offer"));
1407 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
1408 $this->tpl->parseCurrentBlock();
1420 $selected_array = split(
",",
$_POST[
"chosen_questions"]);
1421 if (!count($selected_array))
1427 $total = $this->
object->evalTotalPersons();
1437 foreach ($selected_array as $key => $value)
1439 $this->
object->insertQuestion( $this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value );
1441 $this->
object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
1443 $this->ctrl->redirect($this,
"questions");
1468 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1471 else if(isset(
$_REQUEST[
'sel_question_types']))
1473 $sel_question_types =
$_REQUEST[
"sel_question_types"];
1476 if (!$qpl_mode || ($qpl_mode == 2 && strcmp(
$_REQUEST[
"txt_qpl"],
"") == 0) || ($qpl_mode == 3 && strcmp($qpl_ref_id,
"") == 0))
1480 $_REQUEST[
'sel_question_types'] = $sel_question_types;
1487 $_SESSION[
"test_id"] = $this->
object->getRefId();
1488 if ($qpl_mode == 2 && strcmp(
$_REQUEST[
"txt_qpl"],
"") != 0)
1493 else if ($qpl_mode == 1)
1495 $qpl_ref_id =
$_GET[
"ref_id"];
1498 include_once
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php";
1499 $baselink =
"ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" . $qpl_ref_id .
"&cmd=createQuestionForTest&test_ref_id=".$_GET[
"ref_id"].
"&calling_test=".
$_GET[
"ref_id"].
"&sel_question_types=" . $sel_question_types;
1503 $baselink .=
'&prev_qid=' .
$_REQUEST[
'prev_qid'];
1507 $baselink .=
'&prev_qid=' .
$_REQUEST[
'position'];
1511 $baselink .=
'&test_express_mode=1';
1514 if( isset(
$_REQUEST[
'add_quest_cont_edit_mode']) )
1517 $baselink,
"add_quest_cont_edit_mode={$_REQUEST['add_quest_cont_edit_mode']}",
false
1521 #var_dump($_REQUEST['prev_qid']);
1537 $this->ctrl->redirect($this,
"questions");
1552 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE,
"write");
1554 if ($this->object->getPoolUsage()) {
1557 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1560 $form->setFormAction($ilCtrl->getFormAction($this,
"executeCreateQuestion"));
1561 $form->setTitle($lng->txt(
"ass_create_question"));
1562 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1566 $hidden->setValue(
$_REQUEST[
"sel_question_types"]);
1567 $form->addItem($hidden);
1572 $ri =
new ilRadioGroupInputGUI($lng->txt(
"tst_add_quest_cont_edit_mode"),
"add_quest_cont_edit_mode");
1575 $lng->txt(
'tst_add_quest_cont_edit_mode_default'),
1580 $lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
1586 $form->addItem($ri,
true);
1592 $form->addItem($hi,
true);
1598 $no_pool =
new ilRadioOption($this->lng->txt(
"assessment_no_pool"), 1);
1599 $usage->addOption($no_pool);
1600 $existing_pool =
new ilRadioOption($this->lng->txt(
"assessment_existing_pool"), 3);
1601 $usage->addOption($existing_pool);
1602 $new_pool =
new ilRadioOption($this->lng->txt(
"assessment_new_pool"), 2);
1603 $usage->addOption($new_pool);
1604 $form->addItem($usage);
1609 $pools_data = array();
1610 foreach($questionpools as $key => $p) {
1611 $pools_data[$key] = $p[
'title'];
1613 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"),
"sel_qpl");
1615 $existing_pool->addSubItem($pools);
1618 $this->lng->loadLanguageModule(
'rbac');
1619 $name =
new ilTextInputGUI($this->lng->txt(
"rbac_create_qpl"),
"txt_qpl");
1621 $name->setMaxLength(50);
1622 $new_pool->addSubItem($name);
1624 $form->addCommandButton(
"executeCreateQuestion", $lng->txt(
"submit"));
1625 $form->addCommandButton(
"cancelCreateQuestion", $lng->txt(
"cancel"));
1627 return $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
1633 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'sel_question_types',
$_REQUEST[
"sel_question_types"]);
1634 $link = $ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'handleToolbarCommand',
'',
false,
false);
1644 $checked_questions =
$_POST[
"q_id"];
1646 $questions = $this->
object->getQuestionTitlesAndIndexes();
1648 foreach((array)$checked_questions as $value)
1650 $this->
object->removeQuestion($value);
1651 $deleted[] = $value;
1654 $this->
object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
1662 $deleted_tmp = $deleted;
1663 $first = array_shift($deleted_tmp);
1664 foreach((array)$questions as $key => $value)
1666 if(!in_array($key, $deleted))
1676 else if($key == $first)
1683 $first = array_shift($deleted_tmp);
1688 count($questions) == count($checked_questions) ||
1692 $this->ctrl->setParameter($this,
'q_id',
'');
1693 $this->ctrl->redirect($this,
'showPage');
1696 $this->ctrl->setParameter($this,
'q_id', $return_to);
1697 $this->ctrl->redirect($this,
"showPage");
1701 $this->ctrl->setParameter($this,
'q_id',
'');
1702 $this->ctrl->redirect($this,
'questions');
1716 $this->ctrl->setParameter($this,
'q_id',
$_REQUEST[
'q_id']);
1717 $this->ctrl->redirect($this,
"showPage");
1720 $this->ctrl->redirect($this,
"questions");
1733 $total = $this->
object->evalTotalPersons();
1737 $question = sprintf($this->lng->txt(
"tst_remove_questions_and_results"),
$total);
1741 if (count($checked_questions) == 1)
1743 $question = $this->lng->txt(
"tst_remove_question");
1747 $question = $this->lng->txt(
"tst_remove_questions");
1751 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
1753 $cgui->setHeaderText($question);
1755 $this->ctrl->saveParameter($this,
'test_express_mode');
1756 $this->ctrl->saveParameter($this,
'q_id');
1758 $cgui->setFormAction($this->ctrl->getFormAction($this));
1759 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelRemoveQuestions");
1760 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirmRemoveQuestions");
1762 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1763 $removablequestions =& $this->
object->getTestQuestions();
1764 if (count($removablequestions))
1766 foreach ($removablequestions as
$data)
1768 if (in_array($data[
"question_id"], $checked_questions))
1771 $txt .=
' ['. $this->lng->txt(
'question_id_short') .
': ' . $data[
'question_id'] .
']';
1773 if($data[
"description"])
1775 $txt .=
"<div class=\"small\">".$data[
"description"].
"</div>";
1778 $cgui->addItem(
"q_id[]", $data[
"question_id"],
$txt);
1783 $this->tpl->setContent($cgui->getHTML());
1797 if (!is_array($checked_questions) && $checked_questions) {
1798 $checked_questions = array($checked_questions);
1800 if (count($checked_questions) > 0)
1805 elseif (count($checked_questions) == 0)
1808 $this->ctrl->redirect($this,
"questions");
1817 $selected_questions = NULL;
1818 $selected_questions =
$_POST[
'q_id'];
1819 if (is_array($selected_questions))
1821 $_SESSION[
'tst_qst_move_' . $this->
object->getTestId()] =
$_POST[
'q_id'];
1828 $this->ctrl->redirect($this,
'questions');
1837 $move_questions =
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
1839 if (count(
$_POST[
'q_id']) == 0)
1842 $this->ctrl->redirect($this,
'questions');
1844 if (count(
$_POST[
'q_id']) > 1)
1847 $this->ctrl->redirect($this,
'questions');
1850 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()],
$_POST[
'q_id'][0], $insert_mode);
1852 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
1853 $this->ctrl->redirect($this,
"questions");
1862 $move_questions =
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
1863 if (count(
$_POST[
'q_id']) == 0)
1866 $this->ctrl->redirect($this,
'questions');
1868 if (count(
$_POST[
'q_id']) > 1)
1871 $this->ctrl->redirect($this,
'questions');
1874 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()],
$_POST[
'q_id'][0], $insert_mode);
1876 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
1877 $this->ctrl->redirect($this,
"questions");
1887 $selected_array = (is_array(
$_POST[
'q_id'])) ?
$_POST[
'q_id'] : array();
1888 if (!count($selected_array))
1891 $this->ctrl->redirect($this,
"browseForQuestions");
1895 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
1896 $manscoring = FALSE;
1897 foreach ($selected_array as $key => $value)
1899 $this->
object->insertQuestion( $this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value );
1905 $this->
object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
1914 $this->ctrl->redirect($this,
"questions");
1921 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
1923 $table_gui->resetOffset();
1924 $table_gui->writeFilterToSession();
1925 $this->ctrl->redirect($this,
"browseForQuestions");
1930 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
1932 $table_gui->resetOffset();
1933 $table_gui->resetFilter();
1934 $this->ctrl->redirect($this,
"browseForQuestions");
1946 $this->ctrl->setParameterByClass(get_class($this),
"browse",
"1");
1948 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
1949 $table_gui =
new ilTestQuestionBrowserTableGUI($this,
'browseForQuestions', $this->ref_id, (($ilAccess->checkAccess(
"write",
"", $this->ref_id) ?
true :
false)));
1950 $arrFilter = array();
1951 foreach ($table_gui->getFilterItems() as $item)
1953 if ($item->getValue() !==
false)
1955 $arrFilter[$item->getPostVar()] = $item->getValue();
1958 $data = $this->
object->getAvailableQuestions($arrFilter, 1);
1959 $table_gui->setData(
$data);
1960 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
1967 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
1969 $ilCtrl->setParameter($this,
'qtype',
$_REQUEST[
'qtype']);
1973 $form->setFormAction($ilCtrl->getFormAction($this,
"executeCreateQuestion"));
1974 $form->setTitle($lng->txt(
"ass_create_question"));
1975 include_once
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
1978 $questionTypes = $pool->getQuestionTypes(
false,
true);
1982 foreach($questionTypes as $label =>
$data)
1987 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
1990 $form->addItem(
$si,
true);
1993 $questions = $this->
object->getQuestionTitlesAndIndexes();
1997 $options = array(
'0' => $lng->txt(
'first'));
1998 foreach($questions as $key => $title)
2000 $options[$key] = $lng->txt(
'behind') .
' '. $title .
' ['.$this->lng->txt(
'question_id_short') .
': '. $key .
']';
2002 $si->setOptions($options);
2004 $form->addItem(
$si,
true);
2010 $ri =
new ilRadioGroupInputGUI($lng->txt(
"tst_add_quest_cont_edit_mode"),
"add_quest_cont_edit_mode");
2013 $lng->txt(
'tst_add_quest_cont_edit_mode_default'),
2018 $lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
2024 $form->addItem($ri,
true);
2030 $form->addItem($hi,
true);
2033 if($this->object->getPoolUsage())
2038 $no_pool =
new ilRadioOption($this->lng->txt(
"assessment_no_pool"), 1);
2039 $usage->addOption($no_pool);
2040 $existing_pool =
new ilRadioOption($this->lng->txt(
"assessment_existing_pool"), 3);
2041 $usage->addOption($existing_pool);
2042 $new_pool =
new ilRadioOption($this->lng->txt(
"assessment_new_pool"), 2);
2043 $usage->addOption($new_pool);
2044 $form->addItem($usage);
2049 $pools_data = array();
2050 foreach($questionpools as $key => $p)
2052 $pools_data[$key] = $p[
'title'];
2054 $pools =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"),
"sel_qpl");
2056 $existing_pool->addSubItem($pools);
2060 $name->setMaxLength(50);
2061 $new_pool->addSubItem($name);
2064 $form->addCommandButton(
"executeCreateQuestion", $lng->txt(
"submit"));
2065 $form->addCommandButton(
"questions", $lng->txt(
"cancel"));
2067 return $tpl->setContent($form->getHTML());
2072 global $ilAccess, $ilTabs;
2074 $ilTabs->activateTab(
'assQuestions');
2077 $this->ctrl->setParameter($this,
'test_express_mode',
'');
2079 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2083 $this->ctrl->redirect($this,
"infoScreen");
2086 if (
$_GET[
'browse'])
2088 return $this->questionbrowser();
2094 $this->ctrl->setParameter($this,
'q_id',
'');
2098 ilUtil::redirect(
"ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" .
$_GET[
"eqpl"] .
"&cmd=editQuestionForTest&calling_test=".
$_GET[
"ref_id"].
"&q_id=" .
$_GET[
"eqid"]);
2101 if (
$_GET[
"up"] > 0)
2103 $this->
object->questionMoveUp(
$_GET[
"up"]);
2105 if (
$_GET[
"down"] > 0)
2107 $this->
object->questionMoveDown(
$_GET[
"down"]);
2112 $selected_array = array();
2113 array_push($selected_array,
$_GET[
"add"]);
2114 $total = $this->
object->evalTotalPersons();
2124 $this->insertQuestions($selected_array);
2128 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_questions.html",
"Modules/Test");
2130 $total = $this->
object->evalTotalPersons();
2131 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
2135 $link = $this->ctrl->getLinkTarget($this,
"participants");
2136 $link =
"<a href=\"".$link.
"\">".$this->lng->txt(
"test_has_datasets_warning_page_view_link").
"</a>";
2137 ilUtil::sendInfo($this->lng->txt(
"test_has_datasets_warning_page_view").
" ".$link);
2142 $ilToolbar->addButton($this->lng->txt(
"ass_create_question"), $this->ctrl->getLinkTarget($this,
"addQuestion"));
2144 if ($this->object->getPoolUsage()) {
2145 $ilToolbar->addSeparator();
2146 $ilToolbar->addButton($this->lng->txt(
"tst_browse_for_questions"), $this->ctrl->getLinkTarget($this,
'browseForQuestions'));
2149 $ilToolbar->addSeparator();
2150 $ilToolbar->addButton($this->lng->txt(
"random_selection"), $this->ctrl->getLinkTarget($this,
"randomselect"));
2154 $online_access =
false;
2155 if ($this->object->getFixedParticipants())
2157 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
2159 if ($online_access_result ===
true)
2161 $online_access =
true;
2165 if( $this->object->isOnline() && $this->
object->isComplete( $this->testQuestionSetConfigFactory->getQuestionSetConfig() ) )
2167 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
2169 $testSession = $this->testSessionFactory->getSession();
2170 $testSequence = $this->testSequenceFactory->getSequence($testSession);
2172 $testPlayerGUI = $this->testPlayerFactory->getPlayerGUI();
2174 $executable = $this->
object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE);
2176 if ($executable[
"executable"])
2178 if ($testSession->getActiveId() > 0)
2182 if ($testSequence->hasStarted($testSession))
2184 $execTestLabel = $this->lng->txt(
"tst_resume_test");
2185 $execTestLink = $this->ctrl->getLinkTarget($testPlayerGUI,
'resumePlayer');
2189 $execTestLabel = $this->
object->getStartTestLabel($testSession->getActiveId());
2190 $execTestLink = $this->ctrl->getLinkTarget($testPlayerGUI,
'startPlayer');
2197 $execTestLabel = $this->
object->getStartTestLabel($testSession->getActiveId());
2198 $execTestLink = $this->ctrl->getLinkTarget($testPlayerGUI,
'startPlayer');
2201 $ilToolbar->addSeparator();
2202 $ilToolbar->addButton($execTestLabel, $execTestLink);
2211 $this->tpl->setCurrentBlock(
"adm_content");
2212 include_once
"./Modules/Test/classes/tables/class.ilTestQuestionsTableGUI.php";
2213 $checked_move = is_array(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]) && (count(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]));
2214 $table_gui =
new ilTestQuestionsTableGUI($this,
'questions', (($ilAccess->checkAccess(
"write",
"", $this->ref_id) ?
true :
false)), $checked_move,
$total);
2215 $data = $this->
object->getTestQuestions();
2216 $table_gui->setData($data);
2217 $this->tpl->setVariable(
'QUESTIONBROWSER', $table_gui->getHTML());
2218 $this->tpl->setVariable(
"ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
2219 $this->tpl->parseCurrentBlock();
2236 require_once
'Modules/Test/classes/class.ilTestParticipantData.php';
2239 $participantData->load($this->object->getTestId());
2241 $this->
object->removeTestResults($participantData);
2244 $this->ctrl->redirect($this,
"participants");
2258 require_once
'Modules/Test/classes/class.ilTestParticipantData.php';
2261 if( $this->object->getFixedParticipants() )
2263 $participantData->setUserIds(
$_POST[
"chbUser"]);
2267 $participantData->setActiveIds(
$_POST[
"chbUser"]);
2270 $participantData->load($this->object->getTestId());
2272 $this->
object->removeTestResults($participantData);
2275 $this->ctrl->redirect($this,
"participants");
2287 $this->ctrl->redirect($this,
"participants");
2302 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_maintenance.html",
"Modules/Test");
2304 $this->tpl->setCurrentBlock(
"confirm_delete");
2305 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_ALL", $this->lng->txt(
"confirm"));
2306 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_ALL", $this->lng->txt(
"cancel"));
2307 $this->tpl->parseCurrentBlock();
2309 $this->tpl->setCurrentBlock(
"adm_content");
2310 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
2311 $this->tpl->parseCurrentBlock();
2320 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2322 $cgui->setFormAction($this->ctrl->getFormAction($this,
"participants"));
2323 $cgui->setHeaderText($this->lng->txt(
"delete_all_user_data_confirmation"));
2324 $cgui->setCancel($this->lng->txt(
"cancel"),
"participants");
2325 $cgui->setConfirm($this->lng->txt(
"proceed"),
"confirmDeleteAllUserResults");
2327 $this->tpl->setContent($cgui->getHTML());
2339 if (count(
$_POST[
"chbUser"]) == 0)
2342 $this->ctrl->redirect($this,
"participants");
2345 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
2347 $cgui->setHeaderText($this->lng->txt(
"confirm_delete_single_user_data"));
2349 $cgui->setFormAction($this->ctrl->getFormAction($this));
2350 $cgui->setCancel($this->lng->txt(
"cancel"),
"cancelDeleteSelectedUserData");
2351 $cgui->setConfirm($this->lng->txt(
"confirm"),
"confirmDeleteSelectedUserData");
2353 include_once
'./Services/User/classes/class.ilObjUser.php';
2354 foreach (
$_POST[
"chbUser"] as $key => $active_id)
2356 if ($this->object->getFixedParticipants())
2358 $user_id = $active_id;
2362 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
2366 if ($this->object->getAnonymity())
2368 $name = $this->lng->txt(
"anonymous");
2370 else if($user[
"lastname"])
2372 $name = $user[
"lastname"].
", ".$user[
"firstname"].
" (".
2377 $name = $this->lng->txt(
"deleted_user");
2380 $cgui->addItem(
"chbUser[]", $active_id, $name,
2384 $this->tpl->setContent($cgui->getHTML());
2396 include_once
"./Modules/Test/classes/tables/class.ilTestHistoryTableGUI.php";
2398 $table_gui->setTestObject($this->
object);
2399 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
2401 $table_gui->setData(
$log);
2402 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2407 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
2409 $form->setTarget(
"_top");
2411 $this->ctrl->setParameter($this,
"new_type", $new_type);
2412 $form->setFormAction($this->ctrl->getFormAction($this));
2413 $form->setTitle($this->lng->txt(
"import_tst"));
2416 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
2417 $fi =
new ilFileInputGUI($this->lng->txt(
"import_file"),
"xmldoc");
2419 $fi->setRequired(
true);
2420 $form->addItem($fi);
2423 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
2425 $questionpools = $tst->getAvailableQuestionpools(TRUE, FALSE, TRUE, TRUE);
2426 if (count($questionpools))
2428 $options = array(
"-1" => $this->lng->txt(
"dont_use_questionpool"));
2429 foreach ($questionpools as $key => $value)
2434 $pool =
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"),
"qpl");
2436 $form->addItem($pool);
2439 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
2440 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
2452 $command =
$_POST[
"command"];
2453 if (strlen($command))
2455 $method = $command .
"Object";
2456 if (method_exists($this, $method))
2462 $this->ctrl->redirect($this,
"participants");
2472 global $ilAccess, $ilToolbar,
$lng;
2476 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2480 $this->ctrl->redirect($this,
"infoScreen");
2483 if( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken($this->tree) )
2486 $this->testQuestionSetConfigFactory->getQuestionSetConfig()->getDepenciesBrokenMessage($this->lng)
2489 elseif( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesInVulnerableState($this->tree) )
2492 $this->questionSetConfig->getDepenciesInVulnerableStateMessage($this->lng)
2496 if ($this->object->getFixedParticipants())
2499 include_once
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
2504 'auto_complete_name' => $lng->txt(
'user'),
2505 'submit_name' => $lng->txt(
'add')
2510 $ilToolbar->addButton($this->lng->txt(
"tst_search_users"),
2511 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
2514 $participants =& $this->
object->getInvitedUsers();
2516 foreach ($participants as
$data)
2518 $maxpass = $this->
object->_getMaxPass($data[
"active_id"]);
2519 if (!is_null($maxpass))
2524 if (strlen($data[
"active_id"]))
2526 $last_access = $this->
object->_getLastAccess($data[
"active_id"]);
2527 $access = $last_access;
2529 $this->ctrl->setParameterByClass(
'iltestevaluationgui',
'active_id', $data[
'active_id']);
2531 if ($data[
'active_id'] == null)
2533 if ( strlen($data[
"firstname"].$data[
"lastname"]) == 0 )
2535 $fullname = $lng->txt(
"deleted_user");
2537 else if($this->object->getAnonymity())
2539 $fullname = $lng->txt(
'anonymous');
2543 $fullname = trim($data[
"lastname"] .
", " . $data[
"firstname"] .
" " . $data[
"title"]);
2546 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
2550 array_push($rows, array(
2551 'usr_id' => $data[
"usr_id"],
2552 'active_id' => $data[
'active_id'],
2553 'login' => $data[
"login"],
2554 'clientip' => $data[
"clientip"],
2555 'firstname' => $data[
"firstname"],
2556 'lastname' => $data[
"lastname"],
2557 'name' => $fullname,
2558 'started' => ($data[
"active_id"] > 0) ? 1 : 0,
2559 'finished' => ($data[
"test_finished"] == 1) ? 1 : 0,
2560 'access' => $access,
2561 'maxpass' => $maxpass,
2562 'result' => $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui',
'outParticipantsResultsOverview')
2565 include_once
"./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php";
2567 $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken(),
2568 $this->
object->getAnonymity(), count($rows)
2571 $table_gui->setResetCommand(
'fpResetFiler');
2573 $table_gui->setData($rows);
2574 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2578 $participants =& $this->
object->getTestParticipants();
2580 foreach ($participants as
$data)
2582 $maxpass = $this->
object->_getMaxPass($data[
"active_id"]);
2583 if (!is_null($maxpass))
2588 if (strlen($data[
"active_id"]))
2590 $last_access = $this->
object->_getLastAccess($data[
"active_id"]);
2591 $access = $last_access;
2593 $this->ctrl->setParameterByClass(
'iltestevaluationgui',
'active_id', $data[
'active_id']);
2595 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
2597 array_push($rows, array(
2598 'usr_id' => $data[
"active_id"],
2599 'active_id' => $data[
'active_id'],
2600 'login' => $data[
"login"],
2601 'name' => $fullname,
2602 'firstname' => $data[
"firstname"],
2603 'lastname' => $data[
"lastname"],
2604 'started' => ($data[
"active_id"] > 0) ? 1 : 0,
2605 'finished' => ($data[
"test_finished"] == 1) ? 1 : 0,
2606 'access' => $access,
2607 'maxpass' => $maxpass,
2608 'result' => $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui',
'outParticipantsResultsOverview')
2611 include_once
"./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php";
2613 $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken(),
2614 $this->
object->getAnonymity(), count($rows)
2617 $table_gui->setResetCommand(
'npResetFilter');
2619 $table_gui->setData($rows);
2620 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());
2628 include_once
"./Modules/Test/classes/tables/class.ilTimingOverviewTableGUI.php";
2631 $participants =& $this->
object->getTestParticipants();#
2632 $times = $this->
object->getStartingTimeOfParticipants();
2633 $addons = $this->
object->getTimeExtensionsOfParticipants();
2635 $tbl_data = array();
2636 foreach ($participants as $participant)
2641 if ($times[$participant[
'active_id']])
2644 $tblRow[
'started'] = $started;
2648 $tblRow[
'started'] =
'';
2651 if ($addons[$participant[
'active_id']] > 0)
2653 $tblRow[
'extratime'] = $addons[$participant[
'active_id']];
2656 $tblRow[
'login'] = $participant[
'login'];
2658 if ($this->object->getAnonymity())
2660 $tblRow[
'name'] = $this->lng->txt(
"anonymous");
2664 $tblRow[
'name'] = $participant[
'lastname'] .
', ' . $participant[
'firstname'];
2667 $tbl_data[] = $tblRow;
2669 $table_gui->setData($tbl_data);
2671 $this->tpl->setContent($table_gui->getHTML());
2680 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2684 $this->ctrl->redirect($this,
"infoScreen");
2687 if ($this->object->getProcessingTimeInSeconds() > 0 && $this->
object->getNrOfTries() == 1)
2690 if (count(
$_POST) && $form->checkInput())
2692 $res = $this->
object->addExtraTime($form->getInput(
'participant'), $form->getInput(
'extratime'));
2693 ilUtil::sendSuccess(sprintf($this->lng->txt(
'tst_extratime_added'), $form->getInput(
'extratime')),
true);
2694 $this->ctrl->redirect($this,
'timingOverview');
2698 return $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
2711 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
2713 $form->setFormAction($this->ctrl->getFormAction($this));
2714 $form->setTableWidth(
"100%");
2715 $form->setId(
"tst_change_workingtime");
2716 $form->setTitle($this->lng->txt(
"tst_change_workingtime"));
2719 $participantslist =
new ilSelectInputGUI($this->lng->txt(
'participants'),
"participant");
2720 $participants =& $this->
object->getTestParticipants();
2721 $times = $this->
object->getStartingTimeOfParticipants();
2722 $addons = $this->
object->getTimeExtensionsOfParticipants();
2724 '' => $this->lng->txt(
'please_select'),
2725 '0' => $this->lng->txt(
'all_participants')
2727 foreach ($participants as $participant)
2731 if ($this->object->getAnonymity())
2733 $name = $this->lng->txt(
"anonymous");
2737 $name = $participant[
'lastname'] .
', ' . $participant[
'firstname'];
2741 if ($times[$participant[
'active_id']])
2745 if ($addons[$participant[
'active_id']] > 0) $started .=
", " . $this->lng->txt(
'extratime') .
': ' . $addons[$participant[
'active_id']] .
' ' . $this->lng->txt(
'minutes');
2746 $options[$participant[
'active_id']] = $participant[
'login'] .
' (' .$name.
')'.$started;
2748 $participantslist->setRequired(
true);
2749 $participantslist->setOptions(
$options);
2750 $form->addItem($participantslist);
2753 $extratime =
new ilNumberInputGUI($this->lng->txt(
"extratime"),
"extratime");
2754 $extratime->
setInfo($this->lng->txt(
'tst_extratime_info'));
2755 $extratime->setRequired(
true);
2756 $extratime->setMinValue(0);
2757 $extratime->setMinvalueShouldBeGreater(
false);
2758 $extratime->setSuffix($this->lng->txt(
'minutes'));
2759 $extratime->setSize(5);
2760 $form->addItem($extratime);
2762 if (is_array(
$_POST) && strlen(
$_POST[
'cmd'][
'timing'])) $form->setValuesByArray(
$_POST);
2764 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) $form->addCommandButton(
"timing", $this->lng->txt(
"save"));
2765 $form->addCommandButton(
'timingOverview', $this->lng->txt(
"cancel"));
2772 $this->tpl->setContent($form->getHTML());
2779 $sess_filter = str_replace(
'"',
'',$sess_filter);
2780 $sess_filter = explode(
':', $sess_filter);
2781 $filter = substr($sess_filter[2],0, strlen($sess_filter[2])-1);
2783 if ($filter ==
'all' || $filter ==
false)
2785 return $in_rows; #unchanged - no filter.
2788 $with_result = array();
2789 $without_result = array();
2790 foreach ($in_rows as
$row)
2793 'SELECT count(solution_id) count
2795 WHERE active_fi = ' . $ilDB->quote($row[
'active_id'])
2797 $count = $ilDB->fetchAssoc(
$result);
2798 $count = $count[
'count'];
2802 $without_result[] =
$row;
2806 $with_result[] =
$row;
2810 if ($filter ==
'withSolutions')
2812 return $with_result;
2814 return $without_result;
2820 include_once(
"./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php");
2823 $table_gui->resetOffset();
2829 include_once(
"./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php");
2831 $this,
"participants",
false, $this->object->getAnonymity(), 0
2834 $table_gui->resetOffset();
2840 include_once(
"./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php");
2842 $this,
"participants",
false, $this->object->getAnonymity(), 0
2845 $table_gui->resetOffset();
2852 include_once(
"./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php");
2854 $this,
"participants",
false, $this->object->getAnonymity(), 0
2857 $table_gui->resetOffset();
2873 $this->
showUserResults($show_pass_details = TRUE, $show_answers = TRUE, $show_reached_points = TRUE);
2887 $this->
showUserResults($show_pass_details = FALSE, $show_answers = TRUE);
2901 $this->
showUserResults($show_pass_details = TRUE, $show_answers = FALSE);
2911 $show_user_results =
$_SESSION[
"show_user_results"];
2913 if (count($show_user_results) == 0)
2916 $this->ctrl->redirect($this,
"participants");
2920 $template = $this->
createUserResults( $show_pass_details, $show_answers, $show_reached_points, $show_user_results);
2922 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
2924 if ($this->object->getShowSolutionAnswersOnly())
2932 if (is_array(
$_POST[
"chbUser"]))
2934 foreach (
$_POST[
"chbUser"] as $user_id)
2936 $this->
object->disinviteUser($user_id);
2943 $this->ctrl->redirect($this,
"participants");
2948 if (is_array(
$_POST[
"chbUser"]))
2950 foreach (
$_POST[
"chbUser"] as $user_id)
2952 $this->
object->setClientIP($user_id,
$_POST[
"clientip_".$user_id]);
2959 $this->ctrl->redirect($this,
"participants");
2971 global $ilAccess,
$ilias;
2972 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
2976 $this->ctrl->redirect($this,
"infoScreen");
2979 $template =
new ilTemplate(
"tpl.il_as_tst_print_test_confirm.html", TRUE, TRUE,
"Modules/Test");
2981 if(!array_key_exists(
"pdf",
$_GET) ||
$_GET[
"pdf"] != 1)
2983 $this->ctrl->setParameter($this,
"pdf",
"1");
2984 $template->setCurrentBlock(
"pdf_export");
2985 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"print"));
2986 $this->ctrl->setParameter($this,
"pdf",
"");
2987 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
2988 $template->parseCurrentBlock();
2990 $template->setCurrentBlock(
"navigation_buttons");
2991 $template->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
2992 $template->parseCurrentBlock();
2998 $print_date = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m") , date(
"d"), date(
"Y"));
3002 require_once
'Modules/Test/classes/class.ilTestQuestionHeaderBlockBuilder.php';
3004 $questionHeaderBlockBuilder->setHeaderMode($this->object->getTitleOutput());
3006 foreach ($this->object->questions as $question)
3008 $template->setCurrentBlock(
"question");
3009 $question_gui = $this->
object->createQuestionGUI(
"", $question);
3011 $questionHeaderBlockBuilder->setQuestionTitle($question_gui->object->getTitle());
3012 $questionHeaderBlockBuilder->setQuestionPoints($question_gui->object->getMaximumPoints());
3013 $questionHeaderBlockBuilder->setQuestionPosition($counter);
3014 $template->setVariable(
"QUESTION_HEADER", $questionHeaderBlockBuilder->getHTML());
3016 $template->setVariable(
"TXT_QUESTION_ID", $this->lng->txt(
'question_id_short'));
3017 $template->setVariable(
"QUESTION_ID", $question_gui->object->getId());
3018 $result_output = $question_gui->getSolutionOutput(
"", NULL, FALSE, TRUE, FALSE, $this->object->getShowSolutionFeedback());
3019 if (strlen($result_output) == 0) $result_output = $question_gui->getPreview(FALSE);
3020 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
3021 $template->parseCurrentBlock(
"question");
3023 $max_points += $question_gui->object->getMaximumPoints();
3033 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
3036 require_once
'class.ilTestPDFGenerator.php';
3041 $this->tpl->setVariable(
"PRINT_CONTENT", $template->get());
3052 function reviewobject()
3054 global $ilAccess,
$ilias;
3055 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3059 $this->ctrl->redirect($this,
"infoScreen");
3062 $template =
new ilTemplate(
"tpl.il_as_tst_print_test_confirm.html", TRUE, TRUE,
"Modules/Test");
3067 $print_date = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m") , date(
"d"), date(
"Y"));
3071 require_once
'Modules/Test/classes/class.ilTestQuestionHeaderBlockBuilder.php';
3073 $questionHeaderBlockBuilder->setHeaderMode($this->object->getTitleOutput());
3075 foreach ($this->object->questions as $question)
3077 $template->setCurrentBlock(
"question");
3078 $question_gui = $this->
object->createQuestionGUI(
"", $question);
3080 $questionHeaderBlockBuilder->setQuestionTitle($question_gui->object->getTitle());
3081 $questionHeaderBlockBuilder->setQuestionPoints($question_gui->object->getMaximumPoints());
3082 $questionHeaderBlockBuilder->setQuestionPosition($counter);
3083 $template->setVariable(
"QUESTION_HEADER", $questionHeaderBlockBuilder->getHTML());
3087 $result_output = $question_gui->getPreview(
false);
3089 if (strlen($result_output) == 0) $result_output = $question_gui->getPreview(FALSE);
3090 $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
3091 $template->parseCurrentBlock(
"question");
3093 $max_points += $question_gui->object->getMaximumPoints();
3105 if (array_key_exists(
"pdf",
$_GET) && (
$_GET[
"pdf"] == 1))
3108 require_once
'class.ilTestPDFGenerator.php';
3109 $content = $template->get();
3114 $this->ctrl->setParameter($this,
"pdf",
"1");
3115 $template->setCurrentBlock(
"pdf_export");
3116 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this,
"review"));
3117 $this->ctrl->setParameter($this,
"pdf",
"");
3118 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
3119 $template->parseCurrentBlock();
3121 $template->setCurrentBlock(
"navigation_buttons");
3122 $template->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
3123 $template->parseCurrentBlock();
3126 $this->tpl->setVariable(
"PRINT_CONTENT", $template->get());
3134 if (is_array($a_user_ids))
3137 foreach ($a_user_ids as $user_id)
3139 $client_ip =
$_POST[
"client_ip"][$i];
3140 $this->
object->inviteUser($user_id, $client_ip);
3148 $message = $this->lng->txt(
"tst_invited_selected_users");
3150 if (strlen($message))
3160 $this->ctrl->redirect($this,
"participants");
3166 public function defaultsObject()
3173 global $ilAccess, $ilToolbar,
$tpl;
3175 if(!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
3178 $this->ctrl->redirect($this,
"infoScreen");
3181 $ilToolbar->setFormAction($this->ctrl->getFormAction($this,
'addDefaults'));
3182 $ilToolbar->addFormButton($this->lng->txt(
'add'),
'addDefaults');
3183 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
3184 $ilToolbar->addInputItem(
new ilTextInputGUI($this->lng->txt(
'tst_defaults_defaults_of_test'),
'name'),
true);
3186 require_once
'Modules/Test/classes/tables/class.ilTestPersonalDefaultSettingsTableGUI.php';
3188 $defaults = $this->
object->getAvailableDefaults();
3189 $table->setData((array)$defaults);
3190 $tpl->setContent($table->getHTML());
3198 if(isset(
$_POST[
'chb_defaults']) && is_array(
$_POST[
'chb_defaults']) && count(
$_POST[
'chb_defaults']))
3200 foreach(
$_POST[
'chb_defaults'] as $test_default_id)
3202 $this->
object->deleteDefaults($test_default_id);
3209 $this->defaultsObject();
3226 if( count(
$_POST[
"chb_defaults"]) != 1 )
3229 $this->lng->txt(
"tst_defaults_apply_select_one")
3232 return $this->defaultsObject();
3236 if($this->object->evalTotalPersons() > 0)
3239 $this->lng->txt(
"tst_defaults_apply_not_possible")
3242 return $this->defaultsObject();
3245 $defaults =& $this->
object->getTestDefaults(
$_POST[
"chb_defaults"][0]);
3246 $defaultSettings = unserialize($defaults[
"defaults"]);
3248 if( isset($defaultSettings[
'isRandomTest']) )
3250 if( $defaultSettings[
'isRandomTest'] )
3261 elseif( isset($defaultSettings[
'questionSetType']) )
3263 $newQuestionSetType = $defaultSettings[
'questionSetType'];
3265 $oldQuestionSetType = $this->
object->getQuestionSetType();
3266 $questionSetTypeSettingSwitched = ( $oldQuestionSetType != $newQuestionSetType );
3268 $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType($oldQuestionSetType);
3272 case !$questionSetTypeSettingSwitched:
3273 case !$oldQuestionSetConfig->doesQuestionSetRelatedDataExist():
3280 require_once
'Modules/Test/classes/confirmations/class.ilTestSettingsChangeConfirmationGUI.php';
3283 $confirmation->setFormAction( $this->ctrl->getFormAction($this) );
3284 $confirmation->setCancel($this->lng->txt(
'cancel'),
'defaults');
3285 $confirmation->setConfirm($this->lng->txt(
'confirm'),
'confirmedApplyDefaults');
3287 $confirmation->setOldQuestionSetType($this->object->getQuestionSetType());
3288 $confirmation->setNewQuestionSetType($newQuestionSetType);
3289 $confirmation->setQuestionLossInfoEnabled(
false);
3290 $confirmation->build();
3292 $confirmation->populateParametersFromPost();
3294 $this->tpl->setContent( $this->ctrl->getHTML($confirmation) );
3299 if( $questionSetTypeSettingSwitched && $this->object->isOnline() )
3301 $this->
object->setOnline(
false);
3303 $info = $this->lng->txt(
"tst_set_offline_due_to_switched_question_set_type_setting");
3308 $this->
object->applyDefaults($defaults);
3312 if( $questionSetTypeSettingSwitched && $oldQuestionSetConfig->doesQuestionSetRelatedDataExist() )
3314 $oldQuestionSetConfig->removeQuestionSetRelatedData();
3317 $this->ctrl->redirect($this,
'defaults');
3325 if (strlen(
$_POST[
"name"]) > 0)
3327 $this->
object->addDefaults(
$_POST[
'name']);
3333 $this->defaultsObject();
3353 #if( !include 'competenzenRocker.php' ) exit;
3355 $this->ctrl->setCmd(
"showSummary");
3356 $this->ctrl->setCmdClass(
"ilinfoscreengui");
3357 $this->infoScreen();
3362 $this->ctrl->setCmd(
"showSummary");
3363 $this->ctrl->setCmdClass(
"ilinfoscreengui");
3364 $this->infoScreen(
$_GET[
'lock']);
3370 function infoScreen($session_lock =
"")
3377 global $ilAccess,
$ilUser, $ilToolbar;
3379 require_once
'Modules/Test/classes/class.ilTestDynamicQuestionSetFilterSelection.php';
3381 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
3382 require_once
'Services/UIComponent/Button/classes/class.ilSubmitButton.php';
3384 $testQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
3385 $testSession = $this->testSessionFactory->getSession();
3386 $testSequence = $this->testSequenceFactory->getSequence($testSession);
3387 $testSequence->loadFromDb();
3390 $testPlayerGUI = $this->testPlayerFactory->getPlayerGUI();
3392 if (
$_GET[
'createRandomSolutions'])
3394 $this->
object->createRandomSolutions(
$_GET[
'createRandomSolutions']);
3397 if (!$ilAccess->checkAccess(
"read",
"", $this->ref_id))
3399 $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
3402 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
3407 return $this->ctrl->forwardCommand($info);
3410 $this->ctrl->setParameter($testPlayerGUI,
"sequence", $testSession->getLastSequence());
3412 $info->setFormAction($this->ctrl->getFormAction($testPlayerGUI));
3414 if (strlen($session_lock))
3416 $info->addHiddenElement(
"lock", $session_lock);
3420 $info->addHiddenElement(
"lock", md5(
$_COOKIE[
'PHPSESSID'] . time()));
3422 $online_access =
false;
3423 if ($this->object->getFixedParticipants())
3425 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
3427 if ($online_access_result ===
true)
3429 $online_access =
true;
3437 $enter_anonymous_code =
false;
3438 if( $this->object->isOnline() && $this->
object->isComplete( $this->testQuestionSetConfigFactory->getQuestionSetConfig() ) )
3440 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
3442 $executable = $this->
object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE
3444 if ($executable[
"executable"])
3446 if( $this->object->areObligationsEnabled() && $this->
object->hasObligations($this->object->getTestId()) )
3451 if ($testSession->getActiveId() > 0)
3454 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
3456 $testPassesSelector->setActiveId($testSession->getActiveId());
3457 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
3459 $closedPasses = $testPassesSelector->getClosedPasses();
3460 $existingPasses = $testPassesSelector->getExistingPasses();
3462 if ($existingPasses > $closedPasses)
3465 $btn->setCaption(
'tst_resume_test');
3466 $btn->setCommand(
'resumePlayer');
3467 $btn->setPrimary(
true);
3468 $big_button[] = $btn;
3473 $btn->setCaption($this->object->getStartTestLabel($testSession->getActiveId()),
false);
3474 $btn->setCommand(
'startPlayer');
3475 $btn->setPrimary(
true);
3476 $big_button[] = $btn;
3483 $btn->setCaption($this->object->getStartTestLabel($testSession->getActiveId()),
false);
3484 $btn->setCommand(
'startPlayer');
3485 $btn->setPrimary(
true);
3486 $big_button[] = $btn;
3493 if ($testSession->getActiveId() > 0)
3497 require_once
'Modules/Test/classes/class.ilTestPassesSelector.php';
3499 $testPassesSelector->setActiveId($testSession->getActiveId());
3500 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
3502 if ($this->object->canShowTestResults($testSession, $ilUser->getId()) && count($testPassesSelector->getReportablePasses()))
3505 $btn->setCaption(
'tst_show_results');
3506 $btn->setUrl($this->ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI',
'outUserResultsOverview'));
3507 $btn->setPrimary(
false);
3508 $big_button[] = $btn;
3510 if ($this->object->getHighscoreEnabled())
3514 $btn->setCaption(
'tst_show_toplist');
3515 $btn->setCommand(
'outResultsToplist');
3516 $btn->setPrimary(
false);
3517 $big_button[] = $btn;
3520 if( $this->object->isSkillServiceToBeConsidered() )
3522 require_once
'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php';
3525 $btn->setCaption(
'tst_show_comp_results');
3527 $btn->setPrimary(
false);
3528 $big_button[] = $btn;
3534 if ($testSession->getActiveId() > 0)
3536 if ($this->object->canShowSolutionPrintview($ilUser->getId()))
3539 $btn->setCaption(
'tst_list_of_answers_show');
3540 $btn->setCommand(
'outUserListOfAnswerPasses');
3541 $btn->setPrimary(
false);
3542 $big_button[] = $btn;
3551 if(
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
3553 $enter_anonymous_code =
true;
3557 if( !$this->object->isOnline() && !$testQuestionSetConfig->areDepenciesBroken() )
3559 $message = $this->lng->txt(
"test_is_offline");
3561 if($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3563 $message .=
"<br /><a href=\"".$this->ctrl->getLinkTargetByClass(
'ilobjtestsettingsgeneralgui').
"\">".
3564 $this->lng->txt(
"test_edit_settings").
"</a>";
3570 if( $ilAccess->checkAccess(
"write",
"", $this->ref_id) )
3572 $testQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
3574 if( $testQuestionSetConfig->areDepenciesBroken() )
3578 $big_button = array();
3579 $enter_anonymous_code =
false;
3581 elseif( $testQuestionSetConfig->areDepenciesInVulnerableState() )
3583 ilUtil::sendInfo( $testQuestionSetConfig->getDepenciesInVulnerableStateMessage($this->lng) );
3587 if ($this->object->getShowInfo())
3589 $info->enablePrivateNotes();
3592 if($big_button || $enter_anonymous_code)
3594 $ilToolbar->setFormAction($this->ctrl->getFormAction($testPlayerGUI));
3596 foreach($big_button as $button)
3598 $ilToolbar->addButtonInstance($button);
3601 if($enter_anonymous_code)
3605 $ilToolbar->addSeparator();
3608 require_once
'Services/Form/classes/class.ilTextInputGUI.php';
3609 $anonymous_id =
new ilTextInputGUI($this->lng->txt(
'enter_anonymous_code'),
'anonymous_id');
3611 $ilToolbar->addInputItem($anonymous_id,
true);
3612 $ilToolbar->addFormButton($this->lng->txt(
'submit'),
'setAnonymousId');
3615 $ilToolbar->setCloseFormTag(
false);
3616 $info->setOpenFormTag(
false);
3619 if (strlen($this->object->getIntroduction()))
3621 $info->addSection($this->lng->txt(
"tst_introduction"));
3622 $info->addProperty(
"", $this->object->prepareTextareaOutput($this->object->getIntroduction(),
true).
3623 $info->getHiddenToggleButton());
3627 $info->addSection(
"");
3628 $info->addProperty(
"", $info->getHiddenToggleButton());
3631 $info->addSection($this->lng->txt(
"tst_general_properties"));
3632 if ($this->object->getShowInfo())
3634 $info->addProperty($this->lng->txt(
"author"), $this->
object->getAuthor());
3635 $info->addProperty($this->lng->txt(
"title"), $this->
object->getTitle());
3637 if( $this->object->isOnline() && $this->
object->isComplete( $this->testQuestionSetConfigFactory->getQuestionSetConfig() ) )
3639 if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
3641 if ($this->object->getShowInfo() || !$this->
object->getForceJS())
3644 $checked_javascript =
false;
3645 if ($this->object->getJavaScriptOutput())
3647 $checked_javascript =
true;
3651 if( !$this->object->isRandomTest() )
3653 if ($this->object->getNrOfTries() != 1)
3655 if ($this->object->getUsePreviousAnswers() == 0)
3657 if ($this->object->getShowInfo())
3659 $info->addProperty($this->lng->txt(
"tst_use_previous_answers"), $this->lng->txt(
"tst_dont_use_previous_answers"));
3664 $use_previous_answers = FALSE;
3665 if ($ilUser->prefs[
"tst_use_previous_answers"])
3667 $checked_previous_answers = TRUE;
3669 $info->addPropertyCheckbox($this->lng->txt(
"tst_use_previous_answers"),
"chb_use_previous_answers", 1, $this->lng->txt(
"tst_use_previous_answers_user"), $checked_previous_answers);
3676 $info->hideFurtherSections(
false);
3678 if ($this->object->getShowInfo())
3680 $info->addSection($this->lng->txt(
"tst_sequence_properties"));
3681 $info->addProperty($this->lng->txt(
"tst_sequence"), $this->lng->txt(($this->object->getSequenceSettings() ==
TEST_FIXED_SEQUENCE)?
"tst_sequence_fixed":
"tst_sequence_postpone"));
3683 $info->addSection($this->lng->txt(
"tst_heading_scoring"));
3684 $info->addProperty($this->lng->txt(
"tst_text_count_system"), $this->lng->txt(($this->object->getCountSystem() ==
COUNT_PARTIAL_SOLUTIONS)?
"tst_count_partial_solutions":
"tst_count_correct_solutions"));
3685 $info->addProperty($this->lng->txt(
"tst_score_mcmr_questions"), $this->lng->txt(($this->object->getMCScoring() ==
SCORE_ZERO_POINTS_WHEN_UNANSWERED)?
"tst_score_mcmr_zero_points_when_unanswered":
"tst_score_mcmr_use_scoring_system"));
3686 if ($this->object->isRandomTest())
3688 $info->addProperty($this->lng->txt(
"tst_pass_scoring"), $this->lng->txt(($this->object->getPassScoring() ==
SCORE_BEST_PASS)?
"tst_pass_best_pass":
"tst_pass_last_pass"));
3691 $info->addSection($this->lng->txt(
"tst_score_reporting"));
3692 $score_reporting_text =
"";
3693 switch ($this->object->getScoreReporting())
3696 $score_reporting_text = $this->lng->txt(
"tst_report_after_test");
3699 $score_reporting_text = $this->lng->txt(
"tst_report_after_first_question");
3702 $score_reporting_text = $this->lng->txt(
"tst_report_after_date");
3705 $score_reporting_text = $this->lng->txt(
"tst_report_never");
3708 $info->addProperty($this->lng->txt(
"tst_score_reporting"), $score_reporting_text);
3709 $reporting_date = $this->
object->getReportingDate();
3710 if ($reporting_date)
3712 #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
3713 #$txt_reporting_date = date($this->lng->text["lang_dateformat"] . " " . $this->lng->text["lang_timeformat"], mktime($matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1]));
3714 #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
3715 $info->addProperty($this->lng->txt(
'tst_score_reporting_date'),
3719 $info->addSection($this->lng->txt(
"tst_session_settings"));
3720 $info->addProperty($this->lng->txt(
"tst_nr_of_tries"), ($this->
object->getNrOfTries() == 0)?$this->lng->txt(
"unlimited"):$this->
object->getNrOfTries());
3721 if ($this->object->getNrOfTries() != 1)
3723 $info->addProperty($this->lng->txt(
"tst_nr_of_tries_of_user"), ($testSession->getPass() ==
false)?$this->lng->txt(
"tst_no_tries"):$testSession->getPass());
3726 if ($this->object->getEnableProcessingTime())
3728 $info->addProperty($this->lng->txt(
"tst_processing_time"), $this->
object->getProcessingTime());
3730 if (strlen($this->object->getAllowedUsers()) && ($this->object->getAllowedUsersTimeGap()))
3732 $info->addProperty($this->lng->txt(
"tst_allowed_users"), $this->
object->getAllowedUsers());
3735 $starting_time = $this->
object->getStartingTime();
3736 if ($starting_time && $this->object->isStartingTimeEnabled())
3738 $info->addProperty($this->lng->txt(
"tst_starting_time"),
3741 $ending_time = $this->
object->getEndingTime();
3742 if ($ending_time && $this->object->isEndingTimeEnabled())
3744 $info->addProperty($this->lng->txt(
"tst_ending_time"),
3747 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
3751 $this->ctrl->forwardCommand($info);
3757 switch ($this->ctrl->getCmd())
3761 case "redirectToInfoScreen":
3768 case "outCorrectSolution":
3770 case "showAnswersOfUser":
3771 case "outUserResultsOverview":
3772 case "backFromSummary":
3773 case "show_answers":
3776 case "outTestSummary":
3777 case "outQuestionSummary":
3778 case "gotoQuestion":
3779 case "selectImagemapRegion":
3780 case "confirmSubmitAnswers":
3781 case "finalSubmission":
3783 case "redirectQuestion":
3784 case "outUserPassDetails":
3785 case "checkPassword":
3786 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"infoScreen"),
"",
$_GET[
"ref_id"]);
3789 case "evalAllUsers":
3790 case "evalUserDetail":
3791 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
"eval_stat"),
"",
$_GET[
"ref_id"]);
3798 case "importVerifiedFile":
3799 case "cancelImport":
3802 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this,
""),
"",
$_GET[
"ref_id"]);
3810 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3812 $this->ctrl->saveParameterByClass($this->ctrl->getCmdClass(),
'q_id');
3814 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTargetByClass($this->ctrl->getCmdClass(),
"questions"));
3815 $tabs_gui->addTarget(
"tst_browse_for_questions",
3816 $this->ctrl->getLinkTarget($this,
"browseForQuestions"),
3817 array(
"browseForQuestions",
"filter",
"resetFilter",
"resetTextFilter",
"insertQuestions"),
3826 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
3829 $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTarget($this,
"questions"));
3830 $tabs_gui->addTarget(
"random_selection",
3831 $this->ctrl->getLinkTarget($this,
"randomQuestions"),
3832 array(
"randomQuestions"),
3847 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
3848 include_once
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
3850 $output_gui->certificateEditor();
3856 $ilTabs->activateTab(
'assQuestions');
3857 $a_cmd = $ilCtrl->getCmd();
3859 if (!$this->object->isRandomTest())
3861 #if (in_array($this->object->getEnabledViewMode(), array('both', 'express'))) {
3862 $questions_per_page = ($a_cmd ==
'questions_per_page' || ($a_cmd ==
'removeQuestions' &&
$_REQUEST[
'test_express_mode'])) ?
true :
false;
3864 $this->tabs_gui->addSubTabTarget(
3865 "questions_per_page_view",
3866 $this->ctrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'showPage'),
3867 "",
"",
"", $questions_per_page);
3870 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
3873 if (!in_array(
'questions', $template->getHiddenTabs())) {
3875 $ilTabs->addSubTabTarget(
"edit_test_questions",
3876 $this->ctrl->getLinkTarget($this,
'questions'),
3877 array(
"questions",
"browseForQuestions",
"questionBrowser",
"createQuestion",
3878 "randomselect",
"filter",
"resetFilter",
"insertQuestions",
3879 "back",
"createRandomSelection",
"cancelRandomSelect",
3880 "insertRandomSelection",
"removeQuestions",
"moveQuestions",
3881 "insertQuestionsBefore",
"insertQuestionsAfter",
"confirmRemoveQuestions",
3882 "cancelRemoveQuestions",
"executeCreateQuestion",
"cancelCreateQuestion",
3883 "addQuestionpool",
"saveRandomQuestions",
"saveQuestionSelectionMode"),
3886 if (in_array($a_cmd, array(
'questions',
'createQuestion')) || ($a_cmd ==
'removeQuestions' && !
$_REQUEST[
'test_express_mode']))
3887 $this->tabs_gui->activateSubTab(
'edit_test_questions');
3892 if (!$this->object->isRandomTest())
3894 $ilTabs->addSubTabTarget(
"print_view",
3895 $this->ctrl->getLinkTarget($this,
'print'),
3896 "print",
"",
"", $this->ctrl->getCmd() ==
'print');
3897 $ilTabs->addSubTabTarget(
'review_view',
3898 $this->ctrl->getLinkTarget($this,
'review'),
3899 'review',
'',
'', $this->ctrl->getCmd() ==
'review');
3910 $ilTabs->addSubTabTarget(
"eval_all_users",
3911 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outEvaluation"),
3912 array(
"outEvaluation",
"detailedEvaluation",
"exportEvaluation",
"evalUserDetail",
"passDetails",
3913 "outStatisticsResultsOverview",
"statisticsPassDetails")
3917 $ilTabs->addSubTabTarget(
"tst_results_aggregated",
3918 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"eval_a"),
3923 $ilTabs->addSubTabTarget(
"tst_single_results",
3924 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"singleResults"),
3925 array(
"singleResults"),
3929 function getSettingsSubTabs($hiddenTabs = array())
3937 $ilTabs->addSubTabTarget(
'general', $this->ctrl->getLinkTargetByClass(
'ilObjTestSettingsGeneralGUI'),
3939 array(
'ilobjtestsettingsgeneralgui')
3942 if(!in_array(
'mark_schema', $hiddenTabs))
3944 $ilTabs->addSubTabTarget(
3946 $this->ctrl->getLinkTargetByClass(
'ilmarkschemagui',
'showMarkSchema'),
3948 array(
'ilmarkschemagui')
3953 $ilTabs->addSubTabTarget(
'scoring', $this->ctrl->getLinkTargetByClass(
'ilObjTestSettingsScoringResultsGUI'),
3955 array(
'ilobjtestsettingsscoringresultsgui')
3959 include_once
"Services/Certificate/classes/class.ilCertificate.php";
3962 $ilTabs->addSubTabTarget(
3964 $this->ctrl->getLinkTarget($this,
'certificate'),
3965 array(
"certificate",
"certificateEditor",
"certificateRemoveBackground",
"certificateSave",
3966 "certificatePreview",
"certificateDelete",
"certificateUpload",
"certificateImport"),
3967 array(
"",
"ilobjtestgui",
"ilcertificategui")
3971 if (!in_array(
'defaults', $hiddenTabs)) {
3973 $ilTabs->addSubTabTarget(
3974 "tst_default_settings",
3975 $this->ctrl->getLinkTarget($this,
"defaults"),
3976 array(
"defaults",
"deleteDefaults",
"addDefaults",
"applyDefaults"),
3977 array(
"",
"ilobjtestgui",
"ilcertificategui")
3987 $ilTabs->addSubTabTarget(
"participants",
3988 $this->ctrl->getLinkTarget($this,
'participants'),
3990 "participants",
"saveClientIP",
3991 "removeParticipant",
3992 "showParticipantAnswersForAuthor",
3993 "deleteAllUserResults",
3994 "cancelDeleteAllUserData",
"deleteSingleUserResults",
3995 "outParticipantsResultsOverview",
"outParticipantsPassDetails",
3996 "showPassOverview",
"showUserAnswers",
"participantsAction",
3997 "showDetailedResults",
3998 'npResetFilter',
'npSetFilter'
4003 if( !$this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken() )
4005 if($this->object->getProcessingTimeInSeconds() > 0 && $this->
object->getNrOfTries() == 1)
4008 $ilTabs->addSubTabTarget(
"timing",
4009 $this->ctrl->getLinkTarget($this,
'timingOverview'),
4010 array(
"timing",
"timingOverview"),
"",
""
4023 global $ilAccess,
$ilUser, $ilHelp;
4025 if (preg_match(
'/^ass(.*?)gui$/i', $this->ctrl->getNextClass($this))) {
4028 else if ($this->ctrl->getNextClass($this) ==
'ilassquestionpagegui') {
4032 $ilHelp->setScreenIdComponent(
"tst");
4034 $hidden_tabs = array();
4036 $template = $this->
object->getTemplate();
4039 include_once
"Services/Administration/classes/class.ilSettingsTemplate.php";
4042 $hidden_tabs = $template->getHiddenTabs();
4046 $curUserHasWriteAccess = $ilAccess->checkAccess(
"write",
"", $this->ref_id);
4048 switch( $this->ctrl->getCmdClass() )
4050 case 'iltestoutputgui':
4054 case 'ilmarkschemagui':
4055 case 'ilobjtestsettingsgeneralgui':
4056 case 'ilobjtestsettingsscoringresultsgui':
4058 if( $curUserHasWriteAccess )
4060 $this->getSettingsSubTabs($hidden_tabs);
4066 switch ($this->ctrl->getCmd())
4072 case "directfeedback":
4074 case "outCorrectSolution":
4076 case "showAnswersOfUser":
4077 case "outUserResultsOverview":
4078 case "backFromSummary":
4079 case "show_answers":
4082 case "confirmFinish":
4083 case "outTestSummary":
4084 case "outQuestionSummary":
4085 case "gotoQuestion":
4086 case "selectImagemapRegion":
4087 case "confirmSubmitAnswers":
4088 case "finalSubmission":
4090 case "redirectQuestion":
4091 case "outUserPassDetails":
4092 case "checkPassword":
4093 case "exportCertificate":
4094 case "finishListOfAnswers":
4095 case "backConfirmFinish":
4096 case "showFinalStatement":
4099 case "browseForQuestions":
4102 case "resetTextFilter":
4103 case "insertQuestions":
4105 if($this->ctrl->getNextClass($this) !=
"illearningprogressgui")
4112 case "certificateservice":
4113 case "certificateImport":
4114 case "certificateUpload":
4115 case "certificateEditor":
4116 case "certificateDelete":
4117 case "certificateSave":
4119 case "deleteDefaults":
4121 case "applyDefaults":
4122 case "inviteParticipants":
4123 case "searchParticipants":
4124 if( $curUserHasWriteAccess && in_array($this->ctrl->getCmdClass(), array(
'ilobjtestgui',
'ilcertificategui')) )
4126 $this->getSettingsSubTabs($hidden_tabs);
4134 case "detailedEvaluation":
4135 case "outEvaluation":
4136 case "singleResults":
4137 case "exportEvaluation":
4138 case "evalUserDetail":
4140 case "outStatisticsResultsOverview":
4141 case "statisticsPassDetails":
4146 if (strcmp(strtolower(get_class($this->
object)),
"ilobjtest") == 0)
4149 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && !in_array(
'assQuestions', $hidden_tabs))
4151 $force_active = (
$_GET[
"up"] !=
"" ||
$_GET[
"down"] !=
"")
4156 if (
$_GET[
"browse"] == 1) $force_active =
true;
4159 switch( $this->object->getQuestionSetType() )
4162 $target = $this->ctrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'showPage');
4166 $target = $this->ctrl->getLinkTargetByClass(
'ilTestRandomQuestionSetConfigGUI');
4170 $target = $this->ctrl->getLinkTargetByClass(
'ilObjTestDynamicQuestionSetConfigGUI');
4174 $tabs_gui->addTarget(
"assQuestions",
4177 array(
"questions",
"browseForQuestions",
"questionBrowser",
"createQuestion",
4178 "randomselect",
"filter",
"resetFilter",
"insertQuestions",
4179 "back",
"createRandomSelection",
"cancelRandomSelect",
4180 "insertRandomSelection",
"removeQuestions",
"moveQuestions",
4181 "insertQuestionsBefore",
"insertQuestionsAfter",
"confirmRemoveQuestions",
4182 "cancelRemoveQuestions",
"executeCreateQuestion",
"cancelCreateQuestion",
4183 "addQuestionpool",
"saveRandomQuestions",
"saveQuestionSelectionMode",
"print",
4184 "addsource",
"removesource",
"randomQuestions"),
4185 "",
"", $force_active);
4189 if ($ilAccess->checkAccess(
"read",
"", $this->ref_id) && !in_array(
'info_short', $hidden_tabs))
4191 $tabs_gui->addTarget(
"info_short",
4192 $this->ctrl->getLinkTarget($this,
'infoScreen'),
4193 array(
"infoScreen",
"outIntroductionPage",
"showSummary",
4194 "setAnonymousId",
"outUserListOfAnswerPasses",
"redirectToInfoScreen"));
4198 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4200 if (!in_array(
'settings', $hidden_tabs))
4202 $settingsCommands = array(
4203 "marks",
"showMarkSchema",
"addMarkStep",
"deleteMarkSteps",
"addSimpleMarkSchema",
"saveMarks",
4204 "certificate",
"certificateEditor",
"certificateRemoveBackground",
"certificateSave",
4205 "certificatePreview",
"certificateDelete",
"certificateUpload",
"certificateImport",
4206 "scoring",
"defaults",
"addDefaults",
"deleteDefaults",
"applyDefaults",
4207 "inviteParticipants",
"saveFixedParticipantsStatus",
"searchParticipants",
"addParticipants"
4210 require_once
'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
4211 $reflection =
new ReflectionClass(
'ilObjTestSettingsGeneralGUI');
4212 foreach($reflection->getConstants() as $name => $value)
4213 if(substr($name, 0, 4) ==
'CMD_') $settingsCommands[] = $value;
4215 require_once
'Modules/Test/classes/class.ilObjTestSettingsScoringResultsGUI.php';
4216 $reflection =
new ReflectionClass(
'ilObjTestSettingsScoringResultsGUI');
4217 foreach($reflection->getConstants() as $name => $value)
4218 if(substr($name, 0, 4) ==
'CMD_') $settingsCommands[] = $value;
4220 $settingsCommands[] =
"";
4222 $tabs_gui->addTarget(
"settings",
4223 $this->ctrl->getLinkTargetByClass(
'ilObjTestSettingsGeneralGUI'),
4225 array(
"ilmarkschemagui",
"ilobjtestsettingsgeneralgui",
"ilobjtestsettingsscoringresultsgui",
"ilobjtestgui",
"ilcertificategui")
4232 require_once
'Modules/Test/classes/class.ilTestSkillQuestionAssignmentsGUI.php';
4234 $link = $this->ctrl->getLinkTargetByClass(
4235 array(
'ilTestSkillAdministrationGUI',
'ilTestSkillQuestionAssignmentsGUI'),
4239 $tabs_gui->addTarget(
'tst_tab_competences', $link, array(), array());
4242 if (!in_array(
'participants', $hidden_tabs))
4245 $tabs_gui->addTarget(
"participants",
4246 $this->ctrl->getLinkTarget($this,
'participants'),
4248 "participants",
"saveClientIP",
4249 "removeParticipant",
4250 "showParticipantAnswersForAuthor",
4251 "deleteAllUserResults",
4252 "cancelDeleteAllUserData",
"deleteSingleUserResults",
4253 "outParticipantsResultsOverview",
"outParticipantsPassDetails",
4254 "showPassOverview",
"showUserAnswers",
"participantsAction",
4255 "showDetailedResults",
4256 'timing',
'timingOverview',
'npResetFilter',
'npSetFilter',
'showTimingForm'
4263 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
4266 $tabs_gui->addTarget(
'learning_progress',
4267 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
4269 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
4272 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && !in_array(
'manscoring', $hidden_tabs))
4274 include_once
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
4276 if (count($scoring))
4279 $tabs_gui->addTarget(
4280 "manscoring", $this->ctrl->getLinkTargetByClass(
'ilTestScoringGUI',
'showManScoringParticipantsTable'),
4282 'showManScoringParticipantsTable',
'applyManScoringParticipantsFilter',
'resetManScoringParticipantsFilter',
'showManScoringParticipantScreen',
4283 'showManScoringByQuestionParticipantsTable',
'applyManScoringByQuestionFilter',
'resetManScoringByQuestionFilter',
'saveManScoringByQuestion'
4292 $scoring_adjust_active = (bool) $setting->get(
'assessment_adjustments_enabled',
false);
4293 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id) && $scoring_adjust_active && !in_array(
'scoringadjust', $hidden_tabs))
4296 $tabs_gui->addTarget(
4297 "scoringadjust", $this->ctrl->getLinkTargetByClass(
'ilScoringAdjustmentGUI',
'showquestionlist'),
4300 'savescoringfortest',
4301 'adjustscoringfortest'
4306 if ((($ilAccess->checkAccess(
"tst_statistics",
"", $this->ref_id)) || ($ilAccess->checkAccess(
"write",
"", $this->ref_id))) && !in_array(
'statistics', $hidden_tabs))
4309 $tabs_gui->addTarget(
4311 $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui",
"outEvaluation"),
4313 "statistics",
"outEvaluation",
"exportEvaluation",
"detailedEvaluation",
"eval_a",
"evalUserDetail",
4314 "passDetails",
"outStatisticsResultsOverview",
"statisticsPassDetails",
"singleResults"
4320 if ($ilAccess->checkAccess(
"write",
"", $this->ref_id))
4322 if (!in_array(
'history', $hidden_tabs)) {
4325 $tabs_gui->addTarget(
"history",
4326 $this->ctrl->getLinkTarget($this,
'history'),
4330 if (!in_array(
'meta_data', $hidden_tabs)) {
4332 $tabs_gui->addTarget(
"meta_data",
4333 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
4334 "",
"ilmdeditorgui");
4337 if(!in_array(
'export', $hidden_tabs))
4340 $tabs_gui->addTarget(
4342 $this->ctrl->getLinkTargetByClass(
'iltestexportgui' ,
''),
4344 array(
'iltestexportgui')
4349 if ($ilAccess->checkAccess(
"edit_permission",
"", $this->ref_id)&& !in_array(
'permissions', $hidden_tabs))
4351 $tabs_gui->addTarget(
"perm_settings",
4352 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
4356 if( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken() )
4358 $hideTabs = $this->testQuestionSetConfigFactory->getQuestionSetConfig()->getHiddenTabsOnBrokenDepencies();
4360 foreach($hideTabs as $tabId)
4362 $tabs_gui->removeTab($tabId);
4379 if ($ilAccess->checkAccess(
"read",
"", $a_target))
4382 $_GET[
"baseClass"] =
"ilObjTestGUI";
4383 $_GET[
"cmd"] =
"infoScreen";
4384 $_GET[
"ref_id"] = $a_target;
4385 include_once(
"ilias.php");
4389 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
4396 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
4407 if($this->create_question_mode)
4412 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
4416 $ilCtrl->saveParameter($this,
'q_mode');
4418 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'test_express_mode', 1);
4419 $ilCtrl->setParameter($this,
'test_express_mode', 1);
4420 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'q_id',
$_REQUEST[
'q_id']);
4421 $ilCtrl->setParameter($this,
'q_id',
$_REQUEST[
'q_id']);
4422 $ilToolbar->setFormAction($ilCtrl->getFormActionByClass(
'iltestexpresspageobjectgui',
'edit'));
4424 if($this->object->evalTotalPersons() == 0)
4446 $ilToolbar->addFormButton($lng->txt(
"ass_create_question"),
"addQuestion");
4448 $ilToolbar->addSeparator();
4450 if($this->object->getPoolUsage())
4452 $ilToolbar->addFormButton($lng->txt(
"tst_browse_for_questions"),
"browseForQuestions");
4454 $show_separator =
true;
4458 $questions = $this->
object->getQuestionTitlesAndIndexes();
4462 foreach($questions as $id => $label)
4464 $options[$id] = $label .
' ['. $this->lng->txt(
'question_id_short') .
': ' . $id .
']';
4467 $optionKeys = array_keys(
$options);
4497 if(count($questions))
4499 if(isset($show_separator) && $show_separator)
4501 $ilToolbar->addSeparator();
4505 $btn->setCaption(
"test_prev_question");
4506 $btn->setUrl($ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'prevQuestion'));
4507 $ilToolbar->addButtonInstance($btn);
4509 if( count(
$options) <= 1 || $optionKeys[0] == $qid )
4511 $btn->setDisabled(
true);
4515 $btn->setCaption(
"test_next_question");
4516 $btn->setUrl($ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'nextQuestion'));
4517 $ilToolbar->addButtonInstance($btn);
4519 if( count(
$options) <= 1 || $optionKeys[count($optionKeys) - 1] == $qid )
4521 $btn->setDisabled(
true);
4525 if(count($questions) > 1)
4528 $ilToolbar->addSeparator();
4530 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
4532 $si->addCustomAttribute(
"onChange=\"forms['ilToolbar'].submit();\"");
4537 $si->setValue($qid);
4540 $ilToolbar->addInputItem(
$si,
true);
4543 $total = $this->
object->evalTotalPersons();
4558 if(count($questions) && !
$total)
4560 $ilCtrl->setParameter($this,
'q_id',
$_REQUEST[
'q_id']);
4561 $ilToolbar->addSeparator();
4562 $ilToolbar->addButton($lng->txt(
"test_delete_page"), $ilCtrl->getLinkTarget($this,
"removeQuestions"));
4565 if(count($questions) > 1 && !
$total)
4567 $ilToolbar->addSeparator();
4568 $ilToolbar->addButton($lng->txt(
"test_move_page"), $ilCtrl->getLinkTarget($this,
"movePageForm"));
4573 $online_access =
false;
4574 if($this->object->getFixedParticipants())
4576 include_once
"./Modules/Test/classes/class.ilObjTestAccess.php";
4578 if($online_access_result ===
true)
4580 $online_access =
true;
4584 if($this->object->isOnline() && $this->
object->isComplete( $this->testQuestionSetConfigFactory->getQuestionSetConfig() ))
4586 if((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read",
"", $this->ref_id))
4588 $testSession = $this->testSessionFactory->getSession();
4590 $executable = $this->
object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE);
4592 if($executable[
"executable"])
4595 $player_instance = $player_factory->getPlayerGUI();
4597 if ($testSession->getActiveId() > 0)
4599 $ilToolbar->addSeparator();
4600 $ilToolbar->addButton($lng->txt(
'tst_resume_test'), $ilCtrl->getLinkTarget($player_instance,
'resumePlayer'));
4604 $ilToolbar->addSeparator();
4605 $ilToolbar->addButton($lng->txt(
'tst_start_test'), $ilCtrl->getLinkTarget($player_instance,
'startTest'));
4621 foreach($questionIds as $q_id)
4624 $newIds[$q_id] = $newId;
4636 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
4639 $newtitle = $question_gui->object->getTitle();
4640 if ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle()))
4643 while ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle() .
" ($counter)"))
4647 $newtitle = $question_gui->object->getTitle() .
" ($counter)";
4650 return $question_gui->object->createNewOriginalFromThisDuplicate($targetParentId, $newtitle);
4658 global $ilObjDataCache;
4660 $qplId = $ilObjDataCache->lookupObjId(
$_REQUEST[
'sel_qpl']);
4663 foreach(
$result->ids as $oldId => $newId)
4670 $oldOriginal->delete($oldOriginal->getId());
4673 $questionInstance->setNewOriginalId($newId);
4682 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
4687 $form->addItem($title);
4690 $form->addItem($description);
4692 $form->addCommandButton(
'createQuestionPoolAndCopy', $lng->txt(
'create'));
4699 $hidden->setValue($id);
4700 $form->addItem($hidden);
4716 require_once
'Modules/TestQuestionPool/classes/class.assQuestion.php';
4720 'copyAndLinkToQuestionpool' == $this->ctrl->getCmd() &&
4725 $this->ctrl->redirect($this,
'questions');
4793 $ilTabs->activateSubTab(
'edit_test_questions');
4795 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.il_as_tst_qpl_select_copy.html",
"Modules/Test");
4796 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE,
"write");
4797 if(count($questionpools) == 0)
4799 $this->tpl->setCurrentBlock(
"option");
4800 $this->tpl->setVariable(
"VALUE_QPL",
"");
4801 $this->tpl->parseCurrentBlock();
4805 foreach($questionpools as $key => $value)
4807 $this->tpl->setCurrentBlock(
"option");
4808 $this->tpl->setVariable(
"VALUE_OPTION", $key);
4809 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
4810 $this->tpl->parseCurrentBlock();
4818 $this->tpl->setCurrentBlock(
"hidden");
4819 $this->tpl->setVariable(
"HIDDEN_NAME",
"q_id[]");
4820 $this->tpl->setVariable(
"HIDDEN_VALUE", $id);
4821 $this->tpl->parseCurrentBlock();
4822 $this->tpl->setCurrentBlock(
"adm_content");
4825 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
4827 if(count($questionpools) == 0)
4829 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_enter_questionpool"));
4830 $cmd =
'createQuestionPoolAndCopy';
4834 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_select_questionpool"));
4837 $this->tpl->setVariable(
"CMD_SUBMIT",
$cmd);
4838 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
4839 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
4844 case 'copyAndLinkQuestionsToPool':
4846 $hidden->setValue(1);
4847 $createForm->addItem($hidden);
4849 case 'copyQuestionsToPool':
4852 $createForm->setFormAction($this->ctrl->getFormAction($this));
4854 $this->tpl->parseCurrentBlock();
4862 $simpleSetters = array(
4865 'use_pool' =>
'setPoolUsage',
4866 'question_set_type' =>
'setQuestionSetType',
4869 'intro_enabled' =>
'setIntroductionEnabled',
4870 'showinfo' =>
'setShowInfo',
4873 'chb_starting_time' =>
'setStartingTimeEnabled',
4874 'chb_ending_time' =>
'setEndingTimeEnabled',
4875 'password_enabled' =>
'setPasswordEnabled',
4876 'fixedparticipants' =>
'setFixedParticipants',
4877 'limitUsers' =>
'setLimitUsersEnabled',
4880 'nr_of_tries' =>
'setNrOfTries',
4881 'chb_processing_time' =>
'setEnableProcessingTime',
4882 'kiosk' =>
'setKiosk',
4883 'examid_in_test_pass' =>
'setShowExamIdInTestPassEnabled',
4886 'title_output' =>
'setTitleOutput',
4888 'chb_shuffle_questions' =>
'setShuffleQuestions',
4889 'offer_hints' =>
'setOfferingQuestionHintsEnabled',
4890 'instant_feedback' =>
'setScoringFeedbackOptionsByArray',
4891 'obligations_enabled' =>
'setObligationsEnabled',
4894 'chb_use_previous_answers' =>
'setUsePreviousAnswers',
4895 'chb_show_cancel' =>
'setShowCancel',
4896 'chb_postpone' =>
'setPostponingEnabled',
4897 'list_of_questions' =>
'setListOfQuestionsSettings',
4898 'chb_show_marker' =>
'setShowMarker',
4901 'enable_examview' =>
'setEnableExamview',
4902 'showfinalstatement' =>
'setShowFinalStatement',
4903 'redirection_enabled' => null,
4904 'sign_submission' =>
'setSignSubmission',
4905 'mailnotification' =>
'setMailNotification',
4908 'count_system' =>
'setCountSystem',
4909 'mc_scoring' =>
'setMCScoring',
4910 'score_cutting' =>
'setScoreCutting',
4911 'pass_scoring' =>
'setPassScoring',
4912 'pass_deletion_allowed' =>
'setPassDeletionAllowed',
4915 'results_access_enabled' =>
'setScoreReporting',
4916 'grading_status' =>
'setShowGradingStatusEnabled',
4917 'grading_mark' =>
'setShowGradingMarkEnabled',
4920 'solution_details' =>
'setShowSolutionDetails',
4921 'solution_feedback' =>
'setShowSolutionFeedback',
4922 'solution_suggested' =>
'setShowSolutionSuggested',
4923 'solution_printview' =>
'setShowSolutionPrintview',
4924 'highscore_enabled' =>
'setHighscoreEnabled',
4925 'solution_signature' =>
'setShowSolutionSignature',
4926 'examid_in_test_res' =>
'setShowExamIdInTestResultsEnabled',
4927 'exp_sc_short' =>
'setExportSettingsSingleChoiceShort',
4930 'anonymity' =>
'setAnonymity',
4931 'enable_archiving' =>
'setEnableArchiving'
4934 if (!$templateData[
'results_presentation'][
'value'])
4936 $templateData[
'results_presentation'][
'value'] = array();
4939 foreach($simpleSetters as $field => $setter)
4941 if($templateData[$field] && strlen($setter))
4943 $object->$setter($templateData[$field][
'value']);
4950 if( $templateData[$field][
'value'] > 0 )
4953 $object->setAutosaveIval($templateData[$field][
'value'] * 1000);
4961 case 'redirection_enabled':
4970 if( strlen($templateData[$field][
'value']) )
4973 $object->setRedirectionUrl($templateData[$field][
'value']);
4978 $object->setRedirectionUrl(
'');
4987 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
4991 $this->ctrl->redirect($this,
"infoScreen");
4996 $orders = $obligations = array();
4998 foreach(
$_REQUEST[
'order'] as $qId => $order)
5000 $id = (int)str_replace(
'q_',
'', $qId);
5002 $orders[$id] = $order;
5005 if( $this->object->areObligationsEnabled() && isset(
$_REQUEST[
'obligatory']) && is_array(
$_REQUEST[
'obligatory']) )
5007 foreach(
$_REQUEST[
'obligatory'] as $qId => $obligation)
5009 $id = (int)str_replace(
'q_',
'', $qId);
5013 $obligations[$id] = $obligation;
5018 $this->
object->setQuestionOrderAndObligations(
5019 $orders, $obligations
5022 $ilCtrl->redirect($this,
'questions');
5032 include_once
"Services/Form/classes/class.ilPropertyFormGUI.php";
5034 $form->setFormAction($ilCtrl->getFormAction($this,
"movePage"));
5035 $form->setTitle($lng->txt(
"test_move_page"));
5039 $form->addItem($old_pos);
5041 $questions = $this->
object->getQuestionTitlesAndIndexes();
5042 if (!is_array($questions))
5043 $questions = array();
5045 foreach($questions as $k => $q) {
5047 unset($questions[$k]);
5050 $questions[$k] = $lng->txt(
'behind') .
' '. $q;
5052 #$questions['0'] = $lng->txt('first');
5055 0 => $lng->txt(
'first')
5057 foreach($questions as $k => $q) {
5058 $options[$k] = $q .
' ['. $this->lng->txt(
'question_id_short') .
': ' . $k .
']';
5063 $form->addItem($pos);
5065 $form->addCommandButton(
"movePage", $lng->txt(
"submit"));
5066 $form->addCommandButton(
"showPage", $lng->txt(
"cancel"));
5068 return $tpl->setContent($form->getHTML());
5073 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
5077 $this->ctrl->redirect($this,
"infoScreen");
5087 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui',
'q_id',
$_REQUEST[
'q_id']);
5088 $ilCtrl->redirectByClass(
'iltestexpresspageobjectgui',
'showPage');
5093 if (!$ilAccess->checkAccess(
"write",
"", $this->ref_id))
5097 $this->ctrl->redirect($this,
"infoScreen");
5107 $this->ctrl->redirect($this,
'questions');
5112 $questionTitles = $this->
object->getQuestionTitles();
5114 foreach($ids as $id)
5116 include_once
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
5120 $title = $question->object->getTitle();
5122 while( in_array( $title .
' (' . $i .
')', $questionTitles ))
5125 $title .=
' (' . $i .
')';
5127 $questionTitles[] = $title;
5129 $new_id = $question->object->duplicate(
false, $title);
5132 $clone->object->setObjId($this->object->getId());
5133 $clone->object->saveToDb();
5135 $this->
object->insertQuestion( $this->testQuestionSetConfigFactory->getQuestionSetConfig(), $new_id, true );
5143 $this->ctrl->redirect($this,
'questions');
5153 if( !$testSession->getActiveId() )
5158 if( !$this->object->isDynamicTest() )
5163 if( !$this->object->isPassDeletionAllowed() )
5168 if( !$testSequence->hasStarted($testSession) )
5182 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
5183 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
5185 $this->ctrl->setParameterByClass(
5186 'iltestevaluationgui',
'context',
5190 $this->ctrl->setParameterByClass(
'iltestevaluationgui',
'active_id', $testSession->getActiveId());
5191 $this->ctrl->setParameterByClass(
'iltestevaluationgui',
'pass', $testSession->getPass());
5194 $btn->setCaption(
'tst_delete_dyn_test_results_btn');
5195 $btn->setUrl($this->ctrl->getLinkTargetByClass(
'iltestevaluationgui',
'confirmDeletePass'));
5196 $btn->setPrimary(
false);
5197 $big_button[] = $btn;
5205 if( !isset(
$_GET[
'pdf']) )
5210 if( !(
bool)
$_GET[
'pdf'] )