Skip to content

Commit

Permalink
Exchange $_REQUEST for a Moodle native function dealing with the supe…
Browse files Browse the repository at this point in the history
…r globals
  • Loading branch information
srobotta committed Sep 13, 2024
1 parent e167a48 commit 1e58c44
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions export.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,13 +53,13 @@

$questionlist = [];

// There is not request class to actually get the posted params. The checked checboxed
// have a name like q<ID> where <ID> is the question id.
if (is_array($_REQUEST)) {
foreach (array_keys($_REQUEST) as $key) {
// The checked checkboxes have a name like q<ID> where <ID> 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');
Expand Down

0 comments on commit 1e58c44

Please sign in to comment.