Update of /cvsroot/aimmath/moodle/mod/aim_quiz
In directory sc8-pr-cvs1:/tmp/cvs-serv4126/mod/aim_quiz
Modified Files:
aimpage.php lib.php mod.html view.php
Log Message:
added problem and solution sheets and due date
Index: aimpage.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/aim_quiz/aimpage.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
Index: lib.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/aim_quiz/lib.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** lib.php 31 Aug 2003 20:44:57 -0000 1.4
--- lib.php 2 Sep 2003 00:40:24 -0000 1.5
***************
*** 500,504 ****
fwrite($fp,$latex);
fclose($fp);
! // $latexoutput = shell_exec("pdflatex temp.tex");
return true;
}
--- 500,504 ----
fwrite($fp,$latex);
fclose($fp);
! $latexoutput = system("pdflatex -interaction=batchmode temp.tex");
return true;
}
Index: mod.html
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/aim_quiz/mod.html,v
retrieving revision 1.1.1.1
retrieving revision 1.2
diff -C2 -d -r1.1.1.1 -r1.2
*** mod.html 25 Aug 2003 16:24:08 -0000 1.1.1.1
--- mod.html 2 Sep 2003 00:40:24 -0000 1.2
***************
*** 14,17 ****
--- 14,23 ----
$form->name = "";
}
+ if (!isset($form->problem_sheet)) {
+ $form->problem_sheet = "";
+ }
+ if (!isset($form->solution_sheet)) {
+ $form->solution_sheet = "";
+ }
if (!isset($form->subject)) {
$form->subject = "";
***************
*** 23,26 ****
--- 29,35 ----
$form->grade = 0;
}
+ if (!isset($form->timedue)) {
+ $form->timedue = "";
+ }
// Now we set the defaults
if (!$form->subject) {
***************
*** 50,53 ****
--- 59,113 ----
</TR>
+ <tr valign=top>
+ <td align=right><p><b><?php print_string("duedate", "aim_quiz") ?>:</b></td>
+ <td><?php
+ print_date_selector("dueday", "duemonth", "dueyear", $form->timedue);
+ echo " - ";
+ print_time_selector("duehour", "dueminute", $form->timedue);
+ ?></td>
+ </tr>
+
+ <tr valign="top">
+ <td align="right" nowrap>
+ <p><b><?=get_string("problem_sheet", "aim_quiz")?>:</b></p>
+ </td>
+ <td>
+ <?php
+ $rootdir = $CFG->dataroot."/".$course->id;
+ $coursedirs = get_directory_list($rootdir, $CFG->moddata);
+ foreach ($coursedirs as $dir) {
+ $options["$dir"] = $dir;
+ }
+ choose_from_menu ($options, "problem_sheet", $form->problem_sheet);
+ ?>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td align="right" nowrap>
+ <p><b><?=get_string("solution_sheet", "aim_quiz")?>:</b></p>
+ </td>
+ <td>
+ <?php
+ $rootdir = $CFG->dataroot."/".$course->id;
+ $coursedirs = get_directory_list($rootdir, $CFG->moddata);
+ foreach ($coursedirs as $dir) {
+ $options["$dir"] = $dir;
+ }
+ choose_from_menu ($options, "solution_sheet", $form->solution_sheet);
+ ?>
+ </td>
+ </tr>
+
+ <tr valign="top">
+ <td align="right" nowrap>
+ <p><b><?=get_string("note", "aim_quiz");?>:</b></p>
+ </td>
+ <td>
+ <p><?=get_string("notefile", "aim_quiz", "$CFG->wwwroot/files/index.php?id=$course->id")?>
+ </p>
+ </td>
+ </tr>
+
<TR valign=top>
<TD align=right><P><B><?php echo "$strsubject / $straimserver"; ?>:</B></P></TD>
***************
*** 62,66 ****
$newreturn = "update=$update";
if (!empty($return)) {
! $newreturn .= "&return=$return";
}
}
--- 122,126 ----
$newreturn = "update=$update";
if (!empty($return)) {
! $newreturn .= "&return=$return";
}
}
Index: view.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/aim_quiz/view.php,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** view.php 31 Aug 2003 20:44:57 -0000 1.4
--- view.php 2 Sep 2003 00:40:24 -0000 1.5
***************
*** 176,184 ****
echo "<A href=\"aimpage.php?id=$cm->id&aimaction=subject\">" . get_string("admin_subject", "aim_quiz") . "</A>";
echo "</font></div>";
! }
! print_heading($strgrades);
! if (isteacher($course->id)) {
echo "<P align=\"center\"><B>" . get_string("maximumgrade") . "</B>: $aim_quiz->grade</P>";
$table->head = array ("", get_string("firstname"), get_string("lastname"), $strgrade, "");
--- 176,217 ----
echo "<A href=\"aimpage.php?id=$cm->id&aimaction=subject\">" . get_string("admin_subject", "aim_quiz") . "</A>";
echo "</font></div>";
! }
! print_simple_box_start("CENTER");
! print_heading($aim_quiz->name, "CENTER");
! $timedifference = $aim_quiz->timedue - time();
! if ($timedifference < 31536000) { // Don't bother showing dates over a year in the future
! $strdifference = format_time($timedifference);
! if ($timedifference < 0) {
! $strdifference = "<font color=\"red\">- $strdifference</font>";
! }
! $strduedate = userdate($aim_quiz->timedue)." ($strdifference)";
! echo "<b>".get_string("duedate", "assignment")."</b>: $strduedate<br />";
! }
!
! if (!isteacher($course->id)) {
! echo "<B>$strgrade :</B> ";
! if ($grade->grade >= 0)
! echo "$grade->grade / $aim_quiz->grade";
! else
! print_string("notattempted", "aim_quiz");
! if ($grade->override) {
! echo " (";
! print_string("gradeoverride", "aim_quiz");
! echo ")";
! }
! echo "<br />";
! if ($grade->comment)
! echo "<B>" . get_string("comment", "aim_quiz") . ":</B> " .
! nl2br(htmlspecialchars($grade->comment));
! }
!
! print_simple_box_end();
! echo "<br />";
!
!
! if (isteacher($course->id)) {
! print_heading($strgrades);
echo "<P align=\"center\"><B>" . get_string("maximumgrade") . "</B>: $aim_quiz->grade</P>";
$table->head = array ("", get_string("firstname"), get_string("lastname"), $strgrade, "");
***************
*** 222,248 ****
}
else {
- echo "<TABLE border=0 cellspacing=0 cellpadding=0 align=\"center\"><TR><TD>";
- echo "<P><B>$strgrade :</B> ";
- if ($grade->grade >= 0)
- echo "$grade->grade / $aim_quiz->grade";
- else
- print_string("notattempted", "aim_quiz");
- if ($grade->override) {
- echo " (";
- print_string("gradeoverride", "aim_quiz");
- echo ")";
- }
echo "</P>";
- if ($grade->comment)
- echo "<P align=\"center\"><B>" . get_string("comment", "aim_quiz") . ":</B> " . nl2br(htmlspecialchars($grade->comment)) . "</P>";
if ($grade->override) {
echo "<P align=\"center\">";
print_string("gradeoverridemsg", "aim_quiz");
echo "</P>";
- echo "<P align=\"center\"><A href=\"aimpage.php?id=$cm->id\">" . get_string("viewquiz", "aim_quiz") . "</A></P>";
}
! else
! echo "<P align=\"center\"><A href=\"aimpage.php?id=$cm->id\">" . get_string("viewquiz", "aim_quiz") . "</A></P>";
! echo "</TD></TR></TABLE>";
}
--- 255,280 ----
}
else {
echo "</P>";
if ($grade->override) {
echo "<P align=\"center\">";
print_string("gradeoverridemsg", "aim_quiz");
echo "</P>";
}
! echo "<div align=\"center\"><a href=\"aimpage.php?id=$cm->id\">" . get_string("viewquiz", "aim_quiz") . "</a></div>";
!
! if ($CFG->slasharguments) {
! $proburl = "$CFG->wwwroot/file.php/$course->id/$aim_quiz->problem_sheet";
! $solurl = "$CFG->wwwroot/file.php/$course->id/$aim_quiz->solution_sheet";
! } else {
! $proburl = "$CFG->wwwroot/file.php?file=/$course->id/$aim_quiz->problem_sheet";
! $solurl = "$CFG->wwwroot/file.php?file=/$course->id/$aim_quiz->solution_sheet";
! }
! if ($aim_quiz->problem_sheet) {
! echo "<div align=\"center\"><a href=\"" . $proburl . "\" target=\"problem_sheet\">" . get_string("viewproblem", "aim_quiz") . "</a></div>";
! }
! if (($aim_quiz->solution_sheet) and ($aim_quiz->timedue < time())) {
! echo "<div align=\"center\"><a href=\"" . $solurl . "\" target=\"solution_sheet\">" .
! get_string("viewsolution", "aim_quiz") . "</a></div>";
! }
}
|