19 require_once
'./Modules/TestQuestionPool/classes/class.assSingleChoice.php';
20 if (defined(
'ILIAS_PHPUNIT_CONTEXT')) {
21 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
22 ilUnitUtil::performInitialisation();
24 chdir(dirname(__FILE__));
27 require_once
'./Services/Utilities/classes/class.ilUtil.php';
89 $this->assertEquals(
false, $obj->isComplete());
90 $obj->setTitle(
'Tilte');
91 $obj->setAuthor(
'Me or another');
92 $obj->setQuestion(
'My great Question.');
93 $obj->addAnswer(
'Super simple single Choice', 1);
95 $this->assertEquals(
true, $obj->isComplete());
101 $this->assertEquals(
'thumb.', $obj->getThumbPrefix());
107 $obj->setOutputType(0);
108 $this->assertEquals(0, $obj->getOutputType());
114 $this->assertEquals(0, $obj->getAnswerCount());
115 $obj->addAnswer(
'1', 1, 0);
116 $obj->addAnswer(
'1', 1, 1);
117 $this->assertEquals(2, $obj->getAnswerCount());
118 $obj->deleteAnswer(0);
119 $this->assertEquals(1, $obj->getAnswerCount());
125 $obj->addAnswer(
'1', 1, 0);
126 $obj->addAnswer(
'1', 1, 1);
127 $this->assertEquals(2, $obj->getAnswerCount());
128 $obj->flushAnswers();
129 $this->assertEquals(0, $obj->getAnswerCount());
135 $this->assertEquals(
'assSingleChoice', $obj->getQuestionType());
141 $this->assertEquals(
'qpl_qst_sc', $obj->getAdditionalTableName());
147 $this->assertEquals(
'qpl_a_sc', $obj->getAnswerTableName());
test_flushAnswers_shouldClearAnswers()
test_getThumbPrefix_shouldReturnString()
test_isComplete_shouldReturnTrue()
Create a sample question and save it to the database.
test_setOutputType_shouldReturngetOutputType()
Class for single choice questions.
test_getQuestionType_shouldReturnQuestionType()
test_getAdditionalTableName_shouldReturnAdditionalTableName()
Unit tests for single choice questions.
test_getAnswerTableName_shouldReturnAnswerTableName()
test_getAnswerCount_shouldReturnCount()