diff --git a/export.php b/export.php index 33527f1..f2b10b1 100644 --- a/export.php +++ b/export.php @@ -53,13 +53,13 @@ $questionlist = []; -// There is not request class to actually get the posted params. The checked checboxed -// have a name like q where is the question id. -if (is_array($_REQUEST)) { - foreach (array_keys($_REQUEST) as $key) { +// The checked checkboxes have a name like q where is the question id. +$request = data_submitted(); +if ($request) { + foreach (array_keys(get_object_vars($request)) as $key) { if (strpos($key, 'q') === 0) { - $questionid = substr($key, 1); - if (is_number($questionid)) { + $questionid = (int)substr($key, 1); + if ($questionid > 0) { $question = question_bank::load_question_data($questionid); $questiondata = question_bank::load_question_data($questionid); question_require_capability_on($questiondata, 'view');