MDL-68265 core_question: Switch question import to request dir
authorAndrew Nicols <andrew@nicols.co.uk>
Thu, 26 Mar 2020 09:38:24 +0000 (17:38 +0800)
committerAndrew Nicols <andrew@nicols.co.uk>
Mon, 30 Mar 2020 00:14:46 +0000 (08:14 +0800)
question/import.php

index 0f68d1e..567fb74 100644 (file)
@@ -86,9 +86,7 @@ if ($form = $import_form->get_data()) {
     // work out if this is an uploaded file
     // or one from the filesarea.
     $realfilename = $import_form->get_new_filename('newfile');
-
-    $importfile = "{$CFG->tempdir}/questionimport/{$realfilename}";
-    make_temp_directory('questionimport');
+    $importfile = make_request_directory() . "/{$realfilename}";
     if (!$result = $import_form->save_file('newfile', $importfile, true)) {
         throw new moodle_exception('uploadproblem');
     }