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

index a3d2281..38d5c0f 100644 (file)
@@ -66,9 +66,7 @@ if ($data = $mform->get_data()) {
     require_sesskey();
 
     $realfilename = $mform->get_new_filename('questionfile');
-    //TODO: Leave all imported questions in Questionimport for now.
-    $importfile = "{$CFG->tempdir}/questionimport/{$realfilename}";
-    make_temp_directory('questionimport');
+    $importfile = make_request_directory() . "/{$realfilename}";
     if (!$result = $mform->save_file('questionfile', $importfile, true)) {
         throw new moodle_exception('uploadproblem');
     }