Skip to content

Commit

Permalink
MDL-30485 XML import from 1.9 does not handle files in subfolders.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed Nov 28, 2011
1 parent 1de9151 commit 3385a14
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions question/format/xml/format.php
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,10 @@ public function import_headers($question) {
$data = new stdClass();
$data->content = $filedata;
$data->encoding = 'base64';
$data->name = $filename;
// Question file areas don't support subdirs, so convert path to filename if necessary.
$data->name = clean_param(str_replace('/', '_', $filename), PARAM_FILE);
$qo->questiontextfiles[] = $data;
$qo->questiontext .= ' <img src="@@PLUGINFILE@@/' . $filename . '" />';
$qo->questiontext .= ' <img src="@@PLUGINFILE@@/' . $data->name . '" />';
}

// restore files in generalfeedback
Expand Down

0 comments on commit 3385a14

Please sign in to comment.