Skip to content

Commit

Permalink
Temporary fix to the fact that the files API work has broken question…
Browse files Browse the repository at this point in the history
… import.
  • Loading branch information
tjhunt committed Aug 15, 2008
1 parent f88fb62 commit 8239d2c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions question/import_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ function definition() {
//--------------------------------------------------------------------------------
$mform->addElement('header', 'importfileupload', get_string('importfileupload','quiz'));

$this->set_upload_manager(new upload_manager('newfile', true, false, $COURSE, false, 0, false, true, false));
$mform->addElement('file', 'newfile', get_string('upload'));
//--------------------------------------------------------------------------------
$mform->addElement('submit', 'submitbutton', get_string('uploadthisfile'));
Expand All @@ -77,7 +76,9 @@ function definition() {
function get_importfile_name(){
if ($this->is_submitted() and $this->is_validated()) {
// return the temporary filename to process
return $this->_upload_manager->files['newfile']['tmp_name'];
// TODO change this to use the files API properly.
return $_FILES['newfile']['tmp_name'];
// return $this->_upload_manager->files['newfile']['tmp_name'];
}else{
return NULL;
}
Expand Down

0 comments on commit 8239d2c

Please sign in to comment.