34 include_once
"./classes/class.ilObject.php";
35 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
160 return array(
'questions',
'passes',
'passed',
'lastVisit',
'firstVisit',
'timeOfWork',
'numberOfQuestions',
161 'questionsWorkedThrough',
'markECTS',
'mark_official',
'mark',
'maxpoints',
'reached',
'user_id',
'login',
162 'name',
'passScoring');
172 $this->passes = array();
173 $this->questions = array();
174 $this->passed = FALSE;
195 $this->passed = ($a_passed ? TRUE : FALSE);
205 $this->name = $a_name;
215 $this->login = $a_login;
226 $this->reached = $a_reached;
237 $this->maxpoints = $a_max_points;
242 return $this->getMaxPoints() ? $this->
getReached() / $this->getMaxPoints() * 100.0 : 0;
252 $this->mark = $a_mark;
262 $this->markECTS = $a_mark_ects;
268 if (!is_object($this->passes[$questionpass])) $questionpass = 0;
269 if (is_object($this->passes[$questionpass]))
271 return $this->passes[$questionpass]->getNrOfAnsweredQuestions();
278 $this->questionsWorkedThrough = $a_nr;
284 if (!is_object($this->passes[$questionpass])) $questionpass = 0;
285 if (is_object($this->passes[$questionpass]))
287 return $this->passes[$questionpass]->getQuestionCount();
295 $this->numberOfQuestions = $a_nr;
306 foreach ($this->passes as
$pass)
308 $time += $pass->getWorkingTime();
315 $this->timeOfWork = $a_time_of_work;
325 $this->firstVisit = $a_time;
335 $this->lastVisit = $a_time;
345 $this->passes[$pass_nr] =
$pass;
350 if (array_key_exists($pass_nr, $this->passes))
352 return $this->passes[$pass_nr];
362 return count($this->passes);
381 foreach ($this->passes as
$pass)
387 $bestpass = $pass->getPass();
396 foreach (array_keys($this->passes) as
$pass)
398 if ($pass > $lastpass) $lastpass =
$pass;
405 $this->questionTitles[$question_id] = $question_title;
410 return $this->questionTitles;
415 if (array_key_exists(
$pass, $this->questions))
417 return $this->questions[
$pass];
427 if (!array_key_exists(
$pass, $this->questions)) $this->questions[
$pass] = array();
428 array_push($this->questions[
$pass], array(
"id" => $original_id,
"aid" => $question_id,
"points" => $max_points,
"sequence" => $sequence));
433 if (array_key_exists($index, $this->questions[
$pass]))
435 return $this->questions[
$pass][$index];
446 if (array_key_exists(
$pass, $this->passes))
448 $count = $this->passes[
$pass]->getQuestionCount();
456 if (array_key_exists(
$pass, $this->passes))
467 if (!is_object($this->passes[
$pass])) $pass = 0;
468 if (!is_object($this->passes[$pass]))
return 0;
469 $available = $this->passes[
$pass]->getMaxPoints();
477 $percent = ($available > 0 ) ?
$reached / $available : 0;
483 $this->user_id = $a_usr_id;
493 $this->mark_official = $a_mark_official;