quiz editing: MDL-15903 fix the code that updates $quiz->sumgrades,

so we only update the database when something changes, not on every page view.
This commit is contained in:
tjhunt
2008-12-05 05:08:37 +00:00
parent ab652c35ee
commit 4e6f553d43
3 changed files with 35 additions and 29 deletions
+2 -3
View File
@@ -1515,14 +1515,13 @@ function quiz_print_grading_form($quiz, $pageurl, $tabindex){
* Print the status bar
*
* @param object $quiz The quiz object of the quiz in question
* @param integer $sumgrades The sum of the grades of the quiz to display
*/
function quiz_print_status_bar($quiz,$sumgrades){
function quiz_print_status_bar($quiz){
global $CFG;
$numberofquestions=quiz_number_of_questions_in_quiz($quiz->questions);
?><div class="statusdisplay"><span class="totalpoints">
<?php echo get_string("totalpointsx","quiz",$sumgrades) ?></span>
<?php echo get_string('totalpointsx', 'quiz', quiz_format_grade($quiz, $quiz->sumgrades)) ?></span>
| <span class="numberofquestions">
<?php
echo get_string("numquestionsx","quiz",$numberofquestions);