From 22f2f418101322ec63485f9060660b68b22a8afa Mon Sep 17 00:00:00 2001 From: tjhunt Date: Tue, 25 Jul 2006 07:08:21 +0000 Subject: [PATCH] Start of unit tests for numerical question type. --- .../numerical/simpletest/testquestiontype.php | 82 +++++++++++++++++++ question/type/shortanswer/questiontype.php | 1 + 2 files changed, 83 insertions(+) create mode 100644 question/type/numerical/simpletest/testquestiontype.php diff --git a/question/type/numerical/simpletest/testquestiontype.php b/question/type/numerical/simpletest/testquestiontype.php new file mode 100644 index 0000000000..824ae5f9b9 --- /dev/null +++ b/question/type/numerical/simpletest/testquestiontype.php @@ -0,0 +1,82 @@ +libdir . '/simpletestlib.php'); +require_once($CFG->dirroot . '/question/type/numerical/questiontype.php'); + +class question_numerical_qtype_test extends UnitTestCase { + var $qtype; + + function setUp() { + $this->qtype = new question_numerical_qtype(); + } + + function tearDown() { + $this->qtype = null; + } + + function test_name() { + $this->assertEqual($this->qtype->name(), 'numerical'); + } + +// function test_get_question_options() { +// } +// +// function test_get_numerical_units() { +// } +// +// function test_get_default_numerical_unit() { +// } +// +// function test_save_question_options() { +// } +// +// function test_save_numerical_units() { +// } +// +// function test_delete_question() { +// } +// +// function test_compare_responses() { +// } +// +// function test_test_response() { +// } +// +// function test_check_response(){ +// } +// +// function test_grade_responses() { +// } +// +// function test_get_correct_responses() { +// } +// +// function test_get_all_responses() { +// } + + function test_get_tolerance_interval() { + } + + function test_apply_unit() { + } + +// function test_backup() { +// } +// +// function test_restore() { +// } +} + +?> diff --git a/question/type/shortanswer/questiontype.php b/question/type/shortanswer/questiontype.php index 703b7b1113..92f810492e 100644 --- a/question/type/shortanswer/questiontype.php +++ b/question/type/shortanswer/questiontype.php @@ -10,6 +10,7 @@ /// This class contains some special features in order to make the /// question type embeddable within a multianswer (cloze) question /// +require_once("$CFG->dirroot/question/type/questiontype.php"); class question_shortanswer_qtype extends default_questiontype { -- 2.39.5