MDL-20636 Fix @package names in question/behaviour, question/engine and question top level.

This commit is contained in:
Tim Hunt
2011-02-22 20:50:18 +00:00
parent d3603157bf
commit 017bc1d9f3
60 changed files with 600 additions and 449 deletions
+12 -4
View File
@@ -15,16 +15,24 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Renderer for outputting parts of a question belonging to the legacy
* adaptive behaviour.
*
* @package qbehaviour
* @subpackage adaptive
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Renderer for outputting parts of a question belonging to the legacy
* adaptive behaviour.
*
* @package qbehaviour_adaptive
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_adaptive_renderer extends qbehaviour_renderer {
protected function get_graded_step(question_attempt $qa) {
foreach ($qa->get_reverse_step_iterator() as $step) {
@@ -20,15 +20,23 @@
* This file contains tests that walks a question through the adaptive
* behaviour.
*
* @package qbehaviour_adaptive
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage adaptive
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
/**
* Unit tests for the adaptive behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_adaptive_walkthrough_test extends qbehaviour_walkthrough_test_base {
public function test_adaptive_multichoice() {
@@ -15,15 +15,16 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Question behaviour for the old adaptive mode, with no penalties.
*
* @package qbehaviour_adaptivenopenalty
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage adaptivenopenalty
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../adaptive/behaviour.php');
/**
@@ -31,8 +32,8 @@ require_once(dirname(__FILE__) . '/../adaptive/behaviour.php');
*
* This is the old version of interactive mode, without penalties.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_adaptivenopenalty extends qbehaviour_adaptive {
const IS_ARCHETYPAL = true;
@@ -15,18 +15,27 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Renderer for outputting parts of a question belonging to the legacy
* adaptive (no penalties) behaviour.
*
* @package qbehaviour
* @subpackage adaptivenopenalty
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../adaptive/renderer.php');
/**
* Renderer for outputting parts of a question belonging to the legacy
* adaptive (no penalties) behaviour.
*
* @package qbehaviour_adaptivenopenalty
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../adaptive/renderer.php');
class qbehaviour_adaptivenopenalty_renderer extends qbehaviour_adaptive_renderer {
protected function penalty_info($qa, $mark) {
return '';
@@ -15,20 +15,27 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests that walks a question through the adaptive (no penalties)k
* behaviour.
*
* @package qbehaviour_adaptivenopenalty
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage adaptivenopenalty
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
/**
* Unit tests for the adaptive (no penalties) behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_adaptivenopenalty_walkthrough_test extends qbehaviour_walkthrough_test_base {
public function test_multichoice() {
+5 -6
View File
@@ -15,14 +15,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the quetsion behaviour base class
*
* @package moodlecore
* @package moodlecore
* @subpackage questionbehaviours
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -35,8 +34,8 @@
* In turn, the behaviour will delegate certain processing to the
* relevant {@link question_definition}.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class question_behaviour {
/**
+7 -6
View File
@@ -15,20 +15,21 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Question behaviour that is like the deferred feedback model, but with
* certainly based marking. That is, in addition to the other controls, there are
* where the student can indicate how certain they are that their answer is right.
*
* @package qbehaviour_deferredcbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage deferredcbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../deferredfeedback/behaviour.php');
/**
* Question behaviour for deferred feedback with certainty based marking.
*
@@ -37,8 +38,8 @@ require_once(dirname(__FILE__) . '/../deferredfeedback/behaviour.php');
* when the whole attempt is finished, their answer is graded. Their degree
* of certainty affects their score.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_deferredcbm extends qbehaviour_deferredfeedback {
const IS_ARCHETYPAL = true;
+13 -6
View File
@@ -15,17 +15,24 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Renderer for outputting parts of a question belonging to the deferred
* feedback behaviour.
* Defines the renderer for the deferred feedback with certainty based marking
* behaviour.
*
* @package qbehaviour_deferredcbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage deferredcbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Renderer for outputting parts of a question belonging to the deferred
* feedback with certainty based marking behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_deferredcbm_renderer extends qbehaviour_renderer {
protected function certainly_choices($controlname, $selected, $readonly) {
$attributes = array(
@@ -15,20 +15,27 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests that walks a question through the deferred feedback
* behaviour.
* with certainty base marking behaviour.
*
* @package qbehaviour_deferredcbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage deferredcbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
/**
* Unit tests for the deferred feedback with certainty base marking behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_deferredcbm_walkthrough_test extends qbehaviour_walkthrough_test_base {
public function test_deferred_cbm_truefalse_high_certainty() {
@@ -20,9 +20,10 @@
* Question behaviour for the case when the student's answer is just
* saved until they submit the whole attempt, and then it is graded.
*
* @package qbehaviour_deferredfeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage deferredfeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -32,8 +33,8 @@
* The student enters their response during the attempt, and it is saved. Later,
* when the whole attempt is finished, their answer is graded.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_deferredfeedback extends question_behaviour_with_save {
const IS_ARCHETYPAL = true;
@@ -15,16 +15,22 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the renderer for the deferred feedback behaviour.
*
* @package qbehaviour
* @subpackage deferredfeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Renderer for outputting parts of a question belonging to the deferred
* feedback behaviour.
*
* @package qbehaviour_deferredfeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_deferredfeedback_renderer extends qbehaviour_renderer {
}
@@ -15,20 +15,27 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests that walks a question through the deferred feedback
* behaviour.
*
* @package qbehaviour_deferredfeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage deferredfeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
/**
* Unit tests for the deferred feedback behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_deferredfeedback_walkthrough_test extends qbehaviour_walkthrough_test_base {
public function test_deferredfeedback_feedback_truefalse() {
@@ -20,9 +20,10 @@
* Question behaviour where the student can submit questions one at a
* time for immediate feedback, with certainty based marking.
*
* @package qbehaviour_immediatecbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage immediatecbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -37,8 +38,8 @@ require_once(dirname(__FILE__) . '/../immediatefeedback/behaviour.php');
* Once the qustion is submitted, it is not possible for the student to change
* their answer any more. The student's degree of certainly affects their score.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_immediatecbm extends qbehaviour_immediatefeedback {
const IS_ARCHETYPAL = true;
+12 -6
View File
@@ -15,20 +15,26 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Renderer for outputting parts of a question belonging to the immediate
* feedback with CBM behaviour.
* Defines the renderer for the immediate feedback with CBM behaviour.
*
* @package qbehaviour_immediatecbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage immediatecbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../deferredcbm/renderer.php');
/**
* Renderer for outputting parts of a question belonging to the immediate
* feedback with CBM behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_immediatecbm_renderer extends qbehaviour_deferredcbm_renderer {
public function controls(question_attempt $qa, question_display_options $options) {
$output = parent::controls($qa, $options);
@@ -15,20 +15,27 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests that walks a question through the immediate cbm
* behaviour.
*
* @package qbehaviour_immediatecbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage immediatecbm
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
/**
* Unit tests for the immediate cbm behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_immediatecbm_walkthrough_test extends qbehaviour_walkthrough_test_base {
public function test_immediatecbm_feedback_multichoice_right() {
@@ -15,14 +15,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Question behaviour where the student can submit questions one at a
* time for immediate feedback.
*
* @package qbehaviour_immediatefeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage immediatefeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -34,8 +34,8 @@
* student to change their answer any more, but the student gets full feedback
* straight away.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_immediatefeedback extends question_behaviour_with_save {
const IS_ARCHETYPAL = true;
@@ -15,17 +15,23 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the renderer for the immediate feedback behaviour.
*
* @package qbehaviour
* @subpackage immediatefeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Renderer for outputting parts of a question belonging to the immediate
* feedback behaviour.
*
* @package qbehaviour_immediatefeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_immediatefeedback_renderer extends qbehaviour_renderer {
public function controls(question_attempt $qa, question_display_options $options) {
return $this->submit_button($qa, $options);
@@ -20,15 +20,23 @@
* This file contains tests that walks a question through the immediate feedback
* behaviour.
*
* @package qbehaviour_immediatefeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage immediatefeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
/**
* Unit tests for the immediate feedback behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_immediatefeedback_walkthrough_test extends qbehaviour_walkthrough_test_base {
public function test_immediatefeedback_feedback_multichoice_right() {
@@ -15,13 +15,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This behaviour is for informaiton items.
*
* @package qbehaviour_informationitem
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage informationitem
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -32,8 +32,8 @@
* and the question type is marked complete the first time the user navigates
* away from a page that contains that question.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_informationitem extends question_behaviour {
@@ -15,17 +15,23 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the renderer the information item behaviour.
*
* @package qbehaviour
* @subpackage informationitem
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Renderer for outputting parts of a question belonging to the information
* item behaviour.
*
* @package qbehaviour_deferredfeedback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_informationitem_renderer extends qbehaviour_renderer {
public function controls(question_attempt $qa, question_display_options $options) {
if ($qa->get_state() != question_state::$todo) {
@@ -15,20 +15,27 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests that walks a question through the information item
* behaviour.
*
* @package qbehaviour_informationitem
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage informationitem
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
/**
* Unit tests for the information item behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_informationitem_walkthrough_test extends qbehaviour_walkthrough_test_base {
public function test_informationitem_feedback_description() {
+6 -6
View File
@@ -15,14 +15,14 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Question behaviour where the student can submit questions one at a
* time for immediate feedback.
*
* @package qbehaviour_interactive
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage interactive
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -34,8 +34,8 @@
* student to change their answer any more, but the student gets full feedback
* straight away.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_interactive extends question_behaviour_with_save {
const IS_ARCHETYPAL = true;
+6 -5
View File
@@ -20,17 +20,18 @@
* Renderer for outputting parts of a question belonging to the interactive
* behaviour.
*
* @package qbehaviour_interactive
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage interactive
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Interactive behaviour renderer.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_interactive_renderer extends qbehaviour_renderer {
public function controls(question_attempt $qa, question_display_options $options) {
@@ -15,20 +15,27 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests that walks a question through the interactive
* behaviour.
*
* @package qbehaviour_interactive
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage interactive
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
/**
* Unit tests for the interactive behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_interactive_walkthrough_test extends qbehaviour_walkthrough_test_base {
public function test_interactive_feedback_multichoice_right() {
@@ -15,19 +15,20 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Question behaviour that is like the interactive behaviour, but where the
* student is credited for parts of the question they got right on earlier tries.
*
* @package qbehaviour_interactivecountback
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage interactivecountback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../interactive/behaviour.php');
/**
* Question behaviour for interactive mode with count-back scoring.
*
@@ -56,8 +57,8 @@ require_once(dirname(__FILE__) . '/../interactive/behaviour.php');
* question type. The point is that the final grade can take into account all
* of the tries the student made.
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_interactivecountback extends qbehaviour_interactive {
const IS_ARCHETYPAL = false;
@@ -15,6 +15,15 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the renderer for the interactive with countback behaviour.
*
* @package qbehaviour
* @subpackage interactivecountback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../interactive/renderer.php');
@@ -26,11 +35,8 @@ require_once(dirname(__FILE__) . '/../interactive/renderer.php');
* There are not differences from the interactive output. We just need a class
* definition.
*
* @package qbehaviour_interactivecountback
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_interactivecountback_renderer extends qbehaviour_interactive_renderer {
}
@@ -15,20 +15,27 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests that walks a question through the interactive with
* countback behaviour.
*
* @package qbehaviour_interactivecountback
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage interactivecountback
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
/**
* Unit tests for the interactive with countback behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_interactivecountback_walkthrough_test extends qbehaviour_walkthrough_test_base {
public function test_interactive_feedback_match_reset() {
@@ -15,13 +15,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Question behaviour for questions that can only be graded manually.
*
* @package qbehaviour_manualgraded
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage manualgraded
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -32,8 +32,8 @@
* when the whole attempt is finished, the attempt goes into the NEEDS_GRADING
* state, and the teacher must grade it manually.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_manualgraded extends question_behaviour_with_save {
const IS_ARCHETYPAL = true;
+12 -7
View File
@@ -15,17 +15,22 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the renderer for the manual graded behaviour.
*
* @package qbehaviour
* @subpackage manualgraded
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Renderer for outputting parts of a question belonging to the manual
* graded behaviour.
*
* @package qbehaviour_manualgraded
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_manualgraded_renderer extends qbehaviour_renderer {
}
}
@@ -15,20 +15,27 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests that walks a question through the manual graded
* behaviour.
*
* @package qbehaviour_manualgraded
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage manualgraded
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
/**
* Unit tests for the manual graded behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_manualgraded_walkthrough_test extends qbehaviour_walkthrough_test_base {
public function test_manual_graded_essay() {
+6 -5
View File
@@ -20,9 +20,10 @@
* Fake question behaviour that is used when the actual qim was not
* available.
*
* @package qbehaviour_missing
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage missing
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -39,8 +40,8 @@
* possible. A warning is shown that behaviour specific bits may be missing.
* Any attempt to process anything causes an exception to be thrown.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_missing extends question_behaviour {
public function required_question_definition_type() {
+11 -5
View File
@@ -15,17 +15,23 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the renderer for when the actual behaviour used is not available.
*
* @package qbehaviour
* @subpackage missing
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Renderer for outputting parts of a question when the actual behaviour
* used is not available.
*
* @package qbehaviour_missing
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_missing_renderer extends qbehaviour_renderer {
public function controls(question_attempt $qa, question_display_options $options) {
return html_writer::tag('div',
@@ -15,13 +15,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the 'missing' behaviour.
*
* @package qbehaviour_missing
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage missing
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -29,6 +29,13 @@ require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
require_once(dirname(__FILE__) . '/../behaviour.php');
/**
* Unit tests for the 'missing' behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_missing_test extends UnitTestCase {
public function test_missing_cannot_start() {
$qa = new question_attempt(test_question_maker::make_a_truefalse_question(), 0, 0);
+6 -6
View File
@@ -20,18 +20,18 @@
* This behaviour that is used when the actual qim was not
* available.
*
* @package qbehaviour_opaque
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage opaque
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* This behaviour is specifically for use with the Opaque question type.
*
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_opaque extends question_behaviour {
/** @var string */
+11 -5
View File
@@ -15,17 +15,23 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the renderer for the Opaque behaviour.
*
* @package qbehaviour
* @subpackage opaque
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Renderer for outputting parts of a question when the actual behaviour
* used is not available.
*
* @package qbehaviour_opaque
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_opaque_renderer extends qbehaviour_renderer {
public function controls(question_attempt $qa, question_display_options $options) {
if ($qa->get_state()->is_gave_up()) {
@@ -15,13 +15,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the Opaque behaviour.
*
* @package qbehaviour_opaque
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @package qbehaviour
* @subpackage opaque
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -29,6 +29,13 @@ require_once(dirname(__FILE__) . '/../../../engine/lib.php');
require_once(dirname(__FILE__) . '/../../../engine/simpletest/helpers.php');
require_once(dirname(__FILE__) . '/../behaviour.php');
/**
* Unit tests for the Opaque behaviour.
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_opaque_test extends qbehaviour_walkthrough_test_base {
/**
* Makes an Opaque question that refers to one of the sample questions
+5 -6
View File
@@ -15,14 +15,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Defines the renderer base class for question behaviours.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionbehaviours
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -32,8 +31,8 @@
* The methods in this class are mostly called from {@link core_question_renderer}
* which coordinates the overall output of questions.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class qbehaviour_renderer extends plugin_renderer_base {
/**
+20 -18
View File
@@ -24,20 +24,21 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
/**
* Class representing question categories
*
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// number of categories to display on page
define('QUESTION_PAGE_LENGTH', 25);
require_once($CFG->libdir . '/listlib.php');
require_once($CFG->dirroot . '/question/category_form.php');
require_once('move_form.php');
require_once($CFG->dirroot . '/question/move_form.php');
/**
* Class representing a list of question categories
*
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_category_list extends moodle_list {
public $table = "question_categories";
public $listitemclassname = 'question_category_list_item';
@@ -63,6 +64,13 @@ class question_category_list extends moodle_list {
}
}
/**
* An item in a list of question categories.
*
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_category_list_item extends list_item {
public function set_icon_html($first, $last, &$lastitem){
global $CFG;
@@ -109,9 +117,10 @@ class question_category_list_item extends list_item {
/**
* Class representing question categories
* Class representing q question category
*
* @package questionbank
* @copyright 1999 onwards Martin Dougiamas {@link http://moodle.com}
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_category_object {
@@ -125,7 +134,7 @@ class question_category_object {
var $newtable;
var $tab;
var $tabsize = 3;
//------------------------------------------------------
/**
* @var moodle_url Object representing url for this page
*/
@@ -170,11 +179,8 @@ class question_category_object {
$this->pageurl = $pageurl;
$this->initialize($page, $contexts, $currentcat, $defaultcategory, $todelete, $addcontexts);
}
/**
* Initializes this classes general category-related variables
*/
@@ -199,6 +205,7 @@ class question_category_object {
$this->catform->set_data(array('parent'=>$defaultcategory));
}
}
/**
* Displays the user interface
*
@@ -246,8 +253,6 @@ class question_category_object {
echo $list->display_page_numbers();
}
/**
* gets all the courseids for the given categories
*
@@ -265,8 +270,6 @@ class question_category_object {
return $courseids;
}
public function edit_single_category($categoryid) {
/// Interface for adding a new category
global $COURSE, $DB;
@@ -283,7 +286,6 @@ class question_category_object {
}
}
/**
* Sets the viable parents
*
+5 -5
View File
@@ -23,10 +23,10 @@
* fully object oriented structure, at which point this file can be a
* starting point.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionbank
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -35,8 +35,8 @@
*
* It provides functions for managing question types and question definitions.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class question_bank {
/** @var array question type name => question_type subclass. */
+10 -10
View File
@@ -19,10 +19,10 @@
/**
* Code for loading and saving quiz attempts to and from the database.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -30,8 +30,8 @@
* This class controls the loading and saving of question engine data to and from
* the database.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_engine_data_mapper {
/**
@@ -822,8 +822,8 @@ ORDER BY
* changes to a {@link question_usage_by_activity}, and its constituent parts,
* so that the changes can be saved to the database when {@link save()} is called.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_engine_unit_of_work implements question_usage_observer {
/** @var question_usage_by_activity the usage being tracked. */
@@ -937,7 +937,7 @@ class question_engine_unit_of_work implements question_usage_observer {
* WHERE $qubaids->where() AND qa.slot = 1
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class qubaid_condition {
@@ -975,7 +975,7 @@ abstract class qubaid_condition {
* in a larger database query based on an explicit list of ids.
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qubaid_list extends qubaid_condition {
/** @var array of ids. */
@@ -1045,7 +1045,7 @@ class qubaid_list extends qubaid_condition {
* where $from, $usageidcolumn and $where are the arguments to the constructor.
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qubaid_join extends qubaid_condition {
public $from;
+31 -31
View File
@@ -18,10 +18,10 @@
/**
* This defines the core classes of the Moodle question engine.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -44,8 +44,8 @@ require_once($CFG->libdir . '/questionlib.php');
* creating, loading, saving and deleting {@link question_usage_by_activity}s,
* which is the main class that is used by other code that wants to use questions.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class question_engine {
/** @var array behaviour name => 1. Records which behaviours have been loaded. */
@@ -333,8 +333,8 @@ abstract class question_engine {
* be shown read-only, and a question that has not been submitted will not have
* any sort of feedback displayed.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_display_options {
/**#@+ @var integer named constants for the values that most of the options take. */
@@ -493,7 +493,7 @@ class question_display_options {
* Contains the logic for handling question flags.
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class question_flags {
/**
@@ -611,8 +611,8 @@ class question_out_of_sequence_exception extends moodle_exception {
*
* Instances of this class correspond to rows in the question_usages table.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_usage_by_activity {
/**
@@ -1223,8 +1223,8 @@ class question_usage_by_activity {
* To create an instance of this class, use
* {@link question_usage_by_activity::get_attempt_iterator()}
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_iterator implements Iterator, ArrayAccess {
/** @var question_usage_by_activity that we are iterating over. */
@@ -1289,8 +1289,8 @@ class question_attempt_iterator implements Iterator, ArrayAccess {
* a collection of {@link question_attempt_steps}. Question inteaction models and
* question types do work with question_attempt objects.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt {
/**
@@ -2248,7 +2248,7 @@ class question_attempt {
* All methods that try to modify the question_attempt throw exceptions.
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_with_restricted_history extends question_attempt {
/**
@@ -2327,8 +2327,8 @@ class question_attempt_with_restricted_history extends question_attempt {
* This is actively linked to question_attempt. If you add an new step
* mid-iteration, then it will be included.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_step_iterator implements Iterator, ArrayAccess {
/** @var question_attempt the question_attempt being iterated over. */
@@ -2386,8 +2386,8 @@ class question_attempt_step_iterator implements Iterator, ArrayAccess {
* A variant of {@link question_attempt_step_iterator} that iterates through the
* steps in reverse order.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_reverse_step_iterator extends question_attempt_step_iterator {
public function next() {
@@ -2433,8 +2433,8 @@ class question_attempt_reverse_step_iterator extends question_attempt_step_itera
* to check wether a varaible with a particular name is set, and {@link get_behaviour_data()}
* to get all the behaviour data as an associative array.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_step {
/** @var integer if this attempts is stored in the question_attempts table, the id of that row. */
@@ -2676,7 +2676,7 @@ class question_attempt_step {
* A subclass with a bit of additional funcitonality, for pending steps.
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_pending_step extends question_attempt_step {
/** @var string . */
@@ -2707,8 +2707,8 @@ class question_attempt_pending_step extends question_attempt_step {
/**
* A subclass of {@link question_attempt_step} that cannot be modified.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_step_read_only extends question_attempt_step {
public function set_state($state) {
@@ -2731,8 +2731,8 @@ class question_attempt_step_read_only extends question_attempt_step {
* {@link question_attempt::get_last_step()} etc. when a an attempt has just been
* created and there is no acutal step.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_null_step {
public function get_state() {
@@ -2756,8 +2756,8 @@ class question_null_step {
* A question behaviour controls the flow of actions a student can
* take as they work through a question, and later, as a teacher manually grades it.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
interface question_usage_observer {
/** Called when a field of the question_usage_by_activity is changed. */
@@ -2796,8 +2796,8 @@ interface question_usage_observer {
* Null implmentation of the {@link question_usage_watcher} interface.
* Does nothing.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_usage_null_observer implements question_usage_observer {
public function notify_modified() {
@@ -2817,7 +2817,7 @@ class question_usage_null_observer implements question_usage_observer {
* Useful functions for writing question types and behaviours.
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class question_utils {
/**
+5 -5
View File
@@ -19,10 +19,10 @@
/**
* Renderers for outputting parts of the question engine.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -31,8 +31,8 @@
* {@link qbehaviour_renderer} and a {@link qtype_renderer} to output the
* type-specific bits. The main entry point is the {@link question()} method.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class core_question_renderer extends plugin_renderer_base {
+27 -7
View File
@@ -19,10 +19,10 @@
/**
* This file contains helper classes for testing the question engine.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -32,8 +32,8 @@ require_once(dirname(__FILE__) . '/../lib.php');
/**
* Makes some protected methods of question_attempt public to facilitate testing.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class testable_question_attempt extends question_attempt {
public function add_step($step) {#
@@ -52,8 +52,8 @@ class testable_question_attempt extends question_attempt {
* This class creates questions of various types, which can then be used when
* testing.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class test_question_maker {
const STANDARD_OVERALL_CORRECT_FEEDBACK = 'Well done!';
@@ -301,6 +301,12 @@ class test_question_maker {
}
/**
* Helper for tests that need to simulate records loaded from the database.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class testing_db_record_builder {
public static function build_db_records(array $table) {
$columns = array_shift($table);
@@ -320,6 +326,13 @@ abstract class testing_db_record_builder {
}
/**
* Helper base class for tests that need to simulate records loaded from the
* database.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class data_loading_method_test_base extends UnitTestCase {
public function build_db_records(array $table) {
return testing_db_record_builder::build_db_records($table);
@@ -327,6 +340,13 @@ class data_loading_method_test_base extends UnitTestCase {
}
/**
* Helper base class for tests that walk a question through a sequents of
* interactions under the control of a particular behaviour.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qbehaviour_walkthrough_test_base extends UnitTestCase {
/** @var question_display_options */
protected $displayoptions;
+11 -5
View File
@@ -15,19 +15,25 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the question_state class.
* This file contains tests for some of the code in ../datalib.php.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../lib.php');
/**
* Unit tests for some of the code in ../datalib.php.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qubaid_condition_test extends UnitTestCase {
protected function check_typical_question_attempts_query(
@@ -20,18 +20,27 @@
* This file contains tests for the question_attempt class.
*
* Action methods like start, process_action and finish are assumed to be
* tested by testintegration.php.
* tested by walkthrough tests in the various behaviours.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../lib.php');
require_once(dirname(__FILE__) . '/helpers.php');
/**
* Unit tests for the {@link question_attempt} class.
*
* These are the tests that don't require any steps.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_test extends UnitTestCase {
private $question;
private $usageid;
@@ -122,10 +131,10 @@ class question_attempt_test extends UnitTestCase {
/**
* These tests use a standard fixture of a question_attempt with three steps.
* These tests use a standard fixture of a {@link question_attempt} with three steps.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_with_steps_test extends UnitTestCase {
private $question;
@@ -244,6 +253,12 @@ class question_attempt_with_steps_test extends UnitTestCase {
}
/**
* Unit tests for loading data into the {@link question_attempt} class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_db_test extends data_loading_method_test_base {
public function test_load() {
$records = testing_db_record_builder::build_db_records(array(
@@ -15,14 +15,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the question_attempt_iterator class.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -30,6 +29,12 @@ require_once(dirname(__FILE__) . '/../lib.php');
require_once(dirname(__FILE__) . '/helpers.php');
/**
* This file contains tests for the {@link question_attempt_iterator} class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_iterator_test extends UnitTestCase {
private $quba;
private $qas = array();
@@ -15,20 +15,26 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the question_attempt_step class.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../lib.php');
require_once(dirname(__FILE__) . '/helpers.php');
/**
* Unit tests for the {@link question_attempt_step} class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_step_test extends UnitTestCase {
public function test_initial_state_unprocessed() {
$step = new question_attempt_step();
@@ -123,6 +129,12 @@ class question_attempt_step_test extends UnitTestCase {
}
/**
* Unit tests for the loading data into the {@link question_attempt_step} class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_step_db_test extends data_loading_method_test_base {
public function test_load_with_data() {
$records = $this->build_db_records(array(
@@ -15,14 +15,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the question_attempt_step_iterator class.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -30,6 +29,12 @@ require_once(dirname(__FILE__) . '/../lib.php');
require_once(dirname(__FILE__) . '/helpers.php');
/**
* Unit tests for the {@link question_attempt_step_iterator} class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_attempt_step_iterator_test extends UnitTestCase {
private $qa;
private $iterator;
+10 -4
View File
@@ -15,19 +15,25 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the question_cbm class.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../lib.php');
/**
* Unit tests for the question_cbm class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_cbm_test extends UnitTestCase {
public function test_adjust_fraction() {
$this->assertWithinMargin(0, question_cbm::adjust_fraction(0, question_cbm::LOW), 0.0000001);
@@ -15,19 +15,25 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the question_engine class.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../lib.php');
/**
*Unit tests for the question_engine class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_engine_test extends UnitTestCase {
public function setUp() {
@@ -15,20 +15,26 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the question_state class.
* This file contains tests for the question_state class and subclasses.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../lib.php');
require_once($CFG->libdir . '/questionlib.php');
/**
* Unit tests for the {@link question_state} class and subclasses.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_state_test extends UnitTestCase {
public function test_is_active() {
$this->assertFalse(question_state::$notstarted->is_active());
@@ -15,14 +15,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the question_usage_by_activity class.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -30,6 +29,12 @@ require_once(dirname(__FILE__) . '/../lib.php');
require_once(dirname(__FILE__) . '/helpers.php');
/**
* Unit tests for the question_usage_by_activity class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_usage_by_activity_test extends UnitTestCase {
public function test_set_get_preferred_model() {
@@ -15,19 +15,25 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This file contains tests for the {@link question_utils} class.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../lib.php');
/**
* Unit tests for the {@link question_utils} class.
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_utils_test extends UnitTestCase {
public function test_arrays_have_same_keys_and_values() {
$this->assertTrue(question_utils::arrays_have_same_keys_and_values(
+7 -7
View File
@@ -19,10 +19,10 @@
/**
* This defines the states a question can be in.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -32,8 +32,8 @@
*
* There are also some useful methods for testing and manipulating states.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
abstract class question_state {
@@ -286,8 +286,8 @@ abstract class question_state {
/**#@+
* Specific question_state subclasses.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_state_notstarted extends question_state {
public function is_finished() {
+5 -5
View File
@@ -20,10 +20,10 @@
* This file contains the code required to upgrade all the attempt data from
* old versions of Moodle into the tables used by the new question engine.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
@@ -35,8 +35,8 @@ require_once($CFG->libdir . '/questionlib.php');
* This class serves to record all the assumptions that the code had to make
* during the question engine database database upgrade, to facilitate reviewing them.
*
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_engine_assumption_logger {
protected $handle;
-111
View File
@@ -1,111 +0,0 @@
<?php
// This file is part of Moodle - http://moodle.org/
//
// Moodle is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Moodle is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This script fetches files from the dataroot/questionattempt directory
* It is based on the top-level file.php
*
* On a module-by-module basis (currently only implemented for quiz), it checks
* whether the user has permission to view the file.
*
* Syntax: question/file.php/attemptid/questionid/filename.ext
* Workaround: question/file.php?file=/attemptid/questionid/filename.ext
*
* @package moodlecore
* @subpackage questionengine
* @copyright 2007 Adriane Boyd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
// disable moodle specific debug messages and any errors in output
define('NO_DEBUG_DISPLAY', true);
require_once('../config.php');
require_once('../lib/filelib.php');
$relativepath = get_file_argument();
// force download for any student-submitted files to prevent XSS attacks.
$forcedownload = 1;
// relative path must start with '/', because of backup/restore!!!
if (!$relativepath) {
print_error('invalidarguments');
} else if ($relativepath{0} != '/') {
print_error('pathdoesnotstartslash');
}
$pathname = $CFG->dataroot.'/questionattempt'.$relativepath;
// extract relative path components
$args = explode('/', trim($relativepath, '/'));
// check for the right number of directories in the path
if (count($args) != 3) {
print_error('invalidarguments');
}
// security: require login
require_login();
// security: do not return directory node!
if (is_dir($pathname)) {
question_attempt_not_found();
}
$lifetime = 0; // do not cache because students may reupload files
// security: check that the user has permission to access this file
$haspermission = false;
if ($attempt = $DB->get_record("question_attempts", array("id" => $args[0]))) {
$modfile = $CFG->dirroot .'/mod/'. $attempt->modulename .'/lib.php';
$modcheckfileaccess = $attempt->modulename .'_check_file_access';
if (file_exists($modfile)) {
@require_once($modfile);
if (function_exists($modcheckfileaccess)) {
$haspermission = $modcheckfileaccess($args[0], $args[1]);
}
}
} else if ($args[0][0] == 0) {
global $USER;
$list = explode('_', $args[0]);
if ($list[1] == $USER->id) {
$haspermission = true;
}
}
if ($haspermission) {
// check that file exists
if (!file_exists($pathname)) {
question_attempt_not_found();
}
// send the file
session_get_instance()->write_close(); // unlock session during fileserving
$filename = $args[count($args)-1];
send_file($pathname, $filename, $lifetime, $CFG->filteruploadedfiles, false, $forcedownload);
} else {
question_attempt_not_found();
}
function question_attempt_not_found() {
global $CFG;
header('HTTP/1.0 404 not found');
print_error('filenotfound', 'error', $CFG->wwwroot); //this is not displayed on IIS??
}
+12 -5
View File
@@ -15,22 +15,29 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Form for moving questions between categories.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionbank
* @copyright 2008 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2008 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
if (!defined('MOODLE_INTERNAL')) {
die('Direct access to this script is forbidden.'); /// It must be included from a Moodle page
}
require_once($CFG->libdir.'/formslib.php');
require_once($CFG->libdir . '/formslib.php');
/**
* Form for moving questions between categories.
*
* @copyright 2008 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_move_form extends moodleform {
function definition() {
$mform = $this->_form;
+3 -3
View File
@@ -15,7 +15,6 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* This page displays a preview of a question
*
@@ -24,13 +23,14 @@
* information is stored in the session as an array of subsequent states rather
* than in the database.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionbank
* @copyright Alex Smith {@link http://maths.york.ac.uk/serving_maths} and
* @copyright Alex Smith {@link http://maths.york.ac.uk/serving_maths} and
* numerous contributors.
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once(dirname(__FILE__) . '/../config.php');
require_once($CFG->libdir . '/questionlib.php');
require_once(dirname(__FILE__) . '/previewlib.php');
+7 -7
View File
@@ -19,10 +19,10 @@
/**
* Unit tests for the question import and export system.
*
* @package core
* @package moodlecore
* @subpackage questionbank
* @copyright 2010 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
require_once($CFG->libdir . '/questionlib.php');
@@ -32,8 +32,8 @@ require_once($CFG->dirroot . '/question/format.php');
/**
* Subclass to make it easier to test qformat_default.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class testable_qformat extends qformat_default {
public function assemble_category_path($names) {
@@ -49,8 +49,8 @@ class testable_qformat extends qformat_default {
/**
* Unit tests for the matching question definition class.
*
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class qformat_default_test extends UnitTestCase {
public function test_assemble_category_path() {
+3 -4
View File
@@ -15,14 +15,13 @@
// You should have received a copy of the GNU General Public License
// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
/**
* Used by ajax calls to toggle the flagged state of a question in an attempt.
*
* @package moodlecore
* @package moodlecore
* @subpackage questionengine
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
* @copyright 2009 The Open University
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/