15include_once
"./Services/Object/classes/class.ilObject.php";
16include_once
"./Modules/Test/classes/inc.AssessmentConstants.php";
146 return array(
'questions',
'passes',
'passed',
'lastVisit',
'firstVisit',
'timeOfWork',
'numberOfQuestions',
147 'questionsWorkedThrough',
'markECTS',
'mark_official',
'mark',
'maxpoints',
'reached',
'user_id',
'login',
148 'name',
'passScoring');
158 $this->passes = array();
159 $this->questions = array();
160 $this->passed =
false;
181 $this->passed = ($a_passed ? true :
false);
191 $this->name = $a_name;
201 $this->login = $a_login;
227 $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])) {
271 if (is_object($this->passes[$questionpass])) {
272 return $this->passes[$questionpass]->getNrOfAnsweredQuestions();
279 $this->questionsWorkedThrough = $a_nr;
285 if (!is_object($this->passes[$questionpass])) {
288 if (is_object($this->passes[$questionpass])) {
289 return $this->passes[$questionpass]->getQuestionCount();
297 $this->numberOfQuestions = $a_nr;
308 foreach ($this->passes as
$pass) {
316 $this->timeOfWork = $a_time_of_work;
326 $this->firstVisit = $a_time;
336 $this->lastVisit = $a_time;
350 $this->passes[$pass_nr] =
$pass;
359 if (array_key_exists($pass_nr, $this->passes)) {
360 return $this->passes[$pass_nr];
368 return count($this->passes);
387 foreach ($this->passes as
$pass) {
390 if (
$reached >= $bestpoints && (
$pass->areObligationsAnswered() || !$obligationsAnsweredPassExists)) {
392 $bestpass =
$pass->getPass();
402 foreach (array_keys($this->passes) as
$pass) {
403 if (
$pass > $lastpass) {
412 $this->questionTitles[$question_id] = $question_title;
417 return $this->questionTitles;
422 if (array_key_exists(
$pass, $this->questions)) {
423 return $this->questions[
$pass];
429 public function addQuestion($original_id, $question_id, $max_points, $sequence =
null,
$pass = 0)
431 if (!isset($this->questions[
$pass])) {
432 $this->questions[
$pass] = array();
435 $this->questions[
$pass][] = array(
436 "id" => $question_id,
437 "o_id" => $original_id,
438 "points" => $max_points,
439 "sequence" => $sequence
445 if (array_key_exists(
$index, $this->questions[
$pass])) {
455 if (array_key_exists(
$pass, $this->passes)) {
456 $count = $this->passes[
$pass]->getQuestionCount();
464 if (array_key_exists(
$pass, $this->passes)) {
475 if (!is_object($this->passes[
$pass])) {
478 if (!is_object($this->passes[
$pass])) {
481 $available = $this->passes[
$pass]->getMaxPoints();
482 $available = round($available, 2);
490 $percent = ($available > 0) ?
$reached / $available : 0;
496 $this->user_id = $a_usr_id;
506 $this->mark_official = $a_mark_official;
548 $examId = $this->passes[$scoredPass]->getExamId();
567 $requestedHintsCount = $this->passes[
$pass]->getRequestedHintsCount();
569 return $requestedHintsCount;
585 foreach ($this->passes as
$pass) {
588 if (
$reached >= $bestpoints && (
$pass->areObligationsAnswered() || !$obligationsAnsweredPassExists)) {
590 $bestpassObject =
$pass;
594 return $bestpassObject;
607 foreach (array_keys($this->passes) as $passIndex) {
608 if ($passIndex > $lastpassIndex) {
609 $lastpassIndex = $passIndex;
613 $lastpassObject = $this->passes[$lastpassIndex];
615 return $lastpassObject;
626 foreach ($this->passes as
$pass) {
627 if (
$pass->areObligationsAnswered()) {
An exception for terminatinating execution or to throw for unit testing.
__construct($passScoring)
Constructor.
addQuestion($original_id, $question_id, $max_points, $sequence=null, $pass=0)
getQuestionsWorkedThroughInPercent()
areObligationsAnswered()
returns the fact wether all obligations in the scored test pass are answered or not
setTimeOfWork($a_time_of_work)
getRequestedHintsCount($pass)
returns the count of hints requested by participant for given testpass
getReachedPointsInPercentForPass($pass=0)
getAvailablePoints($pass=0)
getReachedPointsInPercent()
setNumberOfQuestions($a_nr)
getBestPassObject()
returns the object of class ilTestEvaluationPassData that relates to the the best test pass
setPassScoring($passScoring)
getExamIdFromScoredPass()
setMaxpoints($a_max_points)
addQuestionTitle($question_id, $question_title)
getScoredPassObject()
returns the object of class ilTestEvaluationPassData that relates to the the scored test pass (best p...
getLastPassObject()
returns the object of class ilTestEvaluationPassData that relates to the the last test pass
setQuestionsWorkedThrough($a_nr)
doesObligationsAnsweredPassExist()
returns the fact wether a test pass with all obligations answered exists or not
getQuestion($index, $pass=0)
getReachedPoints($pass=0)
setECTSMark($a_mark_ects)
getRequestedHintsCountFromScoredPass()
returns the count of hints requested by participant for scored testpass
getQuestionsWorkedThrough()
setMarkOfficial($a_mark_official)
getQuestionCount($pass=0)
Base Exception for all Exceptions relating to Modules/Test.