]> git.mjollnir.org Git - moodle.git/commitdiff
Possible error passing course id from page to page resolved
authorthepurpleblob <thepurpleblob>
Thu, 26 Jul 2007 12:38:28 +0000 (12:38 +0000)
committerthepurpleblob <thepurpleblob>
Thu, 26 Jul 2007 12:38:28 +0000 (12:38 +0000)
question/import.php

index de65b3a73561393d3124cd5828aea2aaaa821349..8afc11e9de8b9c6266bc0e3ab019917b19bdfaef 100644 (file)
@@ -20,6 +20,7 @@
     $params = new stdClass;
     $params->choosefile = optional_param('choosefile','',PARAM_PATH);
     $catfromfile = optional_param('catfromfile', 0, PARAM_BOOL );
+    $courseid = optional_param('courseid', 0, PARAM_INT);
     $format = optional_param('format','',PARAM_FILE);
     $params->matchgrades = optional_param('matchgrades','',PARAM_ALPHA);
     $params->stoponerror = optional_param('stoponerror', 0, PARAM_BOOL);
@@ -68,6 +69,7 @@
         print_error( 'invalidcategory', 'quiz' );
     }
 
+    $localcourseid = $courseid;
     $courseid = $category->course;
 
     if (!$course = get_record("course", "id", $courseid)) {
     <form id="form" enctype="multipart/form-data" method="post" action="import.php">
         <fieldset class="invisiblefieldset" style="display: block;">
             <input type="hidden" name="sesskey" value="<?php echo sesskey(); ?>" />
+            <input type="hidden" name="courseid" value="<?php echo $localcourseid ?>" />
             <?php echo $thispageurl->hidden_params_out(array(), 3); ?>
             <?php print_simple_box_start("center"); ?>
             <table cellpadding="5">