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 (!array_key_exists(
$pass, $this->questions)) $this->questions[
$pass] = array();
 
  426                 array_push($this->questions[
$pass], array(
"id" => $original_id, 
"aid" => $question_id, 
"points" => $max_points, 
"sequence" => $sequence));
 
  431                 if (array_key_exists($index, $this->questions[
$pass]))
 
  433                         return $this->questions[
$pass][$index];
 
  444                 if (array_key_exists(
$pass, $this->passes))
 
  446                         $count = $this->passes[
$pass]->getQuestionCount();
 
  454                 if (array_key_exists(
$pass, $this->passes))
 
  466                 if (!is_object($this->passes[
$pass])) $pass = 0;
 
  467                 if (!is_object($this->passes[$pass])) 
return 0;
 
  468                 $available = $this->passes[
$pass]->getMaxPoints();
 
  469                 $available = round($available, 2);
 
  477                 $percent = ($available > 0 ) ? 
$reached / $available : 0;
 
  483                 $this->user_id = $a_usr_id;
 
  493                 $this->mark_official = $a_mark_official;