]> git.mjollnir.org Git - moodle.git/commitdiff
Tidy up the import screen
authormoodler <moodler>
Sun, 16 Feb 2003 08:03:55 +0000 (08:03 +0000)
committermoodler <moodler>
Sun, 16 Feb 2003 08:03:55 +0000 (08:03 +0000)
lang/en/quiz.php
mod/quiz/import.php

index 4ca8a6c38a198a8748048add1f2884ca09b4046f..d00bd8b615709d4087943b824b5a105f3e7f0dba 100644 (file)
@@ -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%%
 <BR>Instead, they add up to \$a%%
 <BR>Do you want to go back and fix this question?";
index 8ca8c1d43ce2a2da49345b6d98f18371f26b5e23..b4c8c535c3414e99002573a337b999b30e711b6c 100644 (file)
@@ -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")) {
 
     /// Print upload form
 
-    echo "<DIV ALIGN=CENTER>";
+    if (!$categories = quiz_get_category_menu($course->id, true)) {
+        error("No categories!");
+    }
+
+
+    print_simple_box_start("center", "", "$THEME->cellheading");
     echo "<FORM ENCTYPE=\"multipart/form-data\" METHOD=\"POST\" ACTION=import.php>";
+    echo "<TABLE cellpadding=5>";
+    echo "<TR><TD align=right>";
+    print_string("category", "quiz");
+    echo ":</TD><TD>";
+    choose_from_menu($categories, "category", "$category->id", "");
+    helpbutton("import", $strimportquestions, "quiz");
+    echo "</TR>";
+
+    echo "<TR><TD align=right>";
+    print_string("fileformat", "quiz");
+    echo ":</TD><TD>";
     choose_from_menu($QUIZ_FILE_FORMAT, "format", "missingword", "");
     helpbutton("import", $strimportquestions, "quiz");
-    echo "<BR>";
-    echo " <INPUT TYPE=hidden NAME=category VALUE=\"$category->id\">";
+    echo "</TR><TR><TD align=right>";
+    print_string("upload");
+    echo ":</TD><TD>";
     echo " <INPUT NAME=\"newfile\" TYPE=\"file\" size=\"50\">";
+    echo "</TR><TR><TD>&nbsp;</TD><TD>";
+    echo " <INPUT TYPE=hidden NAME=category VALUE=\"$category->id\">";
     echo " <INPUT TYPE=submit NAME=save VALUE=\"".get_string("uploadthisfile")."\">";
+    echo "</TD></TR>";
+    echo "</TABLE>";
     echo "</FORM>";
-    echo "</DIV>";
+    print_simple_box_end();
 
     print_footer($course);