19 declare(strict_types=1);
29 protected function setUp(): void
38 $this->assertInstanceOf(ilTestEvaluationUserData::class, $this->testObj);
51 "questionsWorkedThrough",
63 $this->assertEquals($expected, $this->testObj->__sleep());
68 $expected = [1, 0, 20, 120, 12];
70 $this->testObj->setPassScoring($expected);
71 $this->assertEquals($expected, $this->testObj->getPassScoring());
76 $this->testObj->setPassed(
true);
77 $this->assertTrue($this->testObj->getPassed());
79 $this->testObj->setPassed(
false);
80 $this->assertFalse($this->testObj->getPassed());
85 $this->testObj->setName(
"testName");
86 $this->assertEquals(
"testName", $this->testObj->getName());
91 $this->testObj->setLogin(
"testLogin");
92 $this->assertEquals(
"testLogin", $this->testObj->getLogin());
97 $this->testObj->setSubmitted(
true);
98 $this->assertTrue($this->testObj->isSubmitted());
100 $this->testObj->setSubmitted(
false);
101 $this->assertFalse($this->testObj->isSubmitted());
106 $this->testObj->setReached(220.55);
107 $this->assertEquals(220.55, $this->testObj->reached);
113 $testEvaluationPassData->setReachedPoints(20);
115 $this->testObj->passes = [
116 $testEvaluationPassData
119 $this->assertEquals(20, $this->testObj->getReached());
125 $testEvaluationPassData->setMaxPoints(20);
127 $this->testObj->passes = [
128 $testEvaluationPassData
131 $this->assertEquals(20, $this->testObj->getMaxpoints());
136 $this->testObj->setMaxpoints(220.55);
137 $this->assertEquals(220.55, $this->testObj->maxpoints);
143 $testEvaluationPassData->setReachedPoints(15);
144 $testEvaluationPassData->setMaxPoints(20);
146 $this->testObj->passes = [
147 $testEvaluationPassData
150 $this->assertEquals(75, $this->testObj->getReachedPointsInPercent());
155 $this->testObj->setMark(
"testMark");
156 $this->assertEquals(
"testMark", $this->testObj->getMark());
161 $this->testObj->setECTSMark(
"testECTSMark");
162 $this->assertEquals(
"testECTSMark", $this->testObj->getECTSMark());
168 $testEvaluationPassData->setReachedPoints(15);
169 $testEvaluationPassData->setMaxPoints(20);
170 $testEvaluationPassData->setNrOfAnsweredQuestions(5);
172 $this->testObj->passes = [
173 $testEvaluationPassData
176 $this->assertEquals(5, $this->testObj->getQuestionsWorkedThrough());
181 $this->testObj->setQuestionsWorkedThrough(215);
182 $this->assertEquals(215, $this->testObj->questionsWorkedThrough);
188 $testEvaluationPassData->setQuestionCount(5);
190 $this->testObj->passes = [
191 $testEvaluationPassData
194 $this->assertEquals(5, $this->testObj->getNumberOfQuestions());
199 $this->testObj->setNumberOfQuestions(215);
200 $this->assertEquals(215, $this->testObj->numberOfQuestions);
206 $testEvaluationPassData->setQuestionCount(5);
207 $testEvaluationPassData->setNrOfAnsweredQuestions(3);
209 $this->testObj->passes = [
210 $testEvaluationPassData
213 $this->assertEquals(60, $this->testObj->getQuestionsWorkedThroughInPercent());
219 $data1->setWorkingTime(5);
222 $data2->setWorkingTime(7);
224 $this->testObj->passes = [
229 $this->assertEquals(12, $this->testObj->getTimeOfWork());
234 $this->testObj->setTimeOfWork(215);
235 $this->assertEquals(215, $this->testObj->timeOfWork);
240 $this->testObj->setFirstVisit(
"2125");
242 $this->assertEquals(
"2125", $this->testObj->getFirstVisit());
247 $this->testObj->setLastVisit(
"2125");
249 $this->assertEquals(
"2125", $this->testObj->getLastVisit());
255 $data1->setWorkingTime(5);
258 $data2->setWorkingTime(7);
260 $this->testObj->passes = [
265 $this->assertEquals([$data1, $data2], $this->testObj->getPasses());
270 $this->assertEquals(0, $this->testObj->getPassCount());
276 $this->assertEquals(2, $this->testObj->getPassCount());
281 $this->assertEquals(0, $this->testObj->getPassCount());
284 $this->testObj->addPass(3, $data);
288 $this->assertEquals($data, $this->testObj->getPass(3));
293 $this->assertEquals(0, $this->testObj->getPassCount());
299 $this->assertEquals(2, $this->testObj->getPassCount());
304 $this->testObj->addQuestionTitle(0,
"testString");
305 $this->testObj->addQuestionTitle(1,
"testString2");
307 $this->assertEquals(
"testString", $this->testObj->getQuestionTitles()[0]);
312 $this->assertNull($this->testObj->getQuestions());
321 $this->testObj->addQuestion(20, 22, 15, null, 0);
323 $this->assertEquals([$expected], $this->testObj->getQuestions());
335 $this->testObj->addQuestion(20, 22, 15, null, 0);
337 $this->assertEquals($expected, $this->testObj->getQuestion(0));
343 $pass->setQuestionCount(5);
344 $this->testObj->addPass(0, $pass);
346 $this->assertEquals(5, $this->testObj->getQuestionCount());
355 $pass->setReachedPoints($input);
356 $this->testObj->addPass(0, $pass);
358 $this->assertEquals($expected, $this->testObj->getReachedPoints());
364 "float X.0" => [25.0, 25.0],
365 "float X.Y" => [25.3, 25.3],
373 $this->testObj->addPass(0, $pass);
375 $this->assertEquals(0.0, $this->testObj->getReachedPoints());
381 $pass->setMaxPoints(25);
382 $this->testObj->addPass(0, $pass);
384 $this->assertEquals(25, $this->testObj->getAvailablePoints());
390 $pass->setReachedPoints(25);
391 $pass->setMaxPoints(50);
392 $this->testObj->addPass(0, $pass);
394 $this->assertEquals(0.5, $this->testObj->getReachedPointsInPercentForPass(0));
399 $this->testObj->setUserID(120);
400 $this->assertEquals(120, $this->testObj->getUserID());
405 $this->testObj->setMarkOfficial(
"test");
406 $this->assertEquals(
"test", $this->testObj->getMarkOfficial());
testGetQuestionsWorkedThrough()
ilTestEvaluationUserData $testObj
Class ilTestEvaluationUserDataTest.
testGetQuestionsWorkedThroughInPercent()
testGetReachedPointsInPercent()
reachedPointsDataProvider()
testSetNumberOfQuestions()
testReachedPoints($input, float $expected)
reachedPointsDataProvider
testSetQuestionsWorkedThrough()
testGetReachedPointsInPercentForPass()
testGetNumberOfQuestions()
test_instantiateObject_shouldReturnInstance()
testGetUninitializedReachedPoints()