15include_once
"./Services/Object/classes/class.ilObject.php";
16include_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) {
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])) {
403 $this->questions[
$pass] = array();
406 $this->questions[
$pass][] = array(
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()) {
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)
& getQuestion($index, $pass=0)
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
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.