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;
186 $this->passes = array();
191 $this->questions = array();
211 $this->passed = ($a_passed ? TRUE : FALSE);
221 $this->name = $a_name;
231 $this->login = $a_login;
241 $this->reached = $a_reached;
251 $this->maxpoints = $a_max_points;
256 return $this->getMaxPoints() ? $this->
getReached() / $this->getMaxPoints() * 100.0 : 0;
266 $this->mark = $a_mark;
276 $this->markECTS = $a_mark_ects;
282 if (!is_object($this->passes[$questionpass])) $questionpass = 0;
283 if (is_object($this->passes[$questionpass]))
285 return $this->passes[$questionpass]->getNrOfAnsweredQuestions();
292 $this->questionsWorkedThrough = $a_nr;
298 if (!is_object($this->passes[$questionpass])) $questionpass = 0;
299 if (is_object($this->passes[$questionpass]))
301 return $this->passes[$questionpass]->getQuestionCount();
309 $this->numberOfQuestions = $a_nr;
320 foreach ($this->passes as
$pass)
322 $time += $pass->getWorkingTime();
329 $this->timeOfWork = $a_time_of_work;
339 $this->firstVisit = $a_time;
349 $this->lastVisit = $a_time;
359 $this->passes[$pass_nr] =
$pass;
364 if (array_key_exists($pass_nr, $this->passes))
366 return $this->passes[$pass_nr];
376 return count($this->passes);
395 foreach ($this->passes as
$pass)
401 $bestpass = $pass->getPass();
410 foreach (array_keys($this->passes) as
$pass)
412 if ($pass > $lastpass) $lastpass =
$pass;
419 $this->questionTitles[$question_id] = $question_title;
424 return $this->questionTitles;
429 if (array_key_exists(
$pass, $this->questions))
431 return $this->questions[
$pass];
441 if (!array_key_exists(
$pass, $this->questions)) $this->questions[
$pass] = array();
442 array_push($this->questions[
$pass], array(
"id" => $question_id,
"o_id" => $original_id,
"points" => $max_points,
"sequence" => $sequence));
447 if (array_key_exists($index, $this->questions[
$pass]))
449 return $this->questions[
$pass][$index];
460 if (array_key_exists(
$pass, $this->passes))
462 $count = $this->passes[
$pass]->getQuestionCount();
470 if (array_key_exists(
$pass, $this->passes))
482 if (!is_object($this->passes[
$pass])) $pass = 0;
483 if (!is_object($this->passes[$pass]))
return 0;
484 $available = $this->passes[
$pass]->getMaxPoints();
485 $available = round($available, 2);
493 $percent = ($available > 0 ) ?
$reached / $available : 0;
499 $this->user_id = $a_usr_id;
509 $this->mark_official = $a_mark_official;