15 include_once
"./Services/Object/classes/class.ilObject.php";
16 include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
141 return array(
'questions',
'passes',
'passed',
'lastVisit',
'firstVisit',
'timeOfWork',
'numberOfQuestions',
142 'questionsWorkedThrough',
'markECTS',
'mark_official',
'mark',
'maxpoints',
'reached',
'user_id',
'login',
143 'name',
'passScoring');
153 $this->passes =
array();
154 $this->questions =
array();
155 $this->passed =
false;
176 $this->passed = ($a_passed ? true :
false);
186 $this->name = $a_name;
196 $this->login = $a_login;
206 $this->reached = $a_reached;
216 $this->maxpoints = $a_max_points;
221 return $this->getMaxPoints() ? $this->
getReached() / $this->getMaxPoints() * 100.0 : 0;
231 $this->mark = $a_mark;
241 $this->markECTS = $a_mark_ects;
247 if (!is_object($this->passes[$questionpass])) {
250 if (is_object($this->passes[$questionpass])) {
251 return $this->passes[$questionpass]->getNrOfAnsweredQuestions();
258 $this->questionsWorkedThrough = $a_nr;
264 if (!is_object($this->passes[$questionpass])) {
267 if (is_object($this->passes[$questionpass])) {
268 return $this->passes[$questionpass]->getQuestionCount();
276 $this->numberOfQuestions = $a_nr;
287 foreach ($this->passes as
$pass) {
288 $time += $pass->getWorkingTime();
295 $this->timeOfWork = $a_time_of_work;
305 $this->firstVisit = $a_time;
315 $this->lastVisit = $a_time;
325 $this->passes[$pass_nr] =
$pass;
330 if (array_key_exists($pass_nr, $this->passes)) {
331 return $this->passes[$pass_nr];
339 return count($this->passes);
358 foreach ($this->passes as
$pass) {
361 if (
$reached >= $bestpoints && ($pass->areObligationsAnswered() || !$obligationsAnsweredPassExists)) {
363 $bestpass = $pass->getPass();
373 foreach (array_keys($this->passes) as
$pass) {
374 if ($pass > $lastpass) {
383 $this->questionTitles[$question_id] = $question_title;
388 return $this->questionTitles;
393 if (array_key_exists(
$pass, $this->questions)) {
394 return $this->questions[
$pass];
400 public function addQuestion($original_id, $question_id, $max_points, $sequence = null,
$pass = 0)
402 if (!isset($this->questions[
$pass])) {
407 "id" => $question_id,
408 "o_id" => $original_id,
409 "points" => $max_points,
410 "sequence" => $sequence
416 if (array_key_exists(
$index, $this->questions[
$pass])) {
426 if (array_key_exists(
$pass, $this->passes)) {
427 $count = $this->passes[
$pass]->getQuestionCount();
435 if (array_key_exists(
$pass, $this->passes)) {
446 if (!is_object($this->passes[
$pass])) {
449 if (!is_object($this->passes[$pass])) {
452 $available = $this->passes[
$pass]->getMaxPoints();
453 $available = round($available, 2);
461 $percent = ($available > 0) ?
$reached / $available : 0;
467 $this->user_id = $a_usr_id;
477 $this->mark_official = $a_mark_official;
523 $requestedHintsCount = $this->passes[
$pass]->getRequestedHintsCount();
525 return $requestedHintsCount;
541 foreach ($this->passes as
$pass) {
544 if (
$reached >= $bestpoints && ($pass->areObligationsAnswered() || !$obligationsAnsweredPassExists)) {
546 $bestpassObject =
$pass;
550 return $bestpassObject;
563 foreach (array_keys($this->passes) as $passIndex) {
564 if ($passIndex > $lastpassIndex) {
565 $lastpassIndex = $passIndex;
569 $lastpassObject = $this->passes[$lastpassIndex];
571 return $lastpassObject;
582 foreach ($this->passes as
$pass) {
583 if ($pass->areObligationsAnswered()) {
setECTSMark($a_mark_ects)
getQuestionsWorkedThroughInPercent()
getReachedPointsInPercent()
getRequestedHintsCount($pass)
returns the count of hints requested by participant for given testpass
setTimeOfWork($a_time_of_work)
& getQuestion($index, $pass=0)
getReachedPoints($pass=0)
setPassScoring($passScoring)
addQuestionTitle($question_id, $question_title)
Base Exception for all Exceptions relating to Modules/Test.
getScoredPassObject()
returns the object of class ilTestEvaluationPassData that relates to the the scored test pass (best p...
setNumberOfQuestions($a_nr)
getReachedPointsInPercentForPass($pass=0)
setMarkOfficial($a_mark_official)
Create styles array
The data for the language used.
getQuestionsWorkedThrough()
getBestPassObject()
returns the object of class ilTestEvaluationPassData that relates to the the best test pass ...
setQuestionsWorkedThrough($a_nr)
getLastPassObject()
returns the object of class ilTestEvaluationPassData that relates to the the last test pass ...
addQuestion($original_id, $question_id, $max_points, $sequence=null, $pass=0)
getQuestionCount($pass=0)
doesObligationsAnsweredPassExist()
returns the fact wether a test pass with all obligations answered exists or not
__construct($passScoring)
Constructor.
getAvailablePoints($pass=0)
getRequestedHintsCountFromScoredPass()
returns the count of hints requested by participant for scored testpass
setMaxpoints($a_max_points)
areObligationsAnswered()
returns the fact wether all obligations in the scored test pass are answered or not ...