4 require_once
'./Modules/Test/classes/class.ilTestPlayerAbstractGUI.php';
32 global
$ilDB, $ilPluginAdmin,
$lng, $ilTabs;
36 $ilTabs->clearTargets();
38 $cmd = $this->ctrl->getCmd();
39 $next_class = $this->ctrl->getNextClass($this);
41 $this->ctrl->saveParameter($this,
"sequence");
42 $this->ctrl->saveParameter($this,
"pmode");
43 $this->ctrl->saveParameter($this,
"active_id");
56 $this->testSequence = $testSequenceFactory->getSequenceByTestSession($this->testSession);
57 $this->testSequence->loadFromDb();
58 $this->testSequence->loadQuestions();
60 require_once
'Modules/Test/classes/class.ilTestQuestionRelatedObjectivesList.php';
63 include_once
'Services/jQuery/classes/class.iljQueryUtil.php';
65 include_once
"./Services/YUI/classes/class.ilYuiUtil.php";
74 case 'ilassquestionpagegui':
80 require_once
"./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
82 $ret = $this->ctrl->forwardCommand($page_gui);
85 case 'iltestsubmissionreviewgui':
89 require_once
'./Modules/Test/classes/class.ilTestSubmissionReviewGUI.php';
92 $ret = $this->ctrl->forwardCommand($gui);
95 case 'ilassquestionhintrequestgui':
99 $questionGUI = $this->
object->createQuestionGUI(
100 "", $this->testSequence->getQuestionForSequence($this->getCurrentSequenceElement())
103 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintTracking.php';
105 $questionGUI->object->getId(), $this->testSession->getActiveId(), $this->testSession->getPass()
108 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
114 $ret = $this->ctrl->forwardCommand($gui);
118 case 'iltestsignaturegui':
122 require_once
'./Modules/Test/classes/class.ilTestSignatureGUI.php';
124 $ret = $this->ctrl->forwardCommand($gui);
127 case 'iltestpasswordprotectiongui':
131 require_once
'Modules/Test/classes/class.ilTestPasswordProtectionGUI.php';
133 $ret = $this->ctrl->forwardCommand($gui);
157 $this->testSession->setUserId($ilUser->getId());
158 $this->testSession->setAnonymousId(
$_SESSION[
"tst_access_code"][$this->
object->getTestId()]);
160 $this->testSession->saveToDb();
162 $active_id = $this->testSession->getActiveId();
163 $this->ctrl->setParameter($this,
"active_id", $active_id);
165 $shuffle = $this->
object->getShuffleQuestions();
166 if ($this->
object->isRandomTest())
170 $this->
object->loadQuestions();
174 assQuestion::_updateTestPassResults(
175 $active_id, $this->testSession->getPass(), $this->
object->areObligationsEnabled(), null, $this->
object->id
179 if( !$this->testSequence->hasSequence() )
181 $this->testSequence->createNewSequence($this->
object->getQuestionCount(), $shuffle);
182 $this->testSequence->saveToDb();
185 $this->testSequence->loadFromDb();
186 $this->testSequence->loadQuestions();
188 if( $this->testSession->isObjectiveOriented() )
190 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
193 $objectivesAdapter->notifyTestStart($this->testSession, $this->
object->getId());
194 $objectivesAdapter->prepareTestPass($this->testSession, $this->testSequence);
196 $objectivesAdapter->buildQuestionRelatedObjectiveList(
197 $this->testSequence, $this->questionRelatedObjectivesList
200 if( $this->testSequence->hasOptionalQuestions() )
204 $this->testSequence->reorderOptionalQuestionsToSequenceEnd();
205 $this->testSequence->saveToDb();
209 $active_time_id = $this->
object->startWorkingTime(
210 $this->testSession->getActiveId(), $this->testSession->getPass()
212 $_SESSION[
"active_time_id"] = $active_time_id;
216 $sequenceElement = $this->testSequence->getFirstSequence();
218 $this->ctrl->setParameter($this,
'sequence', $sequenceElement);
219 $this->ctrl->setParameter($this,
'pmode',
'');
221 if ($this->
object->getListOfQuestionsStart())
233 require_once (
'./Modules/Test/classes/class.ilObjTestAccess.php');
234 require_once(
'./Services/Tracking/classes/class.ilLPStatusWrapper.php');
240 if( $sequenceElement ===
false )
245 if( $sequenceElement < 1 )
250 if( !$this->testSequence->getPositionOfSequence($sequenceElement) )
262 $_SESSION[
"active_time_id"]= $this->
object->startWorkingTime(
263 $this->testSession->getActiveId(), $this->testSession->getPass()
270 $sequenceElement = $this->testSequence->getFirstSequence();
273 $this->testSession->setLastSequence($sequenceElement);
274 $this->testSession->saveToDb();
277 $questionId = $this->testSequence->getQuestionForSequence($sequenceElement);
279 if( !(
int)$questionId && $this->testSession->isObjectiveOriented() )
285 $this->testSession->getActiveId(), $questionId, $this->testSession->getPass()
292 $instantResponse =
true;
308 $questionGui->setSequenceNumber($this->testSequence->getPositionOfSequence($sequenceElement));
309 $questionGui->setQuestionCount($this->testSequence->getUserQuestionCount());
311 require_once
'Modules/Test/classes/class.ilTestQuestionHeaderBlockBuilder.php';
313 $headerBlockBuilder->setHeaderMode($this->
object->getTitleOutput());
314 $headerBlockBuilder->setQuestionTitle($questionGui->object->getTitle());
315 $headerBlockBuilder->setQuestionPoints($questionGui->object->getPoints());
316 $headerBlockBuilder->setQuestionPosition($this->testSequence->getPositionOfSequence($sequenceElement));
317 $headerBlockBuilder->setQuestionCount($this->testSequence->getUserQuestionCount());
318 $headerBlockBuilder->setQuestionPostponed($this->testSequence->isPostponedQuestion($questionId));
319 $headerBlockBuilder->setQuestionObligatory(
322 if( $this->testSession->isObjectiveOriented() )
324 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
326 $objectivesAdapter->buildQuestionRelatedObjectiveList($this->testSequence, $this->questionRelatedObjectivesList);
327 $this->questionRelatedObjectivesList->loadObjectivesTitles();
329 $objectivesString = $this->questionRelatedObjectivesList->getQuestionRelatedObjectiveTitles($questionId);
330 $headerBlockBuilder->setQuestionRelatedObjectives($objectivesString);
332 $questionGui->setQuestionHeaderBlockBuilder($headerBlockBuilder);
334 $this->
prepareTestPage($presentationMode, $sequenceElement, $questionId);
337 $navigationToolbarGUI->setFinishTestButtonEnabled(
true);
341 $this->ctrl->setParameter($this,
'sequence', $sequenceElement);
342 $this->ctrl->setParameter($this,
'pmode', $presentationMode);
345 switch($presentationMode)
350 $navigationToolbarGUI->setDisabledStateEnabled(
false);
352 $this->
showQuestionEditable($questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse);
358 if( $this->testSequence->isQuestionOptional($questionGui->object->getId()) )
363 $this->
showQuestionViewable($questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse);
369 require_once
'Modules/Test/exceptions/class.ilTestException.php';
373 $navigationToolbarGUI->build();
380 if ($instantResponse)
407 if( $this->
object->isForceInstantFeedbackEnabled() )
414 $questionId = $this->testSequence->getQuestionForSequence(
424 $nextSequenceElement = $this->testSequence->getFirstSequence();
427 $this->testSession->setLastSequence($nextSequenceElement);
428 $this->testSession->saveToDb();
430 $this->ctrl->setParameter($this,
'sequence', $nextSequenceElement);
431 $this->ctrl->setParameter($this,
'pmode',
'');
441 $questionId = $this->testSequence->getQuestionForSequence(
447 if( $this->
object->isForceInstantFeedbackEnabled() )
449 $this->ctrl->setParameter($this,
'instresp', 1);
451 $this->testSequence->setQuestionChecked($questionId);
452 $this->testSequence->saveToDb();
460 $this->ctrl->setParameter($this,
'pmode',
'');
484 $this->ctrl->saveParameter($this,
'sequence');
495 $this->testSequence->getQuestionForSequence($currentSequenceElement)
498 $currentQuestionOBJ->resetUsersAnswer(
499 $this->testSession->getActiveId(), $this->testSession->getPass()
502 $this->ctrl->saveParameter($this,
'sequence');
512 $nextSequenceElement = $this->testSequence->getNextSequence($curSequenceElement);
516 $nextSequenceElement = $this->testSequence->getFirstSequence();
519 if( $this->
object->isPostponingEnabled() )
521 $this->testSequence->postponeSequence($curSequenceElement);
522 $this->testSequence->saveToDb();
525 $this->ctrl->setParameter($this,
'sequence', $nextSequenceElement);
526 $this->ctrl->setParameter($this,
'pmode',
'');
533 $questionId = $this->testSequence->getQuestionForSequence($sequenceElement);
536 $this->testSession->getActiveId(), $questionId, $this->testSession->getPass()
539 if( !$isQuestionWorkedThrough )
541 $this->testSequence->postponeQuestion($questionId);
542 $this->testSequence->saveToDb();
549 $nextSequenceElement = $this->testSequence->getNextSequence($lastSequenceElement);
551 if( $this->
object->isPostponingEnabled() )
558 $nextSequenceElement = $this->testSequence->getFirstSequence();
561 $this->ctrl->setParameter($this,
'sequence', $nextSequenceElement);
562 $this->ctrl->setParameter($this,
'pmode',
'');
569 $sequenceElement = $this->testSequence->getPreviousSequence(
575 $sequenceElement = $this->testSequence->getLastSequence();
578 $this->ctrl->setParameter($this,
'sequence', $sequenceElement);
579 $this->ctrl->setParameter($this,
'pmode',
'');
586 return $sequenceElement == $this->testSequence->getFirstSequence();
591 return $sequenceElement == $this->testSequence->getLastSequence();
609 return $this->testSequence->getQuestionForSequence(
$_GET[
"sequence"]);
618 $this->saveResult = FALSE;
621 $formtimestamp =
$_POST[
"formtimestamp"];
622 if (strlen($formtimestamp) == 0) $formtimestamp =
$_GET[
"formtimestamp"];
623 if ($formtimestamp !=
$_SESSION[
"formtimestamp"])
625 $_SESSION[
"formtimestamp"] = $formtimestamp;
636 $q_id = $this->testSequence->getQuestionForSequence(
$_GET[
"sequence"]);
637 if (is_numeric($q_id) && (
int)$q_id)
641 $active_id = $this->testSession->getActiveId();
642 if ($this->
object->isRandomTest())
646 $this->saveResult = $questionOBJ->persistWorkingState(
647 $active_id,
$pass, $this->
object->areObligationsEnabled(), $authorized
650 if( $authorized && $this->testSession->isObjectiveOriented() )
652 require_once
'Modules/Course/classes/Objectives/class.ilLOTestQuestionAdapter.php';
654 $objectivesAdapter->updateQuestionResult($this->testSession, $questionOBJ);
657 if( $authorized && $this->
object->isSkillServiceToBeConsidered() )
664 if ($this->saveResult == FALSE)
666 $this->ctrl->setParameter($this,
"save_error",
"1");
675 $questionId = $this->testSequence->getQuestionForSequence(
690 $this->testSequence->setQuestionChecked($questionId);
691 $this->testSequence->saveToDb();
694 $this->ctrl->setParameter($this,
'instresp', 1);
708 $questionId = $this->testSequence->getQuestionForSequence(
726 if ($this->testSession->getActiveId() > 0)
728 if ($this->testSequence->hasRandomQuestionsForPass($this->testSession->getActiveId(), $this->testSession->getPass()) > 0)
736 __METHOD__.
' Random Questions allready exists for user '.
737 $ilUser->getId().
' in test '.$this->
object->getTestId()
749 $ilLog->write(__METHOD__.
' '.sprintf(
750 $this->lng->txt(
"error_random_question_generation"), $ilUser->getId(), $this->
object->getTestId()
763 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetConfig.php';
765 $questionSetConfig->loadFromDb();
767 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
770 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
772 $sourcePoolDefinitionList->loadDefinitions();
774 $this->processLocker->executeRandomPassBuildOperation(
function() use ($ilDB, $ilPluginAdmin, $questionSetConfig, $sourcePoolDefinitionList) {
778 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
781 require_once
'Modules/Test/classes/class.ilTestRandomQuestionSetBuilder.php';
784 $questionSetBuilder->performBuild($this->testSession);
787 }, $sourcePoolDefinitionList->hasTaxonomyFilters());
797 $active_id = $this->testSession->getActiveId();
798 $this->ctrl->setParameter($this,
"active_id", $active_id);
800 $active_time_id = $this->
object->startWorkingTime($active_id, $this->testSession->getPass());
801 $_SESSION[
"active_time_id"] = $active_time_id;
804 if ($this->
object->isRandomTest())
806 if (!$this->testSequence->hasRandomQuestionsForPass($active_id, $this->testSession->getPass()))
813 $shuffle = $this->
object->getShuffleQuestions();
814 if ($this->
object->isRandomTest())
819 assQuestion::_updateTestPassResults(
820 $active_id, $this->testSession->getPass(), $this->
object->areObligationsEnabled(), null, $this->
object->id
824 if( !$this->testSequence->hasSequence() )
826 $this->testSequence->createNewSequence($this->
object->getQuestionCount(), $shuffle);
827 $this->testSequence->saveToDb();
830 if ($this->
object->getListOfQuestionsStart())
835 $this->ctrl->setParameter($this,
'sequence', $this->testSession->getLastSequence());
836 $this->ctrl->setParameter($this,
'pmode',
'');
842 return $this->testSequence->isPostponedQuestion($questionId);
851 include_once (
"./Modules/Test/classes/class.ilObjAssessmentFolder.php");
854 require_once
'Modules/TestQuestionPool/classes/class.ilAssQuestionUserSolutionAdopter.php';
857 $userSolutionAdopter->setUserId($ilUser->getId());
858 $userSolutionAdopter->setActiveId($this->testSession->getActiveId());
859 $userSolutionAdopter->setTargetPass($this->testSequence->getPass());
860 $userSolutionAdopter->setQuestionIds($this->testSequence->getOptionalQuestions());
862 $userSolutionAdopter->perform();
869 if( $this->testSequence->isAnsweringOptionalQuestionsConfirmed() )
874 $questionId = $this->testSequence->getQuestionForSequence($sequenceKey);
876 if( !$this->testSequence->isQuestionOptional($questionId) )
891 ilUtil::sendFailure(sprintf($this->lng->txt(
'tst_objective_oriented_test_pass_without_questions'), $this->
object->getTitle()),
true);
901 $isNextPrimary =
true;
903 if( $this->
object->isForceInstantFeedbackEnabled() )
905 $isNextPrimary =
false;
909 $this->testSession->getActiveId(), $this->testSession->getPass(),
910 $this->testSequence->getOrderedSequenceQuestions()
913 if( !count($questionsMissingResult) )
916 $isNextPrimary =
false;
918 elseif( count($questionsMissingResult) == 1 )
920 $lastOpenQuestion = current($questionsMissingResult);
922 if($currentQuestionId == $lastOpenQuestion)
925 $isNextPrimary =
false;
929 return $isNextPrimary;
isShowingPostponeStatusReguired($questionId)
checkTestSessionUser(ilTestSession $testSession)
isValidSequenceElement($sequenceElement)
isQuestionSummaryFinishTestButtonRequired()
removeIntermediateSolution()
remove an auto-saved solution of the current question
populateQuestionOptionalMessage()
static _getPass($active_id)
Retrieves the actual pass of a given user for a given test.
setAnswerChangedParameter($changed=true)
Set the 'answer changed' url parameter for generated links.
static getQuestionsMissingResultRecord($activeId, $pass, $questionIds)
showQuestionEditable(assQuestionGUI $questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse)
getObjectiveOrientedContainer()
Output class for assessment test execution.
static _updateStatus($a_obj_id, $a_usr_id, $a_obj=null, $a_percentage=false, $a_force_raise=false)
Update status.
updateWorkingTime()
updates working time and stores state saveresult to see if question has to be stored or not ...
handleTearsAndAngerNoObjectiveOrientedQuestion()
submitSolutionAndNextCmd()
getNextCommandParameter()
isLastQuestionInSequence($sequenceElement)
isFirstQuestionInSequence($sequenceElement)
executeCommand()
Execute Command.
handleQuestionActionCmd()
resumePlayerCmd()
Resume a test at the last position.
handleUserSettings()
Handles some form parameters on starting and resuming a test.
Base Exception for all Exceptions relating to Modules/Test.
prepareTestPage($presentationMode, $sequenceElement, $questionId)
unregisterForcedFeedbackNavUrl()
populateInstantResponseBlocks(assQuestionGUI $questionGui, $authorizedSolution)
static isQuestionObligatory($question_id)
checks wether the question with given id is marked as obligatory or not
isNrOfTriesReached()
nr of tries exceeded
ensureExistingTestSession(ilTestSession $testSession)
populateQuestionNavigation($sequenceElement, $disabled, $primaryNext)
static getInstance(ilTestSession $a_test_session)
isForcedFeedbackNavUrlRegistered()
static _enabledAssessmentLogging()
check wether assessment logging is enabled or not
getInstantResponseParameter()
isOptionalQuestionAnsweringConfirmationRequired($sequenceKey)
handleSkillTriggering(ilTestSession $testSession)
Class ilTestSubmissionReviewGUI.
handleQuestionPostponing($sequenceElement)
getRegisteredForcedFeedbackNavUrl()
getCommand($cmd)
Retrieves the ilCtrl command.
const PRESENTATION_MODE_EDIT
saveNavigationPreventConfirmation()
Save the save the switch to prevent the navigation confirmation.
populateTestNavigationToolbar(ilTestNavigationToolbarGUI $toolbarGUI)
static getInstance(ilDBInterface $db, ilObjTest $testOBJ, ilTestRandomQuestionSetConfig $questionSetConfig, ilTestRandomQuestionSetSourcePoolDefinitionList $sourcePoolDefinitionList, ilTestRandomQuestionSetStagingPoolQuestionList $stagingPoolQuestionList)
handlePrimaryButton(ilTestNavigationToolbarGUI $navigationToolbarGUI, $currentQuestionId)
getAnswerChangedParameter()
Get the 'answer changed' status from the current request It may be set by ilTestPlayerNavigationContr...
Basic GUI class for assessment questions.
const PRESENTATION_MODE_VIEW
const SUBMIT_INTERMEDIATE_SOLUTION
initProcessLocker($activeId)
updateLearningProgressOnTestStart()
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
handlePasswordProtectionRedirect()
registerForcedFeedbackNavUrl($forcedFeedbackNavUrl)
saveQuestionSolution($authorized=true, $force=false)
saves the user input of a question
showQuestionViewable(assQuestionGUI $questionGui, $formAction, $isQuestionWorkedThrough, $instantResponse)
performTearsAndAngerBrokenConfessionChecks()
Create new PHPExcel object
obj_idprivate
$questionRelatedObjectivesList
generateRandomTestPassForActiveUser()
populateInstantResponseModal(assQuestionGUI $questionGui, $navUrl)
getNextSequenceParameter()
getNavigationUrlParameter()
getQuestionGuiInstance($questionId, $fromCache=true)
static initjQuery($a_tpl=null)
Init jQuery.
getQuestionInstance($questionId, $fromCache=true)
handleTearsAndAngerQuestionIsNull($questionId, $sequenceElement)
isMaxProcessingTimeReached()
Checks wheather the maximum processing time is reached or not.
getCurrentSequenceElement()
static redirect($a_script)
http redirect to other script
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 ...
getTestNavigationToolbarGUI()
static initConnectionWithAnimation()
Init YUI Connection module.
canSaveResult()
Returns TRUE if the answers of the current user could be saved.
adoptUserSolutionsFromPreviousPass()
static isTestExecutionCommand($cmd)
isParticipantsAnswerFixed($questionId)
Output class for assessment test execution.