15 require_once
'./Modules/TestQuestionPool/classes/class.assKprimChoice.php';
16 require_once
'./Modules/TestQuestionPool/classes/class.ilAssKprimChoiceAnswer.php';
17 if (
defined(
'ILIAS_PHPUNIT_CONTEXT')) {
18 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
19 ilUnitUtil::performInitialisation();
21 chdir(dirname(__FILE__));
24 require_once
'./Services/Utilities/classes/class.ilUtil.php';
30 $this->assertInstanceOf(
'assKprimChoice', $instance);
36 $this->assertEquals(
'assKprimChoice', $obj->getQuestionType());
42 $this->assertEquals(
'qpl_qst_kprim', $obj->getAdditionalTableName());
48 $this->assertEquals(
'qpl_a_kprim', $obj->getAnswerTableName());
54 $this->assertEquals(
false, $obj->isComplete());
55 $obj->setTitle(
'Tilte');
56 $obj->setAuthor(
'Me or another');
57 $obj->setQuestion(
'My great Question.');
58 $this->assertEquals(
false, $obj->isComplete());
60 $this->assertEquals(
true, $obj->isComplete());
66 $this->assertEquals(
false, $obj->isComplete());
67 $obj->setTitle(
'Tilte');
68 $obj->setAuthor(
'Me or another');
69 $obj->setQuestion(
'My great Question.');
72 $obj->addAnswer($ans);
73 $this->assertEquals(
false, $obj->isComplete());
74 $ans->setCorrectness(
true);
75 $obj->addAnswer($ans);
76 $this->assertEquals(
false, $obj->isComplete());
77 $ans->setAnswertext(
'Text');
78 $obj->addAnswer($ans);
79 $this->assertEquals(
true, $obj->isComplete());
85 $this->assertEquals(
false, $obj->isValidOptionLabel(
'not valid'));
86 $this->assertEquals(
true, $obj->isValidOptionLabel($obj::OPTION_LABEL_RIGHT_WRONG));
92 $this->assertEquals(
true, $obj->isObligationPossible(1));
99 $ans->setCorrectness(
true);
100 $ans->setAnswertext(
'Text');
101 $obj->addAnswer($ans);
102 $this->assertInstanceOf(
'ilAssKprimChoiceAnswer', $obj->getAnswer(0));
103 $this->assertEquals(null, $obj->getAnswer(1));
109 $this->assertEquals(
false, $obj->isValidAnswerType(
'not valid'));
110 $this->assertEquals(
true, $obj->isValidAnswerType($obj::ANSWER_TYPE_SINGLE_LINE));
test_getAnswer_shouldReturnAnswer()
test_getAnswerTableName_shouldReturnAnswerTableName()
test_isValidAnswerType_shouldReturnTrue()
test_getQuestionType_shouldReturnQuestionType()
test_instantiateObject_shouldReturnInstance()
test_isCompleteWithoutAnswer_shouldReturnTrue()
test_isObligationPossible_shouldReturnTrue()
defined( 'APPLICATION_ENV')||define( 'APPLICATION_ENV'
test_isValidOptionLabel_shouldReturnTrue()
test_isCompleteWithAnswer_shouldReturnTrue()
test_getAdditionalTableName_shouldReturnAdditionalTableName()