private function buildForm()
 {
     require_once 'Services/Form/classes/class.ilPropertyFormGUI.php';
     $form = new ilPropertyFormGUI();
     $form->setFormAction($this->ctrl->getFormAction($this));
     $form->addCommandButton(self::CMD_SAVE_FORM, $this->lng->txt("save"));
     $form->setTableWidth("100%");
     $form->setId("test_properties");
     if (!$this->settingsTemplate || $this->formShowGeneralSection($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_general_properties"));
         $form->addItem($header);
     }
     // title & description (meta data)
     include_once 'Services/MetaData/classes/class.ilMD.php';
     $md_obj = new ilMD($this->testOBJ->getId(), 0, "tst");
     $md_section = $md_obj->getGeneral();
     $title = new ilTextInputGUI($this->lng->txt("title"), "title");
     $title->setRequired(true);
     $title->setValue($md_section->getTitle());
     $form->addItem($title);
     $ids = $md_section->getDescriptionIds();
     if ($ids) {
         $desc_obj = $md_section->getDescription(array_pop($ids));
         $desc = new ilTextAreaInputGUI($this->lng->txt("description"), "description");
         $desc->setCols(50);
         $desc->setRows(4);
         $desc->setValue($desc_obj->getDescription());
         $form->addItem($desc);
     }
     // anonymity
     $anonymity = new ilRadioGroupInputGUI($this->lng->txt('tst_anonymity'), 'anonymity');
     if ($this->testOBJ->participantDataExist()) {
         $anonymity->setDisabled(true);
     }
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_no_anonymization'), 0);
     $anonymity->addOption($rb);
     $rb = new ilRadioOption($this->lng->txt('tst_anonymity_anonymous_test'), 1);
     $anonymity->addOption($rb);
     $anonymity->setValue((int) $this->testOBJ->getAnonymity());
     $form->addItem($anonymity);
     // test mode (question set type)
     $questSetType = new ilRadioGroupInputGUI($this->lng->txt("tst_question_set_type"), 'question_set_type');
     $questSetTypeFixed = new ilRadioOption($this->lng->txt("tst_question_set_type_fixed"), ilObjTest::QUESTION_SET_TYPE_FIXED, $this->lng->txt("tst_question_set_type_fixed_desc"));
     $questSetType->addOption($questSetTypeFixed);
     $questSetTypeRandom = new ilRadioOption($this->lng->txt("tst_question_set_type_random"), ilObjTest::QUESTION_SET_TYPE_RANDOM, $this->lng->txt("tst_question_set_type_random_desc"));
     $questSetType->addOption($questSetTypeRandom);
     $questSetTypeContinues = new ilRadioOption($this->lng->txt("tst_question_set_type_dynamic"), ilObjTest::QUESTION_SET_TYPE_DYNAMIC, $this->lng->txt("tst_question_set_type_dynamic_desc"));
     $questSetType->addOption($questSetTypeContinues);
     $questSetType->setValue($this->testOBJ->getQuestionSetType());
     if ($this->testOBJ->participantDataExist()) {
         $questSetType->setDisabled(true);
     }
     $form->addItem($questSetType);
     // pool usage
     $pool_usage = new ilCheckboxInputGUI($this->lng->txt("test_question_pool_usage"), "use_pool");
     $pool_usage->setValue(1);
     $pool_usage->setChecked($this->testOBJ->getPoolUsage());
     $form->addItem($pool_usage);
     // enable_archiving
     $enable_archiving = new ilCheckboxInputGUI($this->lng->txt('test_enable_archiving'), 'enable_archiving');
     $enable_archiving->setValue(1);
     $enable_archiving->setChecked($this->testOBJ->getEnableArchiving());
     $form->addItem($enable_archiving);
     // activation/availability  (no template support yet)
     include_once "Services/Object/classes/class.ilObjectActivation.php";
     $this->lng->loadLanguageModule('rep');
     $section = new ilFormSectionHeaderGUI();
     $section->setTitle($this->lng->txt('rep_activation_availability'));
     $form->addItem($section);
     // additional info only with multiple references
     $act_obj_info = $act_ref_info = "";
     if (sizeof(ilObject::_getAllReferences($this->testOBJ->getId())) > 1) {
         $act_obj_info = ' ' . $this->lng->txt('rep_activation_online_object_info');
         $act_ref_info = $this->lng->txt('rep_activation_access_ref_info');
     }
     $online = new ilCheckboxInputGUI($this->lng->txt('rep_activation_online'), 'online');
     $online->setChecked($this->testOBJ->isOnline());
     $online->setInfo($this->lng->txt('tst_activation_online_info') . $act_obj_info);
     $form->addItem($online);
     $act_type = new ilRadioGroupInputGUI($this->lng->txt('rep_activation_access'), 'activation_type');
     $act_type->setInfo($act_ref_info);
     $act_type->setValue($this->testOBJ->isActivationLimited() ? ilObjectActivation::TIMINGS_ACTIVATION : ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_limitless'), ilObjectActivation::TIMINGS_DEACTIVATED);
     $opt->setInfo($this->lng->txt('tst_availability_limitless_info'));
     $act_type->addOption($opt);
     $opt = new ilRadioOption($this->lng->txt('rep_visibility_until'), ilObjectActivation::TIMINGS_ACTIVATION);
     $opt->setInfo($this->lng->txt('tst_availability_until_info'));
     $this->tpl->addJavaScript('./Services/Form/js/date_duration.js');
     include_once "Services/Form/classes/class.ilDateDurationInputGUI.php";
     $dur = new ilDateDurationInputGUI("", "access_period");
     $dur->setShowTime(true);
     $date = $this->testOBJ->getActivationStartingTime();
     $dur->setStart(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setStartText($this->lng->txt('rep_activation_limited_start'));
     $date = $this->testOBJ->getActivationEndingTime();
     $dur->setEnd(new ilDateTime($date ? $date : time(), IL_CAL_UNIX));
     $dur->setEndText($this->lng->txt('rep_activation_limited_end'));
     $opt->addSubItem($dur);
     $visible = new ilCheckboxInputGUI($this->lng->txt('rep_activation_limited_visibility'), 'activation_visibility');
     $visible->setInfo($this->lng->txt('tst_activation_limited_visibility_info'));
     $visible->setChecked($this->testOBJ->getActivationVisibility());
     $opt->addSubItem($visible);
     $act_type->addOption($opt);
     $form->addItem($act_type);
     if (!$this->settingsTemplate || $this->formShowBeginningEndingInformation($this->settingsTemplate->getSettings())) {
         // general properties
         $header = new ilFormSectionHeaderGUI();
         $header->setTitle($this->lng->txt("tst_beginning_ending_information"));
         $form->addItem($header);
     }
     // introduction
     $intro = new ilTextAreaInputGUI($this->lng->txt("tst_introduction"), "introduction");
     $intro->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getIntroduction()));
     $intro->setRows(10);
     $intro->setCols(80);
     $intro->setUseRte(TRUE);
     $intro->addPlugin("latex");
     $intro->addButton("latex");
     $intro->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
     $intro->setRteTagSet('full');
     $intro->setInfo($this->lng->txt('intro_desc'));
     // showinfo
     $showinfo = new ilCheckboxInputGUI('', "showinfo");
     $showinfo->setValue(1);
     $showinfo->setChecked($this->testOBJ->getShowInfo());
     $showinfo->setOptionTitle($this->lng->txt("showinfo"));
     $showinfo->setInfo($this->lng->txt("showinfo_desc"));
     $intro->addSubItem($showinfo);
     $form->addItem($intro);
     // final statement
     $finalstatement = new ilTextAreaInputGUI($this->lng->txt("final_statement"), "finalstatement");
     $finalstatement->setValue($this->testOBJ->prepareTextareaOutput($this->testOBJ->getFinalStatement()));
     $finalstatement->setRows(10);
     $finalstatement->setCols(80);
     $finalstatement->setUseRte(TRUE);
     $finalstatement->addPlugin("latex");
     $finalstatement->addButton("latex");
     $finalstatement->setRTESupport($this->testOBJ->getId(), "tst", "assessment");
     $finalstatement->setRteTagSet('full');
     // show final statement
     $showfinal = new ilCheckboxInputGUI('', "showfinalstatement");
     $showfinal->setValue(1);
     $showfinal->setChecked($this->testOBJ->getShowFinalStatement());
     $showfinal->setOptionTitle($this->lng->txt("final_statement_show"));
     $showfinal->setInfo($this->lng->txt("final_statement_show_desc"));
     $finalstatement->addSubItem($showfinal);
     $form->addItem($finalstatement);
     // examview
     $enable_examview = new ilCheckboxInputGUI($this->lng->txt("enable_examview"), 'enable_examview');
     $enable_examview->setValue(1);
     $enable_examview->setChecked($this->testOBJ->getEnableExamview());
     $enable_examview->setInfo($this->lng->txt("enable_examview_desc"));
     $show_examview_html = new ilCheckboxInputGUI('', 'show_examview_html');
     $show_examview_html->setValue(1);
     $show_examview_html->setChecked($this->testOBJ->getShowExamviewHtml());
     $show_examview_html->setOptionTitle($this->lng->txt("show_examview_html"));
     $show_examview_html->setInfo($this->lng->txt("show_examview_html_desc"));
     $enable_examview->addSubItem($show_examview_html);
     $show_examview_pdf = new ilCheckboxInputGUI('', 'show_examview_pdf');
     $show_examview_pdf->setValue(1);
     $show_examview_pdf->setChecked($this->testOBJ->getShowExamviewPdf());
     $show_examview_pdf->setOptionTitle($this->lng->txt("show_examview_pdf"));
     $show_examview_pdf->setInfo($this->lng->txt("show_examview_pdf_desc"));
     $enable_examview->addSubItem($show_examview_pdf);
     $form->addItem($enable_examview);
     if (!$this->settingsTemplate || $this->formShowSessionSection($this->settingsTemplate->getSettings())) {
         // session properties
         $sessionheader = new ilFormSectionHeaderGUI();
         $sessionheader->setTitle($this->lng->txt("tst_session_settings"));
         $form->addItem($sessionheader);
     }
     // max. number of passes
     $nr_of_tries = new ilTextInputGUI($this->lng->txt("tst_nr_of_tries"), "nr_of_tries");
     $nr_of_tries->setSize(3);
     $nr_of_tries->setValue($this->testOBJ->getNrOfTries());
     $nr_of_tries->setRequired(true);
     $nr_of_tries->setSuffix($this->lng->txt("0_unlimited"));
     $total = $this->testOBJ->evalTotalPersons();
     if ($total) {
         $nr_of_tries->setDisabled(true);
     }
     $form->addItem($nr_of_tries);
     // enable max. processing time
     $processing = new ilCheckboxInputGUI($this->lng->txt("tst_processing_time"), "chb_processing_time");
     $processing->setValue(1);
     //$processing->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_processing_time')) {
         $processing->setChecked(true);
     } else {
         $processing->setChecked($this->testOBJ->getEnableProcessingTime());
     }
     // max. processing time
     $processingtime = new ilDurationInputGUI('', 'processing_time');
     $ptime = $this->testOBJ->getProcessingTimeAsArray();
     $processingtime->setHours($ptime['hh']);
     $processingtime->setMinutes($ptime['mm']);
     $processingtime->setSeconds($ptime['ss']);
     $processingtime->setShowMonths(false);
     $processingtime->setShowDays(false);
     $processingtime->setShowHours(true);
     $processingtime->setShowMinutes(true);
     $processingtime->setShowSeconds(true);
     $processingtime->setInfo($this->lng->txt("tst_processing_time_desc"));
     $processing->addSubItem($processingtime);
     // reset max. processing time
     $resetprocessing = new ilCheckboxInputGUI('', "chb_reset_processing_time");
     $resetprocessing->setValue(1);
     $resetprocessing->setOptionTitle($this->lng->txt("tst_reset_processing_time"));
     $resetprocessing->setChecked($this->testOBJ->getResetProcessingTime());
     $resetprocessing->setInfo($this->lng->txt("tst_reset_processing_time_desc"));
     $processing->addSubItem($resetprocessing);
     $form->addItem($processing);
     // enable starting time
     $enablestartingtime = new ilCheckboxInputGUI($this->lng->txt("tst_starting_time"), "chb_starting_time");
     $enablestartingtime->setValue(1);
     //$enablestartingtime->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_starting_time')) {
         $enablestartingtime->setChecked(true);
     } else {
         $enablestartingtime->setChecked(strlen($this->testOBJ->getStartingTime()));
     }
     // starting time
     $startingtime = new ilDateTimeInputGUI('', 'starting_time');
     $startingtime->setShowDate(true);
     $startingtime->setShowTime(true);
     if (strlen($this->testOBJ->getStartingTime())) {
         $startingtime->setDate(new ilDateTime($this->testOBJ->getStartingTime(), IL_CAL_TIMESTAMP));
     } else {
         $startingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $enablestartingtime->addSubItem($startingtime);
     $form->addItem($enablestartingtime);
     if ($this->testOBJ->participantDataExist()) {
         $enablestartingtime->setDisabled(true);
         $startingtime->setDisabled(true);
     }
     // enable ending time
     $enableendingtime = new ilCheckboxInputGUI($this->lng->txt("tst_ending_time"), "chb_ending_time");
     $enableendingtime->setValue(1);
     //$enableendingtime->setOptionTitle($this->lng->txt("enabled"));
     if ($this->settingsTemplate && $this->getTemplateSettingValue('chb_ending_time')) {
         $enableendingtime->setChecked(true);
     } else {
         $enableendingtime->setChecked(strlen($this->testOBJ->getEndingTime()));
     }
     // ending time
     $endingtime = new ilDateTimeInputGUI('', 'ending_time');
     $endingtime->setShowDate(true);
     $endingtime->setShowTime(true);
     if (strlen($this->testOBJ->getEndingTime())) {
         $endingtime->setDate(new ilDateTime($this->testOBJ->getEndingTime(), IL_CAL_TIMESTAMP));
     } else {
         $endingtime->setDate(new ilDateTime(time(), IL_CAL_UNIX));
     }
     $enableendingtime->addSubItem($endingtime);
     $form->addItem($enableendingtime);
     // test password
     $password = new ilTextInputGUI($this->lng->txt("tst_password"), "password");
     $password->setSize(20);
     $password->setValue($this->testOBJ->getPassword());
     $password->setInfo($this->lng->txt("tst_password_details"));
     $form->addItem($password);
     if (!$this->settingsTemplate || $this->formShowPresentationSection($this->settingsTemplate->getSettings())) {
         // sequence properties
         $seqheader = new ilFormSectionHeaderGUI();
         $seqheader->setTitle($this->lng->txt("tst_presentation_properties"));
         $form->addItem($seqheader);
     }
     // use previous answers
     $prevanswers = new ilCheckboxInputGUI($this->lng->txt("tst_use_previous_answers"), "chb_use_previous_answers");
     $prevanswers->setValue(1);
     $prevanswers->setChecked($this->testOBJ->getUsePreviousAnswers());
     $prevanswers->setInfo($this->lng->txt("tst_use_previous_answers_description"));
     $form->addItem($prevanswers);
     // force js
     $forcejs = new ilCheckboxInputGUI($this->lng->txt("forcejs_short"), "forcejs");
     $forcejs->setValue(1);
     $forcejs->setChecked($this->testOBJ->getForceJS());
     $forcejs->setOptionTitle($this->lng->txt("forcejs"));
     $forcejs->setInfo($this->lng->txt("forcejs_desc"));
     $form->addItem($forcejs);
     // question title output
     $title_output = new ilRadioGroupInputGUI($this->lng->txt("tst_title_output"), "title_output");
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_full"), 0, ''));
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_hide_points"), 1, ''));
     $title_output->addOption(new ilRadioOption($this->lng->txt("tst_title_output_no_title"), 2, ''));
     $title_output->setValue($this->testOBJ->getTitleOutput());
     $title_output->setInfo($this->lng->txt("tst_title_output_description"));
     $form->addItem($title_output);
     // selector for unicode characters
     global $ilSetting;
     if ($ilSetting->get('char_selector_availability') > 0) {
         require_once 'Services/UIComponent/CharSelector/classes/class.ilCharSelectorGUI.php';
         $char_selector = new ilCharSelectorGUI(ilCharSelectorConfig::CONTEXT_TEST);
         $char_selector->getConfig()->setAvailability($this->testOBJ->getCharSelectorAvailability());
         $char_selector->getConfig()->setDefinition($this->testOBJ->getCharSelectorDefinition());
         $char_selector->addFormProperties($form);
         $char_selector->setFormValues($form);
     }
     // Autosave
     $autosave_output = new ilCheckboxInputGUI($this->lng->txt('autosave'), 'autosave');
     $autosave_output->setValue(1);
     $autosave_output->setChecked($this->testOBJ->getAutosave());
     $autosave_output->setInfo($this->lng->txt('autosave_info'));
     $autosave_interval = new ilTextInputGUI($this->lng->txt('autosave_ival'), 'autosave_ival');
     $autosave_interval->setSize(10);
     $autosave_interval->setValue($this->testOBJ->getAutosaveIval() / 1000);
     $autosave_interval->setInfo($this->lng->txt('autosave_ival_info'));
     $autosave_output->addSubItem($autosave_interval);
     $form->addItem($autosave_output);
     if (!$this->settingsTemplate || $this->formShowSequenceSection($this->settingsTemplate->getSettings())) {
         // sequence properties
         $seqheader = new ilFormSectionHeaderGUI();
         $seqheader->setTitle($this->lng->txt("tst_sequence_properties"));
         $form->addItem($seqheader);
     }
     // postpone questions
     $postpone = new ilCheckboxInputGUI($this->lng->txt("tst_postpone"), "chb_postpone");
     $postpone->setValue(1);
     $postpone->setChecked($this->testOBJ->getSequenceSettings());
     $postpone->setInfo($this->lng->txt("tst_postpone_description"));
     $form->addItem($postpone);
     // shuffle questions
     $shuffle = new ilCheckboxInputGUI($this->lng->txt("tst_shuffle_questions"), "chb_shuffle_questions");
     $shuffle->setValue(1);
     $shuffle->setChecked($this->testOBJ->getShuffleQuestions());
     $shuffle->setInfo($this->lng->txt("tst_shuffle_questions_description"));
     $form->addItem($shuffle);
     // show list of questions
     $list_of_questions = new ilCheckboxInputGUI($this->lng->txt("tst_show_summary"), "list_of_questions");
     //$list_of_questions->setOptionTitle($this->lng->txt("tst_show_summary"));
     $list_of_questions->setValue(1);
     $list_of_questions->setChecked($this->testOBJ->getListOfQuestions());
     $list_of_questions->setInfo($this->lng->txt("tst_show_summary_description"));
     $list_of_questions_options = new ilCheckboxGroupInputGUI('', "list_of_questions_options");
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_start"), 'chb_list_of_questions_start', ''));
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_end"), 'chb_list_of_questions_end', ''));
     $list_of_questions_options->addOption(new ilCheckboxOption($this->lng->txt("tst_list_of_questions_with_description"), 'chb_list_of_questions_with_description', ''));
     $values = array();
     if ($this->testOBJ->getListOfQuestionsStart()) {
         array_push($values, 'chb_list_of_questions_start');
     }
     if ($this->testOBJ->getListOfQuestionsEnd()) {
         array_push($values, 'chb_list_of_questions_end');
     }
     if ($this->testOBJ->getListOfQuestionsDescription()) {
         array_push($values, 'chb_list_of_questions_with_description');
     }
     $list_of_questions_options->setValue($values);
     $list_of_questions->addSubItem($list_of_questions_options);
     $form->addItem($list_of_questions);
     // show question marking
     $marking = new ilCheckboxInputGUI($this->lng->txt("question_marking"), "chb_show_marker");
     $marking->setValue(1);
     $marking->setChecked($this->testOBJ->getShowMarker());
     $marking->setInfo($this->lng->txt("question_marking_description"));
     $form->addItem($marking);
     // show suspend test
     $cancel = new ilCheckboxInputGUI($this->lng->txt("tst_show_cancel"), "chb_show_cancel");
     $cancel->setValue(1);
     $cancel->setChecked($this->testOBJ->getShowCancel());
     $cancel->setInfo($this->lng->txt("tst_show_cancel_description"));
     $form->addItem($cancel);
     if (!$this->settingsTemplate || $this->formShowNotificationSection($this->settingsTemplate->getSettings())) {
         // notifications
         $notifications = new ilFormSectionHeaderGUI();
         $notifications->setTitle($this->lng->txt("tst_mail_notification"));
         $form->addItem($notifications);
     }
     // mail notification
     $mailnotification = new ilRadioGroupInputGUI($this->lng->txt("tst_finish_notification"), "mailnotification");
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_no"), 0, ''));
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_simple"), 1, ''));
     $mailnotification->addOption(new ilRadioOption($this->lng->txt("tst_finish_notification_advanced"), 2, ''));
     $mailnotification->setValue($this->testOBJ->getMailNotification());
     $form->addItem($mailnotification);
     $mailnottype = new ilCheckboxInputGUI('', "mailnottype");
     $mailnottype->setValue(1);
     $mailnottype->setOptionTitle($this->lng->txt("mailnottype"));
     $mailnottype->setChecked($this->testOBJ->getMailNotificationType());
     $form->addItem($mailnottype);
     /* This options always active (?) */
     $highscore_head = new ilFormSectionHeaderGUI();
     $highscore_head->setTitle($this->lng->txt("tst_highscore_options"));
     $form->addItem($highscore_head);
     $highscore = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_enabled"), "highscore_enabled");
     $highscore->setValue(1);
     $highscore->setChecked($this->testOBJ->getHighscoreEnabled());
     $highscore->setInfo($this->lng->txt("tst_highscore_description"));
     $form->addItem($highscore);
     $highscore_anon = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_anon"), "highscore_anon");
     $highscore_anon->setValue(1);
     $highscore_anon->setChecked($this->testOBJ->getHighscoreAnon());
     $highscore_anon->setInfo($this->lng->txt("tst_highscore_anon_description"));
     $highscore->addSubItem($highscore_anon);
     $highscore_achieved_ts = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_achieved_ts"), "highscore_achieved_ts");
     $highscore_achieved_ts->setValue(1);
     $highscore_achieved_ts->setChecked($this->testOBJ->getHighscoreAchievedTS());
     $highscore_achieved_ts->setInfo($this->lng->txt("tst_highscore_achieved_ts_description"));
     $highscore->addSubItem($highscore_achieved_ts);
     $highscore_score = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_score"), "highscore_score");
     $highscore_score->setValue(1);
     $highscore_score->setChecked($this->testOBJ->getHighscoreScore());
     $highscore_score->setInfo($this->lng->txt("tst_highscore_score_description"));
     $highscore->addSubItem($highscore_score);
     $highscore_percentage = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_percentage"), "highscore_percentage");
     $highscore_percentage->setValue(1);
     $highscore_percentage->setChecked($this->testOBJ->getHighscorePercentage());
     $highscore_percentage->setInfo($this->lng->txt("tst_highscore_percentage_description"));
     $highscore->addSubItem($highscore_percentage);
     $highscore_hints = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_hints"), "highscore_hints");
     $highscore_hints->setValue(1);
     $highscore_hints->setChecked($this->testOBJ->getHighscoreHints());
     $highscore_hints->setInfo($this->lng->txt("tst_highscore_hints_description"));
     $highscore->addSubItem($highscore_hints);
     $highscore_wtime = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_wtime"), "highscore_wtime");
     $highscore_wtime->setValue(1);
     $highscore_wtime->setChecked($this->testOBJ->getHighscoreWTime());
     $highscore_wtime->setInfo($this->lng->txt("tst_highscore_wtime_description"));
     $highscore->addSubItem($highscore_wtime);
     $highscore_own_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_own_table"), "highscore_own_table");
     $highscore_own_table->setValue(1);
     $highscore_own_table->setChecked($this->testOBJ->getHighscoreOwnTable());
     $highscore_own_table->setInfo($this->lng->txt("tst_highscore_own_table_description"));
     $highscore->addSubItem($highscore_own_table);
     $highscore_top_table = new ilCheckboxInputGUI($this->lng->txt("tst_highscore_top_table"), "highscore_top_table");
     $highscore_top_table->setValue(1);
     $highscore_top_table->setChecked($this->testOBJ->getHighscoreTopTable());
     $highscore_top_table->setInfo($this->lng->txt("tst_highscore_top_table_description"));
     $highscore->addSubItem($highscore_top_table);
     $highscore_top_num = new ilTextInputGUI($this->lng->txt("tst_highscore_top_num"), "highscore_top_num");
     $highscore_top_num->setSize(4);
     $highscore_top_num->setSuffix($this->lng->txt("tst_highscore_top_num_unit"));
     $highscore_top_num->setValue($this->testOBJ->getHighscoreTopNum());
     $highscore_top_num->setInfo($this->lng->txt("tst_highscore_top_num_description"));
     $highscore->addSubItem($highscore_top_num);
     if (!$this->settingsTemplate || $this->formShowTestExecutionSection($this->settingsTemplate->getSettings())) {
         $testExecution = new ilFormSectionHeaderGUI();
         $testExecution->setTitle($this->lng->txt("tst_test_execution"));
         $form->addItem($testExecution);
     }
     // kiosk mode
     $kiosk = new ilCheckboxInputGUI($this->lng->txt("kiosk"), "kiosk");
     $kiosk->setValue(1);
     $kiosk->setChecked($this->testOBJ->getKioskMode());
     $kiosk->setInfo($this->lng->txt("kiosk_description"));
     // kiosk mode options
     $kiosktitle = new ilCheckboxGroupInputGUI($this->lng->txt("kiosk_options"), "kiosk_options");
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_title"), 'kiosk_title', ''));
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt("kiosk_show_participant"), 'kiosk_participant', ''));
     $kiosktitle->addOption(new ilCheckboxOption($this->lng->txt('examid_in_kiosk'), 'examid_in_kiosk'));
     $values = array();
     if ($this->testOBJ->getShowKioskModeTitle()) {
         array_push($values, 'kiosk_title');
     }
     if ($this->testOBJ->getShowKioskModeParticipant()) {
         array_push($values, 'kiosk_participant');
     }
     if ($this->testOBJ->getExamidInKiosk()) {
         array_push($values, 'examid_in_kiosk');
     }
     $kiosktitle->setValue($values);
     $kiosktitle->setInfo($this->lng->txt("kiosk_options_desc"));
     $kiosk->addSubItem($kiosktitle);
     $form->addItem($kiosk);
     $redirection_mode = $this->testOBJ->getRedirectionMode();
     $rm_enabled = new ilCheckboxInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_enabled');
     $rm_enabled->setChecked($redirection_mode == '0' ? false : true);
     $radio_rm = new ilRadioGroupInputGUI($this->lng->txt('redirect_after_finishing_tst'), 'redirection_mode');
     $always = new ilRadioOption($this->lng->txt('tst_results_access_always'), REDIRECT_ALWAYS);
     $radio_rm->addOption($always);
     $kiosk = new ilRadioOption($this->lng->txt('redirect_in_kiosk_mode'), REDIRECT_KIOSK);
     $radio_rm->addOption($kiosk);
     $radio_rm->setValue(in_array($redirection_mode, array(REDIRECT_ALWAYS, REDIRECT_KIOSK)) ? $redirection_mode : REDIRECT_ALWAYS);
     $rm_enabled->addSubItem($radio_rm);
     $redirection_url = new ilTextInputGUI($this->lng->txt('redirection_url'), 'redirection_url');
     $redirection_url->setValue((string) $this->testOBJ->getRedirectionUrl());
     $redirection_url->setRequired(true);
     $rm_enabled->addSubItem($redirection_url);
     $form->addItem($rm_enabled);
     // Sign submission
     $sign_submission = $this->testOBJ->getSignSubmission();
     $sign_submission_enabled = new ilCheckboxInputGUI($this->lng->txt('sign_submission'), 'sign_submission');
     $sign_submission_enabled->setChecked($sign_submission);
     $sign_submission_enabled->setInfo($this->lng->txt('sign_submission_info'));
     $form->addItem($sign_submission_enabled);
     if (!$this->settingsTemplate || $this->formShowParticipantSection($this->settingsTemplate->getSettings())) {
         // participants properties
         $restrictions = new ilFormSectionHeaderGUI();
         $restrictions->setTitle($this->lng->txt("tst_max_allowed_users"));
         $form->addItem($restrictions);
     }
     $fixedparticipants = new ilCheckboxInputGUI($this->lng->txt('participants_invitation'), "fixedparticipants");
     $fixedparticipants->setValue(1);
     $fixedparticipants->setChecked($this->testOBJ->getFixedParticipants());
     $fixedparticipants->setOptionTitle($this->lng->txt("tst_allow_fixed_participants"));
     $fixedparticipants->setInfo($this->lng->txt("participants_invitation_description"));
     $invited_users = $this->testOBJ->getInvitedUsers();
     if ($total && count($invited_users) == 0) {
         $fixedparticipants->setDisabled(true);
     }
     $form->addItem($fixedparticipants);
     // simultaneous users
     $simul = new ilTextInputGUI($this->lng->txt("tst_allowed_users"), "allowedUsers");
     $simul->setSize(3);
     $simul->setValue($this->testOBJ->getAllowedUsers() ? $this->testOBJ->getAllowedUsers() : '');
     $form->addItem($simul);
     // idle time
     $idle = new ilTextInputGUI($this->lng->txt("tst_allowed_users_time_gap"), "allowedUsersTimeGap");
     $idle->setSize(4);
     $idle->setSuffix($this->lng->txt("seconds"));
     $idle->setValue($this->testOBJ->getAllowedUsersTimeGap() ? $this->testOBJ->getAllowedUsersTimeGap() : '');
     $form->addItem($idle);
     // Edit ecs export settings
     include_once 'Modules/Test/classes/class.ilECSTestSettings.php';
     $ecs = new ilECSTestSettings($this->testOBJ);
     $ecs->addSettingsToForm($form, 'tst');
     // remove items when using template
     if ($this->settingsTemplate) {
         foreach ($this->settingsTemplate->getSettings() as $id => $item) {
             if ($item["hide"]) {
                 $form->removeItemByPostVar($id);
             }
         }
     }
     return $form;
 }
Example #2
0
 /**
  * show information screen
  */
 function infoScreen($session_lock = "")
 {
     /**
      * @var $ilAccess  ilAccessHandler
      * @var $ilUser    ilObjUser
      * @var $ilToolbar ilToolbarGUI
      */
     global $ilAccess, $ilUser, $ilToolbar;
     require_once 'Modules/Test/classes/class.ilTestDynamicQuestionSetFilterSelection.php';
     $testQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
     $testSession = $this->testSessionFactory->getSession();
     $testSequence = $this->testSequenceFactory->getSequenceByTestSession($testSession);
     $testSequence->loadFromDb();
     $testSequence->loadQuestions($testQuestionSetConfig, new ilTestDynamicQuestionSetFilterSelection());
     $testPlayerGUI = $this->testPlayerFactory->getPlayerGUI();
     if ($_GET['createRandomSolutions']) {
         $this->object->createRandomSolutions($_GET['createRandomSolutions']);
     }
     if (!$ilAccess->checkAccess("read", "", $this->ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
     }
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     $info = new ilInfoScreenGUI($this);
     $this->ctrl->setParameter($testPlayerGUI, "sequence", $testSession->getLastSequence());
     $info->setFormAction($this->ctrl->getFormAction($testPlayerGUI));
     if (strlen($session_lock)) {
         $info->addHiddenElement("lock", $session_lock);
     } else {
         $info->addHiddenElement("lock", md5($_COOKIE['PHPSESSID'] . time()));
     }
     $online_access = false;
     if ($this->object->getFixedParticipants()) {
         include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
         $online_access_result = ilObjTestAccess::_lookupOnlineTestAccess($this->object->getId(), $ilUser->getId());
         if ($online_access_result === true) {
             $online_access = true;
         } else {
             ilUtil::sendInfo($online_access_result);
         }
     }
     $enter_anonymous_code = false;
     if ($this->object->isOnline() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) {
         if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
             $executable = $this->object->isExecutable($testSession, $ilUser->getId(), $allowPassIncrease = TRUE);
             if ($executable["executable"]) {
                 if ($this->object->areObligationsEnabled() && $this->object->hasObligations($this->object->getTestId())) {
                     ilUtil::sendInfo($GLOBALS['lng']->txt('tst_test_contains_obligatory_questions'));
                 }
                 if ($testSession->getActiveId() > 0) {
                     // resume test
                     require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
                     $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
                     $testPassesSelector->setActiveId($testSession->getActiveId());
                     $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
                     $closedPasses = $testPassesSelector->getReportablePasses();
                     $existingPasses = $testPassesSelector->getExistingPasses();
                     if ($existingPasses > $closedPasses) {
                         $resumeTestLabel = $this->lng->txt("tst_resume_test");
                         $big_button[] = array('resumePlayer', $resumeTestLabel, true);
                     } else {
                         $resumeTestLabel = $this->object->getStartTestLabel($testSession->getActiveId());
                         $big_button[] = array('startPlayer', $resumeTestLabel, true);
                     }
                 } else {
                     // start new test
                     $big_button[] = array("startPlayer", $this->object->getStartTestLabel($testSession->getActiveId()), true);
                 }
             } else {
                 ilUtil::sendInfo($executable["errormessage"]);
             }
             if ($testSession->getActiveId() > 0) {
                 // test results button
                 require_once 'Modules/Test/classes/class.ilTestPassesSelector.php';
                 $testPassesSelector = new ilTestPassesSelector($GLOBALS['ilDB'], $this->object);
                 $testPassesSelector->setActiveId($testSession->getActiveId());
                 $testPassesSelector->setLastFinishedPass($testSession->getLastFinishedPass());
                 if ($this->object->canShowTestResults($testSession, $ilUser->getId()) && count($testPassesSelector->getReportablePasses())) {
                     //$info->addFormButton("outUserResultsOverview", $this->lng->txt("tst_show_results"));
                     $big_button[] = array(array('ilTestEvaluationGUI', 'outUserResultsOverview'), $this->lng->txt("tst_show_results"), false);
                     if ($this->object->getHighscoreEnabled()) {
                         // Can also compare results then
                         $big_button[] = array("outResultsToplist", $this->lng->txt("tst_show_toplist"), false);
                     }
                     if ($this->object->isSkillServiceToBeConsidered()) {
                         require_once 'Modules/Test/classes/class.ilTestSkillEvaluationGUI.php';
                         $big_button[] = array(array('ilTestSkillEvaluationGUI', ilTestSkillEvaluationGUI::CMD_SHOW), $this->lng->txt("tst_show_comp_results"), false);
                     }
                 }
             }
         }
         if ($testSession->getActiveId() > 0) {
             if ($this->object->canShowSolutionPrintview($ilUser->getId())) {
                 //$info->addFormButton("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"));
                 $big_button[] = array("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"), false);
             }
         }
         if ($this->isDeleteDynamicTestResultsButtonRequired($testSession, $testSequence)) {
             $this->populateDeleteDynamicTestResultsButton($testSession, $big_button);
         }
         if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) {
             $enter_anonymous_code = true;
         }
     }
     if (!$this->object->isOnline()) {
         $message = $this->lng->txt("test_is_offline");
         if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
             $message .= "<br /><a href=\"" . $this->ctrl->getLinkTargetByClass('ilobjtestsettingsgeneralgui') . "\">" . $this->lng->txt("test_edit_settings") . "</a>";
         }
         ilUtil::sendInfo($message);
     }
     if ($this->areSkillLevelThresholdsMissing()) {
         ilUtil::sendFailure($this->getSkillLevelThresholdsMissingInfo());
     }
     if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
         $testQuestionSetConfig = $this->testQuestionSetConfigFactory->getQuestionSetConfig();
         if ($testQuestionSetConfig->areDepenciesBroken()) {
             ilUtil::sendFailure($testQuestionSetConfig->getDepenciesBrokenMessage($this->lng));
             $big_button = array();
             $enter_anonymous_code = false;
         } elseif ($testQuestionSetConfig->areDepenciesInVulnerableState()) {
             ilUtil::sendInfo($testQuestionSetConfig->getDepenciesInVulnerableStateMessage($this->lng));
         }
     }
     if ($this->object->getShowInfo()) {
         $info->enablePrivateNotes();
     }
     if ($big_button || $enter_anonymous_code) {
         $ilToolbar->setFormAction($this->ctrl->getFormAction($testPlayerGUI));
         foreach ($big_button as $button) {
             if (is_array($button[0])) {
                 $link = $this->ctrl->getLinkTargetByClass($button[0][0], $button[0][1]);
                 $ilToolbar->addButton($button[1], $link, '', '', '', '', $button[2] ? 'submit emphSubmit' : 'submit');
             } else {
                 $ilToolbar->addFormButton($button[1], $button[0], "", $button[2]);
             }
         }
         if ($enter_anonymous_code) {
             if ($big_button) {
                 $ilToolbar->addSeparator();
             }
             require_once 'Services/Form/classes/class.ilTextInputGUI.php';
             $anonymous_id = new ilTextInputGUI($this->lng->txt('enter_anonymous_code'), 'anonymous_id');
             $anonymous_id->setSize(8);
             $ilToolbar->addInputItem($anonymous_id, true);
             $ilToolbar->addFormButton($this->lng->txt('submit'), 'setAnonymousId');
         }
         $ilToolbar->setCloseFormTag(false);
         $info->setOpenFormTag(false);
     }
     if (strlen($this->object->getIntroduction())) {
         $info->addSection($this->lng->txt("tst_introduction"));
         $info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction(), true) . $info->getHiddenToggleButton());
     } else {
         $info->addSection("");
         $info->addProperty("", $info->getHiddenToggleButton());
     }
     $info->addSection($this->lng->txt("tst_general_properties"));
     if ($this->object->getShowInfo()) {
         $info->addProperty($this->lng->txt("author"), $this->object->getAuthor());
         $info->addProperty($this->lng->txt("title"), $this->object->getTitle());
     }
     if ($this->object->isOnline() && $this->object->isComplete($this->testQuestionSetConfigFactory->getQuestionSetConfig())) {
         if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
             if ($this->object->getShowInfo() || !$this->object->getForceJS()) {
                 // use javascript
                 $checked_javascript = false;
                 if ($this->object->getJavaScriptOutput()) {
                     $checked_javascript = true;
                 }
             }
             // hide previous results
             if (!$this->object->isRandomTest() && !$this->getObjectiveOrientedContainer()->isObjectiveOrientedPresentationRequired()) {
                 if ($this->object->getNrOfTries() != 1) {
                     if ($this->object->getUsePreviousAnswers() == 0) {
                         if ($this->object->getShowInfo()) {
                             $info->addProperty($this->lng->txt("tst_use_previous_answers"), $this->lng->txt("tst_dont_use_previous_answers"));
                         }
                     } else {
                         $use_previous_answers = FALSE;
                         if ($ilUser->prefs["tst_use_previous_answers"]) {
                             $checked_previous_answers = TRUE;
                         }
                         $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);
                     }
                 }
             }
         }
     }
     $info->hideFurtherSections(false);
     if ($this->object->getShowInfo()) {
         $info->addSection($this->lng->txt("tst_sequence_properties"));
         $info->addProperty($this->lng->txt("tst_sequence"), $this->lng->txt($this->object->getSequenceSettings() == TEST_FIXED_SEQUENCE ? "tst_sequence_fixed" : "tst_sequence_postpone"));
         $info->addSection($this->lng->txt("tst_heading_scoring"));
         $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"));
         $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"));
         if ($this->object->isRandomTest()) {
             $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"));
         }
         $info->addSection($this->lng->txt("tst_score_reporting"));
         $score_reporting_text = "";
         switch ($this->object->getScoreReporting()) {
             case REPORT_AFTER_TEST:
                 $score_reporting_text = $this->lng->txt("tst_report_after_test");
                 break;
             case REPORT_ALWAYS:
                 $score_reporting_text = $this->lng->txt("tst_report_after_first_question");
                 break;
             case REPORT_AFTER_DATE:
                 $score_reporting_text = $this->lng->txt("tst_report_after_date");
                 break;
             case 4:
                 $score_reporting_text = $this->lng->txt("tst_report_never");
                 break;
         }
         $info->addProperty($this->lng->txt("tst_score_reporting"), $score_reporting_text);
         $reporting_date = $this->object->getReportingDate();
         if ($reporting_date) {
             #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
             #$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]));
             #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
             $info->addProperty($this->lng->txt('tst_score_reporting_date'), ilDatePresentation::formatDate(new ilDateTime($reporting_date, IL_CAL_TIMESTAMP)));
         }
         $info->addSection($this->lng->txt("tst_session_settings"));
         $info->addProperty($this->lng->txt("tst_nr_of_tries"), $this->object->getNrOfTries() == 0 ? $this->lng->txt("unlimited") : $this->object->getNrOfTries());
         if ($this->object->getNrOfTries() != 1) {
             $info->addProperty($this->lng->txt("tst_nr_of_tries_of_user"), $testSession->getPass() == false ? $this->lng->txt("tst_no_tries") : $testSession->getPass());
         }
         if ($this->object->getEnableProcessingTime()) {
             $info->addProperty($this->lng->txt("tst_processing_time"), $this->object->getProcessingTime());
         }
         if (strlen($this->object->getAllowedUsers()) && $this->object->getAllowedUsersTimeGap()) {
             $info->addProperty($this->lng->txt("tst_allowed_users"), $this->object->getAllowedUsers());
         }
         $starting_time = $this->object->getStartingTime();
         if ($starting_time) {
             $info->addProperty($this->lng->txt("tst_starting_time"), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_TIMESTAMP)));
         }
         $ending_time = $this->object->getEndingTime();
         if ($ending_time) {
             $info->addProperty($this->lng->txt("tst_ending_time"), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_TIMESTAMP)));
         }
         $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
         // forward the command
     }
     $this->ctrl->forwardCommand($info);
 }
 /**
  * show information screen
  */
 function infoScreen($session_lock = "")
 {
     global $ilAccess;
     global $ilUser;
     // Disabled
     if ($_GET['crs_show_result']) {
         $this->object->hideCorrectAnsweredQuestions();
     } else {
         if ($this->object->getTestSequence()->hasHiddenQuestions()) {
             $this->object->getTestSequence()->clearHiddenQuestions();
             $this->object->getTestSequence()->saveToDb();
         }
     }
     if ($_GET['createRandomSolutions']) {
         $this->object->createRandomSolutions($_GET['createRandomSolutions']);
     }
     if (!$ilAccess->checkAccess("visible", "", $this->ref_id)) {
         $this->ilias->raiseError($this->lng->txt("msg_no_perm_read"), $this->ilias->error_obj->MESSAGE);
     }
     include_once "./Services/InfoScreen/classes/class.ilInfoScreenGUI.php";
     $info = new ilInfoScreenGUI($this);
     $seq = $this->object->getTestSession()->getLastSequence();
     include_once "./Modules/Test/classes/class.ilTestOutputGUI.php";
     $output_gui =& new ilTestOutputGUI($this->object);
     $this->ctrl->setParameter($output_gui, "sequence", $seq);
     $info->setFormAction($this->ctrl->getFormAction($output_gui));
     if (strlen($session_lock)) {
         $info->addHiddenElement("lock", $session_lock);
     } else {
         $info->addHiddenElement("lock", md5($_COOKIE['PHPSESSID'] . time()));
     }
     $online_access = false;
     if ($this->object->getFixedParticipants()) {
         include_once "./Modules/Test/classes/class.ilObjTestAccess.php";
         $online_access_result = ilObjTestAccess::_lookupOnlineTestAccess($this->object->getId(), $ilUser->getId());
         if ($online_access_result === true) {
             $online_access = true;
         } else {
             ilUtil::sendInfo($online_access_result);
         }
     }
     if ($this->object->isOnline() && $this->object->isComplete()) {
         if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
             $executable = $this->object->isExecutable($ilUser->getId(), $allowPassIncrease = TRUE);
             if ($executable["executable"]) {
                 if ($this->object->areObligationsEnabled() && $this->object->hasObligations($this->object->getTestId())) {
                     ilUtil::sendInfo($GLOBALS['lng']->txt('tst_test_contains_obligatory_questions'));
                 }
                 if ($this->object->getTestSession()->getActiveId() > 0) {
                     // resume test
                     $resume_text = $this->lng->txt("tst_resume_test");
                     if ($seq < 1 || $seq == $this->object->getTestSequence()->getFirstSequence()) {
                         $resume_text = $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId());
                     }
                     //$info->addFormButton("resume", $resume_text);
                     $big_button[] = array('resume', $resume_text);
                 } else {
                     // start new test
                     //$info->addFormButton("start", $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId()));
                     $big_button[] = array("start", $this->object->getStartTestLabel($this->object->getTestSession()->getActiveId()));
                 }
             } else {
                 ilUtil::sendInfo($executable["errormessage"]);
             }
             if ($this->object->getTestSession()->getActiveId() > 0) {
                 // test results button
                 if ($this->object->canShowTestResults($ilUser->getId())) {
                     //$info->addFormButton("outUserResultsOverview", $this->lng->txt("tst_show_results"));
                     $big_button[] = array("outUserResultsOverview", $this->lng->txt("tst_show_results"));
                     if ($this->object->getHighscoreEnabled()) {
                         // Can also compare results then
                         $big_button[] = array("outResultsToplist", $this->lng->txt("tst_show_toplist"));
                     }
                 }
             }
         }
         if ($this->object->getTestSession()->getActiveId() > 0) {
             if ($this->object->canShowSolutionPrintview($ilUser->getId())) {
                 //$info->addFormButton("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"));
                 $big_button[] = array("outUserListOfAnswerPasses", $this->lng->txt("tst_list_of_answers_show"));
             }
         }
     }
     if (!$this->object->isOnline()) {
         $message = $this->lng->txt("test_is_offline");
         if ($ilAccess->checkAccess("write", "", $this->ref_id)) {
             $message .= "<br /><a href=\"" . $this->ctrl->getLinkTarget($this, "properties") . "\">" . $this->lng->txt("test_edit_settings") . "</a>";
         }
         ilUtil::sendInfo($message);
     }
     if ($this->object->getShowInfo()) {
         $info->enablePrivateNotes();
     }
     /*
     		if (strlen($this->object->getIntroduction()))
     		{
     			$info->addSection($this->lng->txt("tst_introduction"));
     			$info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction()));
     		}
     		 * */
     if ($big_button) {
         $out = '<div class="il_ButtonGroup il_BigButton">';
         foreach ($big_button as $button) {
             $out .= '<input type="submit" class="submit il_BigButton" name="cmd[' . $button[0] . ']" value="' . $button[1] . '" />';
         }
         $out .= '</div>';
         $big_button = $out;
     }
     if (strlen($this->object->getIntroduction())) {
         $introduction = $this->object->getIntroduction();
         $info->addSection($this->lng->txt("tst_introduction"));
         $info->addProperty("", $this->object->prepareTextareaOutput($this->object->getIntroduction()) . $big_button . "<br />" . $info->getHiddenToggleButton());
     } else {
         $info->addSection("");
         $info->addProperty("", $big_button . $info->getHiddenToggleButton());
     }
     $info->addSection($this->lng->txt("tst_general_properties"));
     if ($this->object->getShowInfo()) {
         $info->addProperty($this->lng->txt("author"), $this->object->getAuthor());
         $info->addProperty($this->lng->txt("title"), $this->object->getTitle());
     }
     if ($this->object->isOnline() && $this->object->isComplete()) {
         if ((!$this->object->getFixedParticipants() || $online_access) && $ilAccess->checkAccess("read", "", $this->ref_id)) {
             if ($this->object->getShowInfo() || !$this->object->getForceJS()) {
                 // use javascript
                 $checked_javascript = false;
                 if ($this->object->getJavaScriptOutput()) {
                     $checked_javascript = true;
                 }
                 if ($this->object->getForceJS()) {
                     $info->addProperty($this->lng->txt("tst_test_output"), $this->lng->txt("tst_use_javascript"));
                 } else {
                     $info->addPropertyCheckbox($this->lng->txt("tst_test_output"), "chb_javascript", 1, $this->lng->txt("tst_use_javascript"), $checked_javascript);
                 }
             }
             // hide previous results
             if (!$this->object->isRandomTest()) {
                 if ($this->object->getNrOfTries() != 1) {
                     if ($this->object->getUsePreviousAnswers() == 0) {
                         if ($this->object->getShowInfo()) {
                             $info->addProperty($this->lng->txt("tst_use_previous_answers"), $this->lng->txt("tst_dont_use_previous_answers"));
                         }
                     } else {
                         $use_previous_answers = FALSE;
                         if ($ilUser->prefs["tst_use_previous_answers"]) {
                             $checked_previous_answers = TRUE;
                         }
                         $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);
                     }
                 }
             }
             if ($_SESSION["AccountId"] == ANONYMOUS_USER_ID) {
                 $info->addPropertyTextinput($this->lng->txt("enter_anonymous_code"), "anonymous_id", "", 8, "setAnonymousId", $this->lng->txt("submit"));
             }
         }
     }
     $info->hideFurtherSections(false);
     if ($this->object->getShowInfo()) {
         $info->addSection($this->lng->txt("tst_sequence_properties"));
         $info->addProperty($this->lng->txt("tst_sequence"), $this->lng->txt($this->object->getSequenceSettings() == TEST_FIXED_SEQUENCE ? "tst_sequence_fixed" : "tst_sequence_postpone"));
         $info->addSection($this->lng->txt("tst_heading_scoring"));
         $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"));
         $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"));
         if ($this->object->isRandomTest()) {
             $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"));
         }
         $info->addSection($this->lng->txt("tst_score_reporting"));
         $score_reporting_text = "";
         switch ($this->object->getScoreReporting()) {
             case REPORT_AFTER_TEST:
                 $score_reporting_text = $this->lng->txt("tst_report_after_test");
                 break;
             case REPORT_ALWAYS:
                 $score_reporting_text = $this->lng->txt("tst_report_after_first_question");
                 break;
             case REPORT_AFTER_DATE:
                 $score_reporting_text = $this->lng->txt("tst_report_after_date");
                 break;
             case 4:
                 $score_reporting_text = $this->lng->txt("tst_report_never");
                 break;
         }
         $info->addProperty($this->lng->txt("tst_score_reporting"), $score_reporting_text);
         $reporting_date = $this->object->getReportingDate();
         if ($reporting_date) {
             #preg_match("/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/", $reporting_date, $matches);
             #$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]));
             #$info->addProperty($this->lng->txt("tst_score_reporting_date"), $txt_reporting_date);
             $info->addProperty($this->lng->txt('tst_score_reporting_date'), ilDatePresentation::formatDate(new ilDateTime($reporting_date, IL_CAL_TIMESTAMP)));
         }
         $info->addSection($this->lng->txt("tst_session_settings"));
         $info->addProperty($this->lng->txt("tst_nr_of_tries"), $this->object->getNrOfTries() == 0 ? $this->lng->txt("unlimited") : $this->object->getNrOfTries());
         if ($this->object->getNrOfTries() != 1) {
             $info->addProperty($this->lng->txt("tst_nr_of_tries_of_user"), $this->object->getTestSession()->getPass() == false ? $this->lng->txt("tst_no_tries") : $this->object->getTestSession()->getPass());
         }
         if ($this->object->getEnableProcessingTime()) {
             $info->addProperty($this->lng->txt("tst_processing_time"), $this->object->getProcessingTime());
         }
         if (strlen($this->object->getAllowedUsers()) && $this->object->getAllowedUsersTimeGap()) {
             $info->addProperty($this->lng->txt("tst_allowed_users"), $this->object->getAllowedUsers());
         }
         $starting_time = $this->object->getStartingTime();
         if ($starting_time) {
             $info->addProperty($this->lng->txt("tst_starting_time"), ilDatePresentation::formatDate(new ilDateTime($starting_time, IL_CAL_TIMESTAMP)));
         }
         $ending_time = $this->object->getEndingTime();
         if ($ending_time) {
             $info->addProperty($this->lng->txt("tst_ending_time"), ilDatePresentation::formatDate(new ilDateTime($ending_time, IL_CAL_TIMESTAMP)));
         }
         $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
         // forward the command
         if ($_GET['crs_show_result'] and !$this->object->getTestSequence()->getFirstSequence()) {
             #ilUtil::sendInfo($this->lng->txt('crs_all_questions_answered_successfully'));
         }
     }
     $this->ctrl->forwardCommand($info);
 }
 /**
  * Returns the pass details overview for a given active ID and pass
  *
  * @param array $result_array An array containing the results of the users test pass (generated by ilObjTest::getTestResult)
  * @param integer $active_id Active ID of the active user
  * @param integer $pass Test pass
  * @param string $targetclass The name of the ILIAS class for the "pass details" URL (optional)
  * @param string $targetcommand The name of the ILIAS command for the "pass details" URL (optional)
  * @param string $targetcommanddetails The name of the ILIAS command which should be called for the details of an answer (optional)
  * @param boolean $standard_header TRUE if the table headers should be plain text, FALSE if the table headers should be URL's for sortable columns
  * @return string HTML code of the pass details overview
  * @access public
  */
 function getPassDetailsOverview($result_array, $active_id, $pass, $targetclass = "", $targetcommandsort = "", $targetcommanddetails = "", $standard_header = TRUE)
 {
     global $ilUser;
     $testresults = $result_array["pass"];
     unset($result_array["test"]);
     $user_id = $this->object->_getUserIdFromActiveId($active_id);
     $sort = $_GET["sort"] ? $_GET["sort"] : "nr";
     $sortorder = $_GET["sortorder"] ? $_GET["sortorder"] : "asc";
     if (!$standard_header) {
         // change sortorder of result array
         usort($result_array, "sortResults");
     }
     $color_class = array("tblrow1top", "tblrow2top");
     $counter = 0;
     $template = new ilTemplate("tpl.il_as_tst_pass_details_overview.html", TRUE, TRUE, "Modules/Test");
     $this->ctrl->setParameterByClass($targetclass, "pass", "{$pass}");
     if (!$testresults["total_max_points"]) {
         $percentage = 0;
     } else {
         $percentage = $testresults["total_reached_points"] / $testresults["total_max_points"] * 100;
     }
     $total_max = $testresults["total_max_points"];
     $total_reached = $testresults["total_reached_points"];
     $totalRequestedHints = $testresults["total_requested_hints"];
     $img_title_percent = "";
     $img_title_nr = "";
     $hasSuggestedSolutions = FALSE;
     if ($this->object->getShowSolutionSuggested()) {
         foreach ($result_array as $key => $value) {
             if (strlen($value["solution"])) {
                 $hasSuggestedSolutions = TRUE;
             }
         }
     }
     foreach ($result_array as $key => $value) {
         if (preg_match("/\\d+/", $key)) {
             if (strlen($targetclass) && strlen($targetcommanddetails)) {
                 $template->setCurrentBlock("linked_title");
                 $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
                 $template->setVariable("VALUE_QUESTION_TITLE", $value["title"]);
                 $this->ctrl->setParameterByClass($targetclass, "evaluation", $value["qid"]);
                 $this->ctrl->setParameterByClass($targetclass, "active_id", $active_id);
                 $template->setVariable("URL_QUESTION_TITLE", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommanddetails));
                 $template->parseCurrentBlock();
             } else {
                 $template->setCurrentBlock("plain_title");
                 $template->setVariable("VALUE_QUESTION_TITLE", $value["title"]);
                 $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
                 $template->parseCurrentBlock();
             }
             if ($hasSuggestedSolutions) {
                 $template->setCurrentBlock("question_suggested_solution");
                 $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
                 $template->setVariable("SOLUTION_HINT", $this->object->prepareTextareaOutput($value["solution"], true));
                 $template->parseCurrentBlock();
             }
             $template->setCurrentBlock("question");
             $template->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
             $template->setVariable("VALUE_QUESTION_COUNTER", $value["nr"]);
             $template->setVariable("VALUE_MAX_POINTS", $value["max"]);
             $template->setVariable("VALUE_REACHED_POINTS", $value["reached"]);
             if ($this->object->isOfferingQuestionHintsEnabled()) {
                 $template->setVariable("VALUE_HINT_COUNT", $value["requested_hints"]);
             }
             $template->setVariable("VALUE_PERCENT_SOLVED", $value["percent"]);
             $template->parseCurrentBlock();
             $counter++;
         }
     }
     if ($hasSuggestedSolutions) {
         $template->touchBlock("footer_suggested_solution");
     }
     $template->setCurrentBlock("footer");
     $template->setVariable("VALUE_QUESTION_COUNTER", "<strong>" . $this->lng->txt("total") . "</strong>");
     $template->setVariable("VALUE_QUESTION_TITLE", "");
     $template->setVariable("VALUE_MAX_POINTS", "<strong>{$total_max}</strong>");
     $template->setVariable("VALUE_REACHED_POINTS", "<strong>{$total_reached}</strong>");
     if ($this->object->isOfferingQuestionHintsEnabled()) {
         $template->setVariable("VALUE_TOTAL_HINT_COUNT", "<strong>{$totalRequestedHints}</strong>");
     }
     $template->setVariable("VALUE_PERCENT_SOLVED", "<strong>" . sprintf("%2.2f", $percentage) . " %" . "</strong>");
     $template->parseCurrentBlock();
     if ($standard_header) {
         if ($hasSuggestedSolutions) {
             $template->setCurrentBlock("standard_header_suggested_solution");
             $template->setVariable("SOLUTION_HINT_HEADER", $this->lng->txt("solution_hint"));
             $template->parseCurrentBlock();
         }
         $template->setCurrentBlock("standard_header");
         $template->setVariable("QUESTION_COUNTER", $this->lng->txt("tst_question_no"));
         $template->setVariable("PERCENT_SOLVED", $this->lng->txt("tst_percent_solved"));
         $template->setVariable("QUESTION_TITLE", $this->lng->txt("tst_question_title"));
         $template->setVariable("MAX_POINTS", $this->lng->txt("tst_maximum_points"));
         $template->setVariable("REACHED_POINTS", $this->lng->txt("tst_reached_points"));
         if ($this->object->isOfferingQuestionHintsEnabled()) {
             $template->setVariable("HINT_COUNT", $this->lng->txt("tst_question_hints_requested_hint_count_header"));
         }
         $template->parseCurrentBlock();
     } else {
         if ($hasSuggestedSolutions) {
             $template->setCurrentBlock("linked_header_suggested_solution");
             if (strcmp($sort, "solution") == 0) {
                 $this->ctrl->setParameterByClass($targetclass, "sortorder", !strcmp($sortorder, "asc") ? "desc" : "asc");
             } else {
                 $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc");
             }
             $this->ctrl->setParameterByClass($targetclass, "sort", "solution");
             $template->setVariable("URL_SOLUTION_HINT_HEADER", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort));
             $template->setVariable("SOLUTION_HINT_HEADER", $this->lng->txt("solution_hint"));
             if (strcmp($sort, "solution") == 0) {
                 $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test");
                 $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png"));
                 $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction"));
                 $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction"));
                 $template->setVariable("IMAGE_SOLUTION_HINT_HEADER", $image->get());
             }
             $template->parseCurrentBlock();
         }
         $template->setCurrentBlock("linked_header");
         $this->ctrl->setParameterByClass($targetclass, "sort", "nr");
         if (strcmp($sort, "nr") == 0) {
             $this->ctrl->setParameterByClass($targetclass, "sortorder", !strcmp($sortorder, "asc") ? "desc" : "asc");
         } else {
             $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc");
         }
         $template->setVariable("URL_QUESTION_COUNTER", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort));
         $template->setVariable("QUESTION_COUNTER", $this->lng->txt("tst_question_no"));
         if (strcmp($sort, "nr") == 0) {
             $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test");
             $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png"));
             $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction"));
             $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction"));
             $template->setVariable("IMAGE_QUESTION_COUNTER", $image->get());
         }
         $this->ctrl->setParameterByClass($targetclass, "sort", "percent");
         if (strcmp($sort, "percent") == 0) {
             $this->ctrl->setParameterByClass($targetclass, "sortorder", !strcmp($sortorder, "asc") ? "desc" : "asc");
         } else {
             $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc");
         }
         $template->setVariable("URL_PERCENT_SOLVED", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort));
         $template->setVariable("PERCENT_SOLVED", $this->lng->txt("tst_percent_solved"));
         if (strcmp($sort, "percent") == 0) {
             $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test");
             $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png"));
             $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction"));
             $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction"));
             $template->setVariable("IMAGE_PERCENT_SOLVED", $image->get());
         }
         $this->ctrl->setParameterByClass($targetclass, "sort", "title");
         if (strcmp($sort, "title") == 0) {
             $this->ctrl->setParameterByClass($targetclass, "sortorder", !strcmp($sortorder, "asc") ? "desc" : "asc");
         } else {
             $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc");
         }
         $template->setVariable("URL_QUESTION_TITLE", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort));
         $template->setVariable("QUESTION_TITLE", $this->lng->txt("tst_question_title"));
         if (strcmp($sort, "title") == 0) {
             $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test");
             $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png"));
             $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction"));
             $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction"));
             $template->setVariable("IMAGE_QUESTION_TITLE", $image->get());
         }
         $this->ctrl->setParameterByClass($targetclass, "sort", "max");
         if (strcmp($sort, "max") == 0) {
             $this->ctrl->setParameterByClass($targetclass, "sortorder", strcmp($sortorder, "asc") ? "desc" : "asc");
         } else {
             $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc");
         }
         $template->setVariable("URL_MAX_POINTS", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort));
         $template->setVariable("MAX_POINTS", $this->lng->txt("tst_maximum_points"));
         if (strcmp($sort, "max") == 0) {
             $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test");
             $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png"));
             $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction"));
             $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction"));
             $template->setVariable("IMAGE_MAX_POINTS", $image->get());
         }
         $this->ctrl->setParameterByClass($targetclass, "sort", "reached");
         if (strcmp($sort, "reached") == 0) {
             $this->ctrl->setParameterByClass($targetclass, "sortorder", !strcmp($sortorder, "asc") ? "desc" : "asc");
         } else {
             $this->ctrl->setParameterByClass($targetclass, "sortorder", "asc");
         }
         $template->setVariable("URL_REACHED_POINTS", $this->ctrl->getLinkTargetByClass($targetclass, $targetcommandsort));
         $template->setVariable("REACHED_POINTS", $this->lng->txt("tst_reached_points"));
         if (strcmp($sort, "reached") == 0) {
             $image = new ilTemplate("tpl.image.html", TRUE, TRUE, "Modules/Test");
             $image->setVariable("IMAGE_SOURCE", ilUtil::getImagePath($sortorder . "_order.png"));
             $image->setVariable("IMAGE_ALT", $this->lng->txt("change_sort_direction"));
             $image->setVariable("IMAGE_TITLE", $this->lng->txt("change_sort_direction"));
             $template->setVariable("IMAGE_REACHED_POINTS", $image->get());
         }
         $template->parseCurrentBlock();
     }
     return $template->get();
 }
 /**
  * Returns the list of answers of a users test pass and offers a scoring option
  *
  * @param array $result_array An array containing the results of the users test pass (generated by ilObjTest::getTestResult)
  * @param integer $active_id Active ID of the active user
  * @param integer $pass Test pass
  * @param boolean $show_solutions TRUE, if the solution output should be shown in the answers, FALSE otherwise
  * @return string HTML code of the list of answers
  * @access public
  * 
  * @deprecated
  */
 function getPassListOfAnswersWithScoring(&$result_array, $active_id, $pass, $show_solutions = FALSE)
 {
     include_once "./Modules/TestQuestionPool/classes/class.assQuestion.php";
     $maintemplate = new ilTemplate("tpl.il_as_tst_list_of_answers.html", TRUE, TRUE, "Modules/Test");
     include_once "./Modules/Test/classes/class.ilObjAssessmentFolder.php";
     $scoring = ilObjAssessmentFolder::_getManualScoring();
     $counter = 1;
     // output of questions with solutions
     foreach ($result_array as $question_data) {
         $question = $question_data["qid"];
         if (is_numeric($question)) {
             $question_gui = $this->object->createQuestionGUI("", $question);
             if (in_array($question_gui->object->getQuestionTypeID(), $scoring)) {
                 $template = new ilTemplate("tpl.il_as_qpl_question_printview.html", TRUE, TRUE, "Modules/TestQuestionPool");
                 $scoretemplate = new ilTemplate("tpl.il_as_tst_manual_scoring_points.html", TRUE, TRUE, "Modules/Test");
                 #mbecker: No such block. $this->tpl->setCurrentBlock("printview_question");
                 $template->setVariable("COUNTER_QUESTION", $counter . ". ");
                 $template->setVariable("QUESTION_TITLE", $this->object->getQuestionTitle($question_gui->object->getTitle()));
                 $points = $question_gui->object->getMaximumPoints();
                 if ($points == 1) {
                     $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("point"));
                 } else {
                     $template->setVariable("QUESTION_POINTS", $points . " " . $this->lng->txt("points"));
                 }
                 $show_question_only = $this->object->getShowSolutionAnswersOnly() ? TRUE : FALSE;
                 $result_output = $question_gui->getSolutionOutput($active_id, $pass, $show_solutions, FALSE, $show_question_only, $this->object->getShowSolutionFeedback(), FALSE, TRUE);
                 $solout = $question_gui->object->getSuggestedSolutionOutput();
                 if (strlen($solout)) {
                     $scoretemplate->setCurrentBlock("suggested_solution");
                     $scoretemplate->setVariable("TEXT_SUGGESTED_SOLUTION", $this->lng->txt("solution_hint"));
                     $scoretemplate->setVariable("VALUE_SUGGESTED_SOLUTION", $solout);
                     $scoretemplate->parseCurrentBlock();
                 }
                 $scoretemplate->setCurrentBlock("feedback");
                 $scoretemplate->setVariable("FEEDBACK_NAME_INPUT", $question);
                 $feedback = $this->object->getManualFeedback($active_id, $question, $pass);
                 $scoretemplate->setVariable("VALUE_FEEDBACK", ilUtil::prepareFormOutput($this->object->prepareTextareaOutput($feedback, TRUE)));
                 $scoretemplate->setVariable("TEXT_MANUAL_FEEDBACK", $this->lng->txt("set_manual_feedback"));
                 $scoretemplate->parseCurrentBlock();
                 $scoretemplate->setVariable("NAME_INPUT", $question);
                 $this->ctrl->setParameter($this, "active_id", $active_id);
                 $this->ctrl->setParameter($this, "pass", $pass);
                 $scoretemplate->setVariable("FORMACTION", $this->ctrl->getFormAction($this, "manscoring"));
                 $scoretemplate->setVariable("LABEL_INPUT", $this->lng->txt("tst_change_points_for_question"));
                 $scoretemplate->setVariable("VALUE_INPUT", " value=\"" . assQuestion::_getReachedPoints($active_id, $question_data["qid"], $pass) . "\"");
                 $scoretemplate->setVariable("VALUE_SAVE", $this->lng->txt("save"));
                 $template->setVariable("SOLUTION_OUTPUT", $result_output);
                 $maintemplate->setCurrentBlock("printview_question");
                 $maintemplate->setVariable("QUESTION_PRINTVIEW", $template->get());
                 $maintemplate->setVariable("QUESTION_SCORING", $scoretemplate->get());
                 $maintemplate->parseCurrentBlock();
             }
             $counter++;
         }
     }
     if ($counter == 1) {
         // no scorable questions found
         $maintemplate->setVariable("NO_QUESTIONS_FOUND", $this->lng->txt("manscoring_questions_not_found"));
     }
     $maintemplate->setVariable("RESULTS_OVERVIEW", sprintf($this->lng->txt("manscoring_results_pass"), $pass + 1));
     include_once "./Services/YUI/classes/class.ilYuiUtil.php";
     ilYuiUtil::initDomEvent();
     return $maintemplate->get();
 }