Skip to content
Snippets Groups Projects
Commit d8381bb0 authored by Chris Sangwin's avatar Chris Sangwin
Browse files

Question tests now import + bug fixes to question test editing to include courseid.

parent 65ceb0ed
Branches
No related tags found
No related merge requests found
......@@ -8,8 +8,6 @@ There have been a number of changes between STACK 2 and STACK 3. These are deta
Please note the following.
__Currently question tests do not import.__ Please hold off importing large quantities of questions until this is completed.
* If you have used an input type which has not yet been implemented in STACK 3 the the importer will throw an exception. E.g. Matrix input types are not yet available in STACK 3, and so questions containing these cannot be imported.
* The following question level options are now ignored by the importer
* Display (Reason: this should not be set at the question level anyay).
......@@ -18,3 +16,4 @@ __Currently question tests do not import.__ Please hold off importing large qua
* From the old MetaData only the `name` is preserved. All other MetaData is lost on import.
* STACK 2 exporter does not seem to export some of the interaction element options correctly, in particular the options which ask the student to verify and to show validation feedback.
* Questions with a single potential response tree import with the PRT feedback in the specific feedback slot, not in the question text. We envisage this will enable single part questions to respect a wider variety of Moodle question behaviours.
* When importing question tests, the new testing mechanism in STACK 3 enables the teacher to specifiy a score and penalty, not just an answernote. Since we have to set defaults on import, most question tests now fail and this information will need to be added by hand. A good opportunity to confirm questions have imported correctly.....
......@@ -31,6 +31,7 @@ require_once(dirname(__FILE__) . '/stack/questiontest.php');
// Get the parameters from the URL.
$questionid = required_param('questionid', PARAM_INT);
$courseid = required_param('courseid', PARAM_INT);
$seed = optional_param('seed', null, PARAM_INT);
$testcase = optional_param('testcase', null, PARAM_INT);
......@@ -47,7 +48,7 @@ require_login();
question_require_capability_on($questiondata, 'edit');
// Initialise $PAGE.
$urlparams = array('questionid' => $question->id);
$urlparams = array('courseid' => $courseid, 'questionid' => $question->id);
if (!is_null($seed)) {
$urlparams['seed'] = $seed;
}
......
......@@ -304,11 +304,11 @@ foreach ($testresults as $key => $result) {
if ($canedit) {
echo html_writer::start_tag('div', array('class' => 'testcasebuttons'));
echo $OUTPUT->single_button(new moodle_url('/question/type/stack/questiontestedit.php',
array('questionid' => $question->id, 'testcase' => $key)),
array('courseid' => $courseid, 'questionid' => $question->id, 'testcase' => $key)),
stack_string('editthistestcase', 'qtype_stack'), 'get');
echo $OUTPUT->single_button(new moodle_url('/question/type/stack/questiontestdelete.php',
array('questionid' => $question->id, 'testcase' => $key)),
array('courseid' => $courseid, 'questionid' => $question->id, 'testcase' => $key)),
stack_string('deletethistestcase', 'qtype_stack'), 'get');
echo html_writer::end_tag('div');
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment