[Aimmath-commit] moodle/mod/math_assignment mod.html,1.6,1.7
Brought to you by:
gustav_delius,
npstrick
|
From: <ma...@us...> - 2003-09-16 15:20:18
|
Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv18670/mod/math_assignment
Modified Files:
mod.html
Log Message:
Changed handling of problem and solution sheets.
Index: mod.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/mod.html,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** mod.html 16 Sep 2003 14:57:55 -0000 1.6
--- mod.html 16 Sep 2003 15:20:12 -0000 1.7
***************
*** 11,15 ****
* We check that these are setup here.
*/
-
if (!isset($form->name)) {
$form->name = "";
--- 11,14 ----
***************
*** 18,26 ****
$form->problems = "";
}
if (!isset($form->solutions)) {
$form->solutions = "";
}
if (!isset($form->aimsubject)) {
! $form->aimsubject = 0;
}
if (!isset($form->aimquiz)) {
--- 17,31 ----
$form->problems = "";
}
+ if (!isset($form->problemscompile)) {
+ $form->problemscompile = true;
+ }
if (!isset($form->solutions)) {
$form->solutions = "";
}
+ if (!isset($form->solutionscompile)) {
+ $form->solutionscompile = true;
+ }
if (!isset($form->aimsubject)) {
! $form->aimsubject = "";
}
if (!isset($form->aimquiz)) {
***************
*** 39,50 ****
if (!$form->name)
$form->name = get_string("modulename", "math_assignment");
!
! if (!$form->aimsubject > 0) {
! // get aimsubject from database
! if (!$form->aimsubject = get_field("math_assignment_subject", "id", "course", $form->course)) {
! $form->aimsubject = 0;
! };
}
-
// Process problems and solutions
$form->problemsurl = "";
--- 44,51 ----
if (!$form->name)
$form->name = get_string("modulename", "math_assignment");
! if (!$form->aimsubject) {
! $courses = get_courses();
! $form->aimsubject = $courses[$form->course]->shortname;
}
// Process problems and solutions
$form->problemsurl = "";
***************
*** 52,56 ****
if (strcasecmp(substr($form->problems, 0, 5), "http:") == 0) {
$form->problemsurl = $form->problems;
! $form->problems = "|url|";
}
}
--- 53,57 ----
if (strcasecmp(substr($form->problems, 0, 5), "http:") == 0) {
$form->problemsurl = $form->problems;
! $form->problems = "";
}
}
***************
*** 59,63 ****
if (strcasecmp(substr($form->solutions, 0, 5), "http:") == 0) {
$form->solutionsurl = $form->solutions;
! $form->solutions = "|url|";
}
}
--- 60,64 ----
if (strcasecmp(substr($form->solutions, 0, 5), "http:") == 0) {
$form->solutionsurl = $form->solutions;
! $form->solutions = "";
}
}
***************
*** 65,73 ****
$strname = get_string("name");
$strtimedue = get_string("timedue", "math_assignment");
- $strnone = get_string("none");
- $strexternalurl = get_string("externalurl", "math_assignment");
- $struploadnew = get_string("uploadnew", "math_assignment");
$strproblems = get_string("problems", "math_assignment");
$strsolutions = get_string("solutions", "math_assignment");
$strmaxgrade = get_string("maxgrade", "math_assignment");
$straimsubject = get_string("aimsubject","math_assignment");
--- 66,77 ----
$strname = get_string("name");
$strtimedue = get_string("timedue", "math_assignment");
$strproblems = get_string("problems", "math_assignment");
$strsolutions = get_string("solutions", "math_assignment");
+ $strnone = get_string("none");
+ $struseuploaded = get_string("useuploaded", "math_assignment");
+ $stror = get_string("or", "math_assignment");
+ $struploadnew = get_string("uploadnew", "math_assignment");
+ $strexternalurl = get_string("externalurl", "math_assignment");
+ $strcompiletex = get_string("compiletex", "math_assignment");
$strmaxgrade = get_string("maxgrade", "math_assignment");
$straimsubject = get_string("aimsubject","math_assignment");
***************
*** 77,87 ****
<script language="JavaScript"><!-- //hide
! function enableeditbox(type)
{
list = eval("document.form." + type);
- url = eval("document.form." + type + "url");
file = eval("document.form." + type + "file");
! url.disabled = (list.value != "|url|");
! file.disabled = (list.value != "|upload|");
}
//end --></script>
--- 81,99 ----
<script language="JavaScript"><!-- //hide
! function sheet_change(type, changed)
{
list = eval("document.form." + type);
file = eval("document.form." + type + "file");
! url = eval("document.form." + type + "url");
! if (changed == "list" && list.value != "<?php echo $strnone; ?>") {
! url.value = "";
! }
! else if (changed == "file" && file.value != "") {
! list.value = "";
! url.value = "";
! }
! else if (changed == "url" && url.value != "") {
! list.value = "";
! }
}
//end --></script>
***************
*** 131,158 ****
<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>
--- 143,174 ----
<tr>
<td align="right">
! <?php echo "$struseuploaded : "; ?>
</td>
<td>
<?php choose_from_menu ($options, "problems", $form->problems,
! $strnone, "sheet_change('problems', 'list');", ""); ?>
</td>
+ <td rowspan="4"><?php helpbutton("addupdate_problems", $strproblems, "math_assignment"); ?>
</tr>
<tr>
<td align="right">
! <?php echo "<b>$stror</b> $struploadnew : "; ?>
</td>
<td>
! <input type="file" name="problemsfile" size="30" value="" onchange="sheet_change('problems', 'file');" />
</td>
</tr>
<tr>
<td align="right">
! <?php echo "<b>$stror</b> $strexternalurl : "; ?>
</td>
<td>
<input type="text" name="problemsurl" size="44" maxlength="255"
! value="<?php echo $form->problemsurl ?>" onchange="sheet_change('problems', 'url');" />
</td>
</tr>
+ <tr>
+ <td colspan="2"><input type="checkbox" name="problemscompile"<?php if ($form->problemscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
+ </tr>
</table>
</td>
***************
*** 164,195 ****
</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, "solutions", $form->solutions, $strnone, "enableeditbox('solutions');", "");
! echo "</td>\n<td align=\"left\">";
! echo "<input type=\"text\" name=\"solutionsurl\" size=\"44\" maxlength=\"255\" value=\"$form->solutionsurl\"";
! if ($form->solutions == "|url|")
! echo " />";
! else
! echo " disabled=\"true\" />";
! echo "</td>\n<td align=\"left\" rowspan=\"2\">";
! helpbutton("addupdate_solutions", $strsolutions, "math_assignment");
! echo "</td>\n</tr>\n";
! echo "<tr valign=\"middle\">\n";
! echo "<td align=\"left\">";
! echo "<input type=\"file\" name=\"solutionsfile\" size=\"40\" value=\"\" disabled=\"true\" />";
! echo "</td>\n</tr>\n";
! echo "</table>\n";
! ?>
</td>
</tr>
--- 180,223 ----
</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">
! <?php echo "$struseuploaded : "; ?>
! </td>
! <td>
! <?php choose_from_menu ($options, "solutions", $form->solutions,
! $strnone, "sheet_change('solutions', 'list');", ""); ?>
! </td>
! <td rowspan="4"><?php helpbutton("addupdate_solutions", $strsolutions, "math_assignment"); ?>
! </tr>
! <tr>
! <td align="right">
! <?php echo "<b>$stror</b> $struploadnew : "; ?>
! </td>
! <td>
! <input type="file" name="solutionsfile" size="30" value="" onchange="sheet_change('solutions', 'file');" />
! </td>
! </tr>
! <tr>
! <td align="right">
! <?php echo "<b>$stror</b> $strexternalurl : "; ?>
! </td>
! <td>
! <input type="text" name="solutionsurl" size="44" maxlength="255"
! value="<?php echo $form->solutionsurl ?>" onchange="sheet_change('problems', 'url');" />
! </td>
! </tr>
! <tr>
! <td colspan="2"><input type="checkbox" name="solutionscompile"<?php if ($form->solutionscompile) echo " checked=\"true\""; ?> /><?php echo "$strcompiletex"; ?></td>
! </tr>
! </table>
</td>
</tr>
***************
*** 205,256 ****
</tr>
! <?php
! if ($CFG->math_assignment_teachers_choose_subject) {
! ?>
! <tr valign="top">
! <td align="right"><p><b><?php echo "$straimsubject"; ?>:</b></p></td>
! <td>
! <select name="aimsubject">
! <?php math_assignment_list_all_subjects($form->aimsubject); ?>
! </select>
! <?php
! helpbutton ("addupdate_serversubject", $straimsubject, "math_assignment");
! if (isadmin()) {
! if (!empty($update)) {
! $newreturn = "update=$update";
! if (!empty($return)) {
! $newreturn .= "&return=$return";
! }
! }
! else if (isset($id) && isset($section) && isset($add)) {
! $newreturn = "id=$id§ion=$section&add=$add";
! }
! else {
! $newreturn = "";
! }
! if (!empty($newreturn)) {
! $newreturn = "?return=" . htmlspecialchars(urlencode($newreturn));
}
- echo "<a href=\"$CFG->wwwroot/mod/math_assignment/servers.php$newreturn\">" . get_string("aimserverconfig", "math_assignment") . "</a>";
}
! ?>
! </td>
! </tr>
! <?php
! }
! ?>
! <?php
! if (($CFG->math_assignment_teachers_choose_subject > 0) or ($form->aimsubject > 0)) {
! ?>
! <tr valign="top">
! <td align="right"><p><b><?php echo $straimquiz; ?>:</b></p></td>
! <td>
! <input type="text" name="aimquiz" size="40" maxlength="255" value="<?php p($form->aimquiz); ?>" /> <?php helpbutton("addupdate_quiz", $straimquiz, "math_assignment"); ?>
! </td>
! </tr>
! <?php
! }
! ?>
</table>
--- 233,272 ----
</tr>
! <tr valign="top">
! <td align="right"><p><b><?php echo "$straimsubject"; ?>:</b></p></td>
! <td>
! <select name="aimsubject">
! <?php math_assignment_list_all_subjects($form->aimsubject); ?>
! </select>
! <?php
! helpbutton ("addupdate_serversubject", $straimsubject, "math_assignment");
! if (isadmin()) {
! if (!empty($update)) {
! $newreturn = "update=$update";
! if (!empty($return)) {
! $newreturn .= "&return=$return";
}
}
! else if (isset($id) && isset($section) && isset($add)) {
! $newreturn = "id=$id§ion=$section&add=$add";
! }
! else {
! $newreturn = "";
! }
! if (!empty($newreturn)) {
! $newreturn = "?return=" . htmlspecialchars(urlencode($newreturn));
! }
! echo "<a href=\"$CFG->wwwroot/mod/math_assignment/servers.php$newreturn\">" . get_string("aimserverconfig", "math_assignment") . "</a>";
! }
! ?>
! </td>
! </tr>
! <tr valign="top">
! <td align="right"><p><b><?php echo $straimquiz; ?>:</b></p></td>
! <td>
! <input type="text" name="aimquiz" size="40" maxlength="255" value="<?php p($form->aimquiz); ?>" /> <?php helpbutton("addupdate_quiz", $straimquiz, "math_assignment"); ?>
! </td>
! </tr>
</table>
|