From c4e78a1b604b82db090dd8a29259d03c345afe34 Mon Sep 17 00:00:00 2001 From: moodler Date: Sun, 16 Feb 2003 08:03:55 +0000 Subject: [PATCH] Tidy up the import screen --- lang/en/quiz.php | 1 + mod/quiz/import.php | 33 +++++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/lang/en/quiz.php b/lang/en/quiz.php index 4ca8a6c38a..d00bd8b615 100644 --- a/lang/en/quiz.php +++ b/lang/en/quiz.php @@ -51,6 +51,7 @@ $string['false'] = "False"; $string['feedback'] = "Feedback"; $string['filloutoneanswer'] = "You must fill out at least one possible answer. Answers left blank will not be used."; $string['fillouttwochoices'] = "You must fill out at least two choices. Choices left blank will not be used."; +$string['fileformat'] = "File format"; $string['fractionsaddwrong'] = "The positive grades you have chosen do not add up to 100%%
Instead, they add up to \$a%%
Do you want to go back and fix this question?"; diff --git a/mod/quiz/import.php b/mod/quiz/import.php index 8ca8c1d43c..b4c8c535c3 100644 --- a/mod/quiz/import.php +++ b/mod/quiz/import.php @@ -34,9 +34,9 @@ $newfile = $_FILES['newfile']; } if (empty($newfile)) { - notify(get_string("uploadnofilefound") ); - } else if (!is_uploaded_file($newfile['tmp_name']) or $newfile['size'] == 0) { notify(get_string("uploadproblem") ); + } else if (!is_uploaded_file($newfile['tmp_name']) or $newfile['size'] == 0) { + notify(get_string("uploadnofilefound") ); } else { if (! is_readable("format/$form->format".".php")) { @@ -90,16 +90,37 @@ /// Print upload form - echo "
"; + if (!$categories = quiz_get_category_menu($course->id, true)) { + error("No categories!"); + } + + + print_simple_box_start("center", "", "$THEME->cellheading"); echo "
"; + echo ""; + echo ""; + + echo ""; + echo "
"; + print_string("category", "quiz"); + echo ":"; + choose_from_menu($categories, "category", "$category->id", ""); + helpbutton("import", $strimportquestions, "quiz"); + echo "
"; + print_string("fileformat", "quiz"); + echo ":"; choose_from_menu($QUIZ_FILE_FORMAT, "format", "missingword", ""); helpbutton("import", $strimportquestions, "quiz"); - echo "
"; - echo " id\">"; + echo "
"; + print_string("upload"); + echo ":"; echo " "; + echo "
 "; + echo " id\">"; echo " "; + echo "
"; echo "
"; - echo "
"; + print_simple_box_end(); print_footer($course); -- 2.39.5