15 require_once
'./Modules/TestQuestionPool/classes/class.assKprimChoice.php';
16 require_once
'./Modules/TestQuestionPool/classes/class.ilAssKprimChoiceAnswer.php';
17 if (
defined(
'ILIAS_PHPUNIT_CONTEXT'))
19 include_once(
"./Services/PHPUnit/classes/class.ilUnitUtil.php");
20 ilUnitUtil::performInitialisation();
24 chdir( dirname( __FILE__ ) );
27 require_once
'./Services/Utilities/classes/class.ilUtil.php';
33 $this->assertInstanceOf(
'assKprimChoice', $instance);
39 $this->assertEquals(
'assKprimChoice', $obj->getQuestionType());
45 $this->assertEquals(
'qpl_qst_kprim', $obj->getAdditionalTableName());
51 $this->assertEquals(
'qpl_a_kprim', $obj->getAnswerTableName());
57 $this->assertEquals(
false, $obj->isComplete());
58 $obj->setTitle(
'Tilte');
59 $obj->setAuthor(
'Me or another');
60 $obj->setQuestion(
'My great Question.');
61 $this->assertEquals(
false, $obj->isComplete());
63 $this->assertEquals(
true, $obj->isComplete());
69 $this->assertEquals(
false, $obj->isComplete());
70 $obj->setTitle(
'Tilte');
71 $obj->setAuthor(
'Me or another');
72 $obj->setQuestion(
'My great Question.');
75 $obj->addAnswer($ans);
76 $this->assertEquals(
false, $obj->isComplete());
77 $ans->setCorrectness(
true);
78 $obj->addAnswer($ans);
79 $this->assertEquals(
false, $obj->isComplete());
80 $ans->setAnswertext(
'Text');
81 $obj->addAnswer($ans);
82 $this->assertEquals(
true, $obj->isComplete());
88 $this->assertEquals(
false, $obj->isValidOptionLabel(
'not valid'));
89 $this->assertEquals(
true, $obj->isValidOptionLabel($obj::OPTION_LABEL_RIGHT_WRONG));
95 $this->assertEquals(
true, $obj->isObligationPossible(1));
102 $ans->setCorrectness(
true);
103 $ans->setAnswertext(
'Text');
104 $obj->addAnswer($ans);
105 $this->assertInstanceOf(
'ilAssKprimChoiceAnswer', $obj->getAnswer(0));
106 $this->assertEquals(null, $obj->getAnswer(1));
112 $this->assertEquals(
false, $obj->isValidAnswerType(
'not valid'));
113 $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()