ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilTestOutputGUI Class Reference

Output class for assessment test execution. More...

+ Inheritance diagram for ilTestOutputGUI:
+ Collaboration diagram for ilTestOutputGUI:

Public Member Functions

 executeCommand ()
 Execute Command.
 saveQuestionSolution ($force=FALSE)
 saves the user input of a question
- Public Member Functions inherited from ilTestPlayerAbstractGUI
 __construct ($a_object)
 ilTestOutputGUI constructor
 saveTagsCmd ()
 Save tags for tagging gui.
 outResultsToplistCmd ()
 updateWorkingTime ()
 updates working time and stores state saveresult to see if question has to be stored or not
 outIntroductionPageCmd ()
 Creates the introduction page for a test.
 isMaxProcessingTimeReached ()
 Checks wheather the maximum processing time is reached or not.
 showPasswordProtectionPageCmd ()
 Displays a password protection page when a test password is set.
 checkPasswordCmd ()
 Check the password, a user entered for test access.
 setAnonymousIdCmd ()
 Sets a session variable with the test access code for an anonymous test user.
 displayCodeCmd ()
 codeConfirmedCmd ()
 handleUserSettings ()
 Handles some form parameters on starting and resuming a test.
 calculateSequence ()
 Calculates the sequence to determine the next question.
 redirectAfterAutosaveCmd ()
 autosaveCmd ()
 togglesidelistCmd ()
 Toggle side list.
 backFromSummaryCmd ()
 Go back to the last active question from the summary.
 finishTestCmd ($requires_confirmation=true)
 redirectBackCmd ()
 showFinalStatementCmd ()
 getKioskHead ()
 outTestPage ($directfeedback)
 Outputs the question of the active sequence.
 checkOnlineTestAccess ()
 check access restrictions like client ip, partipating user etc.
 isTestAccessible ()
 test accessible returns true if the user can perform the test
 isNrOfTriesReached ()
 nr of tries exceeded
 passDetails ()
 Output of the learners view of an existing test pass.
 maxProcessingTimeReached ()
 Outputs a message when the maximum processing time is reached.
 confirmSubmitAnswers ()
 confirm submit results if confirm then results are submitted and the screen will be redirected to the startpage of the test public
 outProcessingTime ($active_id)
 outQuestionSummaryCmd ($fullpage=true, $contextFinishTest=false, $obligationsNotAnswered=false, $obligationsFilter=false)
 Output of a summary of all test questions for test participants.
 outQuestionSummaryWithObligationsInfoCmd ()
 outObligationsOnlySummaryCmd ()
 showMaximumAllowedUsersReachedMessage ()
 backConfirmFinishCmd ()
 finishListOfAnswersCmd ()
 outCorrectSolution ()
 Creates an output of the solution of an answer compared to the correct solution.
 showListOfAnswers ($active_id, $pass=NULL, $top_data="", $bottom_data="")
 Creates an output of the list of answers for a test participant during the test (only the actual pass will be shown)
 getContentBlockName ()
 Returns the name of the current content block (depends on the kiosk mode setting)
 outUserResultsOverviewCmd ()
 outUserListOfAnswerPassesCmd ()
- Public Member Functions inherited from ilTestServiceGUI
 ilTestServiceGUI (ilObjTest $a_object)
 The constructor takes the test object reference as parameter.
 getCommand ($cmd)
 Retrieves the ilCtrl command.
 getPassOverview ($active_id, $targetclass="", $targetcommand="", $short=FALSE, $hide_details=FALSE)
 Returns the pass overview for a given active ID.
 getFinalStatement ($active_id)
 Returns the final statement for a user.
 getPassListOfAnswers (&$result_array, $active_id, $pass, $show_solutions=FALSE, $only_answered_questions=FALSE, $show_question_only=FALSE, $show_reached_points=FALSE)
 Returns the list of answers of a users test pass.
 getPassListOfAnswersWithScoring (&$result_array, $active_id, $pass, $show_solutions=FALSE)
 Returns the list of answers of a users test pass and offers a scoring option.
 getPassDetailsOverview ($result_array, $active_id, $pass, $targetclass="", $targetcommandsort="", $targetcommanddetails="", $standard_header=TRUE)
 Returns the pass details overview for a given active ID and pass.
 getResultsSignature ()
 Returns HTML code for a signature field.
 getResultsUserdata ($testSession, $active_id, $overwrite_anonymity=FALSE)
 Returns the user data for a test results output.
 getCorrectSolutionOutput ($question_id, $active_id, $pass)
 Returns an output of the solution to an answer compared to the correct solution.
 getResultsOfUserOutput ($testSession, $active_id, $pass, $show_pass_details=TRUE, $show_answers=TRUE, $show_question_only=FALSE, $show_reached_points=FALSE)
 Output of the pass overview for a test called by a test participant.
 getResultsHeadUserAndPass ($active_id, $pass)
 Returns the user and pass data for a test results output.
 getQuestionResultForTestUsers ($question_id, $test_id)
 Creates a HTML representation for the results of a given question in a test.

Protected Member Functions

 startTestCmd ()
 nextQuestionCmd ()
 Go to the next question.
 previousQuestionCmd ()
 Go to the previous question.
 redirectQuestionCmd ()
 Called when a user answered a question to perform a redirect after POST.
 outWorkingForm ($sequence="", $test_id, $postpone_allowed, $directfeedback=false)
 Creates the learners output of a question.
 isFirstPageInSequence ($sequence)
 isLastQuestionInSequence (assQuestionGUI $question_gui)
 canSaveResult ()
 Returns TRUE if the answers of the current user could be saved.
 showInstantResponseCmd ()
 showQuestionListCmd ()
 showQuestionListWithoutSavingCmd ()
 postponeQuestionCmd ()
 Postpone a question to the end of the test.
 handleQuestionActionCmd ()
 performTearsAndAngerBrokenConfessionChecks ()
 generateRandomTestPassForActiveUser ()
- Protected Member Functions inherited from ilTestPlayerAbstractGUI
 ensureExistingTestSession (ilTestSession $testSession)
 initProcessLocker ($activeId)
 determineInlineScoreDisplay ()
 populatePreviousButtons ($sequence)
 populateQuestionMarkingBlockAsUnmarked ()
 populateQuestionMarkingBlockAsMarked ()
 populateNextButtonsLeadingToQuestion ()
 populateLowerNextButtonBlockLeadingToQuestion ()
 populateUpperNextButtonBlockLeadingToQuestion ()
 populateNextButtonsLeadingToEndOfTest ()
 populateLowerNextButtonBlockLeadingToEndOfTest ()
 populateUpperNextButtonBlockLeadingToEndOfTest ()
 populateNextButtonsLeadingToSummary ()
 populateLowerNextButtonBlockLeadingToSummary ()
 populateUpperNextButtonBlockLeadingToSummary ()
 populateCancelButtonBlock ()
 populateSummaryButtons ()
 populateLowerSummaryButtonBlock ()
 populateUpperSummaryButtonBlock ()
 populateQuestionSelectionButtons ()
 populateLowerQuestionSelectionButtonBlock ()
 populateUpperQuestionSelectionButtonBlock ()
 populatePostponeButtons ()
 populateLowerPostponeButtonBlock ()
 populateUpperPostponeButtonBlock ()
 populatePreviousButtonsLeadingToQuestion ()
 populatePreviousButtonsLeadingToIntroduction ()
 populateLowerPreviousButtonBlock ($cmd, $label)
 populateUpperPreviousButtonBlock ($cmd, $label)
 populateSpecificFeedbackBlock ($question_gui)
 populateGenericFeedbackBlock ($question_gui)
 populateScoreBlock ($reachedPoints, $maxPoints)
 populateSolutionBlock ($solutionoutput)
 populateCharSelector ()
 showSideList ()
 populateSyntaxStyleBlock ()
 populateContentStyleBlock ()
 startPlayerCmd ()
 Start a test for the first time.
 getLockParameter ()
 resumePlayerCmd ()
 Resume a test at the last position.
 checkTestPassword ()
 initTestCmd ()
 Start a test for the first time after a redirect.
 markQuestionCmd ()
 Set a question solved.
 unmarkQuestionCmd ()
 Set a question unsolved.
 gotoQuestionCmd ()
 Go to the question with the active sequence.
 confirmFinishCmd ()
 The final submission of a test was confirmed.
 performTestPassFinishedTasks ($finishedPass)
 afterTestPassFinishedCmd ()
 isTestSignRedirectRequired ($activeId, $lastFinishedPass)
 archiveParticipantSubmission ($active, $pass)
 showRequestedHintListCmd ()
 Go to requested hint list.
 confirmHintRequestCmd ()
 Go to hint request confirmation.
 fillQuestionRelatedNavigation (assQuestionGUI $questionGUI)
 renders the elements for the question related navigation
 getMarkedQuestions ()
 prepareSummaryPage ()
 prepareTestPageOutput ()
 populateKioskHead ()

Private Member Functions

 isValidSequenceElement ($sequenceElement)

Additional Inherited Members

- Data Fields inherited from ilTestPlayerAbstractGUI
 $ref_id
 $saveResult
 $sequence
 $cmdCtrl
 $maxProcessingTimeReached
 $endingTimeReached
- Protected Attributes inherited from ilTestPlayerAbstractGUI
 $processLocker
 $testSession

Detailed Description

Output class for assessment test execution.

The ilTestOutputGUI class creates the output for the ilObjTestGUI class when learners execute a test. This saves some heap space because the ilObjTestGUI class will be much smaller then

Author
Helmut Schottmüller helmu.nosp@m.t.sc.nosp@m.hottm.nosp@m.uell.nosp@m.er@ma.nosp@m.c.co.nosp@m.m
Björn Heyser bheys.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Maximilian Becker mbeck.nosp@m.er@d.nosp@m.ataba.nosp@m.y.de
Version
Id:
class.ilTestOutputGUI.php 60920 2015-09-30 10:30:09Z gitmgr

ModulesTest

ilTestOutputGUI: ilAssQuestionHintRequestGUI, ilAssSpecFeedbackPageGUI, ilAssGenFeedbackPageGUI ilTestOutputGUI: ilTestSignatureGUI ilTestOutputGUI: ilAssQuestionPageGUI

Definition at line 24 of file class.ilTestOutputGUI.php.

Member Function Documentation

ilTestOutputGUI::canSaveResult ( )
protected

Returns TRUE if the answers of the current user could be saved.

Returns
boolean TRUE if the answers could be saved, FALSE otherwise

Reimplemented from ilTestPlayerAbstractGUI.

Definition at line 638 of file class.ilTestOutputGUI.php.

References ilTestPlayerAbstractGUI\isMaxProcessingTimeReached(), and ilTestPlayerAbstractGUI\isNrOfTriesReached().

Referenced by saveQuestionSolution().

{
return !$this->object->endingTimeReached() && !$this->isMaxProcessingTimeReached() && !$this->isNrOfTriesReached();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestOutputGUI::executeCommand ( )

Execute Command.

Reimplemented from ilTestServiceGUI.

Definition at line 29 of file class.ilTestOutputGUI.php.

References $_GET, $cmd, $ilUser, ilTestServiceGUI\$lng, $ret, ilTestServiceGUI\$testSequenceFactory, ilTestServiceGUI\$testSessionFactory, ilTestPlayerAbstractGUI\calculateSequence(), ilTestPlayerAbstractGUI\ensureExistingTestSession(), ilTestServiceGUI\getCommand(), ilYuiUtil\initConnectionWithAnimation(), iljQueryUtil\initjQuery(), and ilTestPlayerAbstractGUI\initProcessLocker().

{
global $ilUser, $ilDB, $ilPluginAdmin, $lng, $ilTabs;
$ilTabs->clearTargets();
$cmd = $this->ctrl->getCmd();
$next_class = $this->ctrl->getNextClass($this);
$this->ctrl->saveParameter($this, "sequence");
$this->ctrl->saveParameter($this, "active_id");
if (preg_match("/^gotoquestion_(\\d+)$/", $cmd, $matches))
{
$cmd = "gotoquestion";
if (strlen($matches[1]))
{
$this->ctrl->setParameter($this, 'gotosequence', $matches[1]);
}
}
$this->testSession = $testSessionFactory->getSession($_GET['active_id']);
$this->ensureExistingTestSession($this->testSession);
$this->initProcessLocker($this->testSession->getActiveId());
$testSequenceFactory = new ilTestSequenceFactory($ilDB, $lng, $ilPluginAdmin, $this->object);
$this->testSequence = $testSequenceFactory->getSequence($this->testSession);
$this->testSequence->loadFromDb();
$this->testSequence->loadQuestions();
include_once 'Services/jQuery/classes/class.iljQueryUtil.php';
include_once "./Services/YUI/classes/class.ilYuiUtil.php";
$cmd = $this->getCommand($cmd);
switch($next_class)
{
case 'ilassquestionpagegui':
$questionId = $this->testSequence->getQuestionForSequence( $this->calculateSequence() );
require_once "./Modules/TestQuestionPool/classes/class.ilAssQuestionPageGUI.php";
$page_gui = new ilAssQuestionPageGUI($questionId);
$ret = $this->ctrl->forwardCommand($page_gui);
break;
case 'iltestsubmissionreviewgui':
require_once './Modules/Test/classes/class.ilTestSubmissionReviewGUI.php';
$gui = new ilTestSubmissionReviewGUI($this, $this->object);
$ret = $this->ctrl->forwardCommand($gui);
break;
case 'ilassquestionhintrequestgui':
$questionGUI = $this->object->createQuestionGUI(
"", $this->testSequence->getQuestionForSequence( $this->calculateSequence() )
);
require_once 'Modules/TestQuestionPool/classes/class.ilAssQuestionHintRequestGUI.php';
$gui = new ilAssQuestionHintRequestGUI($this, $this->testSession, $questionGUI);
$ret = $this->ctrl->forwardCommand($gui);
break;
case 'iltestsignaturegui':
require_once './Modules/Test/classes/class.ilTestSignatureGUI.php';
$gui = new ilTestSignatureGUI($this);
$ret = $this->ctrl->forwardCommand($gui);
break;
default:
$cmd .= 'Cmd';
$ret =& $this->$cmd();
break;
}
return $ret;
}

+ Here is the call graph for this function:

ilTestOutputGUI::generateRandomTestPassForActiveUser ( )
protected

Definition at line 785 of file class.ilTestOutputGUI.php.

References ilTestServiceGUI\$tree, ilTestRandomQuestionSetBuilder\getInstance(), and performTearsAndAngerBrokenConfessionChecks().

Referenced by redirectQuestionCmd().

{
global $tree, $ilDB, $ilPluginAdmin;
require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetConfig.php';
$questionSetConfig = new ilTestRandomQuestionSetConfig($tree, $ilDB, $ilPluginAdmin, $this->object);
$questionSetConfig->loadFromDb();
require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionFactory.php';
$sourcePoolDefinitionFactory = new ilTestRandomQuestionSetSourcePoolDefinitionFactory($ilDB, $this->object);
require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetSourcePoolDefinitionList.php';
$sourcePoolDefinitionList = new ilTestRandomQuestionSetSourcePoolDefinitionList($ilDB, $this->object, $sourcePoolDefinitionFactory);
$sourcePoolDefinitionList->loadDefinitions();
$this->processLocker->requestRandomPassBuildLock($sourcePoolDefinitionList->hasTaxonomyFilters());
{
require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetStagingPoolQuestionList.php';
$stagingPoolQuestionList = new ilTestRandomQuestionSetStagingPoolQuestionList($ilDB, $ilPluginAdmin);
require_once 'Modules/Test/classes/class.ilTestRandomQuestionSetBuilder.php';
$questionSetBuilder = ilTestRandomQuestionSetBuilder::getInstance($ilDB, $this->object, $questionSetConfig, $sourcePoolDefinitionList, $stagingPoolQuestionList);
$questionSetBuilder->performBuild($this->testSession);
}
$this->processLocker->releaseRandomPassBuildLock();
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestOutputGUI::handleQuestionActionCmd ( )
protected

Reimplemented from ilTestPlayerAbstractGUI.

Definition at line 740 of file class.ilTestOutputGUI.php.

References saveQuestionSolution(), and ilTestPlayerAbstractGUI\updateWorkingTime().

{
$this->ctrl->setParameter($this, 'activecommand', 'handleQuestionAction');
$this->ctrl->redirect($this, 'redirectQuestion');
}

+ Here is the call graph for this function:

ilTestOutputGUI::isFirstPageInSequence (   $sequence)
protected

Reimplemented from ilTestPlayerAbstractGUI.

Definition at line 623 of file class.ilTestOutputGUI.php.

References ilTestPlayerAbstractGUI\$sequence.

{
return $sequence == $this->testSequence->getFirstSequence();
}
ilTestOutputGUI::isLastQuestionInSequence ( assQuestionGUI  $question_gui)
protected

Reimplemented from ilTestPlayerAbstractGUI.

Definition at line 628 of file class.ilTestOutputGUI.php.

Referenced by outWorkingForm().

{
return $this->testSequence->getQuestionForSequence($this->testSequence->getLastSequence()) == $question_gui->object->getId();
}

+ Here is the caller graph for this function:

ilTestOutputGUI::isValidSequenceElement (   $sequenceElement)
private

Definition at line 368 of file class.ilTestOutputGUI.php.

Referenced by outWorkingForm().

{
if( $sequenceElement < 1 )
{
return false;
}
if( !$this->testSequence->getPositionOfSequence($sequenceElement) )
{
return false;
}
return true;
}

+ Here is the caller graph for this function:

ilTestOutputGUI::nextQuestionCmd ( )
protected

Go to the next question.

Reimplemented from ilTestPlayerAbstractGUI.

Definition at line 123 of file class.ilTestOutputGUI.php.

References saveQuestionSolution().

{
$this->ctrl->setParameter($this, "activecommand", "next");
$this->ctrl->redirect($this, "redirectQuestion");
}

+ Here is the call graph for this function:

ilTestOutputGUI::outWorkingForm (   $sequence = "",
  $test_id,
  $postpone_allowed,
  $directfeedback = false 
)
protected

Creates the learners output of a question.

Reimplemented from ilTestPlayerAbstractGUI.

Definition at line 386 of file class.ilTestOutputGUI.php.

References $_SESSION, $ilLog, $ilUser, ilTestPlayerAbstractGUI\$sequence, ilObjTest\_getSolvedQuestions(), ilTestPlayerAbstractGUI\determineInlineScoreDisplay(), ilTestPlayerAbstractGUI\fillQuestionRelatedNavigation(), ilUtil\getImagePath(), ilUtil\getJSLocation(), isLastQuestionInSequence(), ilObjTest\isQuestionObligatory(), isValidSequenceElement(), OUTPUT_JAVASCRIPT, ilTestPlayerAbstractGUI\populateCancelButtonBlock(), ilTestPlayerAbstractGUI\populateCharSelector(), ilTestPlayerAbstractGUI\populateContentStyleBlock(), ilTestPlayerAbstractGUI\populateGenericFeedbackBlock(), ilTestPlayerAbstractGUI\populateNextButtonsLeadingToEndOfTest(), ilTestPlayerAbstractGUI\populateNextButtonsLeadingToQuestion(), ilTestPlayerAbstractGUI\populateNextButtonsLeadingToSummary(), ilTestPlayerAbstractGUI\populatePostponeButtons(), ilTestPlayerAbstractGUI\populatePreviousButtons(), ilTestPlayerAbstractGUI\populateQuestionMarkingBlockAsMarked(), ilTestPlayerAbstractGUI\populateQuestionMarkingBlockAsUnmarked(), ilTestPlayerAbstractGUI\populateScoreBlock(), ilTestPlayerAbstractGUI\populateSolutionBlock(), ilTestPlayerAbstractGUI\populateSpecificFeedbackBlock(), ilTestPlayerAbstractGUI\populateSummaryButtons(), ilTestPlayerAbstractGUI\populateSyntaxStyleBlock(), and ilTestPlayerAbstractGUI\showSideList().

{
global $ilUser;
{
$sequence = $this->testSequence->getFirstSequence();
}
$_SESSION["active_time_id"]= $this->object->startWorkingTime($this->testSession->getActiveId(),
$this->testSession->getPass()
);
if ($this->object->getListOfQuestions())
{
$this->showSideList();
}
$questionId = $this->testSequence->getQuestionForSequence($sequence);
$question_gui = $this->object->createQuestionGUI("", $questionId);
if( !is_object($question_gui) )
{
global $ilLog;
$ilLog->write(
"INV SEQ: active={$this->testSession->getActiveId()} qId=$questionId seq=$sequence "
.serialize($this->testSequence)
);
$ilLog->logStack('INV SEQ');
$this->ctrl->setParameter($this, 'gotosequence', $this->testSequence->getFirstSequence());
$this->ctrl->setParameter($this, 'activecommand', 'gotoquestion');
$this->ctrl->redirect($this, 'redirectQuestion');
}
$question_gui->setTargetGui($this);
if ($this->object->getJavaScriptOutput())
{
$question_gui->object->setOutputType(OUTPUT_JAVASCRIPT);
}
$is_postponed = $this->testSequence->isPostponedQuestion($question_gui->object->getId());
$this->ctrl->setParameter($this, "sequence", "$sequence");
$formaction = $this->ctrl->getFormAction($this, "gotoQuestion");
$question_gui->setSequenceNumber($this->testSequence->getPositionOfSequence($sequence));
$question_gui->setQuestionCount($this->testSequence->getUserQuestionCount());
// output question
$user_post_solution = FALSE;
if (array_key_exists("previouspost", $_SESSION))
{
$user_post_solution = $_SESSION["previouspost"];
unset($_SESSION["previouspost"]);
}
// Determine $answer_feedback: It should hold a boolean stating if answer-specific-feedback is to be given.
// It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Answer-Specific Feedback"
// $directfeedback holds a boolean stating if the instant feedback was requested using the "Check" button.
$answer_feedback = FALSE;
if (($directfeedback) && ($this->object->getSpecificAnswerFeedback()))
{
$answer_feedback = TRUE;
}
// Answer specific feedback is rendered into the display of the test question with in the concrete question types outQuestionForTest-method.
// Notation of the params prior to getting rid of this crap in favor of a class
$question_gui->outQuestionForTest(
$formaction, #form_action
$this->testSession->getActiveId(), #active_id
NULL, #pass
$is_postponed, #is_postponed
$user_post_solution, #user_post_solution
$answer_feedback #answer_feedback == inline_specific_feedback
);
// The display of specific inline feedback and specific feedback in an own block is to honor questions, which
// have the possibility to embed the specific feedback into their output while maintaining compatibility to
// questions, which do not have such facilities. E.g. there can be no "specific inline feedback" for essay
// questions, while the multiple-choice questions do well.
$this->fillQuestionRelatedNavigation($question_gui);
if ($directfeedback)
{
// This controls if the solution should be shown.
// It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
if ($this->object->getInstantFeedbackSolution())
{
$show_question_inline_score = $this->determineInlineScoreDisplay();
// Notation of the params prior to getting rid of this crap in favor of a class
$solutionoutput = $question_gui->getSolutionOutput(
$this->testSession->getActiveId(), #active_id
NULL, #pass
FALSE, #graphical_output
$show_question_inline_score, #result_output
FALSE, #show_question_only
FALSE, #show_feedback
TRUE, #show_correct_solution
FALSE, #show_manual_scoring
FALSE #show_question_text
);
$this->populateSolutionBlock( $solutionoutput );
}
// This controls if the score should be shown.
// It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Results (Only Points)"
if ($this->object->getAnswerFeedbackPoints())
{
$reachedPoints = $question_gui->object->getAdjustedReachedPoints($this->testSession->getActiveId(), NULL);
$maxPoints = $question_gui->object->getMaximumPoints();
$this->populateScoreBlock( $reachedPoints, $maxPoints );
}
// This controls if the generic feedback should be shown.
// It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Solutions"
if ($this->object->getGenericAnswerFeedback())
{
$this->populateGenericFeedbackBlock( $question_gui );
}
// This controls if the specific feedback should be shown.
// It gets the parameter "Scoring and Results" -> "Instant Feedback" -> "Show Answer-Specific Feedback"
if ($this->object->getSpecificAnswerFeedback())
{
$this->populateSpecificFeedbackBlock( $question_gui );
}
}
if ($postpone_allowed && !$is_postponed)
{
}
if ($this->object->getListOfQuestions())
{
}
if ($this->object->getShowCancel())
{
}
if ($this->isLastQuestionInSequence( $question_gui ))
{
if ($this->object->getListOfQuestionsEnd())
{
}
else
{
}
}
else
{
}
if ($this->object->getShowMarker())
{
include_once "./Modules/Test/classes/class.ilObjTest.php";
$solved_array = ilObjTest::_getSolvedQuestions($this->testSession->getActiveId(), $question_gui->object->getId());
$solved = 0;
if (count ($solved_array) > 0)
{
$solved = array_pop($solved_array);
$solved = $solved["solved"];
}
if ($solved==1)
{
}
else
{
}
}
if ($this->object->getJavaScriptOutput())
{
$this->tpl->setVariable("JAVASCRIPT_IMAGE", ilUtil::getImagePath("javascript_disable.png"));
$this->tpl->setVariable("JAVASCRIPT_IMAGE_ALT", $this->lng->txt("disable_javascript"));
$this->tpl->setVariable("JAVASCRIPT_IMAGE_TITLE", $this->lng->txt("disable_javascript"));
$this->ctrl->setParameter($this, "tst_javascript", "0");
$this->tpl->setVariable("JAVASCRIPT_URL", $this->ctrl->getLinkTarget($this, "gotoQuestion"));
}
else
{
$this->tpl->setVariable("JAVASCRIPT_IMAGE", ilUtil::getImagePath("javascript.png"));
$this->tpl->setVariable("JAVASCRIPT_IMAGE_ALT", $this->lng->txt("enable_javascript"));
$this->tpl->setVariable("JAVASCRIPT_IMAGE_TITLE", $this->lng->txt("enable_javascript"));
$this->ctrl->setParameter($this, "tst_javascript", "1");
$this->tpl->setVariable("JAVASCRIPT_URL", $this->ctrl->getLinkTarget($this, "gotoQuestion"));
}
if ($question_gui->object->requiresJsSwitch() && !$this->object->getForceJS())
{
$this->tpl->touchBlock("jsswitch");
}
$this->tpl->addJavaScript(ilUtil::getJSLocation("autosave.js", "Modules/Test"));
$this->tpl->setVariable("AUTOSAVE_URL", $this->ctrl->getFormAction($this, "autosave", "", true));
if ($question_gui->isAutosaveable()&& $this->object->getAutosave())
{
$this->tpl->touchBlock('autosave');
//$this->tpl->setVariable("BTN_SAVE", "Zwischenspeichern");
//$this->tpl->setVariable("CMD_SAVE", "gotoquestion_{$sequence}");
//$this->tpl->setVariable("AUTOSAVEFORMACTION", str_replace("&amp;", "&", $this->ctrl->getFormAction($this)));
$this->tpl->setVariable("AUTOSAVEFORMACTION", str_replace("&amp;", "&", $this->ctrl->getLinkTarget($this, "autosave")));
$this->tpl->setVariable("AUTOSAVEINTERVAL", $this->object->getAutosaveIval());
}
if( $this->object->areObligationsEnabled() && ilObjTest::isQuestionObligatory($question_gui->object->getId()) )
{
$this->tpl->touchBlock('question_obligatory');
$this->tpl->setVariable('QUESTION_OBLIGATORY', $this->lng->txt('required_field'));
}
}

+ Here is the call graph for this function:

ilTestOutputGUI::performTearsAndAngerBrokenConfessionChecks ( )
protected

Definition at line 750 of file class.ilTestOutputGUI.php.

References $ilLog, and $ilUser.

Referenced by generateRandomTestPassForActiveUser().

{
if ($this->testSession->getActiveId() > 0)
{
if ($this->testSequence->hasRandomQuestionsForPass($this->testSession->getActiveId(), $this->testSession->getPass()) > 0)
{
// Something went wrong. Maybe the user pressed the start button twice
// Questions already exist so there is no need to create new questions
global $ilLog, $ilUser;
$ilLog->write(
__METHOD__.' Random Questions allready exists for user '.
$ilUser->getId().' in test '.$this->object->getTestId()
);
return true;
}
}
else
{
// This may not happen! If it happens, raise a fatal error...
global $ilLog, $ilUser;
$ilLog->write(__METHOD__.' '.sprintf(
$this->lng->txt("error_random_question_generation"), $ilUser->getId(), $this->object->getTestId()
));
return true;
};
return false;
}

+ Here is the caller graph for this function:

ilTestOutputGUI::postponeQuestionCmd ( )
protected

Postpone a question to the end of the test.

public

Reimplemented from ilTestPlayerAbstractGUI.

Definition at line 733 of file class.ilTestOutputGUI.php.

References saveQuestionSolution().

{
$this->ctrl->setParameter($this, "activecommand", "postpone");
$this->ctrl->redirect($this, "redirectQuestion");
}

+ Here is the call graph for this function:

ilTestOutputGUI::previousQuestionCmd ( )
protected

Go to the previous question.

Reimplemented from ilTestPlayerAbstractGUI.

Definition at line 133 of file class.ilTestOutputGUI.php.

References saveQuestionSolution().

{
$this->ctrl->setParameter($this, "activecommand", "previous");
$this->ctrl->redirect($this, "redirectQuestion");
}

+ Here is the call graph for this function:

ilTestOutputGUI::redirectQuestionCmd ( )
protected

Called when a user answered a question to perform a redirect after POST.

This is called for security reasons to prevent users sending a form twice. –> description up to date ??

public

Definition at line 147 of file class.ilTestOutputGUI.php.

References $_GET, $_SESSION, $ilUser, ilObjTest\allObligationsAnswered(), ilTestPlayerAbstractGUI\calculateSequence(), generateRandomTestPassForActiveUser(), ilTestPlayerAbstractGUI\outQuestionSummaryCmd(), ilTestPlayerAbstractGUI\outTestPage(), and ilUtil\sendInfo().

Referenced by startTestCmd().

{
global $ilUser;
// check the test restrictions to access the test in case one
// of the test navigation commands was called by an external script
// e.g. $ilNavigationHistory
$executable = $this->object->isExecutable($this->testSession, $ilUser->getId());
if (!$executable["executable"])
{
ilUtil::sendInfo($executable["errormessage"], TRUE);
$this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
}
switch ($_GET["activecommand"])
{
case "next":
$this->sequence = $this->calculateSequence();
if ($this->sequence === FALSE)
{
if ($this->object->getListOfQuestionsEnd())
{
$allObligationsAnswered = ilObjTest::allObligationsAnswered(
$this->testSession->getTestId(),
$this->testSession->getActiveId(),
$this->testSession->getPass()
);
if( $this->object->areObligationsEnabled() && !$allObligationsAnswered )
{
$this->ctrl->redirect($this, "outQuestionSummaryWithObligationsInfo");
}
}
else
{
$this->ctrl->redirect($this, "finishTest");
}
}
else
{
$this->testSession->setLastSequence($this->sequence);
$this->testSession->saveToDb();
$this->outTestPage(false);
}
break;
case "previous":
$this->sequence = $this->calculateSequence();
$this->testSession->setLastSequence($this->sequence);
$this->testSession->saveToDb();
if ($this->sequence === FALSE)
{
$this->ctrl->redirect($this, "outIntroductionPage");
}
else
{
$this->outTestPage(false);
}
break;
case "postpone":
$this->sequence = $this->calculateSequence();
$nextSequence = $this->testSequence->getNextSequence($this->sequence);
$this->testSequence->postponeSequence($this->sequence);
$this->testSequence->saveToDb();
$this->testSession->setLastSequence($nextSequence);
$this->testSession->saveToDb();
$this->sequence = $nextSequence;
$this->outTestPage(false);
break;
case "setmarked":
$this->sequence = $this->calculateSequence();
$this->testSession->setLastSequence($this->sequence);
$this->testSession->saveToDb();
$q_id = $this->testSequence->getQuestionForSequence($_GET["sequence"]);
$this->object->setQuestionSetSolved(1, $q_id, $ilUser->getId());
$this->outTestPage(false);
break;
case "resetmarked":
$this->sequence = $this->calculateSequence();
$this->testSession->setLastSequence($this->sequence);
$this->testSession->saveToDb();
$q_id = $this->testSequence->getQuestionForSequence($_GET["sequence"]);
$this->object->setQuestionSetSolved(0, $q_id, $ilUser->getId());
$this->outTestPage(false);
break;
case "directfeedback":
$this->sequence = $this->calculateSequence();
$this->testSession->setLastSequence($this->sequence);
$this->testSession->saveToDb();
$this->outTestPage(true);
break;
case "handleQuestionAction":
$this->sequence = $this->calculateSequence();
$this->testSession->setLastSequence($this->sequence);
$this->testSession->saveToDb();
$this->outTestPage(false);
break;
case "summary":
$this->ctrl->redirect($this, "outQuestionSummary");
break;
case "summary_obligations":
$this->ctrl->redirect($this, "outQuestionSummaryWithObligationsInfo");
break;
case "summary_obligations_only":
$this->ctrl->redirect($this, "outObligationsOnlySummary");
break;
case "start":
$_SESSION['tst_pass_finish'] = 0;
// ensure existing test session
$this->testSession->setUserId($ilUser->getId());
$this->testSession->setAnonymousId($_SESSION["tst_access_code"][$this->object->getTestId()]);
$this->testSession->saveToDb();
$active_id = $this->testSession->getActiveId();
$this->ctrl->setParameter($this, "active_id", $active_id);
$shuffle = $this->object->getShuffleQuestions();
if ($this->object->isRandomTest())
{
$this->object->loadQuestions();
$shuffle = FALSE; // shuffle is already done during the creation of the random questions
}
assQuestion::_updateTestPassResults(
$active_id, $this->testSession->getPass(), $this->object->areObligationsEnabled()
);
// ensure existing test sequence
if( !$this->testSequence->hasSequence() )
{
$this->testSequence->createNewSequence($this->object->getQuestionCount(), $shuffle);
$this->testSequence->saveToDb();
}
$active_time_id = $this->object->startWorkingTime($this->testSession->getActiveId(), $this->testSession->getPass());
$_SESSION["active_time_id"] = $active_time_id;
if ($this->object->getListOfQuestionsStart())
{
$this->ctrl->setParameter($this, "activecommand", "summary");
$this->ctrl->redirect($this, "redirectQuestion");
}
else
{
$this->ctrl->setParameter($this, "sequence", $this->sequence);
$this->ctrl->setParameter($this, "activecommand", "gotoquestion");
$this->ctrl->saveParameter($this, "tst_javascript");
$this->ctrl->redirect($this, "redirectQuestion");
}
break;
case "resume":
$_SESSION['tst_pass_finish'] = 0;
$active_id = $this->testSession->getActiveId();
$this->ctrl->setParameter($this, "active_id", $active_id);
if ($this->object->isRandomTest())
{
if (!$this->testSequence->hasRandomQuestionsForPass($active_id, $this->testSession->getPass()))
{
// create a new set of random questions
}
}
$shuffle = $this->object->getShuffleQuestions();
if ($this->object->isRandomTest())
{
$shuffle = FALSE;
}
assQuestion::_updateTestPassResults(
$active_id, $this->testSession->getPass(), $this->object->areObligationsEnabled()
);
// ensure existing test sequence
if( !$this->testSequence->hasSequence() )
{
$this->testSequence->createNewSequence($this->object->getQuestionCount(), $shuffle);
$this->testSequence->saveToDb();
}
$this->sequence = $this->testSession->getLastSequence();
$active_time_id = $this->object->startWorkingTime($active_id, $this->testSession->getPass());
$_SESSION["active_time_id"] = $active_time_id;
if ($this->object->getListOfQuestionsStart())
{
$this->ctrl->setParameter($this, "activecommand", "summary");
$this->ctrl->redirect($this, "redirectQuestion");
}
else
{
$this->ctrl->setParameter($this, "sequence", $this->sequence);
$this->ctrl->setParameter($this, "activecommand", "gotoquestion");
$this->ctrl->saveParameter($this, "tst_javascript");
$this->ctrl->redirect($this, "redirectQuestion");
}
break;
case 'test_submission_overview':
require_once './Modules/Test/classes/class.ilTestSubmissionReviewGUI.php';
$this->ctrl->redirect(new ilTestSubmissionReviewGUI($this, $this->object), "show");
break;
case "back":
case "gotoquestion":
default:
$_SESSION['tst_pass_finish'] = 0;
if (array_key_exists("tst_javascript", $_GET))
{
$ilUser->writePref("tst_javascript", $_GET["tst_javascript"]);
}
$this->sequence = $this->calculateSequence();
if (strlen($_GET['gotosequence'])) $this->sequence = $_GET['gotosequence'];
$this->testSession->setLastSequence($this->sequence);
$this->testSession->saveToDb();
$this->outTestPage(false);
break;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestOutputGUI::saveQuestionSolution (   $force = FALSE)

saves the user input of a question

Reimplemented from ilTestPlayerAbstractGUI.

Definition at line 646 of file class.ilTestOutputGUI.php.

References $_GET, $_POST, $_SESSION, $ilUser, $pass, ilTestPlayerAbstractGUI\$saveResult, canSaveResult(), OUTPUT_JAVASCRIPT, and ilTestPlayerAbstractGUI\updateWorkingTime().

Referenced by handleQuestionActionCmd(), nextQuestionCmd(), postponeQuestionCmd(), previousQuestionCmd(), showInstantResponseCmd(), and showQuestionListCmd().

{
$this->saveResult = FALSE;
if (!$force)
{
$formtimestamp = $_POST["formtimestamp"];
if (strlen($formtimestamp) == 0) $formtimestamp = $_GET["formtimestamp"];
if ($formtimestamp != $_SESSION["formtimestamp"])
{
$_SESSION["formtimestamp"] = $formtimestamp;
}
else
{
return FALSE;
}
}
// save question solution
if ($this->canSaveResult() || $force)
{
// but only if the ending time is not reached
$q_id = $this->testSequence->getQuestionForSequence($_GET["sequence"]);
if (is_numeric($q_id) && (int)$q_id)
{
global $ilUser;
$question_gui = $this->object->createQuestionGUI("", $q_id);
if ($this->object->getJavaScriptOutput())
{
$question_gui->object->setOutputType(OUTPUT_JAVASCRIPT);
}
$pass = NULL;
$active_id = $this->testSession->getActiveId();
if ($this->object->isRandomTest())
{
$pass = $this->object->_getPass($active_id);
}
$this->saveResult = $question_gui->object->persistWorkingState(
$active_id, $pass, $this->object->areObligationsEnabled()
);
// update learning progress (is done in ilTestSession)
//include_once("./Services/Tracking/classes/class.ilLPStatusWrapper.php");
//ilLPStatusWrapper::_updateStatus($this->object->getId(), $ilUser->getId());
}
}
if ($this->saveResult == FALSE)
{
$this->ctrl->setParameter($this, "save_error", "1");
$_SESSION["previouspost"] = $_POST;
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilTestOutputGUI::showInstantResponseCmd ( )
protected

Reimplemented from ilTestPlayerAbstractGUI.

Definition at line 700 of file class.ilTestOutputGUI.php.

References saveQuestionSolution().

{
$this->ctrl->setParameter($this, "activecommand", "directfeedback");
$this->ctrl->redirect($this, "redirectQuestion");
}

+ Here is the call graph for this function:

ilTestOutputGUI::showQuestionListCmd ( )
protected

Definition at line 707 of file class.ilTestOutputGUI.php.

References saveQuestionSolution().

{
if ($this->saveResult == FALSE)
{
$this->ctrl->setParameter($this, "activecommand", "");
$this->ctrl->redirect($this, "redirectQuestion");
}
else
{
$this->ctrl->setParameter($this, "activecommand", "summary");
$this->ctrl->redirect($this, "redirectQuestion");
}
}

+ Here is the call graph for this function:

ilTestOutputGUI::showQuestionListWithoutSavingCmd ( )
protected

Definition at line 722 of file class.ilTestOutputGUI.php.

{
$this->ctrl->setParameter($this, "activecommand", "summary");
$this->ctrl->redirect($this, "redirectQuestion");
}
ilTestOutputGUI::startTestCmd ( )
protected

Definition at line 114 of file class.ilTestOutputGUI.php.

References $_GET, and redirectQuestionCmd().

{
$_GET['activecommand'] = 'start';
}

+ Here is the call graph for this function:


The documentation for this class was generated from the following file: