[Aimmath-commit] moodle/mod/math_assignment lib.php,1.7,1.8 mod.html,1.3,1.4
Brought to you by:
gustav_delius,
npstrick
From: <gus...@us...> - 2003-09-16 10:06:26
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment In directory sc8-pr-cvs1:/tmp/cvs-serv15818/mod/math_assignment Modified Files: lib.php mod.html Log Message: Redesigned posting of problem sheets Index: lib.php =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** lib.php 16 Sep 2003 09:16:30 -0000 1.7 --- lib.php 16 Sep 2003 10:06:23 -0000 1.8 *************** *** 15,25 **** // problems ! if ($math_assignment->problems == "|url|") $math_assignment->problems = $math_assignment->problemsurl; ! else if ($math_assignment->problems == "|upload|") { ! if (empty($_FILES['problemsfile'])) ! $math_assignment->problems = ""; ! else ! $math_assignment->problems = math_assignment_save_upload($math_assignment->course, $_FILES['problemsfile']); } $math_assignment->problems = trim($math_assignment->problems); --- 15,23 ---- // problems ! if ($math_assignment->problemsurl <> "") { $math_assignment->problems = $math_assignment->problemsurl; ! } ! else if ($math_assignment->problemsfile <> "") { ! $math_assignment->problems = math_assignment_save_upload($math_assignment->course, $_FILES['problemsfile']); } $math_assignment->problems = trim($math_assignment->problems); Index: mod.html =================================================================== RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** mod.html 14 Sep 2003 14:11:14 -0000 1.3 --- mod.html 16 Sep 2003 10:06:23 -0000 1.4 *************** *** 115,146 **** </td> <td> ! <?php ! $rootdir = $CFG->dataroot . "/" . $course->id; ! $coursedirs = get_directory_list($rootdir, $CFG->moddata); ! $options = array(); ! $options["|url|"] = $strexternalurl; ! $options["|upload|"] = $struploadnew; ! foreach ($coursedirs as $dir) { ! $options["$dir"] = $dir; ! } ! echo "<table border=\"0\" cellpadding=\"0\" cellspacing=\"1\" align=\"left\">\n"; ! echo "<tr valign=\"middle\">\n"; ! echo "<td align=\"left\" rowspan=\"2\">\n"; ! choose_from_menu ($options, "problems", $form->problems, $strnone, "enableeditbox('problems');", ""); ! echo "</td>\n<td align=\"left\">"; ! echo "<input type=\"text\" name=\"problemsurl\" size=\"44\" maxlength=\"255\" value=\"$form->problemsurl\""; ! if ($form->problems == "|url|") ! echo " />"; ! else ! echo " disabled=\"true\" />"; ! echo "</td>\n<td align=\"left\" rowspan=\"2\">"; ! helpbutton("addupdate_problems", $strproblems, "math_assignment"); ! echo "</td>\n</tr>\n"; ! echo "<tr valign=\"middle\">\n"; ! echo "<td align=\"left\">"; ! echo "<input type=\"file\" name=\"problemsfile\" size=\"40\" value=\"\" disabled=\"true\" />"; ! echo "</td>\n</tr>\n"; ! echo "</table>\n"; ! ?> </td> </tr> --- 115,154 ---- </td> <td> ! <?php ! $rootdir = $CFG->dataroot . "/" . $course->id; ! $coursedirs = get_directory_list($rootdir, $CFG->moddata); ! $options = array(); ! foreach ($coursedirs as $dir) { ! $options["$dir"] = $dir; ! } ! ?> ! <table> ! <tr> ! <td align="right"> ! Choose uploaded file: ! </td> ! <td> ! <?php choose_from_menu ($options, "problems", $form->problems, ! $strnone, "enableeditbox('problems');", ""); ?> ! </td> ! </tr> ! <tr> ! <td align="right"> ! <b>OR</b> upload new file: ! </td> ! <td> ! <input type="file" name="problemsfile" size="30" value="" /> ! </td> ! </tr> ! <tr> ! <td align="right"> ! <b>OR</b> link to URL: ! </td> ! <td> ! <input type="text" name="problemsurl" size="44" maxlength="255" ! value="<?php echo $form->problemsurl ?>"> ! </td> ! </tr> ! </table> </td> </tr> |