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;
225 $this->reached = $a_reached;
235 $this->maxpoints = $a_max_points;
240 return $this->getMaxPoints() ? $this->
getReached() / $this->getMaxPoints() * 100.0 : 0;
250 $this->mark = $a_mark;
260 $this->markECTS = $a_mark_ects;
266 if (!is_object($this->passes[$questionpass])) $questionpass = 0;
267 if (is_object($this->passes[$questionpass]))
269 return $this->passes[$questionpass]->getNrOfAnsweredQuestions();
276 $this->questionsWorkedThrough = $a_nr;
282 if (!is_object($this->passes[$questionpass])) $questionpass = 0;
283 if (is_object($this->passes[$questionpass]))
285 return $this->passes[$questionpass]->getQuestionCount();
293 $this->numberOfQuestions = $a_nr;
304 foreach ($this->passes as
$pass)
306 $time += $pass->getWorkingTime();
313 $this->timeOfWork = $a_time_of_work;
323 $this->firstVisit = $a_time;
333 $this->lastVisit = $a_time;
343 $this->passes[$pass_nr] =
$pass;
348 if (array_key_exists($pass_nr, $this->passes))
350 return $this->passes[$pass_nr];
360 return count($this->passes);
379 foreach ($this->passes as
$pass)
385 $bestpass = $pass->getPass();
394 foreach (array_keys($this->passes) as
$pass)
396 if ($pass > $lastpass) $lastpass =
$pass;
403 $this->questionTitles[$question_id] = $question_title;
408 return $this->questionTitles;
413 if (array_key_exists(
$pass, $this->questions))
415 return $this->questions[
$pass];
425 if( !isset($this->questions[
$pass]) )
427 $this->questions[
$pass] = array();
430 $this->questions[
$pass][] = array(
431 "id" => $question_id,
432 "o_id" => $original_id,
433 "points" => $max_points,
434 "sequence" => $sequence
440 if (array_key_exists($index, $this->questions[
$pass]))
442 return $this->questions[
$pass][$index];
453 if (array_key_exists(
$pass, $this->passes))
455 $count = $this->passes[
$pass]->getQuestionCount();
463 if (array_key_exists(
$pass, $this->passes))
475 if (!is_object($this->passes[
$pass])) $pass = 0;
476 if (!is_object($this->passes[$pass]))
return 0;
477 $available = $this->passes[
$pass]->getMaxPoints();
478 $available = round($available, 2);
486 $percent = ($available > 0 ) ?
$reached / $available : 0;
492 $this->user_id = $a_usr_id;
502 $this->mark_official = $a_mark_official;