]> git.mjollnir.org Git - moodle.git/commitdiff
rqp questions set the type to rqp_nn where nn is the rqp_type id
authorgustav_delius <gustav_delius>
Wed, 22 Mar 2006 11:19:26 +0000 (11:19 +0000)
committergustav_delius <gustav_delius>
Wed, 22 Mar 2006 11:19:26 +0000 (11:19 +0000)
question/question.php

index fc5f52c2a1285261f04f9f199ac63ac583aecc9c..7a659bca07d5fabfa36123235acdb17360e527c2 100644 (file)
     require_once($CFG->libdir.'/questionlib.php');
     require_once($CFG->libdir.'/filelib.php');
 
-    $id = optional_param('id');        // question id
+    $id = optional_param('id', 0, PARAM_INT);        // question id
 
-    $qtype = optional_param('qtype');
-    $category = optional_param('category');
+    $qtype = optional_param('qtype', '', PARAM_FILE);
+    $category = optional_param('category', 0, PARAM_INT);
 
-    // a qtype > 99 means a remote question
-    if ($qtype > 99) {
-    $typeid = $qtype - 100;
-    $qtype = RQP;
+    // rqp questions set the type to rqp_nn where nn is the rqp_type id
+    if (substr($qtype, 0, 4) == 'rqp_') {
+        $typeid = (int) substr($qtype, 4);
+        $qtype = 'rqp';
     }
 
     if ($id) {