Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Addition of returnto parameter to workshop_print_assessment function to

allow return to original pages when making assessemnts; clearing
(trival) unassigned variable bug in the same function.
  • Loading branch information...
commit f05eaa902a92cc6bfd2387b61eee2dcb7ff5e1b8 1 parent 21c1d7d
rkingdon authored
Showing with 14 additions and 6 deletions.
  1. +10 −4 mod/workshop/assessments.php
  2. +4 −2 mod/workshop/lib.php
View
14 mod/workshop/assessments.php
@@ -223,6 +223,7 @@
$assessment->grade = -1; // set impossible grade
$assessment->timecreated = $yearfromnow;
$assessment->timegraded = 0;
+ $assessment->timeagreed = 0;
if (!$assessment->id = insert_record("workshop_assessments", $assessment)) {
error("Could not insert workshop assessment!");
}
@@ -231,7 +232,7 @@
print_heading_with_help(get_string("assessthissubmission", "workshop"), "grading", "workshop");
// show assessment and allow changes
- workshop_print_assessment($workshop, $assessment, true, $allowcomments);
+ workshop_print_assessment($workshop, $assessment, true, $allowcomments, $_SERVER["HTTP_REFERER"]);
}
@@ -875,14 +876,19 @@
}
add_to_log($course->id, "workshop", "assess", "view.php?a=$workshop->id", "$workshop->id");
-
+
+ // set up return address
+ if (!$returnto = $form->returnto) {
+ $returnto = "view.php?id=$cm->id";
+ }
+
// show grade if grading strategy is not zero
if ($workshop->gradingstrategy) {
- redirect("view.php?id=$cm->id", get_string("thegradeis", "workshop").": ".number_format($grade, 2)."% (".get_string("maximumgrade").
+ redirect($returnto, get_string("thegradeis", "workshop").": ".number_format($grade, 2)."% (".get_string("maximumgrade").
" ".number_format($workshop->grade)."%)");
}
else {
- redirect("view.php?id=$cm->id");
+ redirect($returnto);
}
}
View
6 mod/workshop/lib.php
@@ -707,7 +707,7 @@ function workshop_list_ungraded_assessments($workshop, $stype) {
function workshop_list_user_submissions($workshop, $user) {
-function workshop_print_assessment($workshop, $assessment, $allowchanges, $showcommentlinks)
+function workshop_print_assessment($workshop, $assessment, $allowchanges, $showcommentlinks, $returnto)
function workshop_print_assessments_by_user_for_admin($workshop, $user) {
function workshop_print_assessments_for_admin($workshop, $submission) {
function workshop_print_assignment_info($cm, $workshop) {
@@ -2030,8 +2030,9 @@ function workshop_list_user_submissions($workshop, $user) {
function workshop_print_assessment($workshop, $assessment = false, $allowchanges = false,
- $showcommentlinks = false) {
+ $showcommentlinks = false, $returnto = '') {
// $allowchanges added 14/7/03
+ // $returnto added 28/8/03
global $CFG, $THEME, $USER, $WORKSHOP_SCALES, $WORKSHOP_EWEIGHTS;
if (! $course = get_record("course", "id", $workshop->course)) {
error("Course is misconfigured");
@@ -2131,6 +2132,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
<INPUT TYPE="hidden" NAME="id" VALUE="<?PHP echo $cm->id ?>">
<input type="hidden" name="aid" value="<?PHP echo $assessment->id ?>">
<input type="hidden" name="action" value="updateassessment">
+ <input type="hidden" name="returnto" value="<?PHP echo $returnto ?>">
<CENTER>
<TABLE CELLPADDING=2 BORDER=1>
<?PHP
Please sign in to comment.
Something went wrong with that request. Please try again.