4 require_once
'Modules/Test/classes/class.ilTestPlayerAbstractGUI.php';
53 $ilTabs->clearTargets();
55 $this->ctrl->saveParameter($this,
"sequence");
56 $this->ctrl->saveParameter($this,
"active_id");
60 require_once
'Modules/Test/classes/class.ilObjTestDynamicQuestionSetConfig.php';
62 $this->dynamicQuestionSetConfig->loadFromDb();
71 $this->testSequence = $testSequenceFactory->getSequenceByTestSession($this->testSession);
72 $this->testSequence->loadFromDb();
74 if( $this->object->isInstantFeedbackAnswerFixationEnabled() )
76 $this->testSequence->setPreventCheckedQuestionsFromComingUpEnabled(
true);
79 include_once
'Services/jQuery/classes/class.iljQueryUtil.php';
81 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
83 if( $this->object->getKioskMode() )
85 include_once
'Services/UIComponent/Overlay/classes/class.ilOverlayGUI.php';
91 $cmd = $this->ctrl->getCmd();
92 $nextClass = $this->ctrl->getNextClass($this);
96 case 'ilassquestionpagegui':
98 $questionId = $this->testSession->getCurrentQuestionId();
100 require_once
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
102 $ret = $this->ctrl->forwardCommand($page_gui);
105 case 'ilassquestionhintrequestgui':
107 $this->ctrl->saveParameter($this,
'pmode');
109 $questionGUI = $this->
object->createQuestionGUI(
110 "", $this->testSession->getCurrentQuestionId()
113 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
115 $questionGUI->object->getId(), $this->testSession->getActiveId(), $this->testSession->getPass()
118 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
123 $this->ctrl->forwardCommand($gui);
127 case 'ildynamicquestionsetstatistictablegui':
133 case 'iltestpasswordprotectiongui':
134 require_once
'Modules/Test/classes/class.ilTestPasswordProtectionGUI.php';
136 $ret = $this->ctrl->forwardCommand($gui);
154 return $this->testSession->getCurrentQuestionId();
162 if ($this->object->checkMaximumAllowedUsers() == FALSE)
169 if( $this->dynamicQuestionSetConfig->isAnyQuestionFilterEnabled() )
179 $this->testSession->setCurrentQuestionId(null);
181 $this->testSession->saveToDb();
183 $this->ctrl->setParameter($this,
'active_id', $this->testSession->getActiveId());
185 assQuestion::_updateTestPassResults($this->testSession->getActiveId(), $this->testSession->getPass(),
false, null, $this->
object->id);
187 $_SESSION[
'active_time_id'] = $this->
object->startWorkingTime(
188 $this->testSession->getActiveId(), $this->testSession->getPass()
191 $this->ctrl->saveParameter($this,
'tst_javascript');
193 if( $this->dynamicQuestionSetConfig->isAnyQuestionFilterEnabled() )
205 $this->testSequence->loadQuestions(
206 $this->dynamicQuestionSetConfig, $this->testSession->getQuestionSetFilterSelection()
209 $this->testSequence->cleanupQuestions($this->testSession);
211 $this->testSequence->saveToDb();
213 require_once
'Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
216 require_once
'Services/UIComponent/Button/classes/class.ilLinkButton.php';
220 $button->setPrimary(
true);
221 $toolbarGUI->addButtonInstance($button);
223 if( $this->object->getShowCancel() )
226 $button->setUrl($this->ctrl->getLinkTarget(
229 $button->setCaption(
'cancel_test');
230 $toolbarGUI->addButtonInstance($button);
233 if( $this->object->isPassDeletionAllowed() )
235 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
237 $toolbarGUI->addButton(
238 $this->lng->txt(
'tst_dyn_test_pass_deletion_button'),
244 $this->testSequence->getFilteredQuestionsData(), $this->testSequence->getTrackedQuestionList()
245 )); #
vd($filteredData);
247 $filteredTableGUI->setData($filteredData);
250 $this->testSequence->getCompleteQuestionsData(), $this->testSequence->getTrackedQuestionList()
251 )); #
vd($completeData);
253 $completeTableGUI->setData($completeData);
255 $content = $this->ctrl->getHTML($toolbarGUI);
256 $content .= $this->ctrl->getHTML($filteredTableGUI);
257 $content .= $this->ctrl->getHTML($completeTableGUI);
259 $this->tpl->setVariable(
'TABLE_LIST_OF_QUESTIONS', $content);
261 if( $this->object->getEnableProcessingTime() )
270 $tableGUI->writeFilterToSession();
272 $taxFilterSelection = array();
275 foreach( $tableGUI->getFilterItems() as $item )
277 if( strpos($item->getPostVar(),
'tax_') !==
false )
279 $taxId = substr( $item->getPostVar(), strlen(
'tax_') );
280 $taxFilterSelection[$taxId] = $item->getValue();
282 elseif( $item->getPostVar() ==
'question_answer_status' )
284 $answerStatusFilterSelection = $item->getValue();
288 $this->testSession->getQuestionSetFilterSelection()->setTaxonomySelection($taxFilterSelection);
289 $this->testSession->getQuestionSetFilterSelection()->setAnswerStatusSelection($answerStatusFilterSelection);
290 $this->testSession->saveToDb();
292 $this->testSequence->resetTrackedQuestionList();
293 $this->testSequence->saveToDb();
302 $tableGUI->resetFilter();
304 $this->testSession->getQuestionSetFilterSelection()->setTaxonomySelection( array() );
305 $this->testSession->getQuestionSetFilterSelection()->setAnswerStatusSelection( null );
306 $this->testSession->saveToDb();
308 $this->testSequence->resetTrackedQuestionList();
309 $this->testSequence->saveToDb();
328 $this->testSession->getActiveId(), $this->testSession->getCurrentQuestionId(), $this->testSession->getPass()
331 if( !$isWorkedThrough )
333 $this->testSequence->setQuestionPostponed($this->testSession->getCurrentQuestionId());
334 $this->testSequence->saveToDb();
345 $this->
object->setQuestionSetSolved(1, $this->testSession->getCurrentQuestionId(), $ilUser->getId());
353 $this->
object->setQuestionSetSolved(0, $this->testSession->getCurrentQuestionId(), $ilUser->getId());
366 if( $this->object->isForceInstantFeedbackEnabled() )
373 $questionId = $this->testSession->getCurrentQuestionId();
376 $this->testSession->getActiveId(), $this->testSession->getPass()
381 $this->ctrl->setParameter($this,
'pmode',
'');
393 $questionId = $this->testSession->getCurrentQuestionId();
396 $this->testSession->getActiveId(), $this->testSession->getPass()
401 if( $this->object->isForceInstantFeedbackEnabled() )
403 $this->ctrl->setParameter($this,
'instresp', 1);
405 $this->testSequence->unsetQuestionPostponed($questionId);
406 $this->testSequence->setQuestionChecked($questionId);
407 $this->testSequence->saveToDb();
415 $this->ctrl->setParameter($this,
'pmode',
'');
429 $questionId = $this->testSession->getCurrentQuestionId();
433 $currentQuestionOBJ->resetUsersAnswer(
434 $this->testSession->getActiveId(), $this->testSession->getPass()
454 if( $this->testSession->getQuestionSetFilterSelection()->isAnswerStatusSelectionWrongAnswered() )
456 $this->testSequence->loadQuestions(
457 $this->dynamicQuestionSetConfig, $this->testSession->getQuestionSetFilterSelection()
460 if( $this->testSequence->hasFilteredQuestionListCheckedQuestions() )
473 $this->testSequence->loadQuestions(
474 $this->dynamicQuestionSetConfig, $this->testSession->getQuestionSetFilterSelection()
477 $this->testSequence->cleanupQuestions($this->testSession);
490 if( !$this->testSession->getCurrentQuestionId() )
492 $upComingQuestionId = $this->testSequence->getUpcomingQuestionId();
494 $this->testSession->setCurrentQuestionId($upComingQuestionId);
504 $navigationToolbarGUI->setQuestionSelectionButtonEnabled(
true);
506 if( $this->testSession->getCurrentQuestionId() )
509 $this->testSequence->setCurrentQuestionId($this->testSession->getCurrentQuestionId());
511 $questionGui->setQuestionCount(
512 $this->testSequence->getLastPositionIndex()
514 $questionGui->setSequenceNumber(
515 $this->testSequence->getCurrentPositionIndex($this->testSession->getCurrentQuestionId())
521 $this->testSession->getCurrentQuestionId(), $this->testSession->getCurrentQuestionId()
526 $this->testSession->getActiveId(), $this->testSession->getCurrentQuestionId(), $this->testSession->getPass()
529 require_once
'Modules/Test/classes/class.ilTestQuestionHeaderBlockBuilder.php';
531 $headerBlockBuilder->setHeaderMode($this->object->getTitleOutput());
532 $headerBlockBuilder->setQuestionTitle($questionGui->object->getTitle());
533 $headerBlockBuilder->setQuestionPoints($questionGui->object->getPoints());
534 $headerBlockBuilder->setQuestionPosition(
535 $this->testSequence->getCurrentPositionIndex($this->testSession->getCurrentQuestionId())
537 $headerBlockBuilder->setQuestionCount($this->testSequence->getLastPositionIndex());
538 $headerBlockBuilder->setQuestionPostponed($this->testSequence->isPostponedQuestion(
539 $this->testSession->getCurrentQuestionId())
541 $headerBlockBuilder->setQuestionObligatory(
544 $questionGui->setQuestionHeaderBlockBuilder($headerBlockBuilder);
548 if(!$presentationMode)
557 $instantResponse =
true;
562 $this->testSession->getCurrentQuestionId(), $this->testSession->getCurrentQuestionId()
565 $this->ctrl->setParameter($this,
'sequence', $this->testSession->getCurrentQuestionId());
566 $this->ctrl->setParameter($this,
'pmode', $presentationMode);
569 switch($presentationMode)
573 $navigationToolbarGUI->setDisabledStateEnabled(
true);
575 $this->
showQuestionEditable($questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse);
581 $this->
showQuestionViewable($questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse);
587 require_once
'Modules/Test/exceptions/class.ilTestException.php';
591 $navigationToolbarGUI->build();
595 $this->testSession->getCurrentQuestionId(),
599 if ($instantResponse)
610 $navigationToolbarGUI->build();
616 $this->testSequence->saveToDb();
617 $this->testSession->saveToDb();
622 $questionId = $this->testSession->getCurrentQuestionId();
624 $filterSelection = $this->testSession->getQuestionSetFilterSelection();
626 $filterSelection->setForcedQuestionIds(array($this->testSession->getCurrentQuestionId()));
628 $this->testSequence->loadQuestions($this->dynamicQuestionSetConfig, $filterSelection);
629 $this->testSequence->cleanupQuestions($this->testSession);
630 $this->testSequence->saveToDb();
634 if( $this->object->isInstantFeedbackAnswerFixationEnabled() )
638 $this->ctrl->setParameter(
646 $this->ctrl->setParameter(
651 $this->testSequence->unsetQuestionPostponed($questionId);
652 $this->testSequence->setQuestionChecked($questionId);
653 $this->testSequence->saveToDb();
656 $this->ctrl->setParameter(
657 $this,
'sequence', $this->testSession->getCurrentQuestionId()
660 $this->ctrl->setParameter($this,
'instresp', 1);
667 $questionId = $this->testSession->getCurrentQuestionId();
674 $this->ctrl->setParameter(
675 $this,
'sequence', $this->testSession->getCurrentQuestionId()
678 $this->ctrl->saveParameter($this,
'pmode');
685 if( $this->testSequence->openQuestionExists() )
687 $message = $this->lng->txt(
'tst_dyn_test_msg_currently_finished_selection');
691 $message = $this->lng->txt(
'tst_dyn_test_msg_currently_finished_completely');
692 $message .=
"<br /><br />{$this->buildFinishPagePassDeletionLink()}";
695 $msgHtml = $this->tpl->getMessageHTML($message);
697 $tpl =
new ilTemplate(
'tpl.test_currently_finished_msg.html',
true,
true,
'Modules/Test');
698 $tpl->setVariable(
'TEST_CURRENTLY_FINISHED_MSG', $msgHtml);
700 $this->tpl->setVariable(
'QUESTION_OUTPUT',
$tpl->get());
705 return !$this->testSequence->trackedQuestionExists();
720 return !$this->
object->endingTimeReached();
731 $formtimestamp =
$_POST[
"formtimestamp"];
732 if (strlen($formtimestamp) == 0) $formtimestamp =
$_GET[
"formtimestamp"];
733 if ($formtimestamp !=
$_SESSION[
"formtimestamp"])
735 $_SESSION[
"formtimestamp"] = $formtimestamp;
745 $qId = $this->testSession->getCurrentQuestionId();
747 if( !$qId || $qId !=
$_GET[
"sequence"])
754 $this->saveResult = FALSE;
758 $questionGUI = $this->
object->createQuestionGUI(
"", $qId);
760 if( $this->object->getJavaScriptOutput() )
765 $activeId = $this->testSession->getActiveId();
767 $this->saveResult = $questionGUI->object->persistWorkingState(
768 $activeId,
$pass = null, $this->object->areObligationsEnabled(), $authorized
771 if( $authorized && $this->object->isSkillServiceToBeConsidered() )
777 if ($this->saveResult == FALSE)
779 $this->ctrl->setParameter($this,
"save_error",
"1");
788 $questionGUI = $this->
object->createQuestionGUI(
"", $questionId);
791 $maxPoints = $questionGUI->object->getMaximumPoints();
793 if($reachedPoints < $maxPoints)
805 foreach($questions as $key => $value )
807 $this->ctrl->setParameter($this,
'sequence', $value[
'question_id']);
808 $href = $this->ctrl->getLinkTarget($this,
'gotoQuestion');
809 $this->ctrl->setParameter($this,
'sequence',
'');
812 if( $this->object->getListOfQuestionsDescription() )
814 $description = $value[
"description"];
818 if( count($marked_questions) )
820 if( isset($marked_questions[$value[
"question_id"]]) )
822 if( $marked_questions[$value[
"question_id"]][
"solved"] == 1 )
829 array_push(
$data, array(
831 'title' => $this->object->getQuestionTitle($value[
"title"]),
832 'description' => $description,
833 'worked_through' => $this->testSequence->isAnsweredQuestion($value[
"question_id"]),
834 'postponed' => $this->testSequence->isPostponedQuestion($value[
"question_id"]),
844 $questionAnswerStats = array(
845 'total_all' => count($questions),
847 'non_answered_notseen' => 0,
848 'non_answered_skipped' => 0,
849 'wrong_answered' => 0,
850 'correct_answered' => 0
853 foreach($questions as $key => $value )
855 switch( $value[
'question_answer_status'] )
858 if( isset($trackedQuestions[$key]) )
860 $questionAnswerStats[
'non_answered_skipped']++;
864 $questionAnswerStats[
'non_answered_notseen']++;
866 $questionAnswerStats[
'total_open']++;
869 $questionAnswerStats[
'wrong_answered']++;
870 $questionAnswerStats[
'total_open']++;
873 $questionAnswerStats[
'correct_answered']++;
878 return $questionAnswerStats;
883 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';
888 $gui->initTitle(
'tst_dynamic_question_set_complete');
889 $gui->initColumns(
'tst_num_all_questions');
896 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';
901 $gui->initTitle(
'tst_dynamic_question_set_selection');
902 $gui->initColumns(
'tst_num_selected_questions');
904 require_once
'Services/Taxonomy/classes/class.ilObjTaxonomy.php';
906 $this->dynamicQuestionSetConfig->getSourceQuestionPoolId()
909 $gui->setTaxonomyFilterEnabled($this->dynamicQuestionSetConfig->isTaxonomyFilterEnabled());
910 $gui->setAnswerStatusFilterEnabled($this->dynamicQuestionSetConfig->isAnswerStatusFilterEnabled());
912 $gui->setFilterSelection($this->testSession->getQuestionSetFilterSelection());
914 $gui->setFilterCommand(
'filterQuestionSelection');
915 $gui->setResetCommand(
'resetQuestionSelection');
922 require_once
'Modules/Test/classes/tables/class.ilTestDynamicQuestionSetStatisticTableGUI.php';
932 if( $this->testSequence->trackedQuestionExists() )
934 return 'tst_resume_dyn_test_with_cur_quest_sel';
937 return 'tst_start_dyn_test_with_cur_quest_sel';
942 $questionId = $this->testSession->getCurrentQuestionId();
943 $activeId = $this->testSession->getActiveId();
944 $pass = $this->testSession->getPass();
948 $this->testSequence->setQuestionAnsweredCorrect($questionId);
952 $this->testSequence->setQuestionAnsweredWrong($questionId);
955 $this->testSequence->saveToDb();
960 $this->testSession->setCurrentQuestionId(null);
961 $this->testSession->saveToDb();
963 $this->ctrl->setParameter($this,
'sequence', $this->testSession->getCurrentQuestionId());
964 $this->ctrl->setParameter($this,
'pmode',
'');
974 $label = $this->lng->txt(
'tst_dyn_test_msg_pass_deletion_link');
976 return "<a href=\"{$href}\">{$label}</a>";
984 require_once
'Modules/Test/classes/confirmations/class.ilTestPassDeletionConfirmationGUI.php';
987 $this->ctrl->setParameterByClass(
'ilTestEvaluationGUI',
'active_id', $this->testSession->getActiveId());
988 $this->ctrl->setParameterByClass(
'ilTestEvaluationGUI',
'pass', $this->testSession->getPass());
990 return $this->ctrl->getLinkTargetByClass(
'ilTestEvaluationGUI',
'confirmDeletePass');
1000 if( isset(
$_GET[
'reset_checked']) )
1002 return $_GET[
'reset_checked'];
1009 public function outQuestionSummaryCmd($fullpage =
true, $contextFinishTest =
false, $obligationsNotAnswered =
false, $obligationsFilter =
false)
1011 $this->testSequence->loadQuestions(
1012 $this->dynamicQuestionSetConfig, $this->testSession->getQuestionSetFilterSelection()
1015 $this->testSequence->setCurrentQuestionId($this->testSession->getCurrentQuestionId());
1017 parent::outQuestionSummaryCmd($fullpage, $contextFinishTest, $obligationsNotAnswered, $obligationsFilter);
1022 require_once
'Services/Utilities/classes/class.ilConfirmationGUI.php';
1024 $confirmation->setFormAction($this->ctrl->getFormAction($this));
1025 $confirmation->setHeaderText($this->lng->txt(
'tst_dyn_unfreeze_answers_confirmation'));
1034 $this->testSequence->loadQuestions(
1035 $this->dynamicQuestionSetConfig, $this->testSession->getQuestionSetFilterSelection()
1038 $this->testSequence->resetFilteredQuestionListsCheckedStatus();
1039 $this->testSequence->saveToDb();
1054 $this->ctrl->setParameter($this,
'reset_checked', 1);
1056 $this->ctrl->setParameter($this,
'reset_checked',
'');
1068 global $ilPluginAdmin;
1070 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionList.php';
1072 $questionList->setParentObjId($this->dynamicQuestionSetConfig->getSourceQuestionPoolId());
1075 return $questionList;
buildQuestionsTableDataArray($questions, $marked_questions)
filterQuestionSelectionCmd()
isLastQuestionInSequence($sequenceElement)
vd()
shortcut for var_dump with enhanced debug information
buildQuestionSetCompleteStatisticTableGUI()
unfreezeCheckedQuestionsAnswersCmd()
isOptionalQuestionAnsweringConfirmationRequired($sequenceKey)
static getUsageOfObject($a_obj_id, $a_include_titles=false)
Get usage of object.
showQuestionEditable(assQuestionGUI $questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse)
getPresentationModeParameter()
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
isQuestionAnsweredCorrect($questionId, $activeId, $pass)
updateWorkingTime()
updates working time and stores state saveresult to see if question has to be stored or not ...
getNextCommandParameter()
showQuestionSelectionCmd()
handleUserSettings()
Handles some form parameters on starting and resuming a test.
Base Exception for all Exceptions relating to Modules/Test.
prepareTestPage($presentationMode, $sequenceElement, $questionId)
populateInstantResponseBlocks(assQuestionGUI $questionGui, $authorizedSolution)
persistQuestionAnswerStatus()
static isQuestionObligatory($question_id)
checks wether the question with given id is marked as obligatory or not
ensureExistingTestSession(ilTestSession $testSession)
submitSolutionAndNextCmd()
resumePlayerCmd()
Resume a test at the last position.
handleQuestionActionCmd()
buildQuestionSetFilteredStatisticTableGUI()
getInstantResponseParameter()
getEnterTestButtonLangVar()
handleSkillTriggering(ilTestSession $testSession)
special template class to simplify handling of ITX/PEAR
const PRESENTATION_MODE_EDIT
isShowingPostponeStatusReguired($questionId)
populateTestNavigationToolbar(ilTestNavigationToolbarGUI $toolbarGUI)
buildQuestionSetStatisticTableGUI($tableId)
outCurrentlyFinishedPage()
populateNextButtons($disabled)
const SHOW_QUESTION_SELECTION
getSequenceElementParameter()
Basic GUI class for assessment questions.
const PRESENTATION_MODE_VIEW
const SUBMIT_INTERMEDIATE_SOLUTION
outQuestionSummaryCmd($fullpage=true, $contextFinishTest=false, $obligationsNotAnswered=false, $obligationsFilter=false)
initProcessLocker($activeId)
populateQuestionNavigation($sequenceElement, $disabled)
isQuestionSummaryFinishTestButtonRequired()
const ANSWER_STATUS_FILTER_ALL_NON_CORRECT
answer status filter value domain
handlePasswordProtectionRedirect()
_getReachedPoints($active_id, $question_id, $pass=NULL)
Returns the points, a learner has reached answering the question.
showQuestionViewable(assQuestionGUI $questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse)
const QUESTION_ANSWER_STATUS_CORRECT_ANSWERED
populateMessageContent($contentHTML)
showMaximumAllowedUsersReachedMessage()
const QUESTION_ANSWER_STATUS_WRONG_ANSWERED
outProcessingTime($active_id)
showCheckedQuestionResettingConfirmation()
getNextSequenceParameter()
buildQuestionSetAnswerStatisticRowArray($questions, $trackedQuestions)
buildFinishPagePassDeletionLink()
isFirstQuestionInSequence($sequenceElement)
getQuestionGuiInstance($questionId, $fromCache=true)
static initjQuery($a_tpl=null)
Init jQuery.
getQuestionInstance($questionId, $fromCache=true)
getQuestionsDefaultPresentationMode($isQuestionWorkedThrough)
canSaveResult()
Returns TRUE if the answers of the current user could be saved.
$dynamicQuestionSetConfig
isCheckedQuestionResettingConfirmationRequired()
executeCommand()
execute command
handleTearsAndAngerQuestionIsNull($questionId, $sequenceElement)
getStartTestFromQuestionSelectionLink()
static _isWorkedThrough($active_id, $question_id, $pass=NULL)
Returns true if the question was worked through in the given pass Worked through means that the user ...
const CONTEXT_DYN_TEST_PLAYER
getTestNavigationToolbarGUI()
static initConnectionWithAnimation()
Init YUI Connection module.
const QUESTION_INSTANCE_TYPE_ORIGINALS
getResetCheckedParameter()
const QUESTION_ANSWER_STATUS_NON_ANSWERED
answer status domain for single questions
buildTestPassQuestionList()
isParticipantsAnswerFixed($questionId)
Output class for assessment test execution.
Confirmation screen class.
static initJavascript()
Init javascript.
resetQuestionSelectionCmd()