]> git.mjollnir.org Git - moodle.git/commitdiff
Changing the category on the import or export page also changes it on the question...
authorgustav_delius <gustav_delius>
Mon, 1 May 2006 22:26:06 +0000 (22:26 +0000)
committergustav_delius <gustav_delius>
Mon, 1 May 2006 22:26:06 +0000 (22:26 +0000)
question/export.php
question/import.php

index 0a61c5027ba057d6b9305d8eed07501e74ccb5f9..7f67488d4245e15704056ec177d904da3ece7ec0 100644 (file)
     if (! $course = get_record("course", "id", $courseid)) {
         error("Course does not exist!");
     }
-    
-    if (!$categoryid) { // need to get category from modform
+
+    if ($categoryid) { // update category in session variable
+        $SESSION->questioncat = $categoryid;
+    } else { // try to get category from modform
         $showcatmenu = true; // will ensure that user can choose category
         if (isset($SESSION->questioncat)) {
             $categoryid = $SESSION->questioncat;
index aa3cec8c351612347d91c1f8099915587aae0887..f6f6f131261998cd183c7e3b562dbaff28ca678f 100644 (file)
@@ -51,7 +51,9 @@
     $matchgrades['error'] = $txt->matchgradeserror;
     $matchgrades['nearest'] = $txt->matchgradesnearest;
 
-    if (!$categoryid) { // try to get category from modform
+    if ($categoryid) { // update category in session variable
+        $SESSION->questioncat = $categoryid;
+    } else { // try to get category from modform
         $showcatmenu = true; // will ensure that user can choose category
         if (isset($SESSION->questioncat)) {
             $categoryid = $SESSION->questioncat;