]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-17198 - show better confirmation of choice selection.
authordanmarsden <danmarsden>
Mon, 9 Feb 2009 09:51:06 +0000 (09:51 +0000)
committerdanmarsden <danmarsden>
Mon, 9 Feb 2009 09:51:06 +0000 (09:51 +0000)
mod/choice/view.php

index 6b00ca350468781ed4e4bde85411268d9688aced..3c8b4decf188486a6eb4aa4da687908e8cd1bc79 100644 (file)
         }
     }
 
-/// Submit any new data if there is any
+    $navigation = build_navigation('', $cm);
+    print_header_simple(format_string($choice->name), "", $navigation, "", "", true,
+                  update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm));
 
+/// Submit any new data if there is any
     if ($form = data_submitted() && has_capability('mod/choice:choose', $context)) {
         $timenow = time();
         if (has_capability('mod/choice:deleteresponses', $context)) {
         } else {
             choice_user_submit_response($answer, $choice, $USER->id, $course->id, $cm);
         }
-        redirect("view.php?id=$cm->id");
-        exit;
+        notify(get_string('choicesaved', 'choice'),'notifysuccess');
     }
 
 
 /// Display the choice and possibly results
-    $navigation = build_navigation('', $cm);
-    print_header_simple(format_string($choice->name), "", $navigation, "", "", true,
-                  update_module_button($cm->id, $course->id, $strchoice), navmenu($course, $cm));
-
     add_to_log($course->id, "choice", "view", "view.php?id=$cm->id", $choice->id, $cm->id);
 
     /// Check to see if groups are being used in this choice