mirror of
https://github.com/moodle/moodle.git
synced 2025-08-08 10:26:40 +02:00
MDL-27964 lesson - Old file picker is replaced with new filepicker, currently all imported questions will be saved in /temp/questionimport/ where questionbank files are saved.
This commit is contained in:
parent
7fde489dae
commit
b89bf55f84
2 changed files with 54 additions and 23 deletions
|
@ -66,9 +66,13 @@ if ($data = $mform->get_data()) {
|
|||
|
||||
require_sesskey();
|
||||
|
||||
if (!$importfile = $mform->get_importfile_name()) {
|
||||
print_error('uploadproblem', 'moodle');
|
||||
}
|
||||
$realfilename = $mform->get_new_filename('questionfile');
|
||||
//TODO: Leave all imported questions in Questionimport for now.
|
||||
$importfile = "{$CFG->dataroot}/temp/questionimport/{$realfilename}";
|
||||
make_upload_directory('temp/questionimport');
|
||||
if (!$result = $mform->save_file('questionfile', $importfile, true)) {
|
||||
throw new moodle_exception('uploadproblem');
|
||||
}
|
||||
|
||||
$formatclass = 'qformat_'.$data->format;
|
||||
$formatclassfile = $CFG->dirroot.'/question/format/'.$data->format.'/format.php';
|
||||
|
@ -102,4 +106,4 @@ if ($data = $mform->get_data()) {
|
|||
$mform->display();
|
||||
}
|
||||
|
||||
echo $OUTPUT->footer();
|
||||
echo $OUTPUT->footer();
|
Loading…
Add table
Add a link
Reference in a new issue