Skip to content
Snippets Groups Projects
Commit cfc936cc authored by Tim Hunt's avatar Tim Hunt
Browse files

Moodle 4.0: Fix notice in export one script. Fixes #842

parent ecb955e0
No related branches found
No related tags found
No related merge requests found
...@@ -17,6 +17,11 @@ ...@@ -17,6 +17,11 @@
/** /**
* Script to download the export of a single STACK question. * Script to download the export of a single STACK question.
* *
* TODO: Since MDL-63738 landed in Moodle 3.6, this has been a core Moodle
* feature, so we don't really need to keep mainaining this file. We could
* use question/exportone.php, or question/bank/exporttoxml/exportone.php,
* as it later became, instead.
*
* @copyright 2015 the Open University * @copyright 2015 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
*/ */
...@@ -30,8 +35,7 @@ require_once(__DIR__ . '/locallib.php'); ...@@ -30,8 +35,7 @@ require_once(__DIR__ . '/locallib.php');
$questionid = required_param('questionid', PARAM_INT); $questionid = required_param('questionid', PARAM_INT);
// Load the necessary data. // Load the necessary data.
$questiondata = $DB->get_record('question', array('id' => $questionid), '*', MUST_EXIST); $questiondata = question_bank::load_question_data($questionid);
get_question_options($questiondata);
$question = question_bank::load_question($questionid); $question = question_bank::load_question($questionid);
// Process any other URL parameters, and do require_login. // Process any other URL parameters, and do require_login.
......
...@@ -71,7 +71,8 @@ Feature: Create, preview, test, tidy and edit STACK questions ...@@ -71,7 +71,8 @@ Feature: Create, preview, test, tidy and edit STACK questions
| Answer note | prt1-1-F | | Answer note | prt1-1-F |
When I press "Create test case" When I press "Create test case"
Then I should see "All tests passed!" Then I should see "All tests passed!"
And I should see "Test case 1 Pass" And I should see "Test case 1"
And following "Export this question" should download between "3700" and "3800" bytes
When I follow "Preview" When I follow "Preview"
# Use the tidy question script. # Use the tidy question script.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment