diff --git a/question/export.php b/question/export.php index 0a61c5027ba..7f67488d424 100644 --- a/question/export.php +++ b/question/export.php @@ -20,8 +20,10 @@ 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; diff --git a/question/import.php b/question/import.php index aa3cec8c351..f6f6f131261 100644 --- a/question/import.php +++ b/question/import.php @@ -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;