Output class for assessment test execution. More...
Public Member Functions | |
| ilTestOutputGUI ($a_object) | |
| ilSurveyExecutionGUI constructor | |
| & | executeCommand () |
| execute command | |
| getCommand ($cmd) | |
| Retrieves the ilCtrl command. | |
| updateWorkingTime () | |
| updates working time and stores state saveresult to see if question has to be stored or not | |
| saveQuestionSolution () | |
| saves the user input of a question | |
| canSaveResult () | |
| returns if answers can be saved | |
| outIntroductionPage () | |
| Creates the introduction page for a test. | |
| isMaxProcessingTimeReached () | |
| Checks wheather the maximum processing time is reached or not. | |
| isEndingTimeReached () | |
| deleteresults () | |
| Output of the learners view of an existing test. | |
| confirmdeleteresults () | |
| Deletes the results of the current user for the active pass. | |
| canceldeleteresults () | |
| Cancels the deletion of the results of the current user for the active pass. | |
| outShortResult ($user_question_order) | |
| Shows a short result overview in courses. | |
| outWorkingForm ($sequence=1, $finish=false, $test_id, $active, $postpone_allowed, $user_question_order, $directfeedback=0) | |
| Creates the learners output of a question. | |
| start () | |
| Start a test for the first time. | |
| resume () | |
| Resume a test at the last position. | |
| handleStartCommands () | |
| Handles some form parameters on starting and resuming a test. | |
| redirectQuestion () | |
| calculateSequence () | |
| next () | |
| Go to the next question. | |
| previous () | |
| Go to the previous question. | |
| postpone () | |
| Postpone a question to the end of the test. | |
| summary () | |
| Show the question summary in online exams. | |
| setsolved () | |
| Set a question solved. | |
| resetsolved () | |
| Set a question unsolved. | |
| directfeedback () | |
| The direct feedback button was hit to show an instant feedback. | |
| selectImagemapRegion () | |
| Select an image map region in an image map question. | |
| gotoQuestion () | |
| Go to the question with the active sequence. | |
| backFromSummary () | |
| Go back to the last active question from the summary. | |
| confirmFinish () | |
| The final submission of a test was confirmed. | |
| confirmFinishTest () | |
| Confirmation of the tests final submission. | |
| finishTest ($confirm=true) | |
| Finish the test. | |
| outTestPage () | |
| Outputs the question of the active sequence. | |
| prepareRequestVariables () | |
| prepare Request variables e.g. | |
| onRunObjectEnter () | |
| what to when entering the run object | |
| checkOnlineTestAccess () | |
| check access restrictions like client ip, partipating user etc. | |
| getSequence () | |
| get next or previous sequence | |
| readFullSequence () | |
| getNextSequenceByResult ($a_sequence) | |
| getPreviousSequenceByResult ($a_sequence) | |
| isTestAccessible () | |
| test accessible returns true if the user can perform the test | |
| isNrOfTriesReached () | |
| nr of tries exceeded | |
| isTestResumable () | |
| resumable is when there exists a test and the restrictions (time, nr of tries etc) don't prevent an access | |
| handleCancelCommand () | |
| handle cancel command | |
| showTestResults () | |
| showTestResults returns true if the according request is set | |
| outResults () | |
| outResultsOverview () | |
| Output of the learner overview for a varying random test. | |
| passDetails () | |
| Output of the learners view of an existing test pass. | |
| outTestResults ($print=false, $pass=NULL) | |
| Output of the learners view of an existing test. | |
| outEvaluationForm () | |
| show_answers () | |
| Outputs all answers including the solutions for the active user. | |
| showAnswersOfUser () | |
| Output of the results of the active learner. | |
| outShowAnswersDetails ($user_id, $isForm=false) | |
| Outputs all answers including the solutions for the active user (output of the detail part). | |
| 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 () | |
| outTestSummary () | |
| Output of the learners view of an existing test without evaluation. | |
| finalSubmission () | |
Data Fields | |
| $object | |
| $lng | |
| $tpl | |
| $ctrl | |
| $ilias | |
| $tree | |
| $saveResult | |
| $sequence | |
| $cmdCtrl | |
| $maxProcessingTimeReached | |
| $endingTimeReached | |
Private Member Functions | |
| endingTimeReached () | |
| handle endingTimeReached | |
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
class.ilTestOutputGUI.php assessment
Definition at line 38 of file class.ilTestOutputGUI.php.
| ilTestOutputGUI::backFromSummary | ( | ) |
Go back to the last active question from the summary.
Go back to the last active question from the summary
public
Definition at line 929 of file class.ilTestOutputGUI.php.
References gotoQuestion().
{
$this->gotoQuestion();
}
Here is the call graph for this function:| ilTestOutputGUI::calculateSequence | ( | ) |
Definition at line 741 of file class.ilTestOutputGUI.php.
References $_GET, $_SESSION, $sequence, getNextSequenceByResult(), and getPreviousSequenceByResult().
Referenced by redirectQuestion().
{
if ($this->object->getTestType() == TYPE_ONLINE_TEST)
{
if ($this->object->isActiveTestSubmitted()) return "";
}
$sequence = $_GET["sequence"];
if (!$sequence) $sequence = 1;
if ($_GET["save_error"] != 1)
{
switch ($_GET["activecommand"])
{
case "next":
if($_GET['crs_show_result'])
{
$sequence = $this->getNextSequenceByResult($sequence);
}
else
{
$sequence++;
}
break;
case "previous":
if($_GET['crs_show_result'])
{
$sequence = $this->getPreviousSequenceByResult($sequence);
}
else
{
$sequence--;
}
break;
}
}
if ($_GET['crs_show_result'])
{
if(isset($_SESSION['crs_sequence'][0]))
{
$sequence = max($sequence,$_SESSION['crs_sequence'][0]);
}
else
{
$sequence = max($sequence,$this->object->getFirstSequence());
}
}
return $sequence;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::canceldeleteresults | ( | ) |
Cancels the deletion of the results of the current user for the active pass.
Cancels the deletion of the results of the current user for the active pass
public
Definition at line 257 of file class.ilTestOutputGUI.php.
{
$this->ctrl->redirect($this, "outIntroductionPage");
}
| ilTestOutputGUI::canSaveResult | ( | ) |
returns if answers can be saved
Definition at line 168 of file class.ilTestOutputGUI.php.
References isEndingTimeReached(), isMaxProcessingTimeReached(), and isNrOfTriesReached().
Referenced by saveQuestionSolution().
{
return !$this->isEndingTimeReached() && !$this->isMaxProcessingTimeReached() && !$this->isNrOfTriesReached();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::checkOnlineTestAccess | ( | ) |
check access restrictions like client ip, partipating user etc.
Definition at line 1163 of file class.ilTestOutputGUI.php.
References $ilUser, $user, and sendInfo().
Referenced by onRunObjectEnter().
{
global $ilUser;
// check if user is invited to participate
$user = $this->object->getInvitedUsers($ilUser->getId());
if (!is_array ($user) || count($user)!=1)
{
sendInfo($this->lng->txt("user_not_invited"), true);
$this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
}
$user = array_pop($user);
// check if client ip is set and if current remote addr is equal to stored client-ip
if (strcmp($user->clientip,"")!=0 && strcmp($user->clientip,$_SERVER["REMOTE_ADDR"])!=0)
{
sendInfo($this->lng->txt("user_wrong_clientip"), true);
$this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::confirmdeleteresults | ( | ) |
Deletes the results of the current user for the active pass.
Deletes the results of the current user for the active pass
public
Definition at line 241 of file class.ilTestOutputGUI.php.
References $ilUser, and sendInfo().
{
global $ilUser;
$this->object->deleteResults($ilUser->id);
sendInfo($this->lng->txt("tst_confirm_delete_results_info"), true);
$this->ctrl->redirect($this, "outIntroductionPage");
}
Here is the call graph for this function:| ilTestOutputGUI::confirmFinish | ( | ) |
The final submission of a test was confirmed.
The final submission of a test was confirmed
public
Definition at line 941 of file class.ilTestOutputGUI.php.
References finishTest().
{
$this->finishTest(false);
}
Here is the call graph for this function:| ilTestOutputGUI::confirmFinishTest | ( | ) |
Confirmation of the tests final submission.
Confirmation of the tests final submission
public
Definition at line 953 of file class.ilTestOutputGUI.php.
Referenced by finishTest().
{
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_finish_confirmation.html", true);
$this->tpl->setVariable("FINISH_QUESTION", $this->lng->txt("tst_finish_confirmation_question"));
$this->tpl->setVariable("BUTTON_CONFIRM", $this->lng->txt("tst_finish_confirm_button"));
$this->tpl->setVariable("BUTTON_CANCEL", $this->lng->txt("tst_finish_confirm_cancel_button"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}
Here is the caller graph for this function:| ilTestOutputGUI::confirmSubmitAnswers | ( | ) |
confirm submit results if confirm then results are submitted and the screen will be redirected to the startpage of the test public
Definition at line 1929 of file class.ilTestOutputGUI.php.
{
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_submit_answers_confirm.html", true);
$this->tpl->setCurrentBlock("adm_content");
if ($this->object->isActiveTestSubmitted())
{
$this->tpl->setCurrentBlock("not_submit_allowed");
$this->tpl->setVariable("TEXT_ALREADY_SUBMITTED", $this->lng->txt("tst_already_submitted"));
$this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_show_answer_sheet"));
} else
{
$this->tpl->setCurrentBlock("submit_allowed");
$this->tpl->setVariable("TEXT_CONFIRM_SUBMIT_RESULTS", $this->lng->txt("tst_confirm_submit_answers"));
$this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_submit_results"));
}
$this->tpl->setVariable("BTN_BACK", $this->lng->txt("back"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}
| ilTestOutputGUI::deleteresults | ( | ) |
Output of the learners view of an existing test.
Output of the learners view of an existing test
public
Definition at line 223 of file class.ilTestOutputGUI.php.
{
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_delete_results_confirm.html", true);
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TEXT_CONFIRM_DELETE_RESULTS", $this->lng->txt("tst_confirm_delete_results"));
$this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("cancel"));
$this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_delete_results"));
$this->tpl->setVariable("FORM_ACTION", $this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}
| ilTestOutputGUI::directfeedback | ( | ) |
The direct feedback button was hit to show an instant feedback.
The direct feedback button was hit to show an instant feedback
public
Definition at line 882 of file class.ilTestOutputGUI.php.
References saveQuestionSolution().
{
$this->saveQuestionSolution();
$this->ctrl->setParameter($this, "activecommand", "directfeedback");
$this->ctrl->redirect($this, "redirectQuestion");
}
Here is the call graph for this function:| ilTestOutputGUI::endingTimeReached | ( | ) | [private] |
handle endingTimeReached
Definition at line 1895 of file class.ilTestOutputGUI.php.
References ilFormat::ftimestamp2datetimeDB(), outIntroductionPage(), outResults(), outTestSummary(), and sendInfo().
Referenced by isEndingTimeReached(), and outTestPage().
{
sendInfo(sprintf($this->lng->txt("detail_ending_time_reached"), ilFormat::ftimestamp2datetimeDB($this->object->getEndingTime())));
$this->object->setActiveTestUser(1, "", true);
if (!$this->object->canViewResults())
{
$this->outIntroductionPage();
}
else
{
if ($this->object->isOnlineTest())
$this->outTestSummary();
else
$this->outResults();
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| & ilTestOutputGUI::executeCommand | ( | ) |
execute command
Definition at line 77 of file class.ilTestOutputGUI.php.
References $cmd, and getCommand().
{
$cmd = $this->ctrl->getCmd();
$next_class = $this->ctrl->getNextClass($this);
$this->ctrl->saveParameter($this, "sequence");
$cmd = $this->getCommand($cmd);
switch($next_class)
{
default:
$ret =& $this->$cmd();
break;
}
return $ret;
}
Here is the call graph for this function:| ilTestOutputGUI::finalSubmission | ( | ) |
Definition at line 2210 of file class.ilTestOutputGUI.php.
References $ilias, $ilUser, and outIntroductionPage().
{
global $ilias, $ilUser;
$this->object->setActiveTestSubmitted($ilUser->id);
$ilias->auth->setIdle($ilias->ini->readVariable("session","expire"), false);
$ilias->auth->setExpire(0);
$this->outIntroductionPage();
}
Here is the call graph for this function:| ilTestOutputGUI::finishTest | ( | $ | confirm = true |
) |
Finish the test.
Finish the test
public
Definition at line 970 of file class.ilTestOutputGUI.php.
References $_GET, $_SESSION, $ilUser, confirmFinishTest(), outIntroductionPage(), outResults(), and outTestSummary().
Referenced by confirmFinish().
{
global $ilUser;
unset($_SESSION["tst_next"]);
$actualpass = $this->object->_getPass($ilUser->id, $this->object->getTestId());
if (($confirm) && ($actualpass == $this->object->getNrOfTries() - 1))
{
// show confirmation page
return $this->confirmFinishTest();
}
if ($this->object->getTestType() == TYPE_VARYING_RANDOMTEST)
{
// create a new set of random questions if more passes are allowed
$maxpass = $this->object->getNrOfTries();
if (($maxpass == 0) || (($actualpass+1) < ($maxpass)))
{
$this->object->generateRandomQuestions($actualpass+1);
}
}
if ($this->object->isOnlineTest() && !$this->object->isActiveTestSubmitted($ilUser->getId()))
{
$this->outTestSummary();
return;
}
$this->object->setActiveTestUser(1, "", true);
//if (($this->object->getTestType() != TYPE_VARYING_RANDOMTEST) && (!$this->object->canViewResults()))
if (!$this->object->canViewResults())
{
$this->outIntroductionPage($maxprocessingtimereached);
}
else
{
$this->outResults();
}
// Update objectives
include_once './course/classes/class.ilCourseObjectiveResult.php';
$tmp_obj_res =& new ilCourseObjectiveResult($ilUser->getId());
$tmp_obj_res->updateResults($this->object->getTestResult($ilUser->getId()));
unset($tmp_obj_res);
if($_GET['crs_show_result'])
{
$this->ctrl->redirectByClass("ilobjtestgui", "backToCourse");
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::getCommand | ( | $ | cmd | ) |
Retrieves the ilCtrl command.
Retrieves the ilCtrl command
public
Definition at line 100 of file class.ilTestOutputGUI.php.
References $cmd.
Referenced by executeCommand().
{
return $cmd;
}
Here is the caller graph for this function:| ilTestOutputGUI::getNextSequenceByResult | ( | $ | a_sequence | ) |
Definition at line 1260 of file class.ilTestOutputGUI.php.
References $_SESSION, $counter, and $sequence.
Referenced by calculateSequence(), and getSequence().
{
if(!is_array($_SESSION['crs_sequence']))
{
return 1;
}
$counter = 0;
foreach($_SESSION['crs_sequence'] as $sequence)
{
if($sequence == $a_sequence)
{
if($_SESSION['crs_sequence'][$counter+1])
{
return $_SESSION['crs_sequence'][$counter+1];
}
else
{
return $this->object->getQuestionCount() + 1;
}
}
++$counter;
}
return $this->object->getQuestionCount() + 1;
}
Here is the caller graph for this function:| ilTestOutputGUI::getPreviousSequenceByResult | ( | $ | a_sequence | ) |
Definition at line 1285 of file class.ilTestOutputGUI.php.
References $_SESSION, $counter, and $sequence.
Referenced by calculateSequence(), and getSequence().
{
if(!is_array($_SESSION['crs_sequence']))
{
return 0;
}
$counter = 0;
foreach($_SESSION['crs_sequence'] as $sequence)
{
if($sequence == $a_sequence)
{
if($_SESSION['crs_sequence'][$counter-1])
{
return $_SESSION['crs_sequence'][$counter-1];
}
else
{
return 0;
}
}
++$counter;
}
return 0;
}
Here is the caller graph for this function:| ilTestOutputGUI::getSequence | ( | ) |
get next or previous sequence
Definition at line 1188 of file class.ilTestOutputGUI.php.
References $_GET, $_POST, $_SESSION, $saveResult, $sequence, getNextSequenceByResult(), and getPreviousSequenceByResult().
Referenced by gotoQuestion().
{
if ($this->object->getTestType() == TYPE_ONLINE_TEST)
{
if ($this->object->isActiveTestSubmitted()) return "";
}
$sequence = $_GET["sequence"];
if (!$sequence) $sequence = 1;
$saveResult = $this->saveResult;
if (isset($_POST["cmd"]["next"]) && $saveResult == true)
{
if($_GET['crs_show_result'])
{
$sequence = $this->getNextSequenceByResult($sequence);
}
else
{
$sequence++;
}
}
elseif (($_POST["cmd"]["previous"]) and ($sequence != 0) and ($saveResult))
{
if($_GET['crs_show_result'])
{
$sequence = $this->getPreviousSequenceByResult($sequence);
}
else
{
$sequence--;
}
}
elseif($_GET['crs_show_result'])
{
if(isset($_SESSION['crs_sequence'][0]))
{
$sequence = max($sequence,$_SESSION['crs_sequence'][0]);
}
else
{
$sequence = max($sequence,$this->object->getFirstSequence());
}
}
return $sequence;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::gotoQuestion | ( | ) |
Go to the question with the active sequence.
Go to the question with the active sequence
public
Definition at line 915 of file class.ilTestOutputGUI.php.
References getSequence(), and outTestPage().
Referenced by backFromSummary().
{
$this->sequence = $this->getSequence();
$this->object->setActiveTestUser($this->sequence);
$this->outTestPage();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::handleCancelCommand | ( | ) |
handle cancel command
Definition at line 1350 of file class.ilTestOutputGUI.php.
References sendInfo().
Referenced by onRunObjectEnter().
{
sendInfo($this->lng->txt("test_cancelled"), true);
$this->ctrl->redirectByClass("ilobjtestgui", "backToRepository");
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::handleStartCommands | ( | ) |
Handles some form parameters on starting and resuming a test.
Handles some form parameters on starting and resuming a test
public
Definition at line 599 of file class.ilTestOutputGUI.php.
References $_POST, $_SESSION, $ilias, and $ilUser.
Referenced by resume(), and start().
{
global $ilUser;
// create new time dataset and set start time
$active_time_id = $this->object->startWorkingTime($ilUser->id);
$_SESSION["active_time_id"] = $active_time_id;
if ($_POST["chb_javascript"])
{
$ilUser->setPref("tst_javascript", 1);
$ilUser->writePref("tst_javascript", 1);
}
else
{
$ilUser->setPref("tst_javascript", 0);
$ilUser->writePref("tst_javascript", 0);
}
// hide previous results
if ($this->object->getNrOfTries() != 1)
{
if ($this->object->getHidePreviousResults() != 1)
{
if ($_POST["chb_hide_previous_results"])
{
$ilUser->setPref("tst_hide_previous_results", 1);
$ilUser->writePref("tst_hide_previous_results", 1);
}
else
{
$ilUser->setPref("tst_hide_previous_results", 0);
$ilUser->writePref("tst_hide_previous_results", 0);
}
}
}
if ($this->object->getTestType() == TYPE_ONLINE_TEST)
{
global $ilias;
$ilias->auth->setIdle(0, false);
}
}
Here is the caller graph for this function:| ilTestOutputGUI::ilTestOutputGUI | ( | $ | a_object | ) |
ilSurveyExecutionGUI constructor
The constructor takes possible arguments an creates an instance of the ilSurveyExecutionGUI object.
| object | $a_object Associated ilObjSurvey class public |
Definition at line 61 of file class.ilTestOutputGUI.php.
| ilTestOutputGUI::isEndingTimeReached | ( | ) |
Definition at line 207 of file class.ilTestOutputGUI.php.
References $ilUser, and endingTimeReached().
Referenced by canSaveResult(), isTestAccessible(), and outTestPage().
{
global $ilUser;
if (!is_bool($this->endingTimeReached))
$this->endingTimeReached = $this->object->endingTimeReached() && ($this->object->getTestType() == TYPE_ASSESSMENT || $this->object->isOnlineTest());
return $this->endingTimeReached;
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::isMaxProcessingTimeReached | ( | ) |
Checks wheather the maximum processing time is reached or not.
Checks wheather the maximum processing time is reached or not
Definition at line 193 of file class.ilTestOutputGUI.php.
References $ilUser.
Referenced by canSaveResult(), isTestAccessible(), outTestPage(), and outTestSummary().
{
global $ilUser;
$starting_time = $this->object->getStartingTimeOfUser($ilUser->getId());
if ($starting_time === FALSE)
{
return FALSE;
}
else
{
return $this->object->isMaxProcessingTimeReached($starting_time);
}
}
Here is the caller graph for this function:| ilTestOutputGUI::isNrOfTriesReached | ( | ) |
nr of tries exceeded
Definition at line 1325 of file class.ilTestOutputGUI.php.
Referenced by canSaveResult(), and isTestAccessible().
{
$active = $this->object->getActiveTestUser();
return $this->object->hasNrOfTriesRestriction() && is_object($active) && $this->object->isNrOfTriesReached($active->tries);
}
Here is the caller graph for this function:| ilTestOutputGUI::isTestAccessible | ( | ) |
test accessible returns true if the user can perform the test
Definition at line 1314 of file class.ilTestOutputGUI.php.
References isEndingTimeReached(), isMaxProcessingTimeReached(), and isNrOfTriesReached().
Referenced by prepareRequestVariables().
{
return !$this->isNrOfTriesReached()
and !$this->isMaxProcessingTimeReached()
and $this->object->startingTimeReached()
and !$this->isEndingTimeReached();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::isTestResumable | ( | ) |
resumable is when there exists a test and the restrictions (time, nr of tries etc) don't prevent an access
Definition at line 1335 of file class.ilTestOutputGUI.php.
{
if ($this->object->getTestType() == TYPE_ONLINE_TEST)
{
if ($this->object->isActiveTestSubmitted()) return false;
}
$active = $this->object->getActiveTestUser();
return is_object($active) && $this->object->startingTimeReached() && !$this->object->endingTimeReached();
}
| ilTestOutputGUI::maxProcessingTimeReached | ( | ) |
Outputs a message when the maximum processing time is reached.
Outputs a message when the maximum processing time is reached
public
Definition at line 1919 of file class.ilTestOutputGUI.php.
References outIntroductionPage().
Referenced by outTestPage().
{
$this->outIntroductionPage();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::next | ( | ) |
Go to the next question.
Go to the next question
public
Definition at line 797 of file class.ilTestOutputGUI.php.
References $ilUser, and saveQuestionSolution().
{
global $ilUser;
$this->saveQuestionSolution();
$this->ctrl->setParameter($this, "activecommand", "next");
$this->ctrl->redirect($this, "redirectQuestion");
}
Here is the call graph for this function:| ilTestOutputGUI::onRunObjectEnter | ( | ) |
what to when entering the run object
Definition at line 1144 of file class.ilTestOutputGUI.php.
References $_POST, checkOnlineTestAccess(), and handleCancelCommand().
Referenced by outTestPage().
{
// cancel Test if it's not online test
if ($_POST["cmd"]["cancelTest"])
{
$this->handleCancelCommand();
}
// check online exams access restrictions due to participants and client ip
if ($this->object->getTestType() == TYPE_ONLINE_TEST)
{
$this->checkOnlineTestAccess();
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::outEvaluationForm | ( | ) |
Definition at line 1689 of file class.ilTestOutputGUI.php.
References $_GET, $ilUser, ilObjStyleSheet::getContentStylePath(), and ilObjStyleSheet::getSyntaxStylePath().
{
global $ilUser;
$this->ctrl->saveParameter($this, "pass");
include_once("classes/class.ilObjStyleSheet.php");
$this->tpl->setCurrentBlock("ContentStyle");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET", ilObjStyleSheet::getContentStylePath(0));
$this->tpl->parseCurrentBlock();
// syntax style
$this->tpl->setCurrentBlock("SyntaxStyle");
$this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
ilObjStyleSheet::getSyntaxStylePath());
$this->tpl->parseCurrentBlock();
$test_id = $this->object->getTestId();
$question_gui = $this->object->createQuestionGUI("", $_GET["evaluation"]);
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_evaluation.html", true);
switch ($question_gui->getQuestionType())
{
case "qt_imagemap":
$question_gui->outWorkingForm($test_id, "", 1, $formaction);
break;
case "qt_javaapplet":
$question_gui->outWorkingForm("", "", 0);
break;
default:
$question_gui->outWorkingForm($test_id, "", 1);
}
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("BACKLINK_TEXT", "<< " . $this->lng->txt("back"));
$this->tpl->parseCurrentBlock();
}
Here is the call graph for this function:| ilTestOutputGUI::outIntroductionPage | ( | ) |
Creates the introduction page for a test.
Creates the introduction page for a test
public
Definition at line 180 of file class.ilTestOutputGUI.php.
Referenced by endingTimeReached(), finalSubmission(), finishTest(), and maxProcessingTimeReached().
{
$this->ctrl->redirectByClass("ilobjtestgui", "infoScreen");
}
Here is the caller graph for this function:| ilTestOutputGUI::outProcessingTime | ( | ) |
Definition at line 1949 of file class.ilTestOutputGUI.php.
References $ilUser, and formatDate().
Referenced by outTestPage(), and outTestSummary().
{
global $ilUser;
$starting_time = $this->object->getStartingTimeOfUser($ilUser->getId());
$processing_time = $this->object->getProcessingTimeInSeconds();
$processing_time_minutes = floor($processing_time / 60);
$processing_time_seconds = $processing_time - $processing_time_minutes * 60;
$str_processing_time = "";
if ($processing_time_minutes > 0)
{
$str_processing_time = $processing_time_minutes . " " . $this->lng->txt("minutes");
}
if ($processing_time_seconds > 0)
{
if (strlen($str_processing_time) > 0) $str_processing_time .= " " . $this->lng->txt("and") . " ";
$str_processing_time .= $processing_time_seconds . " " . $this->lng->txt("seconds");
}
$time_left = $starting_time + $processing_time - mktime();
$time_left_minutes = floor($time_left / 60);
$time_left_seconds = $time_left - $time_left_minutes * 60;
$str_time_left = "";
if ($time_left_minutes > 0)
{
$str_time_left = $time_left_minutes . " " . $this->lng->txt("minutes");
}
if ($time_left_seconds > 0)
{
if (strlen($str_time_left) > 0) $str_time_left .= " " . $this->lng->txt("and") . " ";
$str_time_left .= $time_left_seconds . " " . $this->lng->txt("seconds");
}
$date = getdate($starting_time);
$this->tpl->setCurrentBlock("enableprocessingtime");
$this->tpl->setVariable("USER_WORKING_TIME",
sprintf($this->lng->txt("tst_time_already_spent"),
ilFormat::formatDate(
$date["year"]."-".
sprintf("%02d", $date["mon"])."-".
sprintf("%02d", $date["mday"])." ".
sprintf("%02d", $date["hours"]).":".
sprintf("%02d", $date["minutes"]).":".
sprintf("%02d", $date["seconds"])
),
$str_processing_time,
$str_time_left
)
);
$this->tpl->parseCurrentBlock();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::outResults | ( | ) |
Definition at line 1364 of file class.ilTestOutputGUI.php.
References outResultsOverview(), and outTestResults().
Referenced by endingTimeReached(), and finishTest().
{
if ($this->object->getTestType() == TYPE_VARYING_RANDOMTEST)
{
$this->outResultsOverview();
}
else
{
$this->outTestResults();
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::outResultsOverview | ( | ) |
Output of the learner overview for a varying random test.
Output of the learner overview for a varying random test
public
Definition at line 1383 of file class.ilTestOutputGUI.php.
References $counter, $ilUser, $user_id, ilObjTest::_getResultPass(), ilFormat::formatDate(), and ilFormat::ftimestamp2dateDB().
Referenced by outResults().
{
global $ilUser;
if ($this->object->getTestType() != TYPE_VARYING_RANDOMTEST)
{
$this->ctrl->redirect($this, "outIntroductionPage");
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_finish.html", true);
$this->tpl->addBlockFile("TEST_RESULTS", "results", "tpl.il_as_tst_varying_results.html", true);
$user_id = $ilUser->id;
$color_class = array("tblrow1", "tblrow2");
$counter = 0;
include_once "./assessment/classes/class.ilObjTest.php";
$counted_pass = ilObjTest::_getResultPass($ilUser->id, $this->object->getTestId());
$reached_pass = $this->object->_getPass($ilUser->id, $this->object->getTestId());
$result_percentage = 0;
$result_total_reached = 0;
$result_total_max = 0;
for ($pass = 0; $pass <= $reached_pass; $pass++)
{
$finishdate = $this->object->getPassFinishDate($ilUser->id, $this->object->getTestId(), $pass);
if ($finishdate > 0)
{
$result_array =& $this->object->getTestResult($user_id, $pass);
if (!$result_array["test"]["total_max_points"])
{
$percentage = 0;
}
else
{
$percentage = ($result_array["test"]["total_reached_points"]/$result_array["test"]["total_max_points"])*100;
}
$total_max = $result_array["test"]["total_max_points"];
$total_reached = $result_array["test"]["total_reached_points"];
$this->tpl->setCurrentBlock("result_row");
if ($pass == $counted_pass)
{
$this->tpl->setVariable("COLOR_CLASS", "tblrowmarked");
$result_percentage = $percentage;
$result_total_reached = $total_reached;
$result_total_max = $total_max;
}
else
{
$this->tpl->setVariable("COLOR_CLASS", $color_class[$pass % 2]);
}
$this->tpl->setVariable("VALUE_PASS", $pass + 1);
$this->tpl->setVariable("VALUE_DATE", ilFormat::formatDate(ilFormat::ftimestamp2dateDB($finishdate), "date"));
$this->tpl->setVariable("VALUE_ANSWERED", $this->object->getAnsweredQuestionCount($ilUser->id, $this->object->getTestId(), $pass) . " " . strtolower($this->lng->txt("of")) . " " . (count($result_array)-1));
$this->tpl->setVariable("VALUE_REACHED", $total_reached . " " . strtolower($this->lng->txt("of")) . " " . $total_max);
$this->tpl->setVariable("VALUE_PERCENTAGE", sprintf("%.2f", $percentage) . "%");
if ($this->object->canViewResults())
{
$this->tpl->setVariable("HREF_PASS_DETAILS", "<a href=\"".$this->ctrl->getLinkTargetByClass(get_class($this), "passDetails")."&pass=$pass\">" . $this->lng->txt("tst_pass_details") . "</a>");
}
$this->tpl->parseCurrentBlock();
}
}
$this->tpl->setCurrentBlock("results");
$this->tpl->setVariable("PASS_COUNTER", $this->lng->txt("pass"));
$this->tpl->setVariable("DATE", $this->lng->txt("date"));
$this->tpl->setVariable("ANSWERED_QUESTIONS", $this->lng->txt("tst_answered_questions"));
$this->tpl->setVariable("REACHED_POINTS", $this->lng->txt("tst_reached_points"));
$this->tpl->setVariable("PERCENTAGE_CORRECT", $this->lng->txt("tst_percent_solved"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("BACK_TO_INTRODUCTION", $this->lng->txt("tst_results_back_introduction"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("test_user_name");
$this->tpl->setVariable("USER_NAME", sprintf($this->lng->txt("tst_result_user_name"), $ilUser->getFullname()));
$this->tpl->parseCurrentBlock();
if ($this->object->canViewResults())
{
$mark_obj = $this->object->mark_schema->get_matching_mark($result_percentage);
if ($mark_obj)
{
if ($mark_obj->get_passed())
{
$mark = $this->lng->txt("tst_result_congratulations");
}
else
{
$mark = $this->lng->txt("tst_result_sorry");
}
$mark .= "<br />" . $this->lng->txt("tst_your_mark_is") . ": "" . $mark_obj->get_official_name() . """;
}
if ($this->object->ects_output)
{
$ects_mark = $this->object->getECTSGrade($result_total_reached, $result_total_max);
$mark .= "<br />" . $this->lng->txt("tst_your_ects_mark_is") . ": "" . $ects_mark . "" (" . $this->lng->txt("ects_grade_". strtolower($ects_mark) . "_short") . ": " . $this->lng->txt("ects_grade_". strtolower($ects_mark)) . ")";
}
$this->tpl->setVariable("USER_FEEDBACK", $mark);
}
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results"));
$this->tpl->parseCurrentBlock();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::outShortResult | ( | $ | user_question_order | ) |
Shows a short result overview in courses.
Shows a short result overview in courses
public
Definition at line 269 of file class.ilTestOutputGUI.php.
References $_GET, $_SESSION, $pos, and $sequence.
Referenced by outTestPage().
{
if(!$_GET['crs_show_result'])
{
$this->tpl->setCurrentBlock("percentage");
$this->tpl->setVariable("PERCENTAGE", (int)(($this->sequence / count($user_question_order))*200));
$this->tpl->setVariable("PERCENTAGE_VALUE", (int)(($this->sequence / count($user_question_order))*100));
$this->tpl->setVariable("HUNDRED_PERCENT", "200");
$this->tpl->setVariable("TEXT_COMPLETED", $this->lng->txt("completed") . ": ");
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("percentage_bottom");
$this->tpl->setVariable("PERCENTAGE", (int)(($this->sequence / count($user_question_order))*200));
$this->tpl->setVariable("PERCENTAGE_VALUE", (int)(($this->sequence / count($user_question_order))*100));
$this->tpl->setVariable("HUNDRED_PERCENT", "200");
$this->tpl->setVariable("TEXT_COMPLETED", $this->lng->txt("completed") . ": ");
$this->tpl->parseCurrentBlock();
}
else
{
$num_wrong = count($_SESSION['crs_sequence']);
$pos = 1;
foreach($_SESSION['crs_sequence'] as $sequence)
{
if($sequence == $this->sequence)
{
break;
}
$pos++;
}
$this->tpl->setCurrentBlock("percentage");
$this->tpl->setVariable("PERCENTAGE", (int)(($pos / $num_wrong)*200));
$this->tpl->setVariable("PERCENTAGE_VALUE", (int)(($pos / $num_wrong)*100));
$this->tpl->setVariable("HUNDRED_PERCENT", "200");
$this->tpl->setVariable("TEXT_COMPLETED", $this->lng->txt("completed") . ": ");
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("percentage_bottom");
$this->tpl->setVariable("PERCENTAGE", (int)(($pos / $num_wrong)*200));
$this->tpl->setVariable("PERCENTAGE_VALUE", (int)(($pos / $num_wrong)*100));
$this->tpl->setVariable("HUNDRED_PERCENT", "200");
$this->tpl->setVariable("TEXT_COMPLETED", $this->lng->txt("completed") . ": ");
$this->tpl->parseCurrentBlock();
}
}
Here is the caller graph for this function:| ilTestOutputGUI::outShowAnswersDetails | ( | $ | user_id, | |
| $ | isForm = false | |||
| ) |
Outputs all answers including the solutions for the active user (output of the detail part).
Outputs all answers including the solutions for the active user (output of the detail part)
public
Definition at line 1777 of file class.ilTestOutputGUI.php.
References $counter, $idx, $ilUser, $t, $type, $user_id, ilUtil::date_mysql2time(), and ilUtil::getImagePath().
Referenced by show_answers(), and showAnswersOfUser().
{
$active = $this->object->getActiveTestUser($user_id);
$t = $active->submittimestamp;
include_once "./classes/class.ilObjUser.php";
$ilUser = new ilObjUser($user_id);
if (strlen($ilUser->getMatriculation()))
{
$this->tpl->setCurrentBlock("user_matric");
$this->tpl->setVariable("TXT_USR_MATRIC", $this->lng->txt("matriculation"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("user_matric_value");
$this->tpl->setVariable("VALUE_USR_MATRIC", $ilUser->getMatriculation());
$this->tpl->parseCurrentBlock();
$this->tpl->touchBlock("user_matric_separator");
}
$invited_users = array_pop($this->object->getInvitedUsers($ilUser->getId()));
if (strlen($invited_users->clientip))
{
$this->tpl->setCurrentBlock("user_clientip");
$this->tpl->setVariable("TXT_CLIENT_IP", $this->lng->txt("matriculation"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("user_clientip_value");
$this->tpl->setVariable("VALUE_CLIENT_IP", $invited_users->clientip);
$this->tpl->parseCurrentBlock();
$this->tpl->touchBlock("user_clientip_separator");
}
include_once "./classes/class.ilUtil.php";
// output of submit date and signature
if ($active->submitted)
{
// only display submit date when it exists (not in the summary but in the print form)
$this->tpl->setCurrentBlock("freefield_bottom");
$this->tpl->setVariable("TXT_DATE", $this->lng->txt("date"));
$this->tpl->setVariable("VALUE_DATE", strftime("%Y-%m-%d %H:%M:%S", ilUtil::date_mysql2time($t)));
$freefieldtypes = array(
"freefield_bottom" => array(
array(
"title" => $this->lng->txt("tst_signature"),
"length" => 300
)
)
);
foreach ($freefieldtypes as $type => $freefields)
{
$counter = 0;
while ($counter < count($freefields))
{
$freefield = $freefields[$counter];
$this->tpl->setVariable("TXT_FREE_FIELD", $freefield["title"]);
$this->tpl->setVariable("IMG_SPACER", ilUtil::getImagePath("spacer.gif"));
$counter ++;
}
}
$this->tpl->parseCurrentBlock();
}
$counter = 1;
// output of questions with solutions
foreach ($this->object->questions as $question)
{
$this->tpl->setCurrentBlock("question");
$question_gui = $this->object->createQuestionGUI("", $question);
$this->tpl->setVariable("COUNTER_QUESTION", $counter.". ");
$this->tpl->setVariable("QUESTION_TITLE", $question_gui->object->getTitle());
$idx = $this->object->getTestId();
switch ($question_gui->getQuestionType())
{
case "qt_imagemap" :
$question_gui->outWorkingForm($idx, false, $show_solutions=false, $formaction, $show_question_page=false, $show_solution_only = false, $ilUser, $pass = NULL, $mixpass = true);
break;
case "qt_javaapplet" :
$question_gui->outWorkingForm("", $is_postponed = false, $showsolution = 0, $show_question_page=false, $show_solution_only = false, $ilUser, $pass = NULL, $mixpass = true);
break;
default :
$question_gui->outWorkingForm($idx, $is_postponed = false, $showsolution = 0, $show_question_page=false, $show_solution_only = false, $ilUser, $pass = NULL, $mixpass = true);
}
$this->tpl->parseCurrentBlock();
$counter ++;
}
// output of submit buttons
if ($isForm && !$active->submitted)
{
$this->tpl->setCurrentBlock("confirm");
$this->tpl->setVariable("TXT_SUBMIT_ANSWERS", $this->lng->txt("tst_submit_answers_txt"));
$this->tpl->setVariable("BTN_CANCEL", $this->lng->txt("back"));
$this->tpl->setVariable("BTN_OK", $this->lng->txt("tst_submit_answers"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("answer_sheet");
$this->tpl->setVariable("TXT_TEST_TITLE", $this->lng->txt("title"));
$this->tpl->setVariable("VALUE_TEST_TITLE", $this->object->getTitle());
$this->tpl->setVariable("TXT_TEST_PROLOG", $this->lng->txt("tst_your_answers"));
$this->tpl->setVariable("TITLE", $this->object->getTitle());
$this->tpl->setVariable("TXT_ANSWER_SHEET", $this->lng->txt("tst_answer_sheet"));
$this->tpl->setVariable("TXT_USR_NAME", $this->lng->txt("name"));
$this->tpl->setVariable("VALUE_USR_NAME", $ilUser->getLastname().", ".$ilUser->getFirstname());
$this->tpl->parseCurrentBlock();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::outTestPage | ( | ) |
Outputs the question of the active sequence.
Outputs the question of the active sequence
public
Definition at line 1028 of file class.ilTestOutputGUI.php.
References $_GET, $rbacsystem, endingTimeReached(), isEndingTimeReached(), isMaxProcessingTimeReached(), maxProcessingTimeReached(), onRunObjectEnter(), outProcessingTime(), outShortResult(), outWorkingForm(), prepareRequestVariables(), and updateWorkingTime().
Referenced by gotoQuestion(), and redirectQuestion().
{
global $rbacsystem;
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_output.html", true);
if (!$rbacsystem->checkAccess("read", $this->object->getRefId()))
{
// only with read access it is possible to run the test
$this->ilias->raiseError($this->lng->txt("cannot_execute_test"),$this->ilias->error_obj->MESSAGE);
}
$this->prepareRequestVariables();
$this->onRunObjectEnter();
// update working time and set saveResult state
$this->updateWorkingTime();
if ($this->isMaxProcessingTimeReached())
{
$this->maxProcessingTimeReached();
return;
}
if ($this->isEndingTimeReached())
{
$this->endingTimeReached();
return;
}
if ($this->object->getScoreReporting() == REPORT_AFTER_QUESTION)
{
$this->tpl->setCurrentBlock("direct_feedback");
$this->tpl->setVariable("TEXT_DIRECT_FEEDBACK", $this->lng->txt("direct_feedback"));
$this->tpl->parseCurrentBlock();
}
// show next/previous question
if ($this->sequence == $this->object->getQuestionCount())
{
$finish = true;
}
else
{
$finish = false;
}
$postpone = false;
if ($this->object->getSequenceSettings() == TEST_POSTPONE)
{
$postpone = true;
}
$active = $this->object->getActiveTestUser();
$user_question_order =& $this->object->getAllQuestionsForActiveUser();
$this->outShortResult($user_question_order);
if ($this->object->getEnableProcessingTime())
{
$this->outProcessingTime();
}
$this->tpl->setVariable("FORM_TIMESTAMP", time());
$directfeedback = 0;
if (strcmp($_GET["activecommand"], "directfeedback") == 0) $directfeedback = 1;
$this->outWorkingForm($this->sequence, $finish, $this->object->getTestId(), $active, $postpone, $user_question_order, $directfeedback, $show_summary);
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::outTestResults | ( | $ | print = false, |
|
| $ | pass = NULL | |||
| ) |
Output of the learners view of an existing test.
Output of the learners view of an existing test
public
Definition at line 1510 of file class.ilTestOutputGUI.php.
References $_GET, $counter, $ilUser, $key, $user_id, and ilUtil::getImagePath().
Referenced by outResults(), and passDetails().
{
global $ilUser;
function sort_percent($a, $b) {
if (strcmp($_GET["order"], "ASC")) {
$smaller = 1;
$greater = -1;
} else {
$smaller = -1;
$greater = 1;
}
if ($a["percent"] == $b["percent"]) {
if ($a["nr"] == $b["nr"]) return 0;
return ($a["nr"] < $b["nr"]) ? -1 : 1;
}
$apercent = 0.0;
if ($a["max"] != 0)
{
$apercent = $a["reached"] / $a["max"];
}
$bpercent = 0.0;
if ($b["max"] != 0)
{
$bpercent = $b["reached"] / $b["max"];
}
return ($apercent < $bpercent) ? $smaller : $greater;
}
function sort_nr($a, $b) {
if (strcmp($_GET["order"], "ASC")) {
$smaller = 1;
$greater = -1;
} else {
$smaller = -1;
$greater = 1;
}
if ($a["nr"] == $b["nr"]) return 0;
return ($a["nr"] < $b["nr"]) ? $smaller : $greater;
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_finish.html", true);
$user_id = $ilUser->id;
$color_class = array("tblrow1", "tblrow2");
$counter = 0;
$this->tpl->addBlockFile("TEST_RESULTS", "results", "tpl.il_as_tst_results.html", true);
$result_array =& $this->object->getTestResult($user_id, $pass);
if (!$result_array["test"]["total_max_points"])
{
$percentage = 0;
}
else
{
$percentage = ($result_array["test"]["total_reached_points"]/$result_array["test"]["total_max_points"])*100;
}
$total_max = $result_array["test"]["total_max_points"];
$total_reached = $result_array["test"]["total_reached_points"];
$img_title_percent = "";
$img_title_nr = "";
switch ($_GET["sortres"]) {
case "percent":
usort($result_array, "sort_percent");
$img_title_percent = " <img src=\"" . ilUtil::getImagePath(strtolower($_GET["order"]) . "_order.png", true) . "\" alt=\"".$this->lng->txt(strtolower($_GET["order"])."ending_order")."\" />";
if (strcmp($_GET["order"], "ASC") == 0)
{
$sortpercent = "DESC";
}
else
{
$sortpercent = "ASC";
}
break;
case "nr":
usort($result_array, "sort_nr");
$img_title_nr = " <img src=\"" . ilUtil::getImagePath(strtolower($_GET["order"]) . "_order.png", true) . "\" alt=\"".$this->lng->txt(strtolower($_GET["order"])."ending_order")."\" />";
if (strcmp($_GET["order"], "ASC") == 0)
{
$sortnr = "DESC";
}
else
{
$sortnr = "ASC";
}
break;
}
if (!$sortpercent) {
$sortpercent = "ASC";
}
if (!$sortnr) {
$sortnr = "ASC";
}
foreach ($result_array as $key => $value) {
if (preg_match("/\d+/", $key)) {
$this->tpl->setCurrentBlock("question");
$this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
$this->tpl->setVariable("VALUE_QUESTION_COUNTER", $value["nr"]);
$this->tpl->setVariable("VALUE_QUESTION_TITLE", "<a href=\"" . $this->ctrl->getLinkTargetByClass(get_class($this), "outEvaluationForm") . "&evaluation=" . $value["qid"] . "\">" . $value["title"] . "</a>");
$this->tpl->setVariable("VALUE_MAX_POINTS", $value["max"]);
$this->tpl->setVariable("VALUE_REACHED_POINTS", $value["reached"]);
if ((preg_match("/http/", $value["solution"])) || (preg_match("/goto/", $value["solution"])))
{
$this->tpl->setVariable("SOLUTION_HINT", "<a href=\"".$value["solution"]."\" target=\"content\">" . $this->lng->txt("solution_hint"). "</a>");
}
else
{
if ($value["solution"])
{
$this->tpl->setVariable("SOLUTION_HINT", $this->lng->txt($value["solution"]));
}
else
{
$this->tpl->setVariable("SOLUTION_HINT", "");
}
}
$this->tpl->setVariable("VALUE_PERCENT_SOLVED", $value["percent"]);
$this->tpl->parseCurrentBlock();
$counter++;
}
}
$this->tpl->setCurrentBlock("footer");
$this->tpl->setVariable("VALUE_QUESTION_COUNTER", "<strong>" . $this->lng->txt("total") . "</strong>");
$this->tpl->setVariable("VALUE_QUESTION_TITLE", "");
$this->tpl->setVariable("SOLUTION_HINT", "");
$this->tpl->setVariable("VALUE_MAX_POINTS", "<strong>" . sprintf("%d", $total_max) . "</strong>");
$this->tpl->setVariable("VALUE_REACHED_POINTS", "<strong>" . sprintf("%d", $total_reached) . "</strong>");
$this->tpl->setVariable("VALUE_PERCENT_SOLVED", "<strong>" . sprintf("%2.2f", $percentage) . " %" . "</strong>");
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("results");
$this->tpl->setVariable("QUESTION_COUNTER", "<a href=\"" . $this->ctrl->getLinkTargetByClass(get_class($this), "passDetails") . "&sortres=nr&order=$sortnr\">" . $this->lng->txt("tst_question_no") . "</a>$img_title_nr");
$this->tpl->setVariable("QUESTION_TITLE", $this->lng->txt("tst_question_title"));
$this->tpl->setVariable("SOLUTION_HINT_HEADER", $this->lng->txt("solution_hint"));
$this->tpl->setVariable("MAX_POINTS", $this->lng->txt("tst_maximum_points"));
$this->tpl->setVariable("REACHED_POINTS", $this->lng->txt("tst_reached_points"));
$this->tpl->setVariable("PERCENT_SOLVED", "<a href=\"" . $this->ctrl->getLinkTargetByClass(get_class($this), "passDetails") . "&sortres=percent&order=$sortpercent\">" . $this->lng->txt("tst_percent_solved") . "</a>$img_title_percent");
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
if ($this->object->getTestType() != TYPE_VARYING_RANDOMTEST)
{
$mark_obj = $this->object->mark_schema->get_matching_mark($percentage);
if ($mark_obj)
{
if ($mark_obj->get_passed())
{
$mark = $this->lng->txt("tst_result_congratulations");
}
else
{
$mark = $this->lng->txt("tst_result_sorry");
}
$mark .= "<br />" . $this->lng->txt("tst_your_mark_is") . ": "" . $mark_obj->get_official_name() . """;
}
if ($this->object->ects_output)
{
$ects_mark = $this->object->getECTSGrade($total_reached, $total_max);
$mark .= "<br />" . $this->lng->txt("tst_your_ects_mark_is") . ": "" . $ects_mark . "" (" . $this->lng->txt("ects_grade_". strtolower($ects_mark) . "_short") . ": " . $this->lng->txt("ects_grade_". strtolower($ects_mark)) . ")";
}
$this->tpl->setVariable("USER_FEEDBACK", $mark);
}
if ($this->object->getTestType() == TYPE_VARYING_RANDOMTEST)
{
$this->tpl->setVariable("BACK_TO_OVERVIEW", $this->lng->txt("tst_results_back_overview"));
}
else
{
$this->tpl->setVariable("BACK_TO_OVERVIEW", $this->lng->txt("tst_results_back_introduction"));
}
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("test_user_name");
$this->tpl->setVariable("USER_NAME", sprintf($this->lng->txt("tst_result_user_name"), $ilUser->getFullname()));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("TEXT_RESULTS", $this->lng->txt("tst_results"));
$this->tpl->parseCurrentBlock();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::outTestSummary | ( | ) |
Output of the learners view of an existing test without evaluation.
public
Definition at line 2004 of file class.ilTestOutputGUI.php.
References $_GET, $counter, $ilUser, $key, $user_id, ilUtil::getImagePath(), isMaxProcessingTimeReached(), and outProcessingTime().
Referenced by endingTimeReached(), finishTest(), and redirectQuestion().
{
global $ilUser;
// handle solved state
if (is_numeric($_GET["set_solved"]) && is_numeric($_GET["question_id"]))
{
$this->object->setQuestionSetSolved($_GET["set_solved"] , $_GET["question_id"], $ilUser->getId());
}
function sort_title($a, $b)
{
if (strcmp($_GET["order"], "ASC"))
{
$smaller = 1;
$greater = -1;
}
else
{
$smaller = -1;
$greater = 1;
}
if ($a["nr"] == $b["nr"]) return 0;
if (strcmp($a["title"],$b["title"])< 0)
return $smaller;
else if (strcmp($a["title"],$b["title"])> 0)
return $greater;
return 0;
}
function sort_nr($a, $b)
{
if (strcmp($_GET["order"], "ASC"))
{
$smaller = 1;
$greater = -1;
}
else
{
$smaller = -1;
$greater = 1;
}
if ($a["nr"] == $b["nr"]) return 0;
return ($a["nr"] < $b["nr"]) ? $smaller : $greater;
}
function sort_visited($a, $b)
{
if (strcmp($_GET["order"], "ASC"))
{
$smaller = 1;
$greater = -1;
}
else
{
$smaller = -1;
$greater = 1;
}
if ($a["nr"] == $b["nr"])
return 0;
return ($a["visited"] < $b["visited"]) ? $smaller : $greater;
}
function sort_solved($a, $b)
{
if (strcmp($_GET["order"], "ASC"))
{
$smaller = 1;
$greater = -1;
}
else
{
$smaller = -1;
$greater = 1;
}
if ($a["nr"] == $b["nr"]) return 0;
return ($a["solved"] < $b["solved"]) ? $smaller : $greater;
}
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_summary.html", true);
$user_id = $ilUser->id;
$color_class = array ("tblrow1", "tblrow2");
$counter = 0;
$result_array = & $this->object->getTestSummary($user_id);
$img_title_nr = "";
$img_title_title = "";
$img_title_solved = "";
if (!$_GET["sort_summary"] )
{
$_GET["sort_summary"] = "nr";
$_GET["order"] = "ASC";
}
switch ($_GET["sort_summary"])
{
case nr:
usort($result_array, "sort_nr");
$img_title_nr = " <img src=\"" . ilUtil::getImagePath(strtolower($_GET["order"]) . "_order.png", true) . "\" alt=\"".$this->lng->txt(strtolower($_GET["order"])."ending_order")."\" />";
if (strcmp($_GET["order"], "ASC") == 0)
{
$sortnr = "DESC";
}
else
{
$sortnr = "ASC";
}
break;
case "title":
usort($result_array, "sort_title");
$img_title_title = " <img src=\"" . ilUtil::getImagePath(strtolower($_GET["order"]) . "_order.png", true) . "\" alt=\"".$this->lng->txt(strtolower($_GET["order"])."ending_order")."\" />";
if (strcmp($_GET["order"], "ASC") == 0)
{
$sorttitle = "DESC";
}
else
{
$sorttitle = "ASC";
}
break;
case "solved":
usort($result_array, "sort_solved");
$img_title_solved = " <img src=\"" . ilUtil::getImagePath(strtolower($_GET["order"]) . "_order.png", true) . "\" alt=\"".$this->lng->txt(strtolower($_GET["order"])."ending_order")."\" />";
if (strcmp($_GET["order"], "ASC") == 0)
{
$sortsolved = "DESC";
}
else
{
$sortsolved = "ASC";
}
break;
}
if (!$sorttitle)
{
$sorttitle = "ASC";
}
if (!$sortsolved)
{
$sortsolved = "ASC";
}
if (!$sortnr)
{
$sortnr = "ASC";
}
$img_solved = " <img border=\"0\" align=\"middle\" src=\"" . ilUtil::getImagePath("solved.png", true) . "\" alt=\"".$this->lng->txt("tst_click_to_change_state")."\" />";
$img_not_solved = " <img border=\"0\" align=\"middle\" src=\"" . ilUtil::getImagePath("not_solved.png", true) . "\" alt=\"".$this->lng->txt("tst_click_to_change_state")."\" />";
$goto_question = " <img border=\"0\" align=\"middle\" src=\"" . ilUtil::getImagePath("goto_question.png", true) . "\" alt=\"".$this->lng->txt("tst_qst_goto")."\" />";
$disabled = $this->isMaxProcessingTimeReached() | $this->object->endingTimeReached();
foreach ($result_array as $key => $value)
{
if (preg_match("/\d+/", $key))
{
$this->tpl->setCurrentBlock("question");
$this->tpl->setVariable("COLOR_CLASS", $color_class[$counter % 2]);
$this->tpl->setVariable("VALUE_QUESTION_COUNTER", $value["nr"]);
$this->tpl->setVariable("VALUE_QUESTION_TITLE", $value["title"]);
$this->tpl->setVariable("VALUE_QUESTION_SOLVED", ($value["solved"] > 0) ?$img_solved : $img_not_solved);
if (!$disabled)
{
$this->ctrl->setParameter($this, "sequence", $value["nr"]);
$this->tpl->setVariable("VALUE_QUESTION_HREF_GOTO", "<a href=\"".$this->ctrl->getLinkTargetByClass(get_class($this), "gotoQuestion")."\">");
$this->ctrl->setParameter($this, "sequence", $_GET["sequence"]);
}
$this->tpl->setVariable("VALUE_QUESTION_GOTO", $goto_question);
$solvedvalue = (($value["solved"]) ? "0" : "1");
$this->tpl->setVariable("VALUE_QUESTION_HREF_SET_SOLVED", $this->ctrl->getLinkTargetByClass(get_class($this), "outTestSummary")."&order=".$_GET["order"]."&sort_summary=".$_GET["sort_summary"]."&set_solved=" . $solvedvalue."&question_id=".$value["qid"]);
$this->tpl->setVariable("VALUE_QUESTION_SET_SOLVED", ($value["solved"] > 0) ?$this->lng->txt("tst_qst_resetsolved"):$this->lng->txt("tst_qst_setsolved"));
$this->tpl->setVariable("VALUE_QUESTION_DESCRIPTION", $value["description"]);
$this->tpl->setVariable("VALUE_QUESTION_POINTS", $value["points"]." ".$this->lng->txt("points_short"));
$this->tpl->parseCurrentBlock();
$counter ++;
}
}
if (!$disabled)
{
$this->tpl->setCurrentBlock("back");
$this->tpl->setVariable("TXT_BACK", $this->lng->txt("back"));
$this->tpl->parseCurrentBlock();
}
else
{
sendinfo($this->lng->txt("detail_max_processing_time_reached"));
}
$this->tpl->setVariable("QUESTION_COUNTER","<a href=\"".$this->ctrl->getLinkTargetByClass(get_class($this), "outTestSummary")."&order=$sortnr&sort_summary=nr\">".$this->lng->txt("tst_qst_order")."</a>".$img_title_nr);
$this->tpl->setVariable("QUESTION_TITLE", "<a href=\"".$this->ctrl->getLinkTargetByClass(get_class($this), "outTestSummary")."&order=$sorttitle&sort_summary=title\">".$this->lng->txt("tst_question_title")."</a>".$img_title_title);
$this->tpl->setVariable("QUESTION_SOLVED", "<a href=\"".$this->ctrl->getLinkTargetByClass(get_class($this), "outTestSummary")."&order=$sortsolved&sort_summary=solved\">".$this->lng->txt("tst_question_solved_state")."</a>".$img_title_solved);
$this->tpl->setVariable("QUESTION_POINTS", $this->lng->txt("tst_maximum_points"));
$this->tpl->setVariable("USER_FEEDBACK", $this->lng->txt("tst_qst_summary_text"));
$this->tpl->setVariable("TXT_SHOW_AND_SUBMIT_ANSWERS", $this->lng->txt("save_finish"));
$this->tpl->setVariable("FORMACTION", $this->ctrl->getFormAction($this));
$this->tpl->setVariable("TEXT_RESULTS", $this->lng->txt("summary"));
if ($this->object->getEnableProcessingTime())
$this->outProcessingTime();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::outWorkingForm | ( | $ | sequence = 1, |
|
| $ | finish = false, |
|||
| $ | test_id, | |||
| $ | active, | |||
| $ | postpone_allowed, | |||
| $ | user_question_order, | |||
| $ | directfeedback = 0 | |||
| ) |
Creates the learners output of a question.
Creates the learners output of a question
public
Definition at line 321 of file class.ilTestOutputGUI.php.
References $_GET, $_SESSION, $ilUser, $sequence, ilObjTest::_getHidePreviousResults(), ilObjTest::_getPass(), ilObjTest::_getSolvedQuestions(), ilObjStyleSheet::getContentStylePath(), ilUtil::getImagePath(), and ilObjStyleSheet::getSyntaxStylePath().
Referenced by outTestPage().
{
global $ilUser;
include_once("classes/class.ilObjStyleSheet.php");
$this->tpl->setCurrentBlock("ContentStyle");
$this->tpl->setVariable("LOCATION_CONTENT_STYLESHEET",
ilObjStyleSheet::getContentStylePath(0));
$this->tpl->parseCurrentBlock();
// syntax style
$this->tpl->setCurrentBlock("SyntaxStyle");
$this->tpl->setVariable("LOCATION_SYNTAX_STYLESHEET",
ilObjStyleSheet::getSyntaxStylePath());
$this->tpl->parseCurrentBlock();
$question_gui = $this->object->createQuestionGUI("", $this->object->getQuestionIdFromActiveUserSequence($sequence));
if (is_null($question_gui))
{
$questioncount = $this->object->getQuestionCount();
while ((($sequence + 1) < $questioncount) && (is_null($question_gui)))
{
$sequence += 1;
$question_gui = $this->object->createQuestionGUI("", $this->object->getQuestionIdFromActiveUserSequence($sequence));
}
if (is_null($question_gui))
{
// no more questions found -> finish the test
$this->object->setActiveTestUser($questioncount);
$this->ctrl->redirect($this, "finishTest");
}
}
if ($ilUser->prefs["tst_javascript"])
{
$question_gui->object->setOutputType(OUTPUT_JAVASCRIPT);
}
// $this->tpl->addBlockFile("QUESTION_CONTENT", "question_content", "tpl.il_as_preview.html", true);
$is_postponed = false;
if (is_object($active))
{
if (!preg_match("/(^|\D)" . $question_gui->object->getId() . "($|\D)/", $active->postponed) and
!($active->postponed == $question_gui->object->getId()))
{
$is_postponed = false;
}
else
{
$is_postponed = true;
}
}
$this->ctrl->setParameter($this, "sequence", "$sequence");
$formaction = $this->ctrl->getFormAction($this);
$question_gui->setSequenceNumber($sequence);
// output question
if (array_key_exists("previouspost", $_SESSION))
{
$user_post_solution = $_SESSION["previouspost"];
unset($_SESSION["previouspost"]);
}
switch ($question_gui->getQuestionType())
{
case "qt_imagemap":
$this->ctrl->setParameter($this, "formtimestamp", time());
$formaction = $this->ctrl->getLinkTargetByClass(get_class($this), "selectImagemapRegion");
$question_gui->outWorkingForm($test_id, $is_postponed, $directfeedback, $formaction, true);
if (ilObjTest::_getHidePreviousResults($test_id, true))
{
$pass = ilObjTest::_getPass($ilUser->id, $test_id);
$info =& $question_gui->object->getSolutionValues($test_id, $ilUser, $pass);
}
else
{
$info =& $question_gui->object->getSolutionValues($test_id, $ilUser, NULL);
}
if (count($info))
{
if (strcmp($info[0]["value1"], "") != 0)
{
$formaction .= "&selImage=" . $info[0]["value1"];
}
}
break;
default:
$question_gui->outWorkingForm(
$test_id,
$is_postponed,
$showsolution = $directfeedback,
true, false, NULL, NULL, false, $user_post_solution
);
break;
}
// Normally the first sequence is 1
// In course objective mode it is the first wrongly answered question
if($_GET['crs_show_result'])
{
$first_sequence = $_SESSION['crs_sequence'][0] ? $_SESSION['crs_sequence'][0] : 1;
}
else
{
$first_sequence = 1;
}
if ($sequence == $first_sequence)
{
$this->tpl->setCurrentBlock("prev");
$this->tpl->setVariable("BTN_PREV", "<< " . $this->lng->txt("save_introduction"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("prev_bottom");
$this->tpl->setVariable("BTN_PREV", "<< " . $this->lng->txt("save_introduction"));
$this->tpl->parseCurrentBlock();
}
else
{
$this->tpl->setCurrentBlock("prev");
$this->tpl->setVariable("BTN_PREV", "<< " . $this->lng->txt("save_previous"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("prev_bottom");
$this->tpl->setVariable("BTN_PREV", "<< " . $this->lng->txt("save_previous"));
$this->tpl->parseCurrentBlock();
}
if ($postpone_allowed)
{
if (!$is_postponed)
{
$this->tpl->setCurrentBlock("postpone");
$this->tpl->setVariable("BTN_POSTPONE", $this->lng->txt("postpone"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("postpone_bottom");
$this->tpl->setVariable("BTN_POSTPONE", $this->lng->txt("postpone"));
$this->tpl->parseCurrentBlock();
}
}
if ($this->object->isOnlineTest() && !$finish)
{
$this->tpl->setCurrentBlock("summary");
$this->tpl->setVariable("BTN_SUMMARY", $this->lng->txt("summary"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("summary_bottom");
$this->tpl->setVariable("BTN_SUMMARY", $this->lng->txt("summary"));
$this->tpl->parseCurrentBlock();
}
if (!$this->object->isOnlineTest())
{
$this->tpl->setCurrentBlock("cancel_test");
$this->tpl->setVariable("TEXT_CANCELTEST", $this->lng->txt("cancel_test"));
$this->tpl->setVariable("TEXT_ALTCANCELTEXT", $this->lng->txt("cancel_test"));
$this->tpl->setVariable("TEXT_TITLECANCELTEXT", $this->lng->txt("cancel_test"));
$this->tpl->setVariable("HREF_IMGCANCELTEST", $this->ctrl->getLinkTargetByClass(get_class($this), "outIntroductionPage") . "&cancelTest=true");
$this->tpl->setVariable("HREF_CANCELTEXT", $this->ctrl->getLinkTargetByClass(get_class($this), "outIntroductionPage") . "&cancelTest=true");
$this->tpl->setVariable("IMAGE_CANCEL", ilUtil::getImagePath("cancel.png"));
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("cancel_test_bottom");
$this->tpl->setVariable("TEXT_CANCELTEST", $this->lng->txt("cancel_test"));
$this->tpl->setVariable("TEXT_ALTCANCELTEXT", $this->lng->txt("cancel_test"));
$this->tpl->setVariable("TEXT_TITLECANCELTEXT", $this->lng->txt("cancel_test"));
$this->tpl->setVariable("HREF_IMGCANCELTEST", $this->ctrl->getLinkTargetByClass(get_class($this), "outIntroductionPage") . "&cancelTest=true");
$this->tpl->setVariable("HREF_CANCELTEXT", $this->ctrl->getLinkTargetByClass(get_class($this), "outIntroductionPage") . "&cancelTest=true");
$this->tpl->setVariable("IMAGE_CANCEL", ilUtil::getImagePath("cancel.png"));
$this->tpl->parseCurrentBlock();
}
if ($finish)
{
if (!$this->object->isOnlineTest())
{
$this->tpl->setCurrentBlock("next");
$this->tpl->setVariable("BTN_NEXT", $this->lng->txt("save_finish") . " >>");
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("next_bottom");
$this->tpl->setVariable("BTN_NEXT", $this->lng->txt("save_finish") . " >>");
$this->tpl->parseCurrentBlock();
}
else
{
$this->tpl->setCurrentBlock("next");
$this->tpl->setVariable("BTN_NEXT", $this->lng->txt("summary") . " >>");
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("next_bottom");
$this->tpl->setVariable("BTN_NEXT", $this->lng->txt("summary") . " >>");
$this->tpl->parseCurrentBlock();
}
}
else
{
$this->tpl->setCurrentBlock("next");
$this->tpl->setVariable("BTN_NEXT", $this->lng->txt("save_next") . " >>");
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("next_bottom");
$this->tpl->setVariable("BTN_NEXT", $this->lng->txt("save_next") . " >>");
$this->tpl->parseCurrentBlock();
}
if ($this->object->isOnlineTest())
{
include_once "./assessment/classes/class.ilObjTest.php";
$solved_array = ilObjTest::_getSolvedQuestions($this->object->test_id, $ilUser->getId(), $question_gui->object->getId());
$solved = 0;
if (count ($solved_array) > 0)
{
$solved = array_pop($solved_array);
$solved = $solved->solved;
}
if ($solved==1)
{
$solved = ilUtil::getImagePath("solved.png", true);
$solved_cmd = "resetsolved";
$solved_txt = $this->lng->txt("tst_qst_resetsolved");
}
else
{
$solved = ilUtil::getImagePath("not_solved.png", true);
$solved_cmd = "setsolved";
$solved_txt = $this->lng->txt("tst_qst_setsolved");
}
$solved = "<input align=\"middle\" border=\"0\" alt=\"".$this->lng->txt("tst_qst_solved_state_click_to_change")."\" name=\"cmd[$solved_cmd]\" type=\"image\" src=\"$solved\" id=\"$solved_cmd\"> <small><label for=\"$solved_cmd\">$solved_txt</label></small>";
$this->tpl->setCurrentBlock("question_status");
$this->tpl->setVariable("TEXT_QUESTION_STATUS_LABEL", $this->lng->txt("tst_question_solved_state").":");
$this->tpl->setVariable("TEXT_QUESTION_STATUS", $solved);
$this->tpl->parseCurrentBlock();
}
$this->tpl->setCurrentBlock("adm_content");
$this->tpl->setVariable("FORMACTION", $formaction);
$this->tpl->parseCurrentBlock();
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::passDetails | ( | ) |
Output of the learners view of an existing test pass.
Output of the learners view of an existing test pass
public
Definition at line 1490 of file class.ilTestOutputGUI.php.
References $_GET, and outTestResults().
{
if (array_key_exists("pass", $_GET) && (strlen($_GET["pass"]) > 0))
{
$this->ctrl->saveParameter($this, "pass");
$this->outTestResults(false, $_GET["pass"]);
}
else
{
$this->outTestResults(false);
}
}
Here is the call graph for this function:| ilTestOutputGUI::postpone | ( | ) |
Postpone a question to the end of the test.
Postpone a question to the end of the test
public
Definition at line 826 of file class.ilTestOutputGUI.php.
References saveQuestionSolution().
{
$this->saveQuestionSolution();
$this->ctrl->setParameter($this, "activecommand", "postpone");
$this->ctrl->redirect($this, "redirectQuestion");
}
Here is the call graph for this function:| ilTestOutputGUI::prepareRequestVariables | ( | ) |
prepare Request variables e.g.
some get parameters have to be mapped to post params
Definition at line 1102 of file class.ilTestOutputGUI.php.
References $_GET, $_POST, and isTestAccessible().
Referenced by outTestPage().
{
if ($this->object->getTestType() == TYPE_ONLINE_TEST)
{
if ($_GET["sort_summary"])
// sort summary: click on title to sort in summary
$_POST["cmd"]["summary"]="1";
if ($_POST["cmd"]["cancel_show_answers"])
{
// cancel_show_answers: click on back in show_answer view
if ($this->isTestAccessible())
{ // everythings ok goto summary
$_POST["cmd"]["summary"]="1";
}
else
{
$_POST["cmd"]["run"]="1";
unset($_GET ["sequence"]);
}
}
if ($_POST["cmd"]["show_answers"] or $_POST["cmd"]["back"] or $_POST["cmd"]["submit_answers"] or $_POST["cmd"]["run"])
{
unset($_GET ["sort_summary"]);
unset($_GET ["setsolved"]);
unset($_GET ["resetsolved"]);
if ($_POST["cmd"]["show_answers"] or $_POST["cmd"]["submit_answers"] or $_POST["cmd"]["run"])
unset($_GET ["sequence"]);
}
}
else
{
// set showresult cmd if pressed on sort in result overview
if ($_GET["sortres"])
$_POST["cmd"]["showresults"] = 1;
}
}
Here is the call graph for this function:
Here is the caller graph for this function:| ilTestOutputGUI::previous | ( | ) |
Go to the previous question.
Go to the previous question
public
Definition at line 812 of file class.ilTestOutputGUI.php.
References saveQuestionSolution().
{
$this->saveQuestionSolution();
$this->ctrl->setParameter($this, "activecommand", "previous");
$this->ctrl->redirect($this, "redirectQuestion");
}
Here is the call graph for this function:| ilTestOutputGUI::readFullSequence | ( | ) |
Definition at line 1233 of file class.ilTestOutputGUI.php.
References $_SESSION, $ilUser, $result, and $results.
Referenced by resume(), and start().
{
global $ilUser;
$results = $this->object->getTestResult($ilUser->getId());
$_SESSION['crs_sequence'] = array();
for($i = $this->object->getFirstSequence();
$i <= $this->object->getQuestionCount();
$i++)
{
$qid = $this->object->getQuestionIdFromActiveUserSequence($i);
foreach($results as $result)
{
if($qid == $result['qid'])
{
if(!$result['max'] or $result['max'] != $result['reached'])
{
$_SESSION['crs_sequence'][] = $i;
}
}
}
}
return true;
}
Here is the caller graph for this function:| ilTestOutputGUI::redirectQuestion | ( | ) |
Definition at line 643 of file class.ilTestOutputGUI.php.
References $_GET, $ilUser, ilObjTest::_getQuestionCount(), calculateSequence(), outTestPage(), and outTestSummary().
{
global $ilUser;
include_once "./assessment/classes/class.ilObjTest.php";
switch ($_GET["activecommand"])
{
case "next":
$this->sequence = $this->calculateSequence();
// calculate count of questions statically to prevent problems with
// random tests. If the numer of questions in the used questionpools
// has been reduced lower than the number of questions which should be
// chosen, the dynamic method fails because it returns the number of questions
// that should be chosen. This leds to an error if the test is completed
$questioncount = ilObjTest::_getQuestionCount($this->object->getTestId(), $ilUser->getId());
if ($this->sequence > $questioncount)
// if ($this->sequence > $this->object->getQuestionCount())
{
if ($this->object->isOnlineTest())
{
$this->outTestSummary();
}
else
{
$this->ctrl->redirect($this, "finishTest");
}
}
else
{
$this->object->setActiveTestUser($this->sequence);
$this->outTestPage();
}
break;
case "previous":
$this->sequence = $this->calculateSequence();
$this->object->setActiveTestUser($this->sequence);
if (!$this->sequence)
{
$this->ctrl->redirect($this, "outIntroductionPage");
}
else
{
$this->outTestPage();
}
break;
case "postpone":
$this->sequence = $this->calculateSequence();
$postpone = $this->sequence;
$this->object->setActiveTestUser($this->sequence, $postpone);
$this->outTestPage();
break;
case "setsolved":
$this->sequence = $this->calculateSequence();
$this->object->setActiveTestUser($this->sequence);
$q_id = $this->object->getQuestionIdFromActiveUserSequence($_GET["sequence"]);
$this->object->setQuestionSetSolved(1, $q_id, $ilUser->getId());
$this->outTestPage();
break;
case "resetsolved":
$this->sequence = $this->calculateSequence();
$this->object->setActiveTestUser($this->sequence);
$q_id = $this->object->getQuestionIdFromActiveUserSequence($_GET["sequence"]);
$this->object->setQuestionSetSolved(0, $q_id, $ilUser->getId());
$this->outTestPage();
break;
case "directfeedback":
$this->sequence = $this->calculateSequence();
$this->object->setActiveTestUser($this->sequence);
$this->outTestPage();
break;
case "selectImagemapRegion":
$this->sequence = $this->calculateSequence();
$this->object->setActiveTestUser($this->sequence);
$this->outTestPage();
break;
case "summary":
$this->ctrl->redirect($this, "outTestSummary");
break;
case "start":
case "resume":
$this->sequence = $this->calculateSequence();
$this->object->setActiveTestUser($this->sequence);
if ($this->object->isOnlineTest())
{
$this->outTestSummary();
}
else
{
$this->outTestPage();
}
break;
default:
$this->sequence = $this->calculateSequence();
$this->object->setActiveTestUser($this->sequence);
$this->outTestPage();
break;
}
}
Here is the call graph for this function:| ilTestOutputGUI::resetsolved | ( | ) |
Set a question unsolved.
Set a question unsolved
public
Definition at line 868 of file class.ilTestOutputGUI.php.
References saveQuestionSolution().
{
$this->saveQuestionSolution();
$this->ctrl->setParameter($this, "activecommand", "resetsolved");
$this->ctrl->redirect($this, "redirectQuestion");
}
Here is the call graph for this function:| ilTestOutputGUI::resume | ( | ) |
Resume a test at the last position.
Resume a test at the last position
public
Definition at line 584 of file class.ilTestOutputGUI.php.
References handleStartCommands(), and readFullSequence().
{
$this->readFullSequence();
$this->handleStartCommands();
$this->ctrl->setParameter($this, "activecommand", "resume");
$this->ctrl->redirect($this, "redirectQuestion");
}
Here is the call graph for this function:| ilTestOutputGUI::saveQuestionSolution | ( | ) |
saves the user input of a question
Definition at line 121 of file class.ilTestOutputGUI.php.
References $_GET, $_POST, $_SESSION, $ilUser, and canSaveResult().
Referenced by directfeedback(), next(), postpone(), previous(), resetsolved(), selectImagemapRegion(), setsolved(), and summary().
{
$this->saveResult = false;
$formtimestamp = $_POST["formtimestamp"];
if (strlen($formtimestamp) == 0) $formtimestamp = $_GET["formtimestamp"];
if ($formtimestamp != $_SESSION["formtimestamp"])
{
$_SESSION["formtimestamp"] = $formtimestamp;
}
else
{
return;
}
// save question solution
if ($this->canSaveResult())
{
// but only if the ending time is not reached
$q_id = $this->object->getQuestionIdFromActiveUserSequence($_GET["sequence"]);
if (is_numeric($q_id))
{
global $ilUser;
$question_gui = $this->object->createQuestionGUI("", $q_id);
if ($ilUser->prefs["tst_javascript"])
{
$question_gui->object->setOutputType(OUTPUT_JAVASCRIPT);
}
$pass = NULL;
if ($this->object->isRandomTest())
{
global $ilUser;
$pass = $this->object->_getPass($ilUser->getId(), $this->object->getTestId());
}
$this->saveResult = $question_gui->object->saveWorkingData($this->object->getTestId(), $pass);
}
}
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::selectImagemapRegion | ( | ) |
Select an image map region in an image map question.
Select an image map region in an image map question
public
Definition at line 896 of file class.ilTestOutputGUI.php.
References $_POST, and saveQuestionSolution().
{
$this->saveQuestionSolution();
$activecommand = "selectImagemapRegion";
if (array_key_exists("cmd", $_POST))
{
$activecommand = key($_POST["cmd"]);
}
$this->ctrl->setParameter($this, "activecommand", $activecommand);
$this->ctrl->redirect($this, "redirectQuestion");
}
Here is the call graph for this function:| ilTestOutputGUI::setsolved | ( | ) |
Set a question solved.
Set a question solved
public
Definition at line 854 of file class.ilTestOutputGUI.php.
References saveQuestionSolution().
{
$this->saveQuestionSolution();
$this->ctrl->setParameter($this, "activecommand", "setsolved");
$this->ctrl->redirect($this, "redirectQuestion");
}
Here is the call graph for this function:| ilTestOutputGUI::show_answers | ( | ) |
Outputs all answers including the solutions for the active user.
Outputs all answers including the solutions for the active user
public
Definition at line 1734 of file class.ilTestOutputGUI.php.
References $ilUser, and outShowAnswersDetails().
{
global $ilUser;
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_print_answers_sheet_details.html", true);
$this->outShowAnswersDetails($ilUser->getId(), true);
}
Here is the call graph for this function:| ilTestOutputGUI::showAnswersOfUser | ( | ) |
Output of the results of the active learner.
Output of the results of the active learner
public
Definition at line 1748 of file class.ilTestOutputGUI.php.
References $ilUser, and outShowAnswersDetails().
{
global $ilUser;
$this->tpl->addBlockFile("ADM_CONTENT", "adm_content", "tpl.il_as_tst_print_answers_sheet_details.html", true);
$this->tpl->setCurrentBlock("generic_css");
$this->tpl->setVariable("LOCATION_GENERIC_STYLESHEET", "./assessment/templates/default/test_print.css");
$this->tpl->setVariable("MEDIA_GENERIC_STYLESHEET", "print");
$this->tpl->parseCurrentBlock();
$this->tpl->setCurrentBlock("navigation_buttons");
$this->tpl->setVariable("BUTTON_PRINT", $this->lng->txt("print"));
$this->tpl->setVariable("BUTTON_BACK", $this->lng->txt("back"));
$this->tpl->setVariable("URL_BACK", $this->ctrl->getLinkTargetByClass("ilobjtestgui", "infoScreen"));
$this->tpl->parseCurrentBlock();
$invited_user =& $this->object->getInvitedUsers($ilUser->getId());
$pagetitle = $this->object->getTitle() . " - " . $this->lng->txt("clientip") .
": " . $invited_user[$ilUser->getId()]->clientip . " - " .
$this->lng->txt("matriculation") . ": " .
$invited_user[$ilUser->getId()]->matriculation;
$this->tpl->setVariable("PAGETITLE", $pagetitle);
$this->outShowAnswersDetails($ilUser->getId());
}
Here is the call graph for this function:| ilTestOutputGUI::showTestResults | ( | ) |
showTestResults returns true if the according request is set
Definition at line 1359 of file class.ilTestOutputGUI.php.
References $_GET.
{
return $_GET['crs_show_result'];
}
| ilTestOutputGUI::start | ( | ) |
Start a test for the first time.
Start a test for the first time
public
Definition at line 563 of file class.ilTestOutputGUI.php.
References handleStartCommands(), and readFullSequence().
{
$this->readFullSequence();
if ($this->object->isRandomTest())
{
$this->object->generateRandomQuestions();
$this->object->loadQuestions();
}
$this->handleStartCommands();
$this->ctrl->setParameter($this, "activecommand", "start");
$this->ctrl->redirect($this, "redirectQuestion");
}
Here is the call graph for this function:| ilTestOutputGUI::summary | ( | ) |
Show the question summary in online exams.
Show the question summary in online exams
public
Definition at line 840 of file class.ilTestOutputGUI.php.
References saveQuestionSolution().
{
$this->saveQuestionSolution();
$this->ctrl->setParameter($this, "activecommand", "summary");
$this->ctrl->redirect($this, "redirectQuestion");
}
Here is the call graph for this function:| ilTestOutputGUI::updateWorkingTime | ( | ) |
updates working time and stores state saveresult to see if question has to be stored or not
Definition at line 109 of file class.ilTestOutputGUI.php.
References $_SESSION.
Referenced by outTestPage().
{
if ($_SESSION["active_time_id"]) // && $this->object->getEnableProcessingTime())
{
$this->object->updateWorkingTime($_SESSION["active_time_id"]);
//echo "updating Worktime<br>";
}
}
Here is the caller graph for this function:| ilTestOutputGUI::$cmdCtrl |
Definition at line 49 of file class.ilTestOutputGUI.php.
| ilTestOutputGUI::$ctrl |
Definition at line 43 of file class.ilTestOutputGUI.php.
| ilTestOutputGUI::$endingTimeReached |
Definition at line 51 of file class.ilTestOutputGUI.php.
| ilTestOutputGUI::$ilias |
Definition at line 44 of file class.ilTestOutputGUI.php.
Referenced by finalSubmission(), handleStartCommands(), and ilTestOutputGUI().
| ilTestOutputGUI::$lng |
Definition at line 41 of file class.ilTestOutputGUI.php.
Referenced by ilTestOutputGUI().
| ilTestOutputGUI::$maxProcessingTimeReached |
Definition at line 50 of file class.ilTestOutputGUI.php.
| ilTestOutputGUI::$object |
Definition at line 40 of file class.ilTestOutputGUI.php.
| ilTestOutputGUI::$saveResult |
Definition at line 47 of file class.ilTestOutputGUI.php.
Referenced by getSequence().
| ilTestOutputGUI::$sequence |
Definition at line 48 of file class.ilTestOutputGUI.php.
Referenced by calculateSequence(), getNextSequenceByResult(), getPreviousSequenceByResult(), getSequence(), outShortResult(), and outWorkingForm().
| ilTestOutputGUI::$tpl |
Definition at line 42 of file class.ilTestOutputGUI.php.
Referenced by ilTestOutputGUI().
| ilTestOutputGUI::$tree |
Definition at line 45 of file class.ilTestOutputGUI.php.
Referenced by ilTestOutputGUI().
1.7.1