ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
assMultipleChoiceTest.php
Go to the documentation of this file.
1<?php
2
29{
30 protected $backupGlobals = false;
31
32 protected function setUp(): void
33 {
34 parent::setUp();
35 $this->setGlobalVariable('ilias', $this->getIliasMock());
36 }
37
38 /* Removed by @kergomard 17 NOV 2022, we should introduce this again
39 public function test_isComplete_shouldReturnTrue(): void
40 {
41 $obj = new assMultipleChoice();
42 $this->assertEquals(false, $obj->isComplete());
43 $obj->setTitle('Tilte');
44 $obj->setAuthor('Me or another');
45 $obj->setQuestion('My great Question.');
46 $obj->addAnswer('Super simple single Choice', 1);
47
48 $this->assertEquals(true, $obj->isComplete());
49 } */
50
52 {
53 $obj = new assMultipleChoice();
54 $this->assertEquals('thumb.', $obj->getThumbPrefix());
55 }
56
57 /* Removed by @kergomard 17 NOV 2022, we should introduce this again
58 public function test_getAnswerCount_shouldReturnCount(): void
59 {
60 $obj = new assMultipleChoice();
61 $this->assertEquals(0, $obj->getAnswerCount());
62 $obj->addAnswer('Points for checked', 1, 0, 0);
63 $obj->addAnswer('Points for unchecked', 0, 1, 1);
64 $this->assertEquals(2, $obj->getAnswerCount());
65 $obj->deleteAnswer(0);
66 $this->assertEquals(1, $obj->getAnswerCount());
67 }
68
69 public function test_flushAnswers_shouldClearAnswers(): void
70 {
71 $obj = new assMultipleChoice();
72 $obj->addAnswer('1', 1, 0, 0);
73 $obj->addAnswer('1', 1, 0, 1);
74 $this->assertEquals(2, $obj->getAnswerCount());
75 $obj->flushAnswers();
76 $this->assertEquals(0, $obj->getAnswerCount());
77 } */
78
80 {
81 $obj = new assMultipleChoice();
82 $this->assertEquals('assMultipleChoice', $obj->getQuestionType());
83 }
84
86 {
87 $obj = new assMultipleChoice();
88 $this->assertEquals('qpl_qst_mc', $obj->getAdditionalTableName());
89 }
90
92 {
93 $obj = new assMultipleChoice();
94 $this->assertEquals('qpl_a_mc', $obj->getAnswerTableName());
95 }
96
97 /* Removed by @kergomard 17 NOV 2022, we should introduce this again
98 public function test_getMaximumPoints_shouldReturnAnswerTableName(): void
99 {
100 $obj = new assMultipleChoice();
101 $obj->addAnswer('Points for checked', 1, 0, 0);
102 $obj->addAnswer('Points for checked', 1, 0, 1);
103 $this->assertEquals(2, $obj->getMaximumPoints());
104 }
105 public function test_getMaximumPointsIfMoreForUnchecked_shouldReturnAnswerTableName(): void
106 {
107 $obj = new assMultipleChoice();
108 $obj->addAnswer('Points for unchecked', 0, 1, 0);
109 $obj->addAnswer('Points for unchecked', 0, 1, 1);
110 $this->assertEquals(2, $obj->getMaximumPoints());
111 }
112 public function test_getMaximumPointsMixed_shouldReturnAnswerTableName(): void
113 {
114 $obj = new assMultipleChoice();
115 $obj->addAnswer('Points for unchecked', 0, 1, 0);
116 $obj->addAnswer('Points for unchecked', 0, 1, 1);
117 $this->assertEquals(2, $obj->getMaximumPoints());
118 $obj->addAnswer('Points for checked', 1, 0, 2);
119 $obj->addAnswer('Points for checked', 1, 0, 3);
120 $this->assertEquals(4, $obj->getMaximumPoints());
121 $obj->addAnswer('Points for checked', 1, 1, 4);
122 $obj->addAnswer('Points for checked', 1, 1, 5);
123 $this->assertEquals(6, $obj->getMaximumPoints());
124 } */
125}
Class assBaseTestCase.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
test_getAdditionalTableName_shouldReturnAdditionalTableName()
Class for multiple choice tests.
setGlobalVariable(string $name, mixed $value)