]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-13046 Fixed notices. Merging from MOODLE_19_STABLE
authornicolasconnault <nicolasconnault>
Thu, 6 Mar 2008 09:42:33 +0000 (09:42 +0000)
committernicolasconnault <nicolasconnault>
Thu, 6 Mar 2008 09:42:33 +0000 (09:42 +0000)
mod/exercise/locallib.php
mod/workshop/locallib.php

index be2528977915ce5666025d6c490b2393ad5446dd..365ee1e634e9c801cb279159a8aa81c0a61d9463 100644 (file)
@@ -1569,7 +1569,7 @@ function exercise_print_assessment_form($exercise, $assessment = false, $allowch
         ?>
     <form id="assessmentform" method="post" action="assessments.php">
     <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
-    <input type="hidden" name="aid" value="<?php echo $assessment->id ?>" />
+    <input type="hidden" name="aid" value="<?php echo @$assessment->id ?>" />
     <input type="hidden" name="action" value="updateassessment" />
     <input type="hidden" name="resubmit" value="0" />
     <input type="hidden" name="returnto" value="<?php echo $returnto ?>" />
@@ -2004,7 +2004,7 @@ function exercise_print_assessment_form($exercise, $assessment = false, $allowch
     $timenow = time();
     
     // always show the teacher the grading grade if it's not their assessment!
-    if (isteacher($course->id) and ($assessment->userid != $USER->id) and $exercise->gradinggrade) {  
+    if ($assessment and isteacher($course->id) and ($assessment->userid != $USER->id) and $exercise->gradinggrade) {  
         echo "<tr><td align=\"right\"><b>".get_string("gradeforstudentsassessment", "exercise", $course->student).
             "</td><td>\n";
         echo number_format($exercise->gradinggrade * $assessment->gradinggrade / 100.0, 0);
index acc3c7cdab2a550e0c4493e8391c468de6823a4c..58b7d91a45531a0a72f48379f5f573103b0bbd49 100644 (file)
@@ -2053,7 +2053,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
     <form id="assessmentform" method="post" action="assessments.php">
     <div>
     <input type="hidden" name="id" value="<?php echo $cm->id ?>" />
-    <input type="hidden" name="aid" value="<?php echo $assessment->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 ?>" />
     <input type="hidden" name="elementno" value="" />
@@ -2069,11 +2069,11 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
     } else {
         print_string('assessment', 'workshop');
     }
-    echo '</b><br />'.userdate($assessment->timecreated)."</div></td>\n";
+    echo '</b><br />'.userdate(@$assessment->timecreated)."</div></td>\n";
     echo "</tr>\n";
     
     // only show the grade if grading strategy > 0 and the grade is positive
-    if ($showgrades and $workshop->gradingstrategy and $assessment->grade >= 0) { 
+    if ($assessment and $showgrades and $workshop->gradingstrategy and $assessment->grade >= 0) { 
         echo "<tr valign=\"top\">\n
             <td colspan=\"2\" align=\"center\">
             <b>".get_string("thegradeis", "workshop").": ".
@@ -2594,7 +2594,7 @@ function workshop_print_assessment($workshop, $assessment = false, $allowchanges
     
     $timenow = time();
     // now show the grading grade if available...
-    if ($assessment->timegraded) {
+    if ($assessment and $assessment->timegraded) {
         echo "<tr valign=\"top\">\n";
         echo "<td colspan=\"2\" class=\"workshopassessmentheading\" align=\"center\"><b>".
             get_string('gradeforstudentsassessment', 'workshop')."</b></td>\n";