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.ilTestExpressPage.php';
 
   62                 $lng->loadLanguageModule(
"assessment");
 
   65                 $this->ctrl->saveParameter($this, array(
"ref_id", 
"test_ref_id", 
"calling_test", 
"test_express_mode", 
"q_id"));
 
   70                         require_once 
'Modules/Test/classes/class.ilTestQuestionSetConfigFactory.php';
 
   73                         require_once 
'Modules/Test/classes/class.ilTestPlayerFactory.php';
 
   76                         require_once 
'Modules/Test/classes/class.ilTestSessionFactory.php';
 
   79                         require_once 
'Modules/Test/classes/class.ilTestSequenceFactory.php';
 
   89                 global $ilAccess, $ilNavigationHistory, 
$ilCtrl, 
$ilErr, 
$tpl, 
$lng, $ilTabs, $ilPluginAdmin, $ilDB, 
$tree, 
$ilUser;
 
   91                 if((!$ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"])))
 
   94                         $ilias->raiseError($this->lng->txt(
"permission_denied"), $ilias->error_obj->MESSAGE);
 
   97                 $cmd = $this->ctrl->getCmd(
"infoScreen");
 
   99                 $cmdsDisabledDueToOfflineStatus = array(
 
  100                         'resumePlayer', 
'resumePlayer', 
'outUserResultsOverview', 
'outUserListOfAnswerPasses' 
  103                 if(!$this->
getCreationMode() && !$this->object->isOnline() && in_array(
$cmd, $cmdsDisabledDueToOfflineStatus))
 
  108                 $next_class = $this->ctrl->getNextClass($this);
 
  109                 $this->ctrl->setReturn($this, 
"infoScreen");
 
  111                 if(method_exists($this->
object, 
"getTestStyleLocation")) $this->tpl->addCss($this->object->getTestStyleLocation(
"output"), 
"screen");
 
  115                         $ilAccess->checkAccess(
"read", 
"", 
$_GET[
"ref_id"])
 
  118                         $ilNavigationHistory->addItem(
$_GET[
"ref_id"],
 
  119                                 "ilias.php?baseClass=ilObjTestGUI&cmd=infoScreen&ref_id=" . 
$_GET[
"ref_id"], 
"tst");
 
  124                         if(IS_PAYMENT_ENABLED)
 
  126                                 require_once 
'Services/Payment/classes/class.ilPaymentObject.php';
 
  130                                         $this->tpl->getStandardTemplate();
 
  132                                         include_once 
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
 
  134                                         $ret = $this->ctrl->forwardCommand($pp);
 
  144                         global $___prev_question_id;
 
  145                         $___prev_question_id = 
$_REQUEST[
'prev_qid'];
 
  146                         $this->ctrl->setParameter($this, 
'prev_qid', 
$_REQUEST[
'prev_qid']);
 
  149                 if( !$this->
getCreationMode() && $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken() )
 
  151                         if( !$this->testQuestionSetConfigFactory->getQuestionSetConfig()->isValidRequestOnBrokenQuestionSetDepencies($next_class, 
$cmd) )
 
  153                                 $this->ctrl->redirectByClass(
'ilObjTestGUI', 
'infoScreen');
 
  159                         case 'iltestexportgui':
 
  160                                 if(!$ilAccess->checkAccess(
'write', 
'', $this->ref_id))
 
  162                                         $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->WARNING);
 
  167                                 require_once 
'Modules/Test/classes/class.ilTestExportGUI.php';
 
  171                         case "ilinfoscreengui":
 
  176                         case 'ilmdeditorgui':
 
  177                                 if(!$ilAccess->checkAccess(
'write', 
'', $this->object->getRefId()))
 
  179                                         $ilErr->raiseError($this->lng->txt(
'permission_denied'), $ilErr->WARNING);
 
  184                                 require_once 
'Services/MetaData/classes/class.ilMDEditorGUI.php';
 
  185                                 $md_gui =& 
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
 
  186                                 $md_gui->
addObserver($this->
object, 
'MDUpdateListener', 
'General');
 
  188                                 $this->ctrl->forwardCommand($md_gui);
 
  191                         case "iltestoutputgui":
 
  192                                 require_once 
"./Modules/Test/classes/class.ilTestOutputGUI.php";
 
  196                                 $this->ctrl->forwardCommand($output_gui);
 
  199                         case "iltestplayerdynamicquestionsetgui":
 
  200                                 require_once 
"./Modules/Test/classes/class.ilTestPlayerDynamicQuestionSetGUI.php";
 
  203                                 $this->ctrl->forwardCommand($output_gui);
 
  206                         case "iltestevaluationgui":
 
  209                                 include_once 
"./Modules/Test/classes/class.ilTestEvaluationGUI.php";
 
  211                                 $this->ctrl->forwardCommand($evaluation_gui);
 
  214                         case "iltestservicegui":
 
  217                                 require_once 
"./Modules/Test/classes/class.ilTestServiceGUI.php";
 
  219                                 $this->ctrl->forwardCommand($serviceGUI);
 
  222                         case 'ilpermissiongui':
 
  225                                 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
 
  227                                 $ret      =& $this->ctrl->forwardCommand($perm_gui);
 
  230                         case "illearningprogressgui":
 
  233                                 require_once 
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
 
  235                                 $this->ctrl->forwardCommand($new_gui);
 
  239                         case "ilcertificategui":
 
  242                                 require_once 
"./Services/Certificate/classes/class.ilCertificateGUI.php";
 
  243                                 require_once 
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
 
  245                                 $this->ctrl->forwardCommand($output_gui);
 
  248                         case "iltestscoringgui":
 
  251                                 require_once 
"./Modules/Test/classes/class.ilTestScoringGUI.php";
 
  253                                 $this->ctrl->forwardCommand($output_gui);
 
  256                         case 'iltestscoringbyquestionsgui':
 
  259                                 include_once 
'Modules/Test/classes/class.ilTestScoringByQuestionsGUI.php';
 
  261                                 $this->ctrl->forwardCommand($output_gui);
 
  264                         case 'ilobjtestsettingsgeneralgui':
 
  267                                 require_once 
'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
 
  269                                                 $this->ctrl, $ilAccess, $this->lng, $this->tpl, $this->tree, $ilDB, $ilPluginAdmin, $ilUser, $this
 
  271                                 $this->ctrl->forwardCommand($gui);
 
  274                         case 'ilobjtestdynamicquestionsetconfiggui':
 
  277                                 require_once 
'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfigGUI.php';
 
  279                                 $this->ctrl->forwardCommand($gui);
 
  282                         case 'iltestrandomquestionsetconfiggui':
 
  285                                 require_once 
'Modules/Test/classes/class.ilTestRandomQuestionSetConfigGUI.php';
 
  287                                 $this->ctrl->forwardCommand($gui);
 
  290                         case 'ilobjectcopygui':
 
  293                                 require_once 
'./Services/Object/classes/class.ilObjectCopyGUI.php';
 
  296                                 $this->ctrl->forwardCommand($cp);
 
  299                         case 'ilrepositorysearchgui':
 
  302                                 require_once 
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
 
  304                                 $rep_search->setCallback($this,
 
  305                                         'addParticipantsObject',
 
  310                                 $this->ctrl->setReturn($this, 
'participants');
 
  311                                 $ret =& $this->ctrl->forwardCommand($rep_search);
 
  312                                 $this->tabs_gui->setTabActive(
'participants');
 
  315                         case 'ilpageeditorgui':
 
  316                         case 'iltestexpresspageobjectgui':
 
  318                                 require_once 
'Modules/TestQuestionPool/classes/class.ilAssIncompleteQuestionPurger.php';
 
  320                                 $incompleteQuestionPurger->setOwnerId($ilUser->getId());
 
  321                                 $incompleteQuestionPurger->purge();
 
  328                                 if(!$qid || $qid == 
'Array')
 
  330                                         $questions = $this->
object->getQuestionTitlesAndIndexes();
 
  331                                         if(!is_array($questions))
 
  332                                                 $questions = array();
 
  334                                         $keys = array_keys($questions);
 
  338                                         $_GET[
'q_id']     = $qid;
 
  343                                 if(!in_array(
$cmd, array(
'addQuestion', 
'browseForQuestions')))
 
  348                                 if(!$qid || in_array(
$cmd, array(
'insertQuestions', 
'browseForQuestions')))
 
  350                                         require_once 
"./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
 
  353                                         $ret                     =& $this->ctrl->forwardCommand($pageObject);
 
  356                                 require_once 
"./Services/Style/classes/class.ilObjStyleSheet.php";
 
  357                                 $this->tpl->setCurrentBlock(
"ContentStyle");
 
  358                                 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  360                                 $this->tpl->parseCurrentBlock();
 
  363                                 $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
  364                                 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
 
  366                                 $this->tpl->parseCurrentBlock();
 
  367                                 require_once 
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
 
  372                                         $this->ctrl->setParameterByClass(
'iltestexpresspageobjectgui', 
'q_id', 
'');
 
  373                                         $this->ctrl->redirectByClass(
'iltestexpresspageobjectgui', $this->ctrl->getCmd());
 
  376                                 $q_gui->outAdditionalOutput();
 
  377                                 $q_gui->object->setObjId($this->object->getId());
 
  378                                 $question = $q_gui->object;
 
  379                                 $this->ctrl->saveParameter($this, 
"q_id");
 
  381                                 #$this->lng->loadLanguageModule("content"); 
  382                                 $this->ctrl->setReturnByClass(
"ilTestExpressPageObjectGUI", 
"view");
 
  383                                 $this->ctrl->setReturn($this, 
"questions");
 
  385                                 require_once 
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php";
 
  386                                 require_once 
"./Modules/Test/classes/class.ilTestExpressPageObjectGUI.php";
 
  390                                 $page_gui->setEditPreview(
true);
 
  391                                 $page_gui->setEnabledTabs(
false);
 
  392                                 if(strlen($this->ctrl->getCmd()) == 0)
 
  394                                         $this->ctrl->setCmdClass(get_class($page_gui));
 
  395                                         $this->ctrl->setCmd(
"preview");
 
  398                                 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
 
  399                                 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
 
  401                                 $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? 
"edit" : 
'preview');
 
  403                                 $page_gui->setHeader($question->getTitle());
 
  404                                 $page_gui->setFileDownloadLink($this->ctrl->getLinkTarget($this, 
"downloadFile"));
 
  405                                 $page_gui->setFullscreenLink($this->ctrl->getLinkTarget($this, 
"fullscreen"));
 
  406                                 $page_gui->setSourcecodeDownloadScript($this->ctrl->getLinkTarget($this));
 
  407                                 $page_gui->setPresentationTitle($question->getTitle() . 
' ['. $this->lng->txt(
'question_id_short') . 
': ' . $question->getId()  . 
']');
 
  408                                 $ret =& $this->ctrl->forwardCommand($page_gui);
 
  411                                 $ilTabs->activateTab(
'assQuestions');
 
  413                                 $this->tpl->setContent(
$ret);
 
  416                         case 'ilassquestionpagegui':
 
  417                                 require_once 
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
 
  421                                         $this->ctrl->setParameter($this, 
'prev_qid', 
$_REQUEST[
'prev_qid']);
 
  427                                 $_GET[
'calling_test'] = $this->
object->getRefId();
 
  428                                 include_once(
"./Services/Style/classes/class.ilObjStyleSheet.php");
 
  429                                 $this->tpl->setCurrentBlock(
"ContentStyle");
 
  430                                 $this->tpl->setVariable(
"LOCATION_CONTENT_STYLESHEET",
 
  432                                 $this->tpl->parseCurrentBlock();
 
  435                                 $this->tpl->setCurrentBlock(
"SyntaxStyle");
 
  436                                 $this->tpl->setVariable(
"LOCATION_SYNTAX_STYLESHEET",
 
  438                                 $this->tpl->parseCurrentBlock();
 
  439                                 require_once 
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
 
  441                                 $q_gui->setQuestionTabs();
 
  442                                 $q_gui->outAdditionalOutput();
 
  443                                 $q_gui->object->setObjId($this->object->getId());
 
  444                                 $question =& $q_gui->object;
 
  445                                 $this->ctrl->saveParameter($this, 
"q_id");
 
  446                                 $this->lng->loadLanguageModule(
"content");
 
  447                                 $this->ctrl->setReturnByClass(
"ilAssQuestionPageGUI", 
"view");
 
  448                                 $this->ctrl->setReturn($this, 
"questions");
 
  450                                 $page_gui->setEditPreview(
true);
 
  451                                 if(strlen($this->ctrl->getCmd()) == 0)
 
  453                                         $this->ctrl->setCmdClass(get_class($page_gui));
 
  454                                         $this->ctrl->setCmd(
"preview");
 
  456                                 $page_gui->setQuestionHTML(array($q_gui->object->getId() => $q_gui->getPreview(TRUE)));
 
  457                                 $page_gui->setTemplateTargetVar(
"ADM_CONTENT");
 
  458                                 $page_gui->setOutputMode($this->object->evalTotalPersons() == 0 ? 
"edit" : 
'preview');
 
  459                                 $page_gui->setHeader($question->getTitle());
 
  460                                 $page_gui->setPresentationTitle($question->getTitle() . 
' ['. $this->lng->txt(
'question_id_short') . 
': ' . $question->getId()  . 
']');
 
  461                                 $ret =& $this->ctrl->forwardCommand($page_gui);
 
  462                                 $this->tpl->setContent(
$ret);
 
  465                         case 'ilassspecfeedbackpagegui':
 
  466                                 require_once 
"./Modules/TestQuestionPool/classes/feedback/class.ilAssSpecFeedbackPageGUI.php";
 
  468                                 $this->ctrl->forwardCommand($pg_gui);
 
  471                         case 'ilassgenfeedbackpagegui':
 
  472                                 require_once 
"./Modules/TestQuestionPool/classes/feedback/class.ilAssGenFeedbackPageGUI.php";
 
  474                                 $this->ctrl->forwardCommand($pg_gui);
 
  477                         case 'illocalunitconfigurationgui':
 
  481                                 $this->ctrl->setReturn($this, 
"questions");
 
  484                                 require_once 
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
 
  486                                 $questionGUI->object->setObjId($this->object->getId());
 
  487                                 $questionGUI->setQuestionTabs();
 
  489                                 require_once 
'Modules/TestQuestionPool/classes/class.ilLocalUnitConfigurationGUI.php';
 
  490                                 require_once 
'Modules/TestQuestionPool/classes/class.ilUnitConfigurationRepository.php';
 
  494                                 $this->ctrl->forwardCommand($gui);
 
  497                         case "ilcommonactiondispatchergui":
 
  498                                 require_once 
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php";
 
  500                                 $this->ctrl->forwardCommand($gui);
 
  503                         case 'ilassquestionhintsgui':
 
  508                                 $this->ctrl->setReturn($this, 
"questions");
 
  511                                 require_once 
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
 
  513                                 $questionGUI->object->setObjId($this->object->getId());
 
  514                                 $questionGUI->setQuestionTabs();
 
  517                                 require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintsGUI.php';
 
  519                                 $ilCtrl->forwardCommand($gui);
 
  523                         case 'ilassquestionfeedbackeditinggui':
 
  528                                 $this->ctrl->setReturn($this, 
"questions");
 
  531                                 require_once 
'Modules/TestQuestionPool/classes/class.assQuestionGUI.php';
 
  533                                 $questionGUI->object->setObjId($this->object->getId());
 
  534                                 $questionGUI->setQuestionTabs();
 
  537                                 require_once 
'Modules/TestQuestionPool/classes/class.ilAssQuestionFeedbackEditingGUI.php';
 
  539                                 $ilCtrl->forwardCommand($gui);
 
  543                         case 'iltesttoplistgui':
 
  545                                 require_once 
'./Modules/Test/classes/class.ilTestToplistGUI.php';
 
  547                                 $this->ctrl->forwardCommand($gui);
 
  550                         case 'ilscoringadjustmentgui':
 
  552                                 require_once 
'./Modules/Test/classes/class.ilScoringAdjustmentGUI.php';
 
  554                                 $this->ctrl->forwardCommand($gui);
 
  561                                 if((strcmp(
$cmd, 
"properties") == 0) && ($_GET[
"browse"]))
 
  566                                 if((strcmp(
$cmd, 
"properties") == 0) && ($_GET[
"up"] || $_GET[
"down"]))
 
  578                                         global $___prev_question_id;
 
  579                                         $___prev_question_id = 
$_REQUEST[
'prev_qid'];
 
  580                                         $this->ctrl->setParameterByClass(
'ilassquestionpagegui', 
'prev_qid', 
$_REQUEST[
'prev_qid']);
 
  581                                         $this->ctrl->setParameterByClass($_GET[
'sel_question_types'] . 
'gui', 
'prev_qid', 
$_REQUEST[
'prev_qid']);
 
  583                                 $this->create_question_mode = 
true;
 
  586                                 $this->ctrl->setReturn($this, 
"questions");
 
  587                                 require_once 
"./Modules/TestQuestionPool/classes/class.assQuestionGUI.php";
 
  589                                 $q_gui->object->setObjId($this->object->getId());
 
  590                                 if(!$_GET[
'sel_question_types'])
 
  594                                         $qType = $_GET[
'sel_question_types'];
 
  596                                 $this->ctrl->setParameterByClass($qType . 
"GUI", 
'prev_qid', 
$_REQUEST[
'prev_qid']);
 
  597                                 $this->ctrl->setParameterByClass($qType . 
"GUI", 
'test_ref_id', 
$_REQUEST[
'ref_id']);
 
  598                                 $this->ctrl->setParameterByClass($qType . 
"GUI", 
'q_id', 
$_REQUEST[
'q_id']);
 
  600                                         $this->ctrl->setParameterByClass($qType . 
"GUI", 
'test_express_mode', 1);
 
  602                                 #global $___test_express_mode; 
  603                                 #$___test_express_mode = true; 
  604                                 if(!$q_gui->isSaveCommand())
 
  605                                         $_GET[
'calling_test'] = $this->object->getRefId();
 
  607                                 $q_gui->setQuestionTabs();
 
  608                                 #unset($___test_express_mode); 
  609                                 $ret =& $this->ctrl->forwardCommand($q_gui);
 
  612                 if ( !in_array(strtolower(
$_GET[
"baseClass"]), array(
'iladministrationgui', 
'ilrepositorygui')) &&
 
  621                 switch( $this->object->getQuestionSetType() )
 
  624                                 $this->ctrl->redirectByClass(
'ilTestExpressPageObjectGUI', 
'showPage');
 
  627                                 $this->ctrl->redirectByClass(
'ilTestRandomQuestionSetConfigGUI');
 
  630                                 $this->ctrl->redirectByClass(
'ilObjTestDynamicQuestionSetConfigGUI');
 
  642         public function createUserResults($show_pass_details, $show_answers, $show_reached_points, $show_user_results)
 
  644                 $template = 
new ilTemplate(
"tpl.il_as_tst_participants_result_output.html", TRUE, TRUE, 
"Modules/Test");
 
  645                 include_once 
"./Modules/Test/classes/class.ilTestServiceGUI.php";
 
  648                 foreach ($show_user_results as $key => $active_id)
 
  652                         if ($this->object->getFixedParticipants())
 
  654                                 $active_id = $this->
object->getActiveIdOfUser( $active_id );
 
  658                                 $results = $serviceGUI->getResultsOfUserOutput(
 
  659                                         $this->testSessionFactory->getSession( $active_id ),
 
  661                                         $this->
object->_getResultPass( $active_id ),
 
  668                         if ($count < count( $show_user_results ))
 
  670                                 $template->touchBlock( 
"break" );
 
  672                         $template->setCurrentBlock( 
"user_result" );
 
  673                         $template->setVariable( 
"USER_RESULT", 
$results );
 
  674                         $template->parseCurrentBlock();
 
  676                 $template->setVariable( 
"BACK_TEXT", $this->lng->txt( 
"back" ) );
 
  677                 $template->setVariable( 
"BACK_URL", $this->ctrl->getLinkTargetByClass( 
"ilobjtestgui", 
"participants" ) );
 
  678                 $template->setVariable( 
"PRINT_TEXT", $this->lng->txt( 
"print" ) );
 
  679                 $template->setVariable( 
"PRINT_URL", 
"javascript:window.print();" );
 
  685                 require_once 
'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
 
  701                 $this->tpl->getStandardTemplate();
 
  713                 require_once 
'Services/WebDAV/classes/class.ilDAVServer.php';
 
  723                 $this->ctrl->redirect($this, 
"infoScreen");
 
  728                 $this->ctrl->redirectByClass(
"iltestevaluationgui", 
"outEvaluation");
 
  737                 if($form->checkInput())
 
  739                         $this->ctrl->setParameter($this, 
"new_type", $this->type);
 
  744                 $form->setValuesByPost();
 
  745                 $this->tpl->setContent($form->getHTML());
 
  750                 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
  752                 $defaults = $tst->getAvailableDefaults();
 
  753                 if (count($defaults))
 
  755                         foreach ($defaults as 
$row)
 
  757                                 $a_options[
"tstdef_".$row[
"test_defaults_id"]] = array($row[
"name"],
 
  758                                         $this->lng->txt(
"tst_default_settings"));
 
  763                 include_once 
"Services/Administration/classes/class.ilSettingsTemplate.php";
 
  767                         foreach($templates as $item)
 
  769                                 $a_options[
"tsttpl_".$item[
"id"]] = array($item[
"title"],
 
  770                                         nl2br(trim($item[
"description"])));
 
  784                         $testDefaultsId = $tstdef;
 
  786                         $a_new_object->applyDefaults($testDefaults);
 
  792                         include_once 
"Services/Administration/classes/class.ilSettingsTemplate.php";
 
  795                         $template_settings = $template->getSettings();
 
  796                         if($template_settings)
 
  801                         $a_new_object->setTemplate($template_id);
 
  804                 $a_new_object->saveToDb();
 
  808                 $this->ctrl->setParameter($this, 
'ref_id', $a_new_object->
getRefId());
 
  809                 $this->ctrl->redirectByClass(
'ilObjTestSettingsGeneralGUI');
 
  814                 include_once 
"./Services/Utilities/classes/class.ilUtil.php";
 
  815                 $path = $this->tree->getPathFull($this->object->getRefID());
 
  824                 if ($_FILES[
"xmldoc"][
"error"] > UPLOAD_ERR_OK)
 
  830                 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
  835                 $file = pathinfo($_FILES[
"xmldoc"][
"name"]);
 
  836                 $full_path = $basedir.
"/".$_FILES[
"xmldoc"][
"name"];
 
  843                 $subdir = basename(
$file[
"basename"],
".".
$file[
"extension"]);
 
  849                 if(!is_file($qti_file))
 
  858                 include_once 
"./Services/QTI/classes/class.ilQTIParser.php";
 
  860                 $result = $qtiParser->startParsing();
 
  861                 $founditems =& $qtiParser->getFoundItems();
 
  863                 if (count($founditems) == 0)
 
  877                 foreach ($founditems as $item)
 
  879                         if (strlen($item[
"type"]))
 
  899                 $_SESSION[
"tst_import_results_file"] = $results_file;
 
  900                 $_SESSION[
"tst_import_xml_file"] = $xml_file;
 
  901                 $_SESSION[
"tst_import_qti_file"] = $qti_file;
 
  902                 $_SESSION[
"tst_import_subdir"] = $subdir;
 
  904                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.tst_import_verification.html", 
"Modules/Test");
 
  905                 $row_class = array(
"tblrow1", 
"tblrow2");
 
  907                 foreach ($founditems as $item)
 
  909                         $this->tpl->setCurrentBlock(
"verification_row");
 
  910                         $this->tpl->setVariable(
"ROW_CLASS", $row_class[$counter++ % 2]);
 
  911                         $this->tpl->setVariable(
"QUESTION_TITLE", $item[
"title"]);
 
  912                         $this->tpl->setVariable(
"QUESTION_IDENT", $item[
"ident"]);
 
  913                         include_once 
"./Services/QTI/classes/class.ilQTIItem.php";
 
  914                         switch ($item[
"type"])
 
  916                                 case "MULTIPLE CHOICE QUESTION":
 
  918                                         $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"qt_multiple_choice"));
 
  920                                 case "SINGLE CHOICE QUESTION":
 
  922                                         $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assSingleChoice"));
 
  924                                 case "NUMERIC QUESTION":
 
  926                                         $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assNumeric"));
 
  928                                 case "TEXTSUBSET QUESTION":
 
  930                                         $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextSubset"));
 
  932                                 case "CLOZE QUESTION":
 
  934                                         $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assClozeTest"));
 
  936                                 case "IMAGE MAP QUESTION":
 
  938                                         $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assImagemapQuestion"));
 
  940                                 case "JAVA APPLET QUESTION":
 
  942                                         $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assJavaApplet"));
 
  944                                 case "MATCHING QUESTION":
 
  946                                         $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assMatchingQuestion"));
 
  948                                 case "ORDERING QUESTION":
 
  950                                         $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assOrderingQuestion"));
 
  952                                 case "TEXT QUESTION":
 
  954                                         $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"assTextQuestion"));
 
  957                         $this->tpl->parseCurrentBlock();
 
  964                 $this->tpl->setCurrentBlock(
"adm_content");
 
  965                 $this->tpl->setVariable(
"TEXT_TYPE", $this->lng->txt(
"question_type"));
 
  966                 $this->tpl->setVariable(
"TEXT_TITLE", $this->lng->txt(
"question_title"));
 
  967                 $this->tpl->setVariable(
"FOUND_QUESTIONS_INTRODUCTION", $this->lng->txt(
"tst_import_verify_found_questions"));
 
  968                 $this->tpl->setVariable(
"VERIFICATION_HEADING", $this->lng->txt(
"import_tst"));
 
  969                 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
 
  971                 $this->tpl->setVariable(
"QUESTIONPOOL_ID", $QplOrTstID);
 
  972                 $this->tpl->setVariable(
"VALUE_IMPORT", $this->lng->txt(
"import"));
 
  973                 $this->tpl->setVariable(
"VALUE_CANCEL", $this->lng->txt(
"cancel"));
 
  974                 $this->tpl->parseCurrentBlock();
 
  982                 include_once 
"./Modules/Test/classes/class.ilObjTest.php";
 
  986                 $newObj->setType(
$_GET[
"new_type"]);
 
  988                 $newObj->setTitle(
"dummy");
 
  990                 $newObj->setDescription(
"test import");
 
  992                 $newObj->create(
true);
 
  994                 $newObj->createReference();
 
  996                 $newObj->putInTree(
$_GET[
"ref_id"]);
 
  998                 $newObj->setPermissions(
$_GET[
"ref_id"]);
 
 1000                 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
 
 1002                 $newObj->mark_schema->flush();
 
 1005                 include_once 
"./Services/QTI/classes/class.ilQTIParser.php";
 
 1009                 if (
$_POST[
"qpl_id"] == 
"-1")
 
 1011                         $qpl_id = $newObj->id;
 
 1015                         $qpl_id = 
$_POST[
"qpl_id"];
 
 1019                 $qtiParser->setTestObject($newObj);
 
 1020                 $result = $qtiParser->startParsing();
 
 1021                 $newObj->saveToDb();
 
 1024                 include_once (
"./Modules/LearningModule/classes/class.ilContObjParser.php");
 
 1026                 $contParser->setQuestionMapping($qtiParser->getImportMapping());
 
 1027                 $contParser->startParsing();
 
 1030                 if (@file_exists(
$_SESSION[
"tst_import_results_file"]))
 
 1032                         include_once (
"./Modules/Test/classes/class.ilTestResultsImportParser.php");
 
 1041                 $newObj->updateMetaData();
 
 1044                                 "&baseClass=ilObjTestGUI");
 
 1060                 $this->lng->txt(
'tst_trigger_result_refreshing');
 
 1062                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.il_as_tst_properties_save_confirmation.html", 
"Modules/Test");
 
 1063                 $information = $this->lng->txt(
'tst_trigger_result_refreshing');
 
 1065                 foreach (
$_POST as $key => $value)
 
 1067                         if (strcmp($key, 
"cmd") == 0)
 
 1074                 $this->tpl->setCurrentBlock(
"hidden_variable");
 
 1075                 $this->tpl->setVariable(
"HIDDEN_KEY", 
"tst_properties_confirmation");
 
 1076                 $this->tpl->setVariable(
"HIDDEN_VALUE", 
"1");
 
 1077                 $this->tpl->parseCurrentBlock();
 
 1078                 $this->tpl->setCurrentBlock(
"adm_content");
 
 1079                 $this->tpl->setVariable(
"TXT_CONFIRMATION", $this->lng->txt(
"confirmation"));
 
 1080                 $this->tpl->setVariable(
"TXT_INFORMATION", $information);
 
 1081                 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
 
 1082                 $this->tpl->setVariable(
"CMD_CONFIRM", $confirmCmd);
 
 1083                 $this->tpl->setVariable(
"BTN_CONFIRM", $this->lng->txt(
"confirm"));
 
 1084                 $this->tpl->setVariable(
"CMD_CANCEL", $cancelCmd);
 
 1085                 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
 
 1095                 if (is_array( $value ))
 
 1097                         foreach ($value as $k => $v)
 
 1105                                         $this->tpl->setCurrentBlock( 
"hidden_variable" );
 
 1106                                         $this->tpl->setVariable( 
"HIDDEN_KEY", $key . 
$path . 
"[" . $k . 
"]" );
 
 1107                                         $this->tpl->setVariable( 
"HIDDEN_VALUE", $v );
 
 1108                                         $this->tpl->parseCurrentBlock();
 
 1114                         $this->tpl->setCurrentBlock( 
"hidden_variable" );
 
 1115                         $this->tpl->setVariable( 
"HIDDEN_KEY", $key );
 
 1116                         $this->tpl->setVariable( 
"HIDDEN_VALUE", $value );
 
 1117                         $this->tpl->parseCurrentBlock();
 
 1128                 if(isset(
$_POST[
'reporting_ts']))
 
 1130                         $_POST[
'reporting_date'][
'date'][
'y'] = date(
'Y', 
$_POST[
'reporting_ts'] );
 
 1131                         $_POST[
'reporting_date'][
'date'][
'm'] = date(
'm', 
$_POST[
'reporting_ts'] );
 
 1132                         $_POST[
'reporting_date'][
'date'][
'd'] = date(
'd', 
$_POST[
'reporting_ts'] );
 
 1133                         $_POST[
'reporting_date'][
'time'][
'h'] = date(
'H', 
$_POST[
'reporting_ts'] );
 
 1134                         $_POST[
'reporting_date'][
'time'][
'm'] = date(
'i', 
$_POST[
'reporting_ts'] );
 
 1140                         $total = $this->
object->evalTotalPersons();
 
 1142                         $this->
object->setCountSystem(
$_POST[
"count_system"]);
 
 1143                         $this->
object->setMCScoring(
$_POST[
"mc_scoring"]);
 
 1144                         $this->
object->setScoreCutting(
$_POST[
"score_cutting"]);
 
 1145                         $this->
object->setPassScoring(
$_POST[
"pass_scoring"]);
 
 1147                         if(!isset(
$_POST[
'disabled_field']))
 
 1149                                 if( isset(
$_POST[
'obligations_enabled']) && 
$_POST[
'obligations_enabled'] )
 
 1151                                         $this->
object->setObligationsEnabled(
true);
 
 1155                                         $this->
object->setObligationsEnabled(
false);
 
 1158                                 if( isset(
$_POST[
'offer_hints']) && 
$_POST[
'offer_hints'] )
 
 1160                                         $this->
object->setOfferingQuestionHintsEnabled(
true);
 
 1164                                         $this->
object->setOfferingQuestionHintsEnabled(
false);
 
 1177             $this->
object->setScoringFeedbackOptionsByArray(
$_POST[
'instant_feedback']);
 
 1180                         $this->
object->setScoreReporting(
$_POST[
"results_access"]);
 
 1184                                 $this->
object->setReportingDate(str_replace(array(
':', 
'-'), 
'', 
$_POST[
"reporting_date"][
'date'].
$_POST[
"reporting_date"][
'time']));
 
 1189                                 $this->
object->setReportingDate(
'');
 
 1192                         $this->
object->setShowPassDetails((is_array(
$_POST[
'results_presentation']) && in_array(
'pass_details', 
$_POST[
'results_presentation'])) ? 1 : 0);
 
 1193                         $this->
object->setShowSolutionDetails((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_details', 
$_POST[
'results_presentation'])) ? 1 : 0);
 
 1194                         $this->
object->setShowSolutionPrintview((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_printview', 
$_POST[
'results_presentation'])) ? 1 : 0);
 
 1195                         $this->
object->setShowSolutionFeedback((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_feedback', 
$_POST[
'results_presentation'])) ? 1 : 0);
 
 1196                         $this->
object->setShowSolutionAnswersOnly((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_answers_only', 
$_POST[
'results_presentation'])) ? 1 : 0);
 
 1197                         $this->
object->setShowSolutionSignature((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_signature', 
$_POST[
'results_presentation'])) ? 1 : 0);
 
 1198                         $this->
object->setShowSolutionSuggested((is_array(
$_POST[
'results_presentation']) && in_array(
'solution_suggested', 
$_POST[
'results_presentation'])) ? 1 : 0);
 
 1199                         $this->
object->setShowSolutionListComparison(isset(
$_POST[
'solution_compare']) && 
$_POST[
'solution_compare']);
 
 1200                         $this->
object->setExportSettingsSingleChoiceShort((is_array(
$_POST[
'export_settings']) && in_array(
'exp_sc_short', 
$_POST[
'export_settings'])) ? 1 : 0);
 
 1202                         $this->
object->setShowExamIdInTestResultsEnabled(isset(
$_POST[
'examid_in_test_res']) && 
$_POST[
'examid_in_test_res']);
 
 1204                         $this->
object->setPrintBestSolutionWithResult((
int) 
$_POST[
'print_bs_with_res'] ? 
true : 
false);
 
 1206                         $this->
object->setPassDeletionAllowed((
bool)$_POST[
'pass_deletion_allowed']);
 
 1208                         $this->
object->saveToDb(
true);
 
 1213                                 $this->
object->recalculateScores(
true);
 
 1216                         $this->ctrl->redirect($this, 
"scoring");
 
 1228                 if (!$ilAccess->checkAccess(
"write", 
"", $this->ref_id)) 
 
 1232                         $this->ctrl->redirect($this, 
"infoScreen");
 
 1237                 $template_settings = null;
 
 1238                 $template = $this->
object->getTemplate();
 
 1242                         include_once 
"Services/Administration/classes/class.ilSettingsTemplate.php";
 
 1243                         include_once 
"Modules/Test/classes/class.ilObjAssessmentFolderGUI.php";
 
 1247                         $template_settings = $template->getSettings();
 
 1250                 $save = (strcmp($this->ctrl->getCmd(), 
"saveScoring") == 0) ? TRUE : FALSE;
 
 1251                 $total = $this->
object->evalTotalPersons();
 
 1252                 $this->tpl->addJavascript(
"./Services/JavaScript/js/Basic.js");
 
 1255                 $setting_available = 
true; 
 
 1259                         $setting_available = 
false; 
 
 1261                 if ($this->object->getScoreReporting() == 4)
 
 1263                         $setting_available = 
true; 
 
 1265                 if ($this->object->getScoreReporting() == 3 && $this->
object->getReportingDate() > time())
 
 1267                         $setting_available = 
true;
 
 1270                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 1272                 $form->setFormAction($this->ctrl->getFormAction($this));
 
 1273                 $form->setTableWidth(
"100%");
 
 1274                 $form->setId(
"test_properties_scoring");
 
 1278                 $header->setTitle($this->lng->txt(
"test_scoring"));
 
 1279                 $form->addItem($header);
 
 1282                 $count_system = 
new ilRadioGroupInputGUI($this->lng->txt(
"tst_text_count_system"), 
"count_system");
 
 1284                 $count_system->addOption(
new ilRadioOption($this->lng->txt(
"tst_count_correct_solutions"), 1, 
''));
 
 1285                 $count_system->setValue($this->object->getCountSystem());
 
 1286                 $count_system->setInfo($this->lng->txt(
"tst_count_system_description"));
 
 1287                 $count_system->setDisabled(!$setting_available);
 
 1288                 $form->addItem($count_system);
 
 1291                 $mc_scoring = 
new ilRadioGroupInputGUI($this->lng->txt(
"tst_score_mcmr_questions"), 
"mc_scoring");
 
 1292                 $mc_scoring->
addOption(
new ilRadioOption($this->lng->txt(
"tst_score_mcmr_zero_points_when_unanswered"), 0, 
''));
 
 1293                 $mc_scoring->addOption(
new ilRadioOption($this->lng->txt(
"tst_score_mcmr_use_scoring_system"), 1, 
''));
 
 1294                 $mc_scoring->setValue($this->object->getMCScoring());
 
 1295                 $mc_scoring->setInfo($this->lng->txt(
"tst_score_mcmr_questions_description"));
 
 1296                 $mc_scoring->setDisabled(!$setting_available);
 
 1297                 $form->addItem($mc_scoring);
 
 1300                 $score_cutting = 
new ilRadioGroupInputGUI($this->lng->txt(
"tst_score_cutting"), 
"score_cutting");
 
 1302                 $score_cutting->addOption(
new ilRadioOption($this->lng->txt(
"tst_score_cut_test"), 1, 
''));
 
 1303                 $score_cutting->setValue($this->object->getScoreCutting());
 
 1304                 $score_cutting->setInfo($this->lng->txt(
"tst_score_cutting_description"));
 
 1305                 $score_cutting->setDisabled(!$setting_available);
 
 1306                 $form->addItem($score_cutting);
 
 1311                 $pass_scoring->addOption(
new ilRadioOption($this->lng->txt(
"tst_pass_best_pass"), 1, 
''));
 
 1312                 $pass_scoring->setValue($this->object->getPassScoring());
 
 1313                 $pass_scoring->setInfo($this->lng->txt(
"tst_pass_scoring_description"));
 
 1314                 $pass_scoring->setDisabled(!$setting_available);
 
 1315                 $form->addItem($pass_scoring);
 
 1319                 $header_tp->setTitle($this->lng->txt(
"test_presentation"));
 
 1320                 $form->addItem($header_tp);
 
 1323                 $checkBoxEnableObligations = 
new ilCheckboxInputGUI($this->lng->txt(
"tst_setting_enable_obligations_label"), 
"obligations_enabled");
 
 1324                 $checkBoxEnableObligations->
setChecked($this->object->areObligationsEnabled());
 
 1325                 $checkBoxEnableObligations->setInfo($this->lng->txt(
"tst_setting_enable_obligations_info"));
 
 1328                         $checkBoxEnableObligations->setDisabled(
true);
 
 1329                         $checkBoxEnableObligations->setPostVar(
"disabled_field");
 
 1331                 $form->addItem($checkBoxEnableObligations);
 
 1335                 $checkBoxOfferHints = 
new ilCheckboxInputGUI($this->lng->txt(
"tst_setting_offer_hints_label"), 
"offer_hints");
 
 1336                 $checkBoxOfferHints->
setChecked($this->object->isOfferingQuestionHintsEnabled());
 
 1337                 $checkBoxOfferHints->setInfo($this->lng->txt(
"tst_setting_offer_hints_info"));
 
 1340                         $checkBoxOfferHints->setDisabled(
true);
 
 1341                         $checkBoxOfferHints->setPostVar(
"disabled_field");
 
 1343                 $form->addItem($checkBoxOfferHints);
 
 1347                 $instant_feedback->
addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_answer_specific"), 
'instant_feedback_specific', 
''));
 
 1348                 $instant_feedback->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_answer_generic"), 
'instant_feedback_generic', 
''));
 
 1349                 $instant_feedback->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_results"), 
'instant_feedback_points', 
''));
 
 1350                 $instant_feedback->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_instant_feedback_solution"), 
'instant_feedback_solution', 
''));
 
 1352                 if ($this->object->getSpecificAnswerFeedback()) array_push($values, 
'instant_feedback_specific');
 
 1353                 if ($this->object->getGenericAnswerFeedback()) array_push($values, 
'instant_feedback_generic');
 
 1354                 if ($this->object->getAnswerFeedbackPoints()) array_push($values, 
'instant_feedback_points');
 
 1355                 if ($this->object->getInstantFeedbackSolution()) array_push($values, 
'instant_feedback_solution');
 
 1356                 $instant_feedback->setValue($values);
 
 1357                 $instant_feedback->setInfo($this->lng->txt(
"tst_instant_feedback_description"));
 
 1358                 $form->addItem($instant_feedback);
 
 1362                 $header_tr->setTitle($this->lng->txt(
"test_results"));
 
 1363                 $form->addItem($header_tr);
 
 1366                 $results_access = 
new ilRadioGroupInputGUI($this->lng->txt(
"tst_results_access"), 
"results_access");
 
 1368                 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_finished"), 1, 
''));
 
 1369                 $results_access_date_limitation = 
new ilRadioOption($this->lng->txt(
"tst_results_access_date"), 3, 
'');
 
 1370                 $results_access->addOption($results_access_date_limitation);            
 
 1371                 $results_access->addOption(
new ilRadioOption($this->lng->txt(
"tst_results_access_never"), 4, 
''));
 
 1372                 $results_access->
setValue($this->object->getScoreReporting());
 
 1373                 $results_access->setInfo($this->lng->txt(
"tst_results_access_description"));
 
 1377                 $reporting_date->setShowDate(
true);
 
 1378                 $reporting_date->setShowTime(
true);
 
 1379                 if (strlen($this->object->getReportingDate()))
 
 1387                 $results_access_date_limitation->addSubItem($reporting_date);
 
 1388                 $form->addItem($results_access);
 
 1390                 $results_print_best_solution = 
new ilCheckboxInputGUI($this->lng->txt(
"tst_results_print_best_solution"), 
"print_bs_with_res");
 
 1391                 $results_print_best_solution->
setInfo($this->lng->txt(
'tst_results_print_best_solution_info'));
 
 1392                 $results_print_best_solution->setValue(1);
 
 1393                 $results_print_best_solution->setChecked((
bool) $this->object->isBestSolutionPrintedWithResult());
 
 1394                 $form->addItem($results_print_best_solution);
 
 1397                 $results_presentation = 
new ilCheckboxGroupInputGUI($this->lng->txt(
"tst_results_presentation"), 
"results_presentation");
 
 1398                 $results_presentation->
addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_pass_details"), 
'pass_details', $this->lng->txt(
"tst_show_pass_details_desc")));
 
 1399                 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_details"), 
'solution_details', $this->lng->txt(
"tst_show_solution_details_desc")));
 
 1400                 $results_presentation->addOption($showSolutionPrintViewOption = 
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_printview"), 
'solution_printview', $this->lng->txt(
"tst_show_solution_printview_desc")));
 
 1401                 $solutionCompareInput = 
new ilCheckboxInputGUI($this->lng->txt(
'tst_show_solution_compare'), 
'solution_compare');
 
 1402                 $solutionCompareInput->
setChecked($this->object->getShowSolutionListComparison());
 
 1403                 $showSolutionPrintViewOption->addSubItem($solutionCompareInput);
 
 1404                 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_feedback"), 
'solution_feedback', $this->lng->txt(
"tst_show_solution_feedback_desc")));
 
 1405                 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_answers_only"), 
'solution_answers_only', $this->lng->txt(
"tst_show_solution_answers_only_desc")));
 
 1406                 $signatureOption = 
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_signature"), 
'solution_signature', $this->lng->txt(
"tst_show_solution_signature_desc"));
 
 1407                 $results_presentation->addOption($signatureOption);
 
 1408                 $results_presentation->addOption(
new ilCheckboxOption($this->lng->txt(
"tst_show_solution_suggested"), 
'solution_suggested', $this->lng->txt(
"tst_show_solution_suggested_desc")));
 
 1410                 if ($this->object->getShowPassDetails()) array_push($values, 
'pass_details');
 
 1411                 if ($this->object->getShowSolutionDetails()) array_push($values, 
'solution_details');
 
 1412                 if ($this->object->getShowSolutionPrintview()) array_push($values, 
'solution_printview');
 
 1413                 if ($this->object->getShowSolutionFeedback()) array_push($values, 
'solution_feedback');
 
 1414                 if ($this->object->getShowSolutionAnswersOnly()) array_push($values, 
'solution_answers_only');
 
 1415                 if ($this->object->getShowSolutionSignature()) array_push($values, 
'solution_signature');
 
 1416                 if ($this->object->getShowSolutionSuggested()) array_push($values, 
'solution_suggested');
 
 1417                 if ($this->object->getShowSolutionListComparison()) array_push($values, 
'solution_compare');
 
 1418                 $results_presentation->setValue($values);
 
 1419                 if ($this->object->getAnonymity())
 
 1421                         $signatureOption->setDisabled(
true);
 
 1423                 $form->addItem($results_presentation);
 
 1426                 $showExamId = 
new ilCheckboxInputGUI($this->lng->txt(
'examid_in_test_res'), 
'examid_in_test_res');
 
 1427                 $showExamId->
setInfo($this->lng->txt(
'examid_in_test_res_desc'));
 
 1428                 $showExamId->setChecked($this->object->isShowExamIdInTestResultsEnabled());
 
 1429                 $form->addItem($showExamId);
 
 1433                 $header_misc->setTitle($this->lng->txt(
"misc"));
 
 1434                 $form->addItem($header_misc);
 
 1437                 $passDeletion = 
new ilRadioGroupInputGUI($this->lng->txt(
"tst_pass_deletion"), 
"pass_deletion_allowed");
 
 1439                 $passDeletion->addOption(
new ilRadioOption($this->lng->txt(
"tst_pass_deletion_allowed"), 1, 
''));
 
 1440                 $passDeletion->setValue($this->object->isPassDeletionAllowed());
 
 1441                 $form->addItem($passDeletion);
 
 1447                 if ($this->object->getExportSettingsSingleChoiceShort()) array_push($values, 
'exp_sc_short');
 
 1448                 $export_settings->setValue($values);
 
 1449                 $form->addItem($export_settings);
 
 1452                 if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"]) && 
$total == 0) $form->addCommandButton(
"saveScoring", $this->lng->txt(
"save"));
 
 1453                 if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"]) && 
$total != 0) $form->addCommandButton(
"confirmScoring", $this->lng->txt(
"save"));
 
 1456                 if($template_settings)
 
 1458                         foreach($template_settings as $id => $item)
 
 1462                                         $form->removeItemByPostVar($id);
 
 1471                         $errors = !$form->checkInput();
 
 1472                         $form->setValuesByPost();
 
 1473                         if (
$errors) $checkonly = 
false;
 
 1476                 if (!$checkonly) $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
 
 1486                 include_once(
"./Modules/File/classes/class.ilObjFile.php");
 
 1488                 $fileObj->sendFile();
 
 1497                 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php");
 
 1499                 $page_gui->showMediaFullscreen();
 
 1508                 include_once(
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPage.php");
 
 1510                 $pg_obj->send_paragraph (
$_GET[
"par_id"], 
$_GET[
"downloadtitle"]);
 
 1547                 $this->ctrl->redirect($this, 
"questions");
 
 1561                 $parent_ref = $tree->getParentId($this->object->getRefId());
 
 1562                 include_once 
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php";
 
 1564                 $qpl->setType(
"qpl");
 
 1565                 $qpl->setTitle($name);
 
 1566                 $qpl->setDescription($description);
 
 1568                 $qpl->createReference();
 
 1569                 $qpl->putInTree($parent_ref);
 
 1570                 $qpl->setPermissions($parent_ref);
 
 1573                 return $qpl->getRefId();
 
 1583                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.il_as_tst_random_select.html", 
"Modules/Test");
 
 1584                 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE);
 
 1585                 $this->tpl->setCurrentBlock(
"option");
 
 1586                 $this->tpl->setVariable(
"VALUE_OPTION", 
"0");
 
 1587                 $this->tpl->setVariable(
"TEXT_OPTION", $this->lng->txt(
"all_available_question_pools"));
 
 1588                 $this->tpl->parseCurrentBlock();
 
 1589                 foreach ($questionpools as $key => $value)
 
 1591                         $this->tpl->setCurrentBlock(
"option");
 
 1592                         $this->tpl->setVariable(
"VALUE_OPTION", $key);
 
 1593                         $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
 
 1594                         $this->tpl->parseCurrentBlock();
 
 1596                 $this->tpl->setCurrentBlock(
"hidden");
 
 1597                 $this->tpl->setVariable(
"HIDDEN_NAME", 
"sel_question_types");
 
 1598                 $this->tpl->setVariable(
"HIDDEN_VALUE", 
$_POST[
"sel_question_types"]);
 
 1599                 $this->tpl->parseCurrentBlock();
 
 1600                 $this->tpl->setCurrentBlock(
"adm_content");
 
 1601                 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
 
 1602                 $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_random_select_questionpool"));
 
 1603                 $this->tpl->setVariable(
"TXT_NR_OF_QUESTIONS", $this->lng->txt(
"tst_random_nr_of_questions"));
 
 1604                 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
 
 1605                 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
 
 1606                 $this->tpl->parseCurrentBlock();
 
 1618                 $this->ctrl->redirect($this, 
"questions");
 
 1631                 $question_array = $this->
object->randomSelectQuestions(
$_POST[
"nr_of_questions"], 
$_POST[
"sel_qpl"]);
 
 1632                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.il_as_tst_random_question_offer.html", 
"Modules/Test");
 
 1633                 $color_class = array(
"tblrow1", 
"tblrow2");
 
 1635                 $questionpools =& $this->
object->getAvailableQuestionpools(
true);
 
 1636                 include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
 1637                 foreach ($question_array as $question_id)
 
 1639                         $dataset = $this->
object->getQuestionDataset($question_id);
 
 1640                         $this->tpl->setCurrentBlock(
"QTab");
 
 1641                         $this->tpl->setVariable(
"COLOR_CLASS", $color_class[$counter % 2]);
 
 1642                         $this->tpl->setVariable(
"QUESTION_TITLE", $dataset->title);
 
 1643                         $this->tpl->setVariable(
"QUESTION_COMMENT", $dataset->description);
 
 1645                         $this->tpl->setVariable(
"QUESTION_AUTHOR", $dataset->author);
 
 1646                         $this->tpl->setVariable(
"QUESTION_POOL", $questionpools[$dataset->obj_fi][
"title"]);
 
 1647                         $this->tpl->parseCurrentBlock();
 
 1650                 if (count($question_array) == 0)
 
 1652                         $this->tpl->setCurrentBlock(
"Emptytable");
 
 1653                         $this->tpl->setVariable(
"TEXT_NO_QUESTIONS_AVAILABLE", $this->lng->txt(
"no_questions_available"));
 
 1654                         $this->tpl->parseCurrentBlock();
 
 1658                         $this->tpl->setCurrentBlock(
"Selectionbuttons");
 
 1659                         $this->tpl->setVariable(
"BTN_YES", $this->lng->txt(
"random_accept_sample"));
 
 1660                         $this->tpl->setVariable(
"BTN_NO", $this->lng->txt(
"random_another_sample"));
 
 1661                         $this->tpl->parseCurrentBlock();
 
 1663                 $chosen_questions = join($question_array, 
",");
 
 1664                 $this->tpl->setCurrentBlock(
"adm_content");
 
 1665                 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
 
 1666                 $this->tpl->setVariable(
"QUESTION_TITLE", $this->lng->txt(
"tst_question_title"));
 
 1667                 $this->tpl->setVariable(
"QUESTION_COMMENT", $this->lng->txt(
"description"));
 
 1668                 $this->tpl->setVariable(
"QUESTION_TYPE", $this->lng->txt(
"tst_question_type"));
 
 1669                 $this->tpl->setVariable(
"QUESTION_AUTHOR", $this->lng->txt(
"author"));
 
 1670                 $this->tpl->setVariable(
"QUESTION_POOL", $this->lng->txt(
"qpl"));
 
 1671                 $this->tpl->setVariable(
"VALUE_CHOSEN_QUESTIONS", $chosen_questions);
 
 1672                 $this->tpl->setVariable(
"VALUE_QUESTIONPOOL_SELECTION", 
$_POST[
"sel_qpl"]);
 
 1673                 $this->tpl->setVariable(
"VALUE_NR_OF_QUESTIONS", 
$_POST[
"nr_of_questions"]);
 
 1674                 $this->tpl->setVariable(
"TEXT_QUESTION_OFFER", $this->lng->txt(
"tst_question_offer"));
 
 1675                 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
 
 1676                 $this->tpl->parseCurrentBlock();
 
 1688                 $selected_array = split(
",", 
$_POST[
"chosen_questions"]);
 
 1689                 if (!count($selected_array))
 
 1695                         $total = $this->
object->evalTotalPersons();
 
 1705                         foreach ($selected_array as $key => $value) 
 
 1707                                 $this->
object->insertQuestion( $this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value );
 
 1709                         $this->
object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
 
 1711                         $this->ctrl->redirect($this, 
"questions");
 
 1736                         include_once 
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
 
 1739                 else if(isset(
$_REQUEST[
'sel_question_types']))
 
 1741                         $sel_question_types = 
$_REQUEST[
"sel_question_types"];
 
 1744                 if (!$qpl_mode || ($qpl_mode == 2 && strcmp(
$_REQUEST[
"txt_qpl"], 
"") == 0) || ($qpl_mode == 3 && strcmp($qpl_ref_id, 
"") == 0))
 
 1748                         $_REQUEST[
'sel_question_types'] = $sel_question_types;
 
 1755                         $_SESSION[
"test_id"] = $this->
object->getRefId();
 
 1756                         if ($qpl_mode == 2 && strcmp(
$_REQUEST[
"txt_qpl"], 
"") != 0)
 
 1761                         else if ($qpl_mode == 1)
 
 1763                             $qpl_ref_id = 
$_GET[
"ref_id"];
 
 1766                         include_once 
"./Modules/TestQuestionPool/classes/class.ilObjQuestionPoolGUI.php";
 
 1767                         $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;
 
 1771                             $baselink .= 
'&prev_qid=' . 
$_REQUEST[
'prev_qid'];
 
 1775                                 $baselink .= 
'&prev_qid=' . 
$_REQUEST[
'position'];
 
 1779                             $baselink .= 
'&test_express_mode=1';
 
 1782                         if( isset(
$_REQUEST[
'add_quest_cont_edit_mode']) )
 
 1785                                                 $baselink, 
"add_quest_cont_edit_mode={$_REQUEST['add_quest_cont_edit_mode']}", 
false 
 1789 #var_dump($_REQUEST['prev_qid']); 
 1805                 $this->ctrl->redirect($this, 
"questions");
 
 1820                 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE, 
"write");
 
 1822                 if ($this->object->getPoolUsage()) {
 
 1825                     include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
 1828                     $form->setFormAction($ilCtrl->getFormAction($this, 
"executeCreateQuestion"));
 
 1829                     $form->setTitle($lng->txt(
"ass_create_question"));
 
 1830                     include_once 
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
 
 1834                     $hidden->setValue(
$_REQUEST[
"sel_question_types"]);
 
 1835                     $form->addItem($hidden);
 
 1840                                 $ri = 
new ilRadioGroupInputGUI($lng->txt(
"tst_add_quest_cont_edit_mode"), 
"add_quest_cont_edit_mode");
 
 1843                                                 $lng->txt(
'tst_add_quest_cont_edit_mode_default'),
 
 1848                                                 $lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
 
 1854                                 $form->addItem($ri, 
true);
 
 1860                                 $form->addItem($hi, 
true);
 
 1866                     $no_pool = 
new ilRadioOption($this->lng->txt(
"assessment_no_pool"), 1);
 
 1867                     $usage->addOption($no_pool);
 
 1868                     $existing_pool = 
new ilRadioOption($this->lng->txt(
"assessment_existing_pool"), 3);
 
 1869                     $usage->addOption($existing_pool);
 
 1870                     $new_pool = 
new ilRadioOption($this->lng->txt(
"assessment_new_pool"), 2);
 
 1871                     $usage->addOption($new_pool);
 
 1872                     $form->addItem($usage);
 
 1877                     $pools_data = array();
 
 1878                     foreach($questionpools as $key => $p) {
 
 1879                         $pools_data[$key] = $p[
'title'];
 
 1881                     $pools = 
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"), 
"sel_qpl");
 
 1883                     $existing_pool->addSubItem($pools);
 
 1886                         $this->lng->loadLanguageModule(
'rbac');
 
 1887                     $name = 
new ilTextInputGUI($this->lng->txt(
"rbac_create_qpl"), 
"txt_qpl");
 
 1889                     $name->setMaxLength(50);
 
 1890                     $new_pool->addSubItem($name);
 
 1892                     $form->addCommandButton(
"executeCreateQuestion", $lng->txt(
"submit"));
 
 1893                     $form->addCommandButton(
"cancelCreateQuestion", $lng->txt(
"cancel"));
 
 1895                     return $this->tpl->setVariable(
'ADM_CONTENT', $form->getHTML());
 
 1901                     $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui', 
'sel_question_types', 
$_REQUEST[
"sel_question_types"]);
 
 1902                     $link = $ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui', 
'handleToolbarCommand',
'',
false,
false);
 
 1912                 $checked_questions = 
$_POST[
"q_id"];
 
 1914                 $questions = $this->
object->getQuestionTitlesAndIndexes();
 
 1916                 foreach((array)$checked_questions as $value)
 
 1918                         $this->
object->removeQuestion($value);
 
 1919                         $deleted[] = $value;
 
 1922                 $this->
object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
 
 1930                         $deleted_tmp = $deleted;
 
 1931                         $first       = array_shift($deleted_tmp);
 
 1932                         foreach((array)$questions as $key => $value)
 
 1934                                 if(!in_array($key, $deleted))
 
 1944                                 else if($key == $first)
 
 1951                                         $first = array_shift($deleted_tmp);
 
 1956                                 count($questions) == count($checked_questions) ||
 
 1960                                 $this->ctrl->setParameter($this, 
'q_id', 
'');
 
 1961                                 $this->ctrl->redirect($this, 
'showPage');
 
 1964                         $this->ctrl->setParameter($this, 
'q_id', $return_to);
 
 1965                         $this->ctrl->redirect($this, 
"showPage");
 
 1969                         $this->ctrl->setParameter($this, 
'q_id', 
'');
 
 1970                         $this->ctrl->redirect($this, 
'questions');
 
 1984                     $this->ctrl->setParameter($this, 
'q_id', 
$_REQUEST[
'q_id']);
 
 1985                     $this->ctrl->redirect($this, 
"showPage");
 
 1988                     $this->ctrl->redirect($this, 
"questions");
 
 2001                 $total = $this->
object->evalTotalPersons();
 
 2005                         $question = sprintf($this->lng->txt(
"tst_remove_questions_and_results"), 
$total);
 
 2009                         if (count($checked_questions) == 1)
 
 2011                                 $question = $this->lng->txt(
"tst_remove_question");
 
 2015                                 $question = $this->lng->txt(
"tst_remove_questions");
 
 2019                 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 2021                 $cgui->setHeaderText($question);
 
 2023                 $this->ctrl->saveParameter($this, 
'test_express_mode');
 
 2024                 $this->ctrl->saveParameter($this, 
'q_id');
 
 2026                 $cgui->setFormAction($this->ctrl->getFormAction($this));
 
 2027                 $cgui->setCancel($this->lng->txt(
"cancel"), 
"cancelRemoveQuestions");
 
 2028                 $cgui->setConfirm($this->lng->txt(
"confirm"), 
"confirmRemoveQuestions");
 
 2030                 include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
 2031                 $removablequestions =& $this->
object->getTestQuestions();                               
 
 2032                 if (count($removablequestions))
 
 2034                         foreach ($removablequestions as 
$data)
 
 2036                                 if (in_array($data[
"question_id"], $checked_questions))
 
 2039                                         $txt .= 
' ['. $this->lng->txt(
'question_id_short') . 
': ' . $data[
'question_id']  . 
']';
 
 2041                                         if($data[
"description"])
 
 2043                                                 $txt .= 
"<div class=\"small\">".$data[
"description"].
"</div>";
 
 2046                                         $cgui->addItem(
"q_id[]", $data[
"question_id"], $txt);
 
 2051                 $this->tpl->setContent($cgui->getHTML());               
 
 2065                 if (!is_array($checked_questions) && $checked_questions) {
 
 2066                     $checked_questions = array($checked_questions);
 
 2068                 if (count($checked_questions) > 0) 
 
 2073                 elseif (count($checked_questions) == 0) 
 
 2076                         $this->ctrl->redirect($this, 
"questions");
 
 2085                 $selected_questions = NULL;
 
 2086                 $selected_questions = 
$_POST[
'q_id'];
 
 2087                 if (is_array($selected_questions))
 
 2089                         $_SESSION[
'tst_qst_move_' . $this->
object->getTestId()] = 
$_POST[
'q_id'];
 
 2096                 $this->ctrl->redirect($this, 
'questions');
 
 2105                 $move_questions = 
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
 
 2107                 if (count(
$_POST[
'q_id']) == 0)
 
 2110                         $this->ctrl->redirect($this, 
'questions');
 
 2112                 if (count(
$_POST[
'q_id']) > 1)
 
 2115                         $this->ctrl->redirect($this, 
'questions');
 
 2118                 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()], 
$_POST[
'q_id'][0], $insert_mode);
 
 2120                 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
 
 2121                 $this->ctrl->redirect($this, 
"questions");
 
 2130                 $move_questions = 
$_SESSION[
'tst_qst_move_' . $this->
object->getTestId()];
 
 2131                 if (count(
$_POST[
'q_id']) == 0)
 
 2134                         $this->ctrl->redirect($this, 
'questions');
 
 2136                 if (count(
$_POST[
'q_id']) > 1)
 
 2139                         $this->ctrl->redirect($this, 
'questions');
 
 2142                 $this->
object->moveQuestions(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()], 
$_POST[
'q_id'][0], $insert_mode);
 
 2144                 unset(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]);
 
 2145                 $this->ctrl->redirect($this, 
"questions");
 
 2155                 $selected_array = (is_array(
$_POST[
'q_id'])) ? 
$_POST[
'q_id'] : array();
 
 2156                 if (!count($selected_array))
 
 2159                         $this->ctrl->redirect($this, 
"browseForQuestions");
 
 2163                         include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
 2164                         $manscoring = FALSE;
 
 2165                         foreach ($selected_array as $key => $value) 
 
 2167                                 $this->
object->insertQuestion( $this->testQuestionSetConfigFactory->getQuestionSetConfig(), $value );
 
 2173                         $this->
object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
 
 2182                         $this->ctrl->redirect($this, 
"questions");
 
 2189                 include_once 
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
 
 2191                 $table_gui->writeFilterToSession();
 
 2192                 $this->ctrl->redirect($this, 
"browseForQuestions");
 
 2197                 include_once 
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
 
 2199                 $table_gui->resetFilter();
 
 2200                 $this->ctrl->redirect($this, 
"browseForQuestions");
 
 2212                 $this->ctrl->setParameterByClass(get_class($this), 
"browse", 
"1");
 
 2214                 include_once 
"./Modules/Test/classes/tables/class.ilTestQuestionBrowserTableGUI.php";
 
 2215                 $table_gui = 
new ilTestQuestionBrowserTableGUI($this, 
'browseForQuestions', (($ilAccess->checkAccess(
"write", 
"", $this->ref_id) ? 
true : 
false)));
 
 2216                 $arrFilter = array();
 
 2217                 foreach ($table_gui->getFilterItems() as $item)
 
 2219                         if ($item->getValue() !== 
false)
 
 2221                                 $arrFilter[$item->getPostVar()] = $item->getValue();
 
 2224                 $data = $this->
object->getAvailableQuestions($arrFilter, 1);
 
 2225                 $table_gui->setData(
$data);
 
 2226                 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());  
 
 2233                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
 2235                 $ilCtrl->setParameter($this, 
'qtype', 
$_REQUEST[
'qtype']);
 
 2239                 $form->setFormAction($ilCtrl->getFormAction($this, 
"executeCreateQuestion"));
 
 2240                 $form->setTitle($lng->txt(
"ass_create_question"));
 
 2241                 include_once 
'Modules/TestQuestionPool/classes/class.ilObjQuestionPool.php';
 
 2244                 $questionTypes = $pool->getQuestionTypes(
false, 
true);
 
 2248                 foreach($questionTypes as $label => 
$data)
 
 2253                 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
 2256                 $form->addItem(
$si, 
true);
 
 2259                 $questions = $this->
object->getQuestionTitlesAndIndexes();
 
 2263                         $options = array(
'0' => $lng->txt(
'first'));
 
 2264                         foreach($questions as $key => $title)
 
 2266                                 $options[$key] = $lng->txt(
'behind') . 
' '. $title . 
' ['.$this->lng->txt(
'question_id_short') . 
': '. $key .
']';
 
 2268                         $si->setOptions($options);
 
 2270                         $form->addItem(
$si, 
true);
 
 2276                         $ri = 
new ilRadioGroupInputGUI($lng->txt(
"tst_add_quest_cont_edit_mode"), 
"add_quest_cont_edit_mode");
 
 2279                                 $lng->txt(
'tst_add_quest_cont_edit_mode_default'),
 
 2284                                 $lng->txt(
'tst_add_quest_cont_edit_mode_page_object'),
 
 2290                         $form->addItem($ri, 
true);
 
 2296                         $form->addItem($hi, 
true);
 
 2299                 if($this->object->getPoolUsage())
 
 2304                         $no_pool = 
new ilRadioOption($this->lng->txt(
"assessment_no_pool"), 1);
 
 2305                         $usage->addOption($no_pool);
 
 2306                         $existing_pool = 
new ilRadioOption($this->lng->txt(
"assessment_existing_pool"), 3);
 
 2307                         $usage->addOption($existing_pool);
 
 2308                         $new_pool = 
new ilRadioOption($this->lng->txt(
"assessment_new_pool"), 2);
 
 2309                         $usage->addOption($new_pool);
 
 2310                         $form->addItem($usage);
 
 2315                         $pools_data = array();
 
 2316                         foreach($questionpools as $key => $p)
 
 2318                                 $pools_data[$key] = $p[
'title'];
 
 2320                         $pools = 
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"), 
"sel_qpl");
 
 2322                         $existing_pool->addSubItem($pools);
 
 2326                         $name->setMaxLength(50);
 
 2327                         $new_pool->addSubItem($name);
 
 2330                 $form->addCommandButton(
"executeCreateQuestion", $lng->txt(
"submit"));
 
 2331                 $form->addCommandButton(
"questions", $lng->txt(
"cancel"));
 
 2333                 return $tpl->setContent($form->getHTML());
 
 2338                 global $ilAccess, $ilTabs;
 
 2340                 $ilTabs->activateTab(
'assQuestions');
 
 2343                 $this->ctrl->setParameter($this, 
'test_express_mode', 
'');
 
 2345                 if (!$ilAccess->checkAccess(
"write", 
"", $this->ref_id)) 
 
 2349                         $this->ctrl->redirect($this, 
"infoScreen");
 
 2352                 if (
$_GET[
'browse'])
 
 2354                         return $this->questionbrowser();
 
 2360                 $this->ctrl->setParameter($this, 
'q_id', 
'');
 
 2364                         ilUtil::redirect(
"ilias.php?baseClass=ilObjQuestionPoolGUI&ref_id=" . 
$_GET[
"eqpl"] . 
"&cmd=editQuestionForTest&calling_test=".
$_GET[
"ref_id"].
"&q_id=" . 
$_GET[
"eqid"]);
 
 2367                 if (
$_GET[
"up"] > 0)
 
 2369                         $this->
object->questionMoveUp(
$_GET[
"up"]);
 
 2371                 if (
$_GET[
"down"] > 0)
 
 2373                         $this->
object->questionMoveDown(
$_GET[
"down"]);
 
 2378                         $selected_array = array();
 
 2379                         array_push($selected_array, 
$_GET[
"add"]);
 
 2380                         $total = $this->
object->evalTotalPersons();
 
 2390                         $this->insertQuestions($selected_array);
 
 2394                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.il_as_tst_questions.html", 
"Modules/Test");
 
 2396                 $total = $this->
object->evalTotalPersons();
 
 2397                 if ($ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 2401                                 $link = $this->ctrl->getLinkTarget($this, 
"participants");
 
 2402                                 $link = 
"<a href=\"".$link.
"\">".$this->lng->txt(
"test_has_datasets_warning_page_view_link").
"</a>";
 
 2403                                 ilUtil::sendInfo($this->lng->txt(
"test_has_datasets_warning_page_view").
" ".$link);
 
 2408                                 $ilToolbar->addButton($this->lng->txt(
"ass_create_question"), $this->ctrl->getLinkTarget($this, 
"addQuestion"));
 
 2410                                 if ($this->object->getPoolUsage()) {
 
 2411                                         $ilToolbar->addSeparator();
 
 2412                                         $ilToolbar->addButton($this->lng->txt(
"tst_browse_for_questions"), $this->ctrl->getLinkTarget($this, 
'browseForQuestions'));
 
 2415                                 $ilToolbar->addSeparator();
 
 2416                                 $ilToolbar->addButton($this->lng->txt(
"random_selection"), $this->ctrl->getLinkTarget($this, 
"randomselect"));
 
 2420                                 $online_access = 
false;
 
 2421                                 if ($this->object->getFixedParticipants())
 
 2423                                         include_once 
"./Modules/Test/classes/class.ilObjTestAccess.php";
 
 2425                                         if ($online_access_result === 
true)
 
 2427                                                 $online_access = 
true;
 
 2431                                 if( $this->object->isOnline() && $this->
object->isComplete( $this->testQuestionSetConfigFactory->getQuestionSetConfig() ) )
 
 2433                                         if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read", 
"", $this->ref_id))
 
 2435                                                 $testSession = $this->testSessionFactory->getSession();
 
 2437                                                 $executable = $this->
object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE);
 
 2439                                                 if ($executable[
"executable"])
 
 2441                                                         if ($testSession->getActiveId() > 0)
 
 2443                                                                 $ilToolbar->addSeparator();
 
 2444                                                                 $ilToolbar->addButton($lng->txt(
'tst_resume_test'), $ilCtrl->getLinkTargetByClass(
'iltestoutputgui', 
'resume'));
 
 2448                                                                 $ilToolbar->addSeparator();
 
 2449                                                                 $ilToolbar->addButton($lng->txt(
'tst_start_test'), $ilCtrl->getLinkTargetByClass(
'iltestoutputgui', 
'startTest'));
 
 2459                 $this->tpl->setCurrentBlock(
"adm_content");
 
 2460                 include_once 
"./Modules/Test/classes/tables/class.ilTestQuestionsTableGUI.php";
 
 2461                 $checked_move = is_array(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]) && (count(
$_SESSION[
'tst_qst_move_' . $this->object->getTestId()]));
 
 2462                 $table_gui = 
new ilTestQuestionsTableGUI($this, 
'questions', (($ilAccess->checkAccess(
"write", 
"", $this->ref_id) ? 
true : 
false)), $checked_move, 
$total);
 
 2463                 $data = $this->
object->getTestQuestions();
 
 2464                 $table_gui->setData($data);
 
 2465                 $this->tpl->setVariable(
'QUESTIONBROWSER', $table_gui->getHTML());      
 
 2466                 $this->tpl->setVariable(
"ACTION_QUESTION_FORM", $this->ctrl->getFormAction($this));
 
 2467                 $this->tpl->parseCurrentBlock();
 
 2483                 $this->
object->mark_schema->addMarkStep();
 
 2496                 $this->
object->mark_schema->flush();
 
 2497                 foreach (
$_POST as $key => $value) {
 
 2498                         if (preg_match(
"/mark_short_(\d+)/", $key, $matches)) 
 
 2503                 $this->
object->ects_grades[
"A"] = 
$_POST[
"ects_grade_a"];
 
 2504                 $this->
object->ects_grades[
"B"] = 
$_POST[
"ects_grade_b"];
 
 2505                 $this->
object->ects_grades[
"C"] = 
$_POST[
"ects_grade_c"];
 
 2506                 $this->
object->ects_grades[
"D"] = 
$_POST[
"ects_grade_d"];
 
 2507                 $this->
object->ects_grades[
"E"] = 
$_POST[
"ects_grade_e"];
 
 2510                         $this->
object->ects_fx = 
$_POST[
"percentFX"];
 
 2514                         $this->
object->ects_fx = 
"";
 
 2516                 $this->
object->ects_output = 
$_POST[
"chbECTS"];
 
 2528                 $this->
object->mark_schema->createSimpleSchema($this->lng->txt(
"failed_short"), $this->lng->txt(
"failed_official"), 0, 0, $this->lng->txt(
"passed_short"), $this->lng->txt(
"passed_official"), 50, 1);
 
 2542                 $delete_mark_steps = array();
 
 2543                 foreach (
$_POST as $key => $value) {
 
 2544                         if (preg_match(
"/cb_(\d+)/", $key, $matches)) {
 
 2545                                 array_push($delete_mark_steps, $matches[1]);
 
 2548                 if (count($delete_mark_steps)) {
 
 2549                         $this->
object->mark_schema->deleteMarkSteps($delete_mark_steps);
 
 2565                 $this->ctrl->redirect($this, 
"marks");
 
 2580                         $mark_check = $this->
object->checkMarks();
 
 2584                         $mark_check = $this->lng->txt(
'mark_schema_invalid');
 
 2587                 if ($mark_check !== 
true)
 
 2591                 elseif (
$_POST[
"chbECTS"] && ((strcmp(
$_POST[
"ects_grade_a"], 
"") == 0) or (strcmp(
$_POST[
"ects_grade_b"], 
"") == 0) or (strcmp(
$_POST[
"ects_grade_c"], 
"") == 0) or (strcmp(
$_POST[
"ects_grade_d"], 
"") == 0) or (strcmp(
$_POST[
"ects_grade_e"], 
"") == 0)))
 
 2595                 elseif ((
$_POST[
"ects_grade_a"] > 100) or (
$_POST[
"ects_grade_a"] < 0))
 
 2599                 elseif ((
$_POST[
"ects_grade_b"] > 100) or (
$_POST[
"ects_grade_b"] < 0))
 
 2603                 elseif ((
$_POST[
"ects_grade_c"] > 100) or (
$_POST[
"ects_grade_c"] < 0))
 
 2607                 elseif ((
$_POST[
"ects_grade_d"] > 100) or (
$_POST[
"ects_grade_d"] < 0))
 
 2611                 elseif ((
$_POST[
"ects_grade_e"] > 100) or (
$_POST[
"ects_grade_e"] < 0))
 
 2617                         $this->
object->mark_schema->saveToDb($this->object->getTestId());
 
 2618                         $this->
object->saveCompleteStatus( $this->testQuestionSetConfigFactory->getQuestionSetConfig() );
 
 2619                         if ($this->object->getReportingDate())
 
 2636                 if (!$ilAccess->checkAccess(
"write", 
"", $this->ref_id)) 
 
 2640                         $this->ctrl->redirect($this, 
"infoScreen");
 
 2643                 if (!$this->object->canEditMarks())
 
 2648                 $this->
object->mark_schema->sort();
 
 2650                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.il_as_tst_marks.html", 
"Modules/Test");
 
 2651                 $marks = $this->
object->mark_schema->mark_steps;
 
 2652                 $rows = array(
"tblrow1", 
"tblrow2");
 
 2654                 foreach ($marks as $key => $value)
 
 2656                         $this->tpl->setCurrentBlock(
"markrow");
 
 2657                         $this->tpl->setVariable(
"MARK_SHORT", $value->getShortName());
 
 2658                         $this->tpl->setVariable(
"MARK_OFFICIAL", $value->getOfficialName());
 
 2659                         $this->tpl->setVariable(
"MARK_PERCENTAGE", sprintf(
"%.2f", $value->getMinimumLevel()));
 
 2660                         $this->tpl->setVariable(
"MARK_PASSED", strtolower($this->lng->txt(
"tst_mark_passed")));
 
 2661                         $this->tpl->setVariable(
"MARK_ID", 
"$key");
 
 2662                         $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
 
 2664                         if( $value->getPassed() )
 
 2666                                 $this->tpl->setVariable(
"MARK_PASSED_CHECKED", 
" checked=\"checked\"");
 
 2669                         $this->tpl->parseCurrentBlock();
 
 2672                 if (count($marks) == 0) 
 
 2674                         $this->tpl->setCurrentBlock(
"Emptyrow");
 
 2675                         $this->tpl->setVariable(
"EMPTY_ROW", $this->lng->txt(
"tst_no_marks_defined"));
 
 2676                         $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
 
 2677                         $this->tpl->parseCurrentBlock();
 
 2681                         if ($ilAccess->checkAccess(
"write", 
"", $this->ref_id) && $this->
object->canEditMarks()) 
 
 2683                                 $this->tpl->setCurrentBlock(
"selectall");
 
 2685                                 $this->tpl->setVariable(
"ROW_CLASS", $rows[$counter % 2]);
 
 2686                                 $this->tpl->setVariable(
"SELECT_ALL", $this->lng->txt(
"select_all"));
 
 2687                                 $this->tpl->parseCurrentBlock();
 
 2688                                 $this->tpl->setCurrentBlock(
"Footer");
 
 2689                                 $this->tpl->setVariable(
"ARROW", 
"<img src=\"" . 
ilUtil::getImagePath(
"arrow_downright.png") . 
"\" alt=\"".$this->lng->txt(
"arrow_downright").
"\"/>");
 
 2690                                 $this->tpl->setVariable(
"BUTTON_EDIT", $this->lng->txt(
"edit"));
 
 2691                                 $this->tpl->setVariable(
"BUTTON_DELETE", $this->lng->txt(
"delete"));
 
 2692                                 $this->tpl->parseCurrentBlock();
 
 2696                 if ($this->object->getReportingDate())
 
 2698                         $this->tpl->setCurrentBlock(
"ects");
 
 2699                         if ($this->object->ects_output)
 
 2701                                 $this->tpl->setVariable(
"CHECKED_ECTS", 
" checked=\"checked\"");
 
 2703                         $this->tpl->setVariable(
"TEXT_OUTPUT_ECTS_GRADES", $this->lng->txt(
"ects_output_of_ects_grades"));
 
 2704                         $this->tpl->setVariable(
"TEXT_ALLOW_ECTS_GRADES", $this->lng->txt(
"ects_allow_ects_grades"));
 
 2705                         $this->tpl->setVariable(
"TEXT_USE_FX", $this->lng->txt(
"ects_use_fx_grade"));
 
 2706                         if (preg_match(
"/\d+/", $this->object->ects_fx))
 
 2708                                 $this->tpl->setVariable(
"CHECKED_FX", 
" checked=\"checked\"");
 
 2709                                 $this->tpl->setVariable(
"VALUE_PERCENT_FX", sprintf(
"value=\"%s\" ", $this->object->ects_fx));
 
 2711                         $this->tpl->setVariable(
"TEXT_PERCENT", $this->lng->txt(
"ects_use_fx_grade_part2"));
 
 2712                         $this->tpl->setVariable(
"ECTS_GRADE", $this->lng->txt(
"ects_grade"));
 
 2713                         $this->tpl->setVariable(
"PERCENTILE", $this->lng->txt(
"percentile"));
 
 2714                         $this->tpl->setVariable(
"ECTS_GRADE_A", 
"A - " . $this->lng->txt(
"ects_grade_a_short"));
 
 2715                         $this->tpl->setVariable(
"VALUE_GRADE_A", $this->object->ects_grades[
"A"]);
 
 2716                         $this->tpl->setVariable(
"ECTS_GRADE_B", 
"B - " . $this->lng->txt(
"ects_grade_b_short"));
 
 2717                         $this->tpl->setVariable(
"VALUE_GRADE_B", $this->object->ects_grades[
"B"]);
 
 2718                         $this->tpl->setVariable(
"ECTS_GRADE_C", 
"C - " . $this->lng->txt(
"ects_grade_c_short"));
 
 2719                         $this->tpl->setVariable(
"VALUE_GRADE_C", $this->object->ects_grades[
"C"]);
 
 2720                         $this->tpl->setVariable(
"ECTS_GRADE_D", 
"D - " . $this->lng->txt(
"ects_grade_d_short"));
 
 2721                         $this->tpl->setVariable(
"VALUE_GRADE_D", $this->object->ects_grades[
"D"]);
 
 2722                         $this->tpl->setVariable(
"ECTS_GRADE_E", 
"E - " . $this->lng->txt(
"ects_grade_e_short"));
 
 2723                         $this->tpl->setVariable(
"VALUE_GRADE_E", $this->object->ects_grades[
"E"]);
 
 2725                         $this->tpl->parseCurrentBlock();
 
 2728                 $this->tpl->setCurrentBlock(
"adm_content");
 
 2729                 $this->tpl->setVariable(
"ACTION_MARKS", $this->ctrl->getFormAction($this));
 
 2730                 $this->tpl->setVariable(
"HEADER_SHORT", $this->lng->txt(
"tst_mark_short_form"));
 
 2731                 $this->tpl->setVariable(
"HEADER_OFFICIAL", $this->lng->txt(
"tst_mark_official_form"));
 
 2732                 $this->tpl->setVariable(
"HEADER_PERCENTAGE", $this->lng->txt(
"tst_mark_minimum_level"));
 
 2733                 $this->tpl->setVariable(
"HEADER_PASSED", $this->lng->txt(
"tst_mark_passed"));
 
 2734                 if ($ilAccess->checkAccess(
"write", 
"", $this->ref_id) && $this->
object->canEditMarks()) 
 
 2736                         $this->tpl->setVariable(
"BUTTON_NEW", $this->lng->txt(
"tst_mark_create_new_mark_step"));
 
 2737                         $this->tpl->setVariable(
"BUTTON_NEW_SIMPLE", $this->lng->txt(
"tst_mark_create_simple_mark_schema"));
 
 2738                         $this->tpl->setVariable(
"SAVE", $this->lng->txt(
"save"));
 
 2739                         $this->tpl->setVariable(
"CANCEL", $this->lng->txt(
"cancel"));
 
 2741                 $this->tpl->parseCurrentBlock();
 
 2755                 require_once 
'Modules/Test/classes/class.ilTestParticipantData.php';
 
 2758                 $participantData->load($this->object->getTestId());
 
 2760                 $this->
object->removeTestResults($participantData);
 
 2763                 $this->ctrl->redirect($this, 
"participants");
 
 2777                 require_once 
'Modules/Test/classes/class.ilTestParticipantData.php';
 
 2780                 if( $this->object->getFixedParticipants() )
 
 2782                         $participantData->setUserIds(
$_POST[
"chbUser"]);
 
 2786                         $participantData->setActiveIds(
$_POST[
"chbUser"]);
 
 2789                 $participantData->load($this->object->getTestId());
 
 2791                 $this->
object->removeTestResults($participantData);
 
 2794                 $this->ctrl->redirect($this, 
"participants");
 
 2806                 $this->ctrl->redirect($this, 
"participants");
 
 2821                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.il_as_tst_maintenance.html", 
"Modules/Test");
 
 2823                 $this->tpl->setCurrentBlock(
"confirm_delete");
 
 2824                 $this->tpl->setVariable(
"BTN_CONFIRM_DELETE_ALL", $this->lng->txt(
"confirm"));
 
 2825                 $this->tpl->setVariable(
"BTN_CANCEL_DELETE_ALL", $this->lng->txt(
"cancel"));
 
 2826                 $this->tpl->parseCurrentBlock();
 
 2828                 $this->tpl->setCurrentBlock(
"adm_content");
 
 2829                 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
 
 2830                 $this->tpl->parseCurrentBlock();
 
 2839                 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 2841                 $cgui->setFormAction($this->ctrl->getFormAction($this, 
"participants"));
 
 2842                 $cgui->setHeaderText($this->lng->txt(
"delete_all_user_data_confirmation"));
 
 2843                 $cgui->setCancel($this->lng->txt(
"cancel"), 
"participants");
 
 2844                 $cgui->setConfirm($this->lng->txt(
"proceed"), 
"confirmDeleteAllUserResults");
 
 2846                 $this->tpl->setContent($cgui->getHTML());
 
 2858                 if (count(
$_POST[
"chbUser"]) == 0)
 
 2861                         $this->ctrl->redirect($this, 
"participants");
 
 2864                 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
 
 2866                 $cgui->setHeaderText($this->lng->txt(
"confirm_delete_single_user_data"));
 
 2868                 $cgui->setFormAction($this->ctrl->getFormAction($this));
 
 2869                 $cgui->setCancel($this->lng->txt(
"cancel"), 
"cancelDeleteSelectedUserData");
 
 2870                 $cgui->setConfirm($this->lng->txt(
"confirm"), 
"confirmDeleteSelectedUserData");
 
 2872                 include_once 
'./Services/User/classes/class.ilObjUser.php';     
 
 2873                 foreach (
$_POST[
"chbUser"] as $key => $active_id)
 
 2875                         if ($this->object->getFixedParticipants())
 
 2877                                 $user_id = $active_id;
 
 2881                                 $user_id = $this->
object->_getUserIdFromActiveId($active_id);
 
 2885                         if ($this->object->getAnonymity())
 
 2887                                 $name = $this->lng->txt(
"anonymous");
 
 2889                         else if($user[
"lastname"])
 
 2891                                 $name = $user[
"lastname"].
", ".$user[
"firstname"].
" (".
 
 2896                                 $name = $this->lng->txt(
"deleted_user");                                
 
 2899                         $cgui->addItem(
"chbUser[]", $active_id, $name,
 
 2903                 $this->tpl->setContent($cgui->getHTML());
 
 2915                 include_once 
"./Modules/Test/classes/tables/class.ilTestHistoryTableGUI.php";
 
 2917                 $table_gui->setTestObject($this->
object);
 
 2918                 include_once 
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
 
 2920                 $table_gui->setData(
$log);
 
 2921                 $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());  
 
 2926                 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
 
 2928                 $form->setTarget(
"_top");
 
 2930                 $this->ctrl->setParameter($this, 
"new_type", $new_type);
 
 2931                 $form->setFormAction($this->ctrl->getFormAction($this));
 
 2932                 $form->setTitle($this->lng->txt(
"import_tst"));
 
 2935                 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
 
 2936                 $fi = 
new ilFileInputGUI($this->lng->txt(
"import_file"), 
"xmldoc");
 
 2938                 $fi->setRequired(
true);
 
 2939                 $form->addItem($fi);
 
 2942                 include_once(
"./Modules/Test/classes/class.ilObjTest.php");
 
 2944                 $questionpools = $tst->getAvailableQuestionpools(TRUE, FALSE, TRUE, TRUE);
 
 2945                 if (count($questionpools))
 
 2947                         $options = array(
"-1" => $this->lng->txt(
"dont_use_questionpool"));
 
 2948                         foreach ($questionpools as $key => $value)
 
 2953                         $pool = 
new ilSelectInputGUI($this->lng->txt(
"select_questionpool"), 
"qpl");
 
 2955                         $form->addItem($pool);
 
 2958                 $form->addCommandButton(
"importFile", $this->lng->txt(
"import"));
 
 2959                 $form->addCommandButton(
"cancel", $this->lng->txt(
"cancel"));
 
 2971                 $command = 
$_POST[
"command"];
 
 2972                 if (strlen($command))
 
 2974                         $method = $command . 
"Object";
 
 2975                         if (method_exists($this, $method))
 
 2981                 $this->ctrl->redirect($this, 
"participants");
 
 2991                 global $ilAccess, $ilToolbar, 
$lng;
 
 2995                 if (!$ilAccess->checkAccess(
"write", 
"", $this->ref_id)) 
 
 2999                         $this->ctrl->redirect($this, 
"infoScreen");
 
 3002                 if( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken($this->tree) )
 
 3005                                         $this->testQuestionSetConfigFactory->getQuestionSetConfig()->getDepenciesBrokenMessage($this->lng)
 
 3008                 elseif( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesInVulnerableState($this->tree) )
 
 3011                                         $this->questionSetConfig->getDepenciesInVulnerableStateMessage($this->lng)
 
 3015                 if ($this->object->getFixedParticipants())
 
 3018                         include_once 
'./Services/Search/classes/class.ilRepositorySearchGUI.php';
 
 3023                                         'auto_complete_name'    => $lng->txt(
'user'),
 
 3024                                         'submit_name'                   => $lng->txt(
'add')
 
 3029                         $ilToolbar->addButton($this->lng->txt(
"tst_search_users"),
 
 3030                                 $this->ctrl->getLinkTargetByClass(
'ilRepositorySearchGUI',
'start'));
 
 3033                         $participants =& $this->
object->getInvitedUsers();
 
 3035                         foreach ($participants as 
$data)
 
 3037                                 $maxpass = $this->
object->_getMaxPass($data[
"active_id"]);
 
 3038                                 if (!is_null($maxpass))
 
 3043                                 if (strlen($data[
"active_id"]))
 
 3045                                         $last_access = $this->
object->_getLastAccess($data[
"active_id"]);
 
 3046                                         $access = $last_access;
 
 3048                                 $this->ctrl->setParameterByClass(
'iltestevaluationgui', 
'active_id', $data[
'active_id']);
 
 3050                                 if ($data[
'active_id'] == null) 
 
 3052                                         if ( strlen($data[
"firstname"].$data[
"lastname"]) == 0 )
 
 3054                                                 $fullname = $lng->txt(
"deleted_user");
 
 3056                                         else if($this->object->getAnonymity())
 
 3058                                                 $fullname = $lng->txt(
'anonymous');     
 
 3062                                                 $fullname = trim($data[
"lastname"] . 
", " . $data[
"firstname"] . 
" " . $data[
"title"]);
 
 3065                                         include_once 
"./Modules/Test/classes/class.ilObjTestAccess.php";
 
 3069                                 array_push($rows, array(
 
 3070                                         'usr_id' => $data[
"usr_id"],
 
 3071                                         'active_id' => $data[
'active_id'],
 
 3072                                         'login' => $data[
"login"],
 
 3073                                         'clientip' => $data[
"clientip"],
 
 3074                                         'firstname' => $data[
"firstname"],
 
 3075                                         'lastname' => $data[
"lastname"],
 
 3076                                         'name' => $fullname,
 
 3077                                         'started' => ($data[
"active_id"] > 0) ? 1 : 0,
 
 3078                                         'finished' => ($data[
"test_finished"] == 1) ? 1 : 0,
 
 3079                                         'access' => $access,
 
 3080                                         'maxpass' => $maxpass,
 
 3081                                         'result' => $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui', 
'outParticipantsResultsOverview')
 
 3084                         include_once 
"./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php";
 
 3086                                         $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken(),
 
 3087                                         $this->
object->getAnonymity(), count($rows)
 
 3090                         $table_gui->setResetCommand(
'fpResetFiler');
 
 3092                         $table_gui->setData($rows);
 
 3093                         $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());  
 
 3097                         $participants =& $this->
object->getTestParticipants();
 
 3099                         foreach ($participants as 
$data)
 
 3101                                 $maxpass = $this->
object->_getMaxPass($data[
"active_id"]);
 
 3102                                 if (!is_null($maxpass))
 
 3107                                 if (strlen($data[
"active_id"]))
 
 3109                                         $last_access = $this->
object->_getLastAccess($data[
"active_id"]);
 
 3110                                         $access = $last_access;
 
 3112                                 $this->ctrl->setParameterByClass(
'iltestevaluationgui', 
'active_id', $data[
'active_id']);
 
 3114                                 include_once 
"./Modules/Test/classes/class.ilObjTestAccess.php";
 
 3116                                 array_push($rows, array(
 
 3117                                         'usr_id' => $data[
"active_id"],
 
 3118                                         'active_id' => $data[
'active_id'],
 
 3119                                         'login' => $data[
"login"],
 
 3120                                         'name' => $fullname,
 
 3121                                         'firstname' => $data[
"firstname"],
 
 3122                                         'lastname' => $data[
"lastname"],
 
 3123                                         'started' => ($data[
"active_id"] > 0) ? 1 : 0,
 
 3124                                         'finished' => ($data[
"test_finished"] == 1) ? 1 : 0,
 
 3125                                         'access' => $access,
 
 3126                                         'maxpass' => $maxpass,
 
 3127                                         'result' => $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui', 
'outParticipantsResultsOverview')
 
 3130                         include_once 
"./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php";
 
 3132                                         $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken(),
 
 3133                                         $this->
object->getAnonymity(), count($rows)
 
 3136                         $table_gui->setResetCommand(
'npResetFilter');
 
 3138                         $table_gui->setData($rows);
 
 3139                         $this->tpl->setVariable(
'ADM_CONTENT', $table_gui->getHTML());  
 
 3147                 include_once 
"./Modules/Test/classes/tables/class.ilTimingOverviewTableGUI.php";
 
 3150                 $participants =& $this->
object->getTestParticipants();#
 
 3151                 $times = $this->
object->getStartingTimeOfParticipants();
 
 3152                 $addons = $this->
object->getTimeExtensionsOfParticipants();
 
 3154                 $tbl_data = array();
 
 3156                 foreach ($participants as $participant)
 
 3159                         if ($times[$participant[
'active_id']])
 
 3162                                 $tbl_data[$i][
'started'] = $started;
 
 3166                                 $tbl_data[$i][
'started'] = 
'';
 
 3169                         if ($addons[$participant[
'active_id']] > 0) 
 
 3171                                 $tbl_data[$i][
'extratime'] = $addons[$participant[
'active_id']];
 
 3174                         $tbl_data[$i][
'login'] = $participant[
'login'];
 
 3176                         if ($this->object->getAnonymity())
 
 3178                                 $name = $this->lng->txt(
"anonymous");
 
 3182                                 $name = $participant[
'lastname'] . 
', ' . $participant[
'firstname'];
 
 3185                         $tbl_data[$i][
'name'] = $name;
 
 3187                 $table_gui->setData($tbl_data);
 
 3189                 $this->tpl->setContent($table_gui->getHTML());
 
 3198                 if (!$ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 3202                         $this->ctrl->redirect($this, 
"infoScreen");
 
 3205                 if ($this->object->getProcessingTimeInSeconds() > 0 && $this->
object->getNrOfTries() == 1)
 
 3208                         if (count(
$_POST) && $form->checkInput())
 
 3210                                 $res = $this->
object->addExtraTime($form->getInput(
'participant'), $form->getInput(
'extratime'));
 
 3211                                 ilUtil::sendSuccess(sprintf($this->lng->txt(
'tst_extratime_added'), $form->getInput(
'extratime')), 
true);
 
 3212                                 $this->ctrl->redirect($this, 
'timingOverview');
 
 3216                                 return $this->tpl->setVariable(
"ADM_CONTENT", $form->getHTML());
 
 3229                 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
 
 3231                 $form->setFormAction($this->ctrl->getFormAction($this));
 
 3232                 $form->setTableWidth(
"100%");
 
 3233                 $form->setId(
"tst_change_workingtime");
 
 3234                 $form->setTitle($this->lng->txt(
"tst_change_workingtime"));
 
 3237                 $participantslist = 
new ilSelectInputGUI($this->lng->txt(
'participants'), 
"participant");
 
 3238                 $participants =& $this->
object->getTestParticipants();
 
 3239                 $times = $this->
object->getStartingTimeOfParticipants();
 
 3240                 $addons = $this->
object->getTimeExtensionsOfParticipants();
 
 3242                         '' => $this->lng->txt(
'please_select'),
 
 3243                         '0' => $this->lng->txt(
'all_participants')
 
 3245                 foreach ($participants as $participant)
 
 3249                         if ($this->object->getAnonymity())
 
 3251                                 $name = $this->lng->txt(
"anonymous");
 
 3255                                 $name = $participant[
'lastname'] . 
', ' . $participant[
'firstname']; 
 
 3259                         if ($times[$participant[
'active_id']])
 
 3263                         if ($addons[$participant[
'active_id']] > 0) $started .= 
", " . $this->lng->txt(
'extratime') . 
': ' . $addons[$participant[
'active_id']] . 
' ' . $this->lng->txt(
'minutes');
 
 3264                         $options[$participant[
'active_id']] = $participant[
'login'] . 
' (' .$name. 
')'.$started;
 
 3266                 $participantslist->setRequired(
true);
 
 3267                 $participantslist->setOptions(
$options);
 
 3268                 $form->addItem($participantslist);
 
 3271                 $extratime = 
new ilNumberInputGUI($this->lng->txt(
"extratime"), 
"extratime");
 
 3272                 $extratime->
setInfo($this->lng->txt(
'tst_extratime_info'));
 
 3273                 $extratime->setRequired(
true);
 
 3274                 $extratime->setMinValue(0);
 
 3275                 $extratime->setMinvalueShouldBeGreater(
false);
 
 3276                 $extratime->setSuffix($this->lng->txt(
'minutes'));
 
 3277                 $extratime->setSize(5);
 
 3278                 $form->addItem($extratime);
 
 3280                 if (is_array(
$_POST) && strlen(
$_POST[
'cmd'][
'timing'])) $form->setValuesByArray(
$_POST);
 
 3282                 if ($ilAccess->checkAccess(
"write", 
"", 
$_GET[
"ref_id"])) $form->addCommandButton(
"timing", $this->lng->txt(
"save"));
 
 3283                 $form->addCommandButton(
'timingOverview', $this->lng->txt(
"cancel"));
 
 3290                 $this->tpl->setContent($form->getHTML());
 
 3297                 $sess_filter = 
$_SESSION[
'form_'][
'selection'];
 
 3298                 $sess_filter = str_replace(
'"',
'',$sess_filter);
 
 3299                 $sess_filter = explode(
':', $sess_filter);
 
 3300                 $filter = substr($sess_filter[2],0, strlen($sess_filter[2])-1);
 
 3302                 if ($filter == 
'all' || $filter == 
false)
 
 3304                         return $in_rows; #unchanged - no filter.
 
 3307                 $with_result = array();
 
 3308                 $without_result = array();
 
 3309                 foreach ($in_rows as 
$row)
 
 3312                                 'SELECT count(solution_id) count 
 3314                                 WHERE active_fi = ' . $ilDB->quote($row[
'active_id'])
 
 3316                         $count = $ilDB->fetchAssoc(
$result);
 
 3317                         $count = $count[
'count'];
 
 3321                                 $without_result[] = 
$row;
 
 3325                                 $with_result[] = 
$row;
 
 3329                 if ($filter == 
'withSolutions')
 
 3331                         return $with_result;
 
 3333                 return $without_result;
 
 3339                 include_once(
"./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php");
 
 3342                 $table_gui->resetOffset();                
 
 3348                 include_once(
"./Modules/Test/classes/tables/class.ilTestFixedParticipantsTableGUI.php");
 
 3350                         $this, 
"participants", 
false, $this->object->getAnonymity(), 0
 
 3353                 $table_gui->resetOffset();                
 
 3359                 include_once(
"./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php");
 
 3361                         $this, 
"participants", 
false, $this->object->getAnonymity(), 0
 
 3364                 $table_gui->resetOffset();                
 
 3371                 include_once(
"./Modules/Test/classes/tables/class.ilTestParticipantsTableGUI.php");
 
 3373                         $this, 
"participants", 
false, $this->object->getAnonymity(), 0
 
 3376                 $table_gui->resetOffset();                
 
 3392                 $this->
showUserResults($show_pass_details = TRUE, $show_answers = TRUE, $show_reached_points = TRUE);
 
 3406                 $this->
showUserResults($show_pass_details = FALSE, $show_answers = TRUE);
 
 3420                 $this->
showUserResults($show_pass_details = TRUE, $show_answers = FALSE);
 
 3430                 $show_user_results = 
$_SESSION[
"show_user_results"];
 
 3432                 if (count($show_user_results) == 0)
 
 3435                         $this->ctrl->redirect($this, 
"participants");
 
 3439                 $template = $this->
createUserResults( $show_pass_details, $show_answers, $show_reached_points, $show_user_results);
 
 3441                 $this->tpl->setVariable(
"ADM_CONTENT", $template->get());
 
 3443                 if ($this->object->getShowSolutionAnswersOnly())
 
 3451                 if (is_array(
$_POST[
"chbUser"])) 
 
 3453                         foreach (
$_POST[
"chbUser"] as $user_id)
 
 3455                                 $this->
object->disinviteUser($user_id);
 
 3462                 $this->ctrl->redirect($this, 
"participants");
 
 3467                 if (is_array(
$_POST[
"chbUser"])) 
 
 3469                         foreach (
$_POST[
"chbUser"] as $user_id)
 
 3471                                 $this->
object->setClientIP($user_id, 
$_POST[
"clientip_".$user_id]);
 
 3478                 $this->ctrl->redirect($this, 
"participants");
 
 3490                 global $ilAccess, 
$ilias;
 
 3491                 if (!$ilAccess->checkAccess(
"write", 
"", $this->ref_id)) 
 
 3495                         $this->ctrl->redirect($this, 
"infoScreen");
 
 3498                 $template = 
new ilTemplate(
"tpl.il_as_tst_print_test_confirm.html", TRUE, TRUE, 
"Modules/Test");
 
 3500                 if(!array_key_exists(
"pdf", 
$_GET) || 
$_GET[
"pdf"] != 1) 
 
 3502                         $this->ctrl->setParameter($this, 
"pdf", 
"1");
 
 3503                         $template->setCurrentBlock(
"pdf_export");
 
 3504                         $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this, 
"print"));
 
 3505                         $this->ctrl->setParameter($this, 
"pdf", 
"");
 
 3506                         $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
 
 3507                         $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
 
 3509                         $template->parseCurrentBlock();
 
 3511                         $template->setCurrentBlock(
"navigation_buttons");
 
 3512                         $template->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
 
 3513                         $template->parseCurrentBlock();
 
 3519                 $print_date = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m")  , date(
"d"), date(
"Y"));
 
 3523                 foreach ($this->object->questions as $question) 
 
 3525                         $template->setCurrentBlock(
"question");
 
 3526                         $question_gui = $this->
object->createQuestionGUI(
"", $question);
 
 3527                         $template->setVariable(
"COUNTER_QUESTION", $counter.
".");
 
 3528                         $template->setVariable(
"TXT_QUESTION_ID", $this->lng->txt(
'question_id_short'));
 
 3529                         $template->setVariable(
"QUESTION_ID", $question_gui->object->getId());
 
 3531                         if ($question_gui->object->getMaximumPoints() == 1)
 
 3533                                 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() . 
" " . $this->lng->txt(
"point"));
 
 3537                                 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() . 
" " . $this->lng->txt(
"points"));
 
 3539                         $result_output = $question_gui->getSolutionOutput(
"", NULL, FALSE, TRUE, FALSE, $this->object->getShowSolutionFeedback());
 
 3540                         if (strlen($result_output) == 0) $result_output = $question_gui->getPreview(FALSE);
 
 3541                         $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
 
 3542                         $template->parseCurrentBlock(
"question");
 
 3544                         $max_points += $question_gui->object->getMaximumPoints();
 
 3554                 if (array_key_exists(
"pdf", 
$_GET) && (
$_GET[
"pdf"] == 1))
 
 3557                         require_once 
'class.ilTestPDFGenerator.php';
 
 3562                         $this->tpl->setVariable(
"PRINT_CONTENT", $template->get());
 
 3573         function reviewobject()
 
 3575                 global $ilAccess, 
$ilias;
 
 3576                 if (!$ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 3580                         $this->ctrl->redirect($this, 
"infoScreen");
 
 3583                 $template = 
new ilTemplate(
"tpl.il_as_tst_print_test_confirm.html", TRUE, TRUE, 
"Modules/Test");
 
 3585                 $this->ctrl->setParameter($this, 
"pdf", 
"1");
 
 3586                 $template->setCurrentBlock(
"pdf_export");
 
 3587                 $template->setVariable(
"PDF_URL", $this->ctrl->getLinkTarget($this, 
"review"));
 
 3588                 $this->ctrl->setParameter($this, 
"pdf", 
"");
 
 3589                 $template->setVariable(
"PDF_TEXT", $this->lng->txt(
"pdf_export"));
 
 3590                 $template->setVariable(
"PDF_IMG_ALT", $this->lng->txt(
"pdf_export"));
 
 3592                 $template->parseCurrentBlock();
 
 3597                 $print_date = mktime(date(
"H"), date(
"i"), date(
"s"), date(
"m")  , date(
"d"), date(
"Y"));
 
 3601                 foreach ($this->object->questions as $question)
 
 3603                         $template->setCurrentBlock(
"question");
 
 3604                         $question_gui = $this->
object->createQuestionGUI(
"", $question);
 
 3605                         $template->setVariable(
"COUNTER_QUESTION", $counter.
".");
 
 3607                         if ($question_gui->object->getMaximumPoints() == 1)
 
 3609                                 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() . 
" " . $this->lng->txt(
"point"));
 
 3613                                 $template->setVariable(
"QUESTION_POINTS", $question_gui->object->getMaximumPoints() . 
" " . $this->lng->txt(
"points"));
 
 3617                         $result_output = $question_gui->getPreview(
false);
 
 3619                         if (strlen($result_output) == 0) $result_output = $question_gui->getPreview(FALSE);
 
 3620                         $template->setVariable(
"SOLUTION_OUTPUT", $result_output);
 
 3621                         $template->parseCurrentBlock(
"question");
 
 3623                         $max_points += $question_gui->object->getMaximumPoints();
 
 3635                 if (array_key_exists(
"pdf", 
$_GET) && (
$_GET[
"pdf"] == 1))
 
 3638                         require_once 
'class.ilTestPDFGenerator.php';
 
 3639                         $content = $template->get();
 
 3644                         $template->setCurrentBlock(
"navigation_buttons");
 
 3645                         $template->setVariable(
"BUTTON_PRINT", $this->lng->txt(
"print"));
 
 3646                         $template->parseCurrentBlock();
 
 3649                         $this->tpl->setVariable(
"PRINT_CONTENT", $template->get());
 
 3657                 if (is_array($a_user_ids))
 
 3660                         foreach ($a_user_ids as $user_id)
 
 3662                                 $client_ip = 
$_POST[
"client_ip"][$i];
 
 3663                                 $this->
object->inviteUser($user_id, $client_ip);
 
 3671                         $message = $this->lng->txt(
"tst_invited_selected_users");
 
 3673                 if (strlen($message))
 
 3683                 $this->ctrl->redirect($this, 
"participants");
 
 3689         public function defaultsObject()
 
 3696                 global $ilAccess, $ilToolbar, 
$tpl;
 
 3698                 if(!$ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 3701                         $this->ctrl->redirect($this, 
"infoScreen");
 
 3704                 $ilToolbar->setFormAction($this->ctrl->getFormAction($this, 
'addDefaults'));
 
 3705                 $ilToolbar->addFormButton($this->lng->txt(
'add'), 
'addDefaults');
 
 3706                 require_once 
'Services/Form/classes/class.ilTextInputGUI.php';
 
 3707                 $ilToolbar->addInputItem(
new ilTextInputGUI($this->lng->txt(
'tst_defaults_defaults_of_test'), 
'name'), 
true);
 
 3709                 require_once 
'Modules/Test/classes/tables/class.ilTestPersonalDefaultSettingsTableGUI.php';
 
 3711                 $defaults = $this->
object->getAvailableDefaults();
 
 3712                 $table->setData((array)$defaults);
 
 3713                 $tpl->setContent($table->getHTML());
 
 3721                 if(isset(
$_POST[
'chb_defaults']) && is_array(
$_POST[
'chb_defaults']) && count(
$_POST[
'chb_defaults']))
 
 3723                         foreach(
$_POST[
'chb_defaults'] as $test_default_id)
 
 3725                                 $this->
object->deleteDefaults($test_default_id);
 
 3732                 $this->defaultsObject();
 
 3749                 if( count(
$_POST[
"chb_defaults"]) != 1 )
 
 3752                                 $this->lng->txt(
"tst_defaults_apply_select_one")
 
 3755                         return $this->defaultsObject();
 
 3759                 if($this->object->evalTotalPersons() > 0)
 
 3762                                 $this->lng->txt(
"tst_defaults_apply_not_possible")
 
 3765                         return $this->defaultsObject();
 
 3768                 $defaults =& $this->
object->getTestDefaults(
$_POST[
"chb_defaults"][0]);
 
 3769                 $defaultSettings = unserialize($defaults[
"defaults"]);
 
 3771                 if( isset($defaultSettings[
'isRandomTest']) )
 
 3773                         if( $defaultSettings[
'isRandomTest'] )
 
 3784                 elseif( isset($defaultSettings[
'questionSetType']) )
 
 3786                         $newQuestionSetType = $defaultSettings[
'questionSetType'];
 
 3788                 $oldQuestionSetType = $this->
object->getQuestionSetType();
 
 3789                 $questionSetTypeSettingSwitched = ( $oldQuestionSetType != $newQuestionSetType );
 
 3791                 $oldQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfigByType($oldQuestionSetType);
 
 3795                         case !$questionSetTypeSettingSwitched:
 
 3796                         case !$oldQuestionSetConfig->doesQuestionSetRelatedDataExist():
 
 3803                                 require_once 
'Modules/Test/classes/confirmations/class.ilTestSettingsChangeConfirmationGUI.php';
 
 3806                                 $confirmation->setFormAction( $this->ctrl->getFormAction($this) );
 
 3807                                 $confirmation->setCancel($this->lng->txt(
'cancel'), 
'defaults');
 
 3808                                 $confirmation->setConfirm($this->lng->txt(
'confirm'), 
'confirmedApplyDefaults');
 
 3810                                 $confirmation->setOldQuestionSetType($this->object->getQuestionSetType());
 
 3811                                 $confirmation->setNewQuestionSetType($newQuestionSetType);
 
 3812                                 $confirmation->setQuestionLossInfoEnabled(
false);
 
 3813                                 $confirmation->build();
 
 3815                                 $confirmation->populateParametersFromPost();
 
 3817                                 $this->tpl->setContent( $this->ctrl->getHTML($confirmation) );
 
 3822                 if( $questionSetTypeSettingSwitched && $this->object->isOnline() )
 
 3824                         $this->
object->setOnline(
false);
 
 3826                         $info = $this->lng->txt(
"tst_set_offline_due_to_switched_question_set_type_setting");
 
 3831                 $this->
object->applyDefaults($defaults);
 
 3835                 if( $questionSetTypeSettingSwitched && $oldQuestionSetConfig->doesQuestionSetRelatedDataExist() )
 
 3837                         $oldQuestionSetConfig->removeQuestionSetRelatedData();
 
 3840                 $this->ctrl->redirect($this, 
'defaults');
 
 3848                 if (strlen(
$_POST[
"name"]) > 0)
 
 3850                         $this->
object->addDefaults(
$_POST[
'name']);
 
 3856                 $this->defaultsObject();
 
 3866                 $this->ctrl->setCmd(
"showSummary");
 
 3867                 $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
 3868                 $this->infoScreen();
 
 3873                 $this->ctrl->setCmd(
"showSummary");
 
 3874                 $this->ctrl->setCmdClass(
"ilinfoscreengui");
 
 3875                 $this->infoScreen(
$_GET[
'lock']);
 
 3881         function infoScreen($session_lock = 
"")
 
 3888                 global $ilAccess, 
$ilUser, $ilToolbar;
 
 3890                 require_once 
'Modules/Test/classes/class.ilTestDynamicQuestionSetFilterSelection.php';
 
 3892                 $testQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
 
 3893                 $testSession = $this->testSessionFactory->getSession();
 
 3894                 $testSequence = $this->testSequenceFactory->getSequence($testSession);
 
 3895                 $testSequence->loadFromDb();
 
 3898                 $testPlayerGUI = $this->testPlayerFactory->getPlayerGUI();
 
 3900                 if (
$_GET[
'createRandomSolutions'])
 
 3902                         $this->
object->createRandomSolutions(
$_GET[
'createRandomSolutions']);
 
 3905                 if (!$ilAccess->checkAccess(
"read", 
"", $this->ref_id))
 
 3907                         $this->ilias->raiseError($this->lng->txt(
"msg_no_perm_read"),$this->ilias->error_obj->MESSAGE);
 
 3910                 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
 
 3913                 $this->ctrl->setParameter($testPlayerGUI, 
"sequence", $testSession->getLastSequence());
 
 3915                 $info->setFormAction($this->ctrl->getFormAction($testPlayerGUI));
 
 3917                 if (strlen($session_lock))
 
 3919                         $info->addHiddenElement(
"lock", $session_lock);
 
 3923                         $info->addHiddenElement(
"lock", md5(
$_COOKIE[
'PHPSESSID'] . time()));
 
 3925                 $online_access = 
false;
 
 3926                 if ($this->object->getFixedParticipants())
 
 3928                         include_once 
"./Modules/Test/classes/class.ilObjTestAccess.php";
 
 3930                         if ($online_access_result === 
true)
 
 3932                                 $online_access = 
true;
 
 3940                 $enter_anonymous_code = 
false;
 
 3941                 if( $this->object->isOnline() && $this->
object->isComplete( $this->testQuestionSetConfigFactory->getQuestionSetConfig() ) )
 
 3943                         if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read", 
"", $this->ref_id))
 
 3945                                 $executable = $this->
object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE
 
 3947                                 if ($executable[
"executable"])
 
 3949                                         if( $this->object->areObligationsEnabled() && $this->
object->hasObligations($this->object->getTestId()) )
 
 3954                                         if ($testSession->getActiveId() > 0)
 
 3957                                                 require_once 
'Modules/Test/classes/class.ilTestPassesSelector.php';
 
 3959                                                 $testPassesSelector->setActiveId($testSession->getActiveId());
 
 3960                                                 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
 
 3962                                                 $closedPasses = $testPassesSelector->getClosedPasses();
 
 3963                                                 $existingPasses = $testPassesSelector->getExistingPasses();
 
 3965                                                 if ($existingPasses > $closedPasses)
 
 3967                                                         $resumeTestLabel = $this->lng->txt(
"tst_resume_test");
 
 3968                                                         $big_button[] = array(
'resumePlayer', $resumeTestLabel, 
true);
 
 3972                                                         $resumeTestLabel = $this->
object->getStartTestLabel($testSession->getActiveId());
 
 3973                                                         $big_button[] = array(
'startPlayer', $resumeTestLabel, 
true);
 
 3980                                                 $big_button[] = array(
"startPlayer", $this->object->getStartTestLabel($testSession->getActiveId()), 
true);
 
 3987                                 if ($testSession->getActiveId() > 0)
 
 3991                                         require_once 
'Modules/Test/classes/class.ilTestPassesSelector.php';
 
 3993                                         $testPassesSelector->setActiveId($testSession->getActiveId());
 
 3994                                         $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
 
 3996                                         if ($this->object->canShowTestResults($testSession, $ilUser->getId()) && count($testPassesSelector->getReportablePasses())) 
 
 3999                                                 $big_button[] = array(
"outUserResultsOverview", $this->lng->txt(
"tst_show_results"), 
false);
 
 4000                                                 if ($this->object->getHighscoreEnabled())
 
 4003                                                         $big_button[] = array(
"outResultsToplist", $this->lng->txt(
"tst_show_toplist"), 
false);
 
 4009                         if ($testSession->getActiveId() > 0)
 
 4011                                 if ($this->object->canShowSolutionPrintview($ilUser->getId()))
 
 4014                                         $big_button[] = array(
"outUserListOfAnswerPasses", $this->lng->txt(
"tst_list_of_answers_show"), 
false);
 
 4023                         if(
$_SESSION[
"AccountId"] == ANONYMOUS_USER_ID)
 
 4025                                 $enter_anonymous_code = 
true;
 
 4029                 if( !$this->object->isOnline() && !$testQuestionSetConfig->areDepenciesBroken() )
 
 4031                         $message = $this->lng->txt(
"test_is_offline");
 
 4033                         if($ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 4035                                 $message .= 
"<br /><a href=\"".$this->ctrl->getLinkTargetByClass(
'ilobjtestsettingsgeneralgui').
"\">".
 
 4036                                         $this->lng->txt(
"test_edit_settings").
"</a>";
 
 4042                 if( $ilAccess->checkAccess(
"write", 
"", $this->ref_id) )
 
 4044                         $testQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
 
 4046                         if( $testQuestionSetConfig->areDepenciesBroken() )
 
 4050                                 $big_button = array();
 
 4051                                 $enter_anonymous_code = 
false;
 
 4053                         elseif( $testQuestionSetConfig->areDepenciesInVulnerableState() )
 
 4055                                 ilUtil::sendInfo( $testQuestionSetConfig->getDepenciesInVulnerableStateMessage($this->lng) );
 
 4059                 if ($this->object->getShowInfo())
 
 4061                         $info->enablePrivateNotes();
 
 4064                 if($big_button || $enter_anonymous_code)
 
 4066                         $ilToolbar->setFormAction($this->ctrl->getFormAction($testPlayerGUI));
 
 4068                         foreach($big_button as $button)
 
 4070                                 if( isset($button[3]) && strlen($button[3]) )
 
 4072                                         $ilToolbar->addButton($button[1], $button[3], 
'', 
'', 
'', 
'', $button[2] ? 
'submit emphSubmit' : 
'submit');
 
 4076                                         $ilToolbar->addFormButton($button[1], $button[0], 
"", $button[2]);
 
 4080                         if($enter_anonymous_code)
 
 4084                                         $ilToolbar->addSeparator();
 
 4087                                 require_once 
'Services/Form/classes/class.ilTextInputGUI.php';
 
 4088                                 $anonymous_id = 
new ilTextInputGUI($this->lng->txt(
'enter_anonymous_code'), 
'anonymous_id');
 
 4090                                 $ilToolbar->addInputItem($anonymous_id, 
true);
 
 4091                                 $ilToolbar->addFormButton($this->lng->txt(
'submit'), 
'setAnonymousId');
 
 4094                         $ilToolbar->setCloseFormTag(
false);
 
 4095                         $info->setOpenFormTag(
false);
 
 4098                 if (strlen($this->object->getIntroduction()))
 
 4100                         $info->addSection($this->lng->txt(
"tst_introduction"));
 
 4101                         $info->addProperty(
"", $this->object->prepareTextareaOutput($this->object->getIntroduction(), 
true).
 
 4102                                         $info->getHiddenToggleButton());
 
 4106                         $info->addSection(
"");
 
 4107                         $info->addProperty(
"", $info->getHiddenToggleButton());
 
 4110                 $info->addSection($this->lng->txt(
"tst_general_properties"));
 
 4111                 if ($this->object->getShowInfo())
 
 4113                         $info->addProperty($this->lng->txt(
"author"), $this->
object->getAuthor());
 
 4114                         $info->addProperty($this->lng->txt(
"title"), $this->
object->getTitle());
 
 4116                 if( $this->object->isOnline() && $this->
object->isComplete( $this->testQuestionSetConfigFactory->getQuestionSetConfig() ) )
 
 4118                         if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read", 
"", $this->ref_id))
 
 4120                                 if ($this->object->getShowInfo() || !$this->
object->getForceJS())
 
 4123                                         $checked_javascript = 
false;
 
 4124                                         if ($this->object->getJavaScriptOutput())
 
 4126                                                 $checked_javascript = 
true;
 
 4128                                         if ($this->object->getForceJS())
 
 4130                                                 $info->addProperty($this->lng->txt(
"tst_test_output"), $this->lng->txt(
"tst_use_javascript"));
 
 4134                                                 $info->addPropertyCheckbox($this->lng->txt(
"tst_test_output"), 
"chb_javascript", 1, $this->lng->txt(
"tst_use_javascript"), $checked_javascript);
 
 4138                                 if( !$this->object->isRandomTest() )
 
 4140                                         if ($this->object->getNrOfTries() != 1)
 
 4142                                                 if ($this->object->getUsePreviousAnswers() == 0)
 
 4144                                                         if ($this->object->getShowInfo())
 
 4146                                                                 $info->addProperty($this->lng->txt(
"tst_use_previous_answers"), $this->lng->txt(
"tst_dont_use_previous_answers"));
 
 4151                                                         $use_previous_answers = FALSE;
 
 4152                                                         if ($ilUser->prefs[
"tst_use_previous_answers"])
 
 4154                                                                 $checked_previous_answers = TRUE;
 
 4156                                                         $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);
 
 4163                 $info->hideFurtherSections(
false);
 
 4165                 if ($this->object->getShowInfo())
 
 4167                         $info->addSection($this->lng->txt(
"tst_sequence_properties"));
 
 4168                         $info->addProperty($this->lng->txt(
"tst_sequence"), $this->lng->txt(($this->object->getSequenceSettings() == 
TEST_FIXED_SEQUENCE)? 
"tst_sequence_fixed":
"tst_sequence_postpone"));
 
 4170                         $info->addSection($this->lng->txt(
"tst_heading_scoring"));
 
 4171                         $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"));
 
 4172                         $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"));
 
 4173                         if ($this->object->isRandomTest())
 
 4175                                 $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"));
 
 4178                         $info->addSection($this->lng->txt(
"tst_score_reporting"));
 
 4179                         $score_reporting_text = 
"";
 
 4180                         switch ($this->object->getScoreReporting())
 
 4183                                         $score_reporting_text = $this->lng->txt(
"tst_report_after_test");
 
 4186                                         $score_reporting_text = $this->lng->txt(
"tst_report_after_first_question");
 
 4189                                         $score_reporting_text = $this->lng->txt(
"tst_report_after_date");
 
 4192                                         $score_reporting_text = $this->lng->txt(
"tst_report_never");
 
 4195                         $info->addProperty($this->lng->txt(
"tst_score_reporting"), $score_reporting_text); 
 
 4196                         $reporting_date = $this->
object->getReportingDate();
 
 4197                         if ($reporting_date)
 
 4199                                 #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches); 
 4200                                 #$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])); 
 4201                                 #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date); 
 4202                                 $info->addProperty($this->lng->txt(
'tst_score_reporting_date'),
 
 4206                         $info->addSection($this->lng->txt(
"tst_session_settings"));
 
 4207                         $info->addProperty($this->lng->txt(
"tst_nr_of_tries"), ($this->
object->getNrOfTries() == 0)?$this->lng->txt(
"unlimited"):$this->
object->getNrOfTries());
 
 4208                         if ($this->object->getNrOfTries() != 1)
 
 4210                                 $info->addProperty($this->lng->txt(
"tst_nr_of_tries_of_user"), ($testSession->getPass() == 
false)?$this->lng->txt(
"tst_no_tries"):$testSession->getPass());
 
 4213                         if ($this->object->getEnableProcessingTime())
 
 4215                                 $info->addProperty($this->lng->txt(
"tst_processing_time"), $this->
object->getProcessingTime());
 
 4217                         if (strlen($this->object->getAllowedUsers()) && ($this->object->getAllowedUsersTimeGap()))
 
 4219                                 $info->addProperty($this->lng->txt(
"tst_allowed_users"), $this->
object->getAllowedUsers());
 
 4222                         $starting_time = $this->
object->getStartingTime();
 
 4225                                 $info->addProperty($this->lng->txt(
"tst_starting_time"),
 
 4228                         $ending_time = $this->
object->getEndingTime();
 
 4231                                 $info->addProperty($this->lng->txt(
"tst_ending_time"),
 
 4234                         $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
 
 4238                 $this->ctrl->forwardCommand($info);
 
 4244                 switch ($this->ctrl->getCmd())
 
 4248                         case "redirectToInfoScreen":
 
 4255                         case "outCorrectSolution":
 
 4257                         case "showAnswersOfUser":
 
 4258                         case "outUserResultsOverview":
 
 4259                         case "backFromSummary":
 
 4260                         case "show_answers":
 
 4263                         case "outTestSummary":
 
 4264                         case "outQuestionSummary":
 
 4265                         case "gotoQuestion":
 
 4266                         case "selectImagemapRegion":
 
 4267                         case "confirmSubmitAnswers":
 
 4268                         case "finalSubmission":
 
 4270                         case "redirectQuestion":
 
 4271                         case "outUserPassDetails":
 
 4272                         case "checkPassword":
 
 4273                                 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, 
"infoScreen"), 
"", 
$_GET[
"ref_id"]);
 
 4276                         case "evalAllUsers":
 
 4277                         case "evalUserDetail":
 
 4278                                 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, 
"eval_stat"), 
"", 
$_GET[
"ref_id"]);
 
 4285                         case "importVerifiedFile":
 
 4286                         case "cancelImport":
 
 4289                                 $ilLocator->addItem($this->object->getTitle(), $this->ctrl->getLinkTarget($this, 
""), 
"", 
$_GET[
"ref_id"]);
 
 4297                 if ($ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 4299                         $this->ctrl->saveParameterByClass($this->ctrl->getCmdClass(), 
'q_id');
 
 4301                         $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTargetByClass($this->ctrl->getCmdClass(), 
"questions"));
 
 4302                         $tabs_gui->addTarget(
"tst_browse_for_questions",
 
 4303                                 $this->ctrl->getLinkTarget($this, 
"browseForQuestions"),
 
 4304                                 array(
"browseForQuestions", 
"filter", 
"resetFilter", 
"resetTextFilter", 
"insertQuestions"),
 
 4313                 if ($ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 4316                         $tabs_gui->setBackTarget($this->lng->txt(
"backtocallingtest"), $this->ctrl->getLinkTarget($this, 
"questions"));
 
 4317                         $tabs_gui->addTarget(
"random_selection",
 
 4318                                 $this->ctrl->getLinkTarget($this, 
"randomQuestions"),
 
 4319                                 array(
"randomQuestions"),
 
 4334                 include_once 
"./Services/Certificate/classes/class.ilCertificateGUI.php";
 
 4335                 include_once 
"./Modules/Test/classes/class.ilTestCertificateAdapter.php";
 
 4337                 $output_gui->certificateEditor();
 
 4343                 $ilTabs->activateTab(
'assQuestions');
 
 4344                 $a_cmd = $ilCtrl->getCmd();
 
 4346                 if (!$this->object->isRandomTest())
 
 4348                 #if (in_array($this->object->getEnabledViewMode(), array('both', 'express'))) { 
 4349                     $questions_per_page = ($a_cmd == 
'questions_per_page' || ($a_cmd == 
'removeQuestions' && 
$_REQUEST[
'test_express_mode'])) ? 
true : 
false;
 
 4351                     $this->tabs_gui->addSubTabTarget(
 
 4352                             "questions_per_page_view",
 
 4353                             $this->ctrl->getLinkTargetByClass(
'iltestexpresspageobjectgui', 
'showPage'),
 
 4354                             "", 
"", 
"", $questions_per_page);
 
 4357                 include_once 
"Services/Administration/classes/class.ilSettingsTemplate.php";
 
 4360                 if (!in_array(
'questions', $template->getHiddenTabs())) {
 
 4362                     $ilTabs->addSubTabTarget(
"edit_test_questions",
 
 4363                              $this->ctrl->getLinkTarget($this,
'questions'),
 
 4364                              array(
"questions", 
"browseForQuestions", 
"questionBrowser", 
"createQuestion",
 
 4365                              "randomselect", 
"filter", 
"resetFilter", 
"insertQuestions",
 
 4366                              "back", 
"createRandomSelection", 
"cancelRandomSelect",
 
 4367                              "insertRandomSelection", 
"removeQuestions", 
"moveQuestions",
 
 4368                              "insertQuestionsBefore", 
"insertQuestionsAfter", 
"confirmRemoveQuestions",
 
 4369                              "cancelRemoveQuestions", 
"executeCreateQuestion", 
"cancelCreateQuestion",
 
 4370                              "addQuestionpool", 
"saveRandomQuestions", 
"saveQuestionSelectionMode"),
 
 4373                     if (in_array($a_cmd, array(
'questions', 
'createQuestion')) || ($a_cmd == 
'removeQuestions' && !
$_REQUEST[
'test_express_mode']))
 
 4374                             $this->tabs_gui->activateSubTab(
'edit_test_questions');
 
 4379                 if (!$this->object->isRandomTest())
 
 4381                         $ilTabs->addSubTabTarget(
"print_view",
 
 4382                                  $this->ctrl->getLinkTarget($this,
'print'),
 
 4383                                  "print", 
"", 
"", $this->ctrl->getCmd() == 
'print');
 
 4384                         $ilTabs->addSubTabTarget(
'review_view', 
 
 4385                                  $this->ctrl->getLinkTarget($this, 
'review'), 
 
 4386                                  'review', 
'', 
'', $this->ctrl->getCmd() == 
'review');
 
 4397                 $ilTabs->addSubTabTarget(
"eval_all_users",
 
 4398                          $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui", 
"outEvaluation"),
 
 4399                          array(
"outEvaluation", 
"detailedEvaluation", 
"exportEvaluation", 
"evalUserDetail", 
"passDetails",
 
 4400                                 "outStatisticsResultsOverview", 
"statisticsPassDetails")
 
 4404                 $ilTabs->addSubTabTarget(
"tst_results_aggregated",
 
 4405                         $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui", 
"eval_a"),
 
 4410                 $ilTabs->addSubTabTarget(
"tst_single_results",
 
 4411                         $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui", 
"singleResults"),
 
 4412                         array(
"singleResults"),
 
 4421                 $ilTabs->addSubTabTarget(
'general', $this->ctrl->getLinkTargetByClass(
'ilObjTestSettingsGeneralGUI'),
 
 4423                          array(
'ilobjtestsettingsgeneralgui')                   
 
 4426                 if (!in_array(
'mark_schema', $hiddenTabs)) {
 
 4428                     $ilTabs->addSubTabTarget(
 
 4430                             $this->ctrl->getLinkTarget($this,
'marks'),
 
 4431                             array(
"marks", 
"addMarkStep", 
"deleteMarkSteps", 
"addSimpleMarkSchema",
 
 4432                                     "saveMarks", 
"cancelMarks"),
 
 4433                             array(
"", 
"ilobjtestgui", 
"ilcertificategui")
 
 4438                 $ilTabs->addSubTabTarget(
 
 4440                         $this->ctrl->getLinkTarget($this,
'scoring'),
 
 4442                         array(
"", 
"ilobjtestgui", 
"ilcertificategui")
 
 4446                 include_once 
"Services/Certificate/classes/class.ilCertificate.php";
 
 4449                         $ilTabs->addSubTabTarget(
 
 4451                                 $this->ctrl->getLinkTarget($this,
'certificate'),
 
 4452                                 array(
"certificate", 
"certificateEditor", 
"certificateRemoveBackground", 
"certificateSave",
 
 4453                                         "certificatePreview", 
"certificateDelete", 
"certificateUpload", 
"certificateImport"),
 
 4454                                 array(
"", 
"ilobjtestgui", 
"ilcertificategui")
 
 4458                 if (!in_array(
'defaults', $hiddenTabs)) {
 
 4460                     $ilTabs->addSubTabTarget(
 
 4461                             "tst_default_settings",
 
 4462                             $this->ctrl->getLinkTarget($this, 
"defaults"),
 
 4463                             array(
"defaults", 
"deleteDefaults", 
"addDefaults", 
"applyDefaults"),
 
 4464                             array(
"", 
"ilobjtestgui", 
"ilcertificategui")
 
 4474                 $ilTabs->addSubTabTarget( 
"participants",
 
 4475                         $this->ctrl->getLinkTarget($this,
'participants'),
 
 4477                                 "participants", 
"saveClientIP",
 
 4478                                 "removeParticipant",
 
 4479                                 "showParticipantAnswersForAuthor",
 
 4480                                 "deleteAllUserResults",
 
 4481                                 "cancelDeleteAllUserData", 
"deleteSingleUserResults",
 
 4482                                 "outParticipantsResultsOverview", 
"outParticipantsPassDetails",
 
 4483                                 "showPassOverview", 
"showUserAnswers", 
"participantsAction",
 
 4484                                 "showDetailedResults",
 
 4485                                 'npResetFilter', 
'npSetFilter' 
 4490                 if( !$this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken() )
 
 4492                         if($this->object->getProcessingTimeInSeconds() > 0 && $this->
object->getNrOfTries() == 1)
 
 4495                                 $ilTabs->addSubTabTarget( 
"timing",
 
 4496                                         $this->ctrl->getLinkTarget($this,
'timingOverview'),
 
 4497                                         array(
"timing", 
"timingOverview"), 
"", 
"" 
 4510                 global $ilAccess, 
$ilUser, $ilHelp;
 
 4512                 if (preg_match(
'/^ass(.*?)gui$/i', $this->ctrl->getNextClass($this))) {
 
 4515                 else if ($this->ctrl->getNextClass($this) == 
'ilassquestionpagegui') {
 
 4519                 $ilHelp->setScreenIdComponent(
"tst");
 
 4521                 $hidden_tabs = array();
 
 4523                 $template = $this->
object->getTemplate();
 
 4526                         include_once 
"Services/Administration/classes/class.ilSettingsTemplate.php";
 
 4529                         $hidden_tabs = $template->getHiddenTabs();
 
 4533                 $curUserHasWriteAccess = $ilAccess->checkAccess(
"write", 
"", $this->ref_id);
 
 4535                 switch( $this->ctrl->getCmdClass() )
 
 4537                         case 'iltestoutputgui':
 
 4541                         case 'ilobjtestsettingsgeneralgui':
 
 4543                                 if( $curUserHasWriteAccess )
 
 4551                 switch ($this->ctrl->getCmd())
 
 4557                         case "directfeedback":
 
 4559                         case "outCorrectSolution":
 
 4561                         case "showAnswersOfUser":
 
 4562                         case "outUserResultsOverview":
 
 4563                         case "backFromSummary":
 
 4564                         case "show_answers":
 
 4567                         case "confirmFinish":
 
 4568                         case "outTestSummary":
 
 4569                         case "outQuestionSummary":
 
 4570                         case "gotoQuestion":
 
 4571                         case "selectImagemapRegion":
 
 4572                         case "confirmSubmitAnswers":
 
 4573                         case "finalSubmission":
 
 4575                         case "redirectQuestion":
 
 4576                         case "outUserPassDetails":
 
 4577                         case "checkPassword":
 
 4578                         case "exportCertificate":
 
 4579                         case "finishListOfAnswers":
 
 4580                         case "backConfirmFinish":
 
 4581                         case "showFinalStatement":
 
 4584                         case "browseForQuestions":
 
 4587                         case "resetTextFilter":
 
 4588                         case "insertQuestions":
 
 4590                                 if($this->ctrl->getNextClass($this) != 
"illearningprogressgui")
 
 4600                         case "deleteMarkSteps":
 
 4601                         case "addSimpleMarkSchema":
 
 4603                         case "certificateservice":
 
 4604                         case "certificateImport":
 
 4605                         case "certificateUpload":
 
 4606                         case "certificateEditor":
 
 4607                         case "certificateDelete":
 
 4608                         case "certificateSave":
 
 4610                         case "deleteDefaults":
 
 4612                         case "applyDefaults":
 
 4613                         case "inviteParticipants":
 
 4614                         case "searchParticipants":
 
 4615                                 if( $curUserHasWriteAccess && in_array($this->ctrl->getCmdClass(), array(
'ilobjtestgui', 
'ilcertificategui')) )
 
 4625                         case "detailedEvaluation":
 
 4626                         case "outEvaluation":
 
 4627                         case "singleResults":
 
 4628                         case "exportEvaluation":
 
 4629                         case "evalUserDetail":
 
 4631                         case "outStatisticsResultsOverview":
 
 4632                         case "statisticsPassDetails":
 
 4637                 if (strcmp(strtolower(get_class($this->
object)), 
"ilobjtest") == 0)
 
 4640                         if ($ilAccess->checkAccess(
"write", 
"", $this->ref_id) && !in_array(
'assQuestions', $hidden_tabs))
 
 4642                                 $force_active = (
$_GET[
"up"] != 
"" || 
$_GET[
"down"] != 
"")
 
 4647                                         if (
$_GET[
"browse"] == 1) $force_active = 
true;
 
 4650                                 switch( $this->object->getQuestionSetType() )
 
 4653                                                 $target = $this->ctrl->getLinkTargetByClass(
'iltestexpresspageobjectgui',
'showPage');
 
 4657                                                 $target = $this->ctrl->getLinkTargetByClass(
'ilTestRandomQuestionSetConfigGUI');
 
 4661                                                 $target = $this->ctrl->getLinkTargetByClass(
'ilObjTestDynamicQuestionSetConfigGUI');
 
 4665                                 $tabs_gui->addTarget(
"assQuestions",
 
 4668                                          array(
"questions", 
"browseForQuestions", 
"questionBrowser", 
"createQuestion", 
 
 4669                                          "randomselect", 
"filter", 
"resetFilter", 
"insertQuestions",
 
 4670                                          "back", 
"createRandomSelection", 
"cancelRandomSelect",
 
 4671                                          "insertRandomSelection", 
"removeQuestions", 
"moveQuestions",
 
 4672                                          "insertQuestionsBefore", 
"insertQuestionsAfter", 
"confirmRemoveQuestions",
 
 4673                                          "cancelRemoveQuestions", 
"executeCreateQuestion", 
"cancelCreateQuestion",
 
 4674                                          "addQuestionpool", 
"saveRandomQuestions", 
"saveQuestionSelectionMode", 
"print",
 
 4675                                         "addsource", 
"removesource", 
"randomQuestions"), 
 
 4676                                          "", 
"", $force_active);
 
 4680                         if ($ilAccess->checkAccess(
"read", 
"", $this->ref_id) && !in_array(
'info_short', $hidden_tabs))
 
 4682                                 $tabs_gui->addTarget(
"info_short",
 
 4683                                          $this->ctrl->getLinkTarget($this,
'infoScreen'),
 
 4684                                          array(
"infoScreen", 
"outIntroductionPage", 
"showSummary", 
 
 4685                                          "setAnonymousId", 
"outUserListOfAnswerPasses", 
"redirectToInfoScreen"));
 
 4689                         if ($ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 4691                                 if (!in_array(
'settings', $hidden_tabs))
 
 4693                                         $settingsCommands = array(
 
 4694                                                 "marks", 
"addMarkStep", 
"deleteMarkSteps", 
"addSimpleMarkSchema", 
"saveMarks", 
"cancelMarks", 
 
 4695                                                 "certificate", 
"certificateEditor", 
"certificateRemoveBackground", 
"certificateSave",
 
 4696                                                 "certificatePreview", 
"certificateDelete", 
"certificateUpload", 
"certificateImport",
 
 4697                                                 "scoring", 
"defaults", 
"addDefaults", 
"deleteDefaults", 
"applyDefaults",
 
 4698                                                 "inviteParticipants", 
"saveFixedParticipantsStatus", 
"searchParticipants", 
"addParticipants"  
 4701                                         require_once 
'Modules/Test/classes/class.ilObjTestSettingsGeneralGUI.php';
 
 4702                                         $reflection = 
new ReflectionClass(
'ilObjTestSettingsGeneralGUI');
 
 4703                                         foreach($reflection->getConstants() as $name => $value)
 
 4704                                                 if(substr($name, 0, 4) == 
'CMD_') $settingsCommands[] = $value;
 
 4706                                         $settingsCommands[] = 
""; 
 
 4708                                         $tabs_gui->addTarget(
"settings",
 
 4709                                                 $this->ctrl->getLinkTargetByClass(
'ilObjTestSettingsGeneralGUI'),
 
 4710                                                 $settingsCommands, array(
"ilobjtestsettingsgeneralgui", 
"ilobjtestgui", 
"ilcertificategui")
 
 4714                                 if (!in_array(
'participants', $hidden_tabs))
 
 4717                                         $tabs_gui->addTarget(
"participants",
 
 4718                                                 $this->ctrl->getLinkTarget($this,
'participants'),
 
 4720                                                         "participants", 
"saveClientIP",
 
 4721                                                         "removeParticipant", 
 
 4722                                                         "showParticipantAnswersForAuthor",
 
 4723                                                         "deleteAllUserResults",
 
 4724                                                         "cancelDeleteAllUserData", 
"deleteSingleUserResults",
 
 4725                                                         "outParticipantsResultsOverview", 
"outParticipantsPassDetails",
 
 4726                                                         "showPassOverview", 
"showUserAnswers", 
"participantsAction",
 
 4727                                                         "showDetailedResults", 
 
 4728                                                         'timing', 
'timingOverview', 
'npResetFilter', 
'npSetFilter', 
'showTimingForm' 
 4735                         include_once 
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
 
 4738                                 $tabs_gui->addTarget(
'learning_progress',
 
 4739                                                                          $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
 
 4741                                                                          array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
 
 4744                         if ($ilAccess->checkAccess(
"write", 
"", $this->ref_id)  && !in_array(
'manscoring', $hidden_tabs))
 
 4746                                 include_once 
"./Modules/Test/classes/class.ilObjAssessmentFolder.php";
 
 4748                                 if (count($scoring))
 
 4751                                         $tabs_gui->addTarget(
 
 4752                                                         "manscoring", $this->ctrl->getLinkTargetByClass(
'ilTestScoringGUI', 
'showManScoringParticipantsTable'),
 
 4754                                                                 'showManScoringParticipantsTable', 
'applyManScoringParticipantsFilter', 
'resetManScoringParticipantsFilter', 
'showManScoringParticipantScreen',
 
 4755                                                                 'showManScoringByQuestionParticipantsTable', 
'applyManScoringByQuestionFilter', 
'resetManScoringByQuestionFilter', 
'saveManScoringByQuestion' 
 4764                         $scoring_adjust_active = (bool) $setting->get(
'assessment_adjustments_enabled', 
false);
 
 4765                         if ($ilAccess->checkAccess(
"write", 
"", $this->ref_id) && $scoring_adjust_active && !in_array(
'scoringadjust', $hidden_tabs))
 
 4768                                 $tabs_gui->addTarget(
 
 4769                                         "scoringadjust", $this->ctrl->getLinkTargetByClass(
'ilScoringAdjustmentGUI', 
'showquestionlist'),
 
 4772                                                 'applyManScoringParticipantsFilter', 
 
 4773                                                 'saveManScoringByQuestion' 
 4778                         if ((($ilAccess->checkAccess(
"tst_statistics", 
"", $this->ref_id)) || ($ilAccess->checkAccess(
"write", 
"", $this->ref_id)))  && !in_array(
'statistics', $hidden_tabs))
 
 4781                                 $tabs_gui->addTarget(
"statistics",
 
 4782                                          $this->ctrl->getLinkTargetByClass(
"iltestevaluationgui", 
"outEvaluation"),
 
 4783                                          array(
"statistics", 
"outEvaluation", 
"exportEvaluation", 
"detailedEvaluation", 
"eval_a", 
"evalUserDetail",
 
 4784                                                 "passDetails", 
"outStatisticsResultsOverview", 
"statisticsPassDetails", 
"singleResults")
 
 4788                         if ($ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 4790                              if (!in_array(
'history', $hidden_tabs)) {
 
 4793                                 $tabs_gui->addTarget(
"history",
 
 4794                                          $this->ctrl->getLinkTarget($this,
'history'),
 
 4798                              if (!in_array(
'meta_data', $hidden_tabs)) {
 
 4800                                 $tabs_gui->addTarget(
"meta_data",
 
 4801                                          $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
'listSection'),
 
 4802                                          "", 
"ilmdeditorgui");
 
 4805                                 if(!in_array(
'export', $hidden_tabs))
 
 4808                                         $tabs_gui->addTarget(
 
 4810                                                  $this->ctrl->getLinkTargetByClass(
'iltestexportgui' ,
''),
 
 4812                                                  array(
'iltestexportgui')
 
 4817                         if ($ilAccess->checkAccess(
"edit_permission", 
"", $this->ref_id)&& !in_array(
'permissions', $hidden_tabs))
 
 4819                                 $tabs_gui->addTarget(
"perm_settings",
 
 4820                                 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm"), array(
"perm",
"info",
"owner"), 
'ilpermissiongui');
 
 4824                 if( $this->testQuestionSetConfigFactory->getQuestionSetConfig()->areDepenciesBroken() )
 
 4826                         $hideTabs = $this->testQuestionSetConfigFactory->getQuestionSetConfig()->getHiddenTabsOnBrokenDepencies();
 
 4828                         foreach($hideTabs as $tabId)
 
 4830                                 $tabs_gui->removeTab($tabId);
 
 4847                 if ($ilAccess->checkAccess(
"read", 
"", $a_target))
 
 4850                         $_GET[
"baseClass"] = 
"ilObjTestGUI";
 
 4851                         $_GET[
"cmd"] = 
"infoScreen";
 
 4852                         $_GET[
"ref_id"] = $a_target;
 
 4853                         include_once(
"ilias.php");
 
 4857                 else if ($ilAccess->checkAccess(
"read", 
"", ROOT_FOLDER_ID))
 
 4864                 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
 
 4875                 if($this->create_question_mode)
 
 4882                 $ilCtrl->saveParameter($this, 
'q_mode');
 
 4884                 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui', 
'test_express_mode', 1);
 
 4885                 $ilCtrl->setParameter($this, 
'test_express_mode', 1);
 
 4886                 $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui', 
'q_id', 
$_REQUEST[
'q_id']);
 
 4887                 $ilCtrl->setParameter($this, 
'q_id', 
$_REQUEST[
'q_id']);
 
 4888                 $ilToolbar->setFormAction($ilCtrl->getFormActionByClass(
'iltestexpresspageobjectgui', 
'edit'));
 
 4890                 if($this->object->evalTotalPersons() == 0)
 
 4912                         $ilToolbar->addFormButton($lng->txt(
"ass_create_question"), 
"addQuestion");
 
 4914                         $ilToolbar->addSeparator();
 
 4916                         if($this->object->getPoolUsage())
 
 4918                                 $ilToolbar->addFormButton($lng->txt(
"tst_browse_for_questions"), 
"browseForQuestions");
 
 4920                                 $show_separator = 
true;
 
 4924                 $questions = $this->
object->getQuestionTitlesAndIndexes();
 
 4928                 foreach($questions as $id => $label)
 
 4930                         $options[$id] = $label . 
' ['. $this->lng->txt(
'question_id_short') . 
': ' . $id . 
']';
 
 4933                 $optionKeys = array_keys(
$options);
 
 4963                 if(count($questions))
 
 4965                         if(isset($show_separator) && $show_separator)
 
 4967                                 $ilToolbar->addSeparator();
 
 4970                         $ilToolbar->addLink($lng->txt(
"test_prev_question"), $ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui', 
'prevQuestion'), !(count(
$options) > 1 && $optionKeys[0] != $qid));
 
 4971                         $ilToolbar->addLink($lng->txt(
"test_next_question"), $ilCtrl->getLinkTargetByClass(
'iltestexpresspageobjectgui', 
'nextQuestion'), !(count(
$options) > 1 && $optionKeys[count($optionKeys) - 1] != $qid));
 
 4974                 if(count($questions) > 1)
 
 4977                         $ilToolbar->addSeparator();
 
 4979                         include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
 
 4981                         $si->addCustomAttribute(
"onChange=\"forms['ilToolbar'].submit();\"");
 
 4986                                 $si->setValue($qid);
 
 4989                         $ilToolbar->addInputItem(
$si, 
true);
 
 4992                 $total = $this->
object->evalTotalPersons();
 
 5007                 if(count($questions) && !
$total)
 
 5009                         $ilCtrl->setParameter($this, 
'q_id', 
$_REQUEST[
'q_id']);
 
 5010                         $ilToolbar->addSeparator();
 
 5011                         $ilToolbar->addButton($lng->txt(
"test_delete_page"), $ilCtrl->getLinkTarget($this, 
"removeQuestions"));
 
 5014                 if(count($questions) > 1 && !
$total)
 
 5016                         $ilToolbar->addSeparator();
 
 5017                         $ilToolbar->addButton($lng->txt(
"test_move_page"), $ilCtrl->getLinkTarget($this, 
"movePageForm"));
 
 5022                 $online_access = 
false;
 
 5023                 if($this->object->getFixedParticipants())
 
 5025                         include_once 
"./Modules/Test/classes/class.ilObjTestAccess.php";
 
 5027                         if($online_access_result === 
true)
 
 5029                                 $online_access = 
true;
 
 5033                 if($this->object->isOnline() && $this->
object->isComplete( $this->testQuestionSetConfigFactory->getQuestionSetConfig() ))
 
 5035                         if((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess(
"read", 
"", $this->ref_id))
 
 5037                                 $testSession = $this->testSessionFactory->getSession();
 
 5039                                 $executable = $this->
object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE);
 
 5041                                 if($executable[
"executable"])
 
 5044                                         $player_instance = $player_factory->getPlayerGUI();
 
 5046                                         if ($testSession->getActiveId() > 0)
 
 5048                                                 $ilToolbar->addSeparator();
 
 5049                                                 $ilToolbar->addButton($lng->txt(
'tst_resume_test'), $ilCtrl->getLinkTarget($player_instance, 
'resumePlayer'));
 
 5053                                                 $ilToolbar->addSeparator();
 
 5054                                                 $ilToolbar->addButton($lng->txt(
'tst_start_test'), $ilCtrl->getLinkTarget($player_instance, 
'startTest'));
 
 5070                 foreach($questionIds as $q_id)
 
 5073                         $newIds[$q_id] = $newId;
 
 5085                 require_once 
'Modules/TestQuestionPool/classes/class.assQuestion.php';
 
 5088                 $newtitle = $question_gui->object->getTitle();
 
 5089                 if ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle()))
 
 5092                         while ($question_gui->object->questionTitleExists($targetParentId, $question_gui->object->getTitle() . 
" ($counter)"))
 
 5096                         $newtitle = $question_gui->object->getTitle() . 
" ($counter)";
 
 5099                 return $question_gui->object->createNewOriginalFromThisDuplicate($targetParentId, $newtitle);
 
 5107                 global $ilObjDataCache;
 
 5109                 $qplId = $ilObjDataCache->lookupObjId(
$_REQUEST[
'sel_qpl']);
 
 5112                 foreach(
$result->ids as $oldId => $newId)
 
 5119                                 $oldOriginal->delete($oldOriginal->getId());
 
 5122                         $questionInstance->setNewOriginalId($newId);
 
 5131                 include_once 
'Services/Form/classes/class.ilPropertyFormGUI.php';
 
 5136                 $form->addItem($title);
 
 5139                 $form->addItem($description);
 
 5141                 $form->addCommandButton(
'createQuestionPoolAndCopy', $lng->txt(
'create'));
 
 5148                                 $hidden->setValue($id);
 
 5149                                 $form->addItem($hidden);
 
 5165                 require_once 
'Modules/TestQuestionPool/classes/class.assQuestion.php';
 
 5169                         'copyAndLinkToQuestionpool' == $this->ctrl->getCmd() &&
 
 5174                         $this->ctrl->redirect($this, 
'questions');
 
 5242                 $ilTabs->activateSubTab(
'edit_test_questions');
 
 5244                 $this->tpl->addBlockFile(
"ADM_CONTENT", 
"adm_content", 
"tpl.il_as_tst_qpl_select_copy.html", 
"Modules/Test");
 
 5245                 $questionpools =& $this->
object->getAvailableQuestionpools(FALSE, FALSE, FALSE, TRUE, FALSE, 
"write");
 
 5246                 if(count($questionpools) == 0)
 
 5248                         $this->tpl->setCurrentBlock(
"option");
 
 5249                         $this->tpl->setVariable(
"VALUE_QPL", 
"");
 
 5250                         $this->tpl->parseCurrentBlock();
 
 5254                         foreach($questionpools as $key => $value)
 
 5256                                 $this->tpl->setCurrentBlock(
"option");
 
 5257                                 $this->tpl->setVariable(
"VALUE_OPTION", $key);
 
 5258                                 $this->tpl->setVariable(
"TEXT_OPTION", $value[
"title"]);
 
 5259                                 $this->tpl->parseCurrentBlock();
 
 5267                                 $this->tpl->setCurrentBlock(
"hidden");
 
 5268                                 $this->tpl->setVariable(
"HIDDEN_NAME", 
"q_id[]");
 
 5269                                 $this->tpl->setVariable(
"HIDDEN_VALUE", $id);
 
 5270                                 $this->tpl->parseCurrentBlock();
 
 5271                                 $this->tpl->setCurrentBlock(
"adm_content");
 
 5274                 $this->tpl->setVariable(
"FORM_ACTION", $this->ctrl->getFormAction($this));
 
 5276                 if(count($questionpools) == 0)
 
 5278                         $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_enter_questionpool"));
 
 5279                         $cmd = 
'createQuestionPoolAndCopy';
 
 5283                         $this->tpl->setVariable(
"TXT_QPL_SELECT", $this->lng->txt(
"tst_select_questionpool"));
 
 5286                 $this->tpl->setVariable(
"CMD_SUBMIT", 
$cmd);
 
 5287                 $this->tpl->setVariable(
"BTN_SUBMIT", $this->lng->txt(
"submit"));
 
 5288                 $this->tpl->setVariable(
"BTN_CANCEL", $this->lng->txt(
"cancel"));
 
 5293                         case 'copyAndLinkQuestionsToPool':
 
 5295                                 $hidden->setValue(1);
 
 5296                                 $createForm->addItem($hidden);
 
 5298                         case 'copyQuestionsToPool':
 
 5301                 $createForm->setFormAction($this->ctrl->getFormAction($this));
 
 5303                 $this->tpl->parseCurrentBlock();
 
 5309                 $simpleSetters = array(
 
 5310                         'anonymity' => 
'setAnonymity',
 
 5311                         'question_set_type' => 
'setQuestionSetType',
 
 5312                         'use_pool' => 
'setPoolUsage',
 
 5313                         'test_enabled_views' => 
'setEnabledViewMode',
 
 5315                         'introduction' => 
'setIntroduction',
 
 5316                         'showinfo' => 
'setShowInfo',
 
 5317                         'finalstatement' => 
'setFinalStatement',
 
 5318                         'showfinalstatement' => 
'setShowFinalStatement',
 
 5319                         'chb_shuffle_questions' => 
'setShuffleQuestions',
 
 5320                         'list_of_questions' => 
'setListOfQuestionsSettings',
 
 5321                         'chb_show_marker' => 
'setShowMarker',
 
 5322                         'chb_show_cancel' => 
'setShowCancel',
 
 5323                         'kiosk' => 
'setKiosk',
 
 5324                         'nr_of_tries' => 
'setNrOfTries',
 
 5325                         'chb_processing_time' => 
'setEnableProcessingTime',
 
 5326                         'chb_use_previous_answers' => 
'setUsePreviousAnswers',
 
 5327                         'forcejs' => 
'setForceJS',
 
 5328                         'title_output' => 
'setTitleOutput',
 
 5329                         'password' => 
'setPassword',
 
 5330                         'fixedparticipants' => 
'setFixedParticipants',
 
 5331                         'allowedUsers' => 
'setAllowedUsers',
 
 5332                         'allowedUsersTimeGap' => 
'setAllowedUsersTimeGap',
 
 5333                         'mailnotification' => 
'setMailNotification',
 
 5334                         'mailnottype' => 
'setMailNotificationType',
 
 5336                         'count_system' => 
'setCountSystem',
 
 5337                         'mc_scoring' => 
'setMCScoring',
 
 5338                         'score_cutting' => 
'setScoreCutting',
 
 5339                         'pass_scoring' => 
'setScoreReporting',
 
 5341                         'instant_feedback' => 
'setScoringFeedbackOptionsByArray',
 
 5343                         'results_presentation' => 
'setResultsPresentationOptionsByArray',
 
 5344                         'export_settings' => 
'setExportSettings',
 
 5345                         'print_bs_with_res' => 
'setPrintBestSolutionWithResult',
 
 5348             if (!$templateData[
'results_presentation'][
'value'])
 
 5350                         $templateData[
'results_presentation'][
'value'] = array();
 
 5353                 foreach($simpleSetters as $field => $setter)
 
 5355                         if($templateData[$field])
 
 5357                                 $object->$setter($templateData[$field][
'value']);
 
 5365             if (!$ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 5369                     $this->ctrl->redirect($this, 
"infoScreen");
 
 5374                 $orders = $obligations = array();
 
 5376                 foreach(
$_REQUEST[
'order'] as $qId => $order)
 
 5378                         $id = (int)str_replace(
'q_', 
'', $qId);
 
 5380                         $orders[$id] = $order;
 
 5383                 if( $this->object->areObligationsEnabled() && isset(
$_REQUEST[
'obligatory']) && is_array(
$_REQUEST[
'obligatory']) )
 
 5385                         foreach(
$_REQUEST[
'obligatory'] as $qId => $obligation)
 
 5387                                 $id = (int)str_replace(
'q_', 
'', $qId);
 
 5391                                         $obligations[$id] = $obligation;
 
 5396             $this->
object->setQuestionOrderAndObligations(
 
 5397                         $orders, $obligations
 
 5400             $ilCtrl->redirect($this, 
'questions');
 
 5410                 include_once 
"Services/Form/classes/class.ilPropertyFormGUI.php";
 
 5412                 $form->setFormAction($ilCtrl->getFormAction($this, 
"movePage"));
 
 5413                 $form->setTitle($lng->txt(
"test_move_page"));
 
 5417                 $form->addItem($old_pos);
 
 5419                 $questions = $this->
object->getQuestionTitlesAndIndexes();
 
 5420                 if (!is_array($questions))
 
 5421                     $questions = array();
 
 5423                 foreach($questions as $k => $q) {
 
 5425                         unset($questions[$k]);
 
 5428                     $questions[$k] = $lng->txt(
'behind') . 
' '. $q;
 
 5430                 #$questions['0'] = $lng->txt('first'); 
 5433                     0 => $lng->txt(
'first')
 
 5435                 foreach($questions as $k => $q) {
 
 5436                     $options[$k] = $q . 
' ['. $this->lng->txt(
'question_id_short') . 
': ' . $k  . 
']';
 
 5441                 $form->addItem($pos);
 
 5443                 $form->addCommandButton(
"movePage", $lng->txt(
"submit"));
 
 5444                 $form->addCommandButton(
"showPage", $lng->txt(
"cancel"));
 
 5446                 return $tpl->setContent($form->getHTML());
 
 5451             if (!$ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 5455                     $this->ctrl->redirect($this, 
"infoScreen");
 
 5465             $ilCtrl->setParameterByClass(
'iltestexpresspageobjectgui', 
'q_id', 
$_REQUEST[
'q_id']);
 
 5466             $ilCtrl->redirectByClass(
'iltestexpresspageobjectgui', 
'showPage');
 
 5471             if (!$ilAccess->checkAccess(
"write", 
"", $this->ref_id))
 
 5475                     $this->ctrl->redirect($this, 
"infoScreen");
 
 5485                 $this->ctrl->redirect($this, 
'questions');
 
 5490             $questionTitles = $this->
object->getQuestionTitles();
 
 5492             foreach($ids as $id)
 
 5494                 include_once 
"./Modules/TestQuestionPool/classes/class.assQuestion.php";
 
 5498                     $title = $question->object->getTitle();
 
 5500                     while(  in_array( $title . 
' (' . $i . 
')', $questionTitles ))
 
 5503                     $title .= 
' (' . $i . 
')';
 
 5505                     $questionTitles[] = $title;
 
 5507                     $new_id = $question->object->duplicate(
false, $title);
 
 5510                     $clone->object->setObjId($this->object->getId());
 
 5511                     $clone->object->saveToDb();
 
 5513                     $this->
object->insertQuestion( $this->testQuestionSetConfigFactory->getQuestionSetConfig(), $new_id, true );
 
 5521             $this->ctrl->redirect($this, 
'questions');
 
 5531                 if( !$testSession->getActiveId() )
 
 5536                 if( !$this->object->isDynamicTest() )
 
 5541                 if( !$this->object->isPassDeletionAllowed() )
 
 5546                 if( !$testSequence->hasStarted($testSession) )
 
 5560                 require_once 
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
 
 5562                 $this->ctrl->setParameterByClass(
 
 5563                         'iltestevaluationgui', 
'context',
 
 5567                 $this->ctrl->setParameterByClass(
'iltestevaluationgui', 
'active_id', $testSession->getActiveId());
 
 5568                 $this->ctrl->setParameterByClass(
'iltestevaluationgui', 
'pass', $testSession->getPass());
 
 5570                 $big_button[] = array(
 
 5572                         $this->lng->txt(
"tst_delete_dyn_test_results_btn"),
 
 5574                         $this->ctrl->getLinkTargetByClass(
'iltestevaluationgui', 
'confirmDeletePass')