15include_once
"./Services/Object/classes/class.ilObject.php";
16include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
153 return array(
'questions',
'passes',
'passed',
'lastVisit',
'firstVisit',
'timeOfWork',
'numberOfQuestions',
154 'questionsWorkedThrough',
'markECTS',
'mark_official',
'mark',
'maxpoints',
'reached',
'user_id',
'login',
155 'name',
'passScoring');
165 $this->passes = array();
166 $this->questions = array();
167 $this->passed =
false;
188 $this->passed = ($a_passed ?
true :
false);
198 $this->name = $a_name;
208 $this->
login = $a_login;
234 $this->reached = $a_reached;
244 $this->maxpoints = $a_max_points;
249 return $this->getMaxPoints() ? $this->
getReached() / $this->getMaxPoints() * 100.0 : 0;
259 $this->mark = $a_mark;
269 $this->markECTS = $a_mark_ects;
275 if (!is_object($this->passes[$questionpass])) {
278 if (is_object($this->passes[$questionpass])) {
279 return $this->passes[$questionpass]->getNrOfAnsweredQuestions();
286 $this->questionsWorkedThrough = $a_nr;
292 if (!is_object($this->passes[$questionpass])) {
295 if (is_object($this->passes[$questionpass])) {
296 return $this->passes[$questionpass]->getQuestionCount();
304 $this->numberOfQuestions = $a_nr;
315 foreach ($this->passes as
$pass) {
316 $time +=
$pass->getWorkingTime();
323 $this->timeOfWork = $a_time_of_work;
333 $this->firstVisit = $a_time;
343 $this->lastVisit = $a_time;
357 $this->passes[$pass_nr] =
$pass;
366 if (array_key_exists($pass_nr, $this->passes)) {
367 return $this->passes[$pass_nr];
375 return count($this->passes);
398 foreach ($this->passes as
$pass) {
402 && (
$pass->areObligationsAnswered() || !$obligationsAnsweredPassExists))
403 || !isset($bestpass)) {
405 $bestpass =
$pass->getPass();
409 return (
int) $bestpass;
415 foreach (array_keys($this->passes) as
$pass) {
416 if (
$pass > $lastpass) {
444 $this->lastFinishedPass =
$pass;
449 $this->questionTitles[$question_id] = $question_title;
454 return $this->questionTitles;
459 if (array_key_exists(
$pass, $this->questions)) {
460 return $this->questions[
$pass];
466 public function addQuestion($original_id, $question_id, $max_points, $sequence =
null,
$pass = 0)
468 if (!isset($this->questions[
$pass])) {
469 $this->questions[
$pass] = array();
472 $this->questions[
$pass][] = array(
473 "id" => $question_id,
474 "o_id" => $original_id,
475 "points" => $max_points,
476 "sequence" => $sequence
482 if (array_key_exists(
$index, $this->questions[
$pass])) {
492 if (array_key_exists(
$pass, $this->passes)) {
493 $count = $this->passes[
$pass]->getQuestionCount();
501 if (array_key_exists(
$pass, $this->passes)) {
512 if (!is_object($this->passes[
$pass])) {
515 if (!is_object($this->passes[
$pass])) {
518 $available = $this->passes[
$pass]->getMaxPoints();
519 $available = round($available, 2);
527 $percent = ($available > 0) ?
$reached / $available : 0;
533 $this->user_id = $a_usr_id;
543 $this->mark_official = $a_mark_official;
585 $examId = $this->passes[$scoredPass]->getExamId();
604 $requestedHintsCount = $this->passes[
$pass]->getRequestedHintsCount();
606 return $requestedHintsCount;
622 foreach ($this->passes as
$pass) {
625 if (
$reached >= $bestpoints && (
$pass->areObligationsAnswered() || !$obligationsAnsweredPassExists)) {
627 $bestpassObject =
$pass;
631 return $bestpassObject;
644 foreach (array_keys($this->passes) as $passIndex) {
645 if ($passIndex > $lastpassIndex) {
646 $lastpassIndex = $passIndex;
650 $lastpassObject = $this->passes[$lastpassIndex];
652 return $lastpassObject;
663 foreach ($this->passes as
$pass) {
664 if (
$pass->areObligationsAnswered()) {
An exception for terminatinating execution or to throw for unit testing.
return true
Flag indicating whether or not HTTP headers will be sent when outputting captcha image/audio.
__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)
getRequestedHintsCountFromScoredPass()
returns the count of hints requested by participant for scored testpass
getQuestionsWorkedThrough()
setMarkOfficial($a_mark_official)
getQuestionCount($pass=0)
Base Exception for all Exceptions relating to Modules/Test.