ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
QuestionResultTest.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
25 
26 class QuestionResultTest extends TestCase
27 {
28  public function testTestQuestionResultBasicProperties(): void
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  $requested_hints = 2,
42  $recapitulation = 'some recap',
43  $autosave = 'some autosave content',
44  $position = 765
45  );
46 
47  $this->assertEquals($id, $qr->getId());
48  $this->assertEquals($type, $qr->getType());
49  $this->assertEquals($title, $qr->getTitle());
50  $this->assertEquals($question_score, $qr->getQuestionScore());
51  $this->assertEquals($usr_score, $qr->getUserScore());
52  $this->assertEquals(50, $qr->getUserScorePercent());
53  $this->assertEquals(QuestionResult::CORRECT_PARTIAL, $qr->getCorrect());
54  $this->assertEquals($feedback, $qr->getFeedback());
55  $this->assertTrue($qr->isWorkedThrough());
56  $this->assertTrue($qr->isAnswered());
57  $this->assertEquals($recapitulation, $qr->getContentForRecapitulation());
58  $this->assertEquals($requested_hints, $qr->getNumberOfRequestedHints());
59  $this->assertEquals($autosave, $qr->getAutosavedAnswer());
60  $this->assertEquals($position, $qr->getPosition());
61  }
62 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:24