diff --git a/lang/en_utf8/question.php b/lang/en_utf8/question.php index f3681b4a67e..994f34693c2 100644 --- a/lang/en_utf8/question.php +++ b/lang/en_utf8/question.php @@ -91,4 +91,5 @@ $string['tofilecontext'] = 'Write context to file'; $string['unknown'] = 'Unknown'; $string['unknownquestiontype'] = 'Unknown question type: $a.'; $string['unpublished'] = 'unshared'; +$string['yourfileshoulddownload'] = 'Your export file should start to download shortly. If not, please click here.'; ?> diff --git a/question/export.php b/question/export.php index 77babbaecb2..1362b11ddbf 100644 --- a/question/export.php +++ b/question/export.php @@ -17,20 +17,7 @@ // get display strings - $txt = new object; - $txt->category = get_string('category', 'quiz'); - $txt->download = get_string('download', 'quiz'); - $txt->downloadextra = get_string('downloadextra', 'quiz'); - $txt->exporterror = get_string('exporterror', 'quiz'); - $txt->exportname = get_string('exportname', 'quiz'); - $txt->exportquestions = get_string('exportquestions', 'quiz'); - $txt->fileformat = get_string('fileformat', 'quiz'); - $txt->exportcategory = get_string('exportcategory', 'quiz'); - $txt->modulename = get_string('modulename', 'quiz'); - $txt->modulenameplural = get_string('modulenameplural', 'quiz'); - $txt->tofile = get_string('tofile', 'quiz'); - - + $strexportquestions = get_string('exportquestions', 'quiz'); // make sure we are using the user's most recent category choice if (empty($categoryid)) { @@ -52,9 +39,9 @@ $navlinks = array(); $navlinks[] = array('name' => get_string('modulenameplural', $cm->modname), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/index.php?id=$COURSE->id", 'type' => 'activity'); $navlinks[] = array('name' => format_string($module->name), 'link' => "$CFG->wwwroot/mod/{$cm->modname}/view.php?id={$cm->id}", 'type' => 'title'); - $navlinks[] = array('name' => $txt->exportquestions, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strexportquestions, 'link' => '', 'type' => 'title'); $navigation = build_navigation($navlinks); - print_header_simple($txt->exportquestions, '', $navigation, "", "", true, $strupdatemodule); + print_header_simple($strexportquestions, '', $navigation, "", "", true, $strupdatemodule); $currenttab = 'edit'; $mode = 'export'; @@ -63,10 +50,10 @@ } else { // Print basic page layout. $navlinks = array(); - $navlinks[] = array('name' => $txt->exportquestions, 'link' => '', 'type' => 'title'); + $navlinks[] = array('name' => $strexportquestions, 'link' => '', 'type' => 'title'); $navigation = build_navigation($navlinks); - print_header_simple($txt->exportquestions, '', $navigation); + print_header_simple($strexportquestions, '', $navigation); // print tabs $currenttab = 'export'; include('tabs.php'); @@ -100,42 +87,62 @@ $from_form->exportfilename = default_export_filename($COURSE, $category); } $qformat->setFilename($from_form->exportfilename); + $canaccessbackupdata = has_capability('moodle/site:backup', $contexts->lowest()); + $qformat->set_can_access_backupdata($canaccessbackupdata); $qformat->setCattofile(!empty($from_form->cattofile)); $qformat->setContexttofile(!empty($from_form->contexttofile)); if (! $qformat->exportpreprocess()) { // Do anything before that we need to - error($txt->exporterror, $thispageurl->out()); + error(get_string('exporterror', 'quiz'), $thispageurl->out()); } if (! $qformat->exportprocess()) { // Process the export data - error($txt->exporterror, $thispageurl->out()); + error(get_string('exporterror', 'quiz'), $thispageurl->out()); } if (! $qformat->exportpostprocess()) { // In case anything needs to be done after - error($txt->exporterror, $thispageurl->out()); + error(get_string('exporterror', 'quiz'), $thispageurl->out()); } echo "