28include_once
"./Services/Object/classes/class.ilObject.php";
29include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
164 return array(
'questions',
'passes',
'passed',
'lastVisit',
'firstVisit',
'timeOfWork',
'numberOfQuestions',
165 'questionsWorkedThrough',
'markECTS',
'mark_official',
'mark',
'maxpoints',
'reached',
'user_id',
'login',
166 'name',
'passScoring');
176 $this->passes = array();
177 $this->questions = array();
178 $this->passed =
false;
199 $this->passed = ($a_passed ?
true :
false);
209 $this->name = $a_name;
214 return $this->
login ??
'';
219 $this->
login = $a_login;
245 $this->reached = $a_reached;
255 $this->maxpoints = $a_max_points;
260 return $this->getMaxPoints() ? $this->
getReached() / $this->getMaxPoints() * 100.0 : 0;
270 $this->mark = $a_mark;
280 $this->markECTS = $a_mark_ects;
286 if (!is_object($this->passes[$questionpass])) {
289 if (is_object($this->passes[$questionpass])) {
290 return $this->passes[$questionpass]->getNrOfAnsweredQuestions();
297 $this->questionsWorkedThrough = $a_nr;
303 if (!is_object($this->passes[$questionpass])) {
306 if (is_object($this->passes[$questionpass])) {
307 return $this->passes[$questionpass]->getQuestionCount();
315 $this->numberOfQuestions = $a_nr;
326 foreach ($this->passes as $pass) {
327 $time += $pass->getWorkingTime();
334 $this->timeOfWork = $a_time_of_work;
344 $this->firstVisit = $a_time;
354 $this->lastVisit = $a_time;
368 $this->passes[$pass_nr] = $pass;
377 if (array_key_exists($pass_nr, $this->passes)) {
378 return $this->passes[$pass_nr];
386 return count($this->passes);
408 foreach ($this->passes as $pass) {
412 && ($pass->areObligationsAnswered() || !$obligationsAnsweredPassExists))
413 || !isset($bestpass)) {
415 $bestpass = $pass->getPass();
419 return (
int) $bestpass;
425 foreach (array_keys($this->passes) as $pass) {
426 if ($pass > $lastpass) {
453 $this->lastFinishedPass = $pass;
457 $this->questionTitles[$question_id] = $question_title;
462 return $this->questionTitles;
467 if (array_key_exists($pass, $this->questions)) {
468 return $this->questions[$pass];
474 public function addQuestion($original_id, $question_id, $max_points, $sequence =
null, $pass = 0)
476 if (!isset($this->questions[$pass])) {
477 $this->questions[$pass] = array();
480 $this->questions[$pass][] = array(
481 "id" => $question_id,
482 "o_id" => $original_id,
483 "points" => $max_points,
484 "sequence" => $sequence
490 if (array_key_exists(
$index, $this->questions[$pass])) {
491 return $this->questions[$pass][
$index];
500 if (array_key_exists($pass, $this->passes)) {
501 $count = $this->passes[$pass]->getQuestionCount();
509 if (array_key_exists($pass, $this->passes)) {
510 $reached = $this->passes[$pass]->getReachedPoints();
520 if (!is_object($this->passes[$pass])) {
523 if (!is_object($this->passes[$pass])) {
526 $available = $this->passes[$pass]->getMaxPoints();
527 $available = round($available, 2);
535 $percent = ($available > 0) ?
$reached / $available : 0;
541 $this->user_id = $a_usr_id;
551 $this->mark_official = $a_mark_official;
593 $examId = $this->passes[$scoredPass]->getExamId();
612 $requestedHintsCount = $this->passes[$pass]->getRequestedHintsCount();
614 return $requestedHintsCount;
630 foreach ($this->passes as $pass) {
633 if (
$reached >= $bestpoints && ($pass->areObligationsAnswered() || !$obligationsAnsweredPassExists)) {
635 $bestpassObject = $pass;
639 return $bestpassObject;
652 foreach (array_keys($this->passes) as $passIndex) {
653 if ($passIndex > $lastpassIndex) {
654 $lastpassIndex = $passIndex;
658 $lastpassObject = $this->passes[$lastpassIndex];
660 return $lastpassObject;
671 foreach ($this->passes as $pass) {
672 if ($pass->areObligationsAnswered()) {
__construct($passScoring)
Constructor.
addQuestion($original_id, $question_id, $max_points, $sequence=null, $pass=0)
getQuestionsWorkedThroughInPercent()
areObligationsAnswered()
returns the fact wether all obligations in the scored test pass are answered or not
setTimeOfWork($a_time_of_work)
getRequestedHintsCount($pass)
returns the count of hints requested by participant for given testpass
getReachedPointsInPercentForPass($pass=0)
getAvailablePoints($pass=0)
getReachedPointsInPercent()
setNumberOfQuestions($a_nr)
getBestPassObject()
returns the object of class ilTestEvaluationPassData that relates to the the best test pass
setPassScoring($passScoring)
getExamIdFromScoredPass()
getBestPass()
This is used in the export of test results Aligned with ilObjTest::_getBestPass: from passes with equ...
setMaxpoints($a_max_points)
addQuestionTitle($question_id, $question_title)
getScoredPassObject()
returns the object of class ilTestEvaluationPassData that relates to the the scored test pass (best p...
getLastPassObject()
returns the object of class ilTestEvaluationPassData that relates to the the last test pass
setQuestionsWorkedThrough($a_nr)
doesObligationsAnsweredPassExist()
returns the fact wether a test pass with all obligations answered exists or not
getQuestion($index, $pass=0)
getReachedPoints($pass=0)
setLastFinishedPass($pass=null)
setECTSMark($a_mark_ects)
$passScoring
Pass Scoring (Last pass = 0, Best pass = 1)
getRequestedHintsCountFromScoredPass()
returns the count of hints requested by participant for scored testpass
getQuestionsWorkedThrough()
setMarkOfficial($a_mark_official)
getQuestionCount($pass=0)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...