Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'MDL-31135_22' of git://github.com/timhunt/moodle into M…

…OODLE_22_STABLE
  • Loading branch information...
commit 8a9edd6dba26ac60973a93b1082d91ce7bab398f 2 parents 282dcd3 + a8f912f
@samhemelryk samhemelryk authored
Showing with 10 additions and 5 deletions.
  1. +10 −5 report/questioninstances/index.php
View
15 report/questioninstances/index.php
@@ -28,7 +28,7 @@
require_once($CFG->libdir.'/questionlib.php');
// Get URL parameters.
-$requestedqtype = optional_param('qtype', '', PARAM_PLUGIN);
+$requestedqtype = optional_param('qtype', '', PARAM_SAFEDIR);
// Print the header & check permissions.
admin_externalpage_setup('reportquestioninstances', '', null, '', array('pagelayout'=>'report'));
@@ -62,21 +62,26 @@
// Work out the bits needed for the SQL WHERE clauses.
if ($requestedqtype == 'missingtype') {
+ $title = get_string('reportformissingqtypes', 'report_questioninstances');
+
$othertypes = array_keys($qtypes);
$key = array_search('missingtype', $othertypes);
unset($othertypes[$key]);
list($sqlqtypetest, $params) = $DB->get_in_or_equal($othertypes, SQL_PARAMS_QM, '', false);
$sqlqtypetest = 'WHERE qtype ' . $sqlqtypetest;
- $title = get_string('reportformissingqtypes', 'report_questioninstances');
+
} else if ($requestedqtype == '_all_') {
+ $title = get_string('reportforallqtypes', 'report_questioninstances');
+
$sqlqtypetest = '';
$params = array();
- $title = get_string('reportforallqtypes', 'report_questioninstances');
+
} else {
- $sqlqtypetest = 'WHERE qtype = ?';
- $params = array($requestedqtype);
$title = get_string('reportforqtype', 'report_questioninstances',
question_bank::get_qtype($requestedqtype)->local_name());
+
+ $sqlqtypetest = 'WHERE qtype = ?';
+ $params = array($requestedqtype);
}
// Get the question counts, and all the context information, for each
Please sign in to comment.
Something went wrong with that request. Please try again.