ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
TestResultsQuestionResultsTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
21 namespace ILIAS\Modules\Test\test;
22 
24 
25 class TestResultsQuestionResultsTest extends TestCase
26 {
28  {
29  $qr = new \ilQuestionResult(
30  $id = 66,
31  $type = 'some type',
32  $title = 'a question title',
33  $question_score = 7.6,
34  $usr_score = 3.8,
35  $usr_solution = 'usr did this',
36  $best_solution = 'he had better done that',
37  $feedback = 'give it another try',
38  $worked_through = true,
39  $answered = true,
40  $requested_hints = 2,
41  $recapitulation = 'some recap',
42  $autosave = 'some autosave content',
43  $position = 765
44  );
45 
46  $this->assertEquals($id, $qr->getId());
47  $this->assertEquals($type, $qr->getType());
48  $this->assertEquals($title, $qr->getTitle());
49  $this->assertEquals($question_score, $qr->getQuestionScore());
50  $this->assertEquals($usr_score, $qr->getUserScore());
51  $this->assertEquals(50, $qr->getUserScorePercent());
52  $this->assertEquals(\ilQuestionResult::CORRECT_PARTIAL, $qr->getCorrect());
53  $this->assertEquals($feedback, $qr->getFeedback());
54  $this->assertTrue($qr->isWorkedThrough());
55  $this->assertTrue($qr->isAnswered());
56  $this->assertEquals($recapitulation, $qr->getContentForRecapitulation());
57  $this->assertEquals($requested_hints, $qr->getNumberOfRequestedHints());
58  $this->assertEquals('some autosave content', $qr->getAutosavedAnswer());
59  $this->assertEquals(765, $qr->getPosition());
60  }
61 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23