ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
QuestionResultTest.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
24use PHPUnit\Framework\TestCase;
25
26class QuestionResultTest extends TestCase
27{
29 {
30 $qr = new QuestionResult(
31 $id = 66,
32 $type = 'some type',
33 $title = 'a question title',
34 $question_score = 7.6,
35 $usr_score = 3.8,
36 $usr_solution = 'usr did this',
37 $best_solution = 'he had better done that',
38 $feedback = 'give it another try',
39 $worked_through = true,
40 $answered = true,
41 $recapitulation = 'some recap',
42 $position = 765
43 );
44
45 $this->assertEquals($id, $qr->getId());
46 $this->assertEquals($type, $qr->getType());
47 $this->assertEquals($title, $qr->getTitle());
48 $this->assertEquals($question_score, $qr->getQuestionScore());
49 $this->assertEquals($usr_score, $qr->getUserScore());
50 $this->assertEquals(50, $qr->getUserScorePercent());
51 $this->assertEquals(QuestionResult::CORRECT_PARTIAL, $qr->getCorrect());
52 $this->assertEquals($feedback, $qr->getFeedback());
53 $this->assertTrue($qr->isWorkedThrough());
54 $this->assertTrue($qr->isAnswered());
55 $this->assertEquals($recapitulation, $qr->getContentForRecapitulation());
56 $this->assertEquals($position, $qr->getPosition());
57 }
58}
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...