Update of /cvsroot/aimmath/moodle/mod/math_assignment
In directory sc8-pr-cvs1:/tmp/cvs-serv32661/mod/math_assignment
Modified Files:
index.php lib.php
Log Message:
Fixed problems and solutions link display bug.
Index: index.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/index.php,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** index.php 18 Sep 2003 23:57:57 -0000 1.5
--- index.php 25 Sep 2003 15:32:55 -0000 1.6
***************
*** 119,122 ****
--- 119,124 ----
math_assignment_get_file_urls($math_assignment, $proburl, $solurl);
+ $proburl = htmlspecialchars($proburl);
+ $solurl = htmlspecialchars($solurl);
if ($teacher) {
if ($showaim && $math_assignment->aimquiz) {
***************
*** 137,141 ****
$row = array ($link);
}
! array_push($row, userdate($math_assignment->timedue, "", 99, false), $math_assignment->problems ? "<a href=\"$proburl\" target=\"problems\">$strviewproblems</a>" : "", $math_assignment->solutions ? "<a href=\"$solurl\" target=\"solutions\">$strviewsolutions</a>" : "");
if ($showaim) {
if ($math_assignment->aimquiz)
--- 139,143 ----
$row = array ($link);
}
! array_push($row, userdate($math_assignment->timedue, "", 99, false), $proburl ? "<a href=\"$proburl\" target=\"problems\">$strviewproblems</a>" : "", $solurl ? "<a href=\"$solurl\" target=\"solutions\">$strviewsolutions</a>" : "");
if ($showaim) {
if ($math_assignment->aimquiz)
***************
*** 168,172 ****
else
$row = array ($link);
! if ($math_assignment->solutions) {
if ($timenow > $math_assignment->timedue)
$solutions = "<a href=\"$solurl\" target=\"solutions\">$strviewsolutions</a>";
--- 170,174 ----
else
$row = array ($link);
! if ($solurl) {
if ($timenow > $math_assignment->timedue)
$solutions = "<a href=\"$solurl\" target=\"solutions\">$strviewsolutions</a>";
***************
*** 176,180 ****
else
$solutions = "";
! array_push($row, userdate($math_assignment->timedue, "", 99, false), $math_assignment->problems ? "<a href=\"$proburl\" target=\"problems\">$strviewproblems</a>" : "", $solutions, $papergrade, $aimgrade);
$table->data[] = $row;
}
--- 178,182 ----
else
$solutions = "";
! array_push($row, userdate($math_assignment->timedue, "", 99, false), $proburl ? "<a href=\"$proburl\" target=\"problems\">$strviewproblems</a>" : "", $solutions, $papergrade, $aimgrade);
$table->data[] = $row;
}
Index: lib.php
===================================================================
RCS file: /cvsroot/aimmath/moodle/mod/math_assignment/lib.php,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** lib.php 24 Sep 2003 11:48:41 -0000 1.19
--- lib.php 25 Sep 2003 15:32:55 -0000 1.20
***************
*** 46,52 ****
}
! $math_assignment->timemodified = time();
if (!math_assignment_setup_aim_quiz($math_assignment))
return false;
return insert_record("math_assignment", $math_assignment);
}
--- 46,60 ----
}
! // check that the paper grade is valid
! if ($math_assignment->papergrade < 0)
! return false;
! // check we have some questions
! if (!$math_assignment->papergrade && !$math_assignment->aimquiz)
! return false;
!
if (!math_assignment_setup_aim_quiz($math_assignment))
return false;
+
+ $math_assignment->timemodified = time();
return insert_record("math_assignment", $math_assignment);
}
***************
*** 58,61 ****
--- 66,71 ----
/// will update an existing instance with new data.
+ $math_assignment->id = $math_assignment->instance;
+
// due time
$math_assignment->timedue = make_timestamp($math_assignment->dueyear, $math_assignment->duemonth,$math_assignment->dueday, $math_assignment->duehour, $math_assignment->dueminute);
***************
*** 93,100 ****
}
! $math_assignment->timemodified = time();
! $math_assignment->id = $math_assignment->instance;
if (!math_assignment_setup_aim_quiz($math_assignment))
return false;
return update_record("math_assignment", $math_assignment);
}
--- 103,117 ----
}
! // check that the paper grade is valid
! if ($math_assignment->papergrade < 0)
! return false;
! // check we have some questions
! if (!$math_assignment->papergrade && !$math_assignment->aimquiz)
! return false;
!
if (!math_assignment_setup_aim_quiz($math_assignment))
return false;
+
+ $math_assignment->timemodified = time();
return update_record("math_assignment", $math_assignment);
}
***************
*** 255,259 ****
$proburl = htmlspecialchars($proburl);
$solurl = htmlspecialchars($solurl);
! if ($math_assignment->problems) {
if (isset($return))
$return .= "<br />\n";
--- 272,276 ----
$proburl = htmlspecialchars($proburl);
$solurl = htmlspecialchars($solurl);
! if ($proburl) {
if (isset($return))
$return .= "<br />\n";
***************
*** 266,270 ****
$return .= math_assignment_help_button("viewproblems", $strviewproblems, false);
}
! if (($math_assignment->solutions) and ($math_assignment->timedue < time())) {
if (isset($return))
$return .= "<br />\n";
--- 283,287 ----
$return .= math_assignment_help_button("viewproblems", $strviewproblems, false);
}
! if (($solurl) and ($math_assignment->timedue < time())) {
if (isset($return))
$return .= "<br />\n";
***************
*** 277,281 ****
$return .= math_assignment_help_button("viewsolutions", $strviewsolutions, false);
}
! else if(($math_assignment->solutions) && isteacher($math_assignment->course)) {
if (isset($return))
$return .= "<br />\n";
--- 294,298 ----
$return .= math_assignment_help_button("viewsolutions", $strviewsolutions, false);
}
! else if(($solurl) && isteacher($math_assignment->course)) {
if (isset($return))
$return .= "<br />\n";
|