Ignore:
Timestamp:
May 2, 2016, 12:09:23 PM (3 years ago)
Author:
jrpelegrina
Message:

Updated to moodle 3.0.3

File:
1 edited

Legend:

Unmodified
Added
Removed
  • moodle/trunk/fuentes/grade/edit/tree/category.php

    r136 r1331  
    8787        $category->grade_item_aggregationcoef = format_float($category->grade_item_aggregationcoef, 4);
    8888    }
    89 
    90     if ($category->aggregation == GRADE_AGGREGATE_SUM) {
    91         // Input fields for grademin and grademax are disabled for the "Natural" category,
    92         // this means they will be ignored if user does not change aggregation method.
    93         // But if user does change aggregation method the default values should be used.
    94         $category->grademax = 100;
    95         $category->grade_item_grademax = 100;
    96         $category->grademin = 0;
    97         $category->grade_item_grademin = 0;
     89    // Check to see if the gradebook is frozen. This allows grades to not be altered at all until a user verifies that they
     90    // wish to update the grades.
     91    $gradebookcalculationsfreeze = get_config('core', 'gradebook_calculations_freeze_' . $courseid);
     92    // Stick with the original code if the grade book is frozen.
     93    if ($gradebookcalculationsfreeze && (int)$gradebookcalculationsfreeze <= 20150627) {
     94        if ($category->aggregation == GRADE_AGGREGATE_SUM) {
     95            // Input fields for grademin and grademax are disabled for the "Natural" category,
     96            // this means they will be ignored if user does not change aggregation method.
     97            // But if user does change aggregation method the default values should be used.
     98            $category->grademax = 100;
     99            $category->grade_item_grademax = 100;
     100            $category->grademin = 0;
     101            $category->grade_item_grademin = 0;
     102        }
     103    } else {
     104        if ($category->aggregation == GRADE_AGGREGATE_SUM && !$grade_item->is_calculated()) {
     105            // Input fields for grademin and grademax are disabled for the "Natural" category,
     106            // this means they will be ignored if user does not change aggregation method.
     107            // But if user does change aggregation method the default values should be used.
     108            // This does not apply to calculated category totals.
     109            $category->grademax = 100;
     110            $category->grade_item_grademax = 100;
     111            $category->grademin = 0;
     112            $category->grade_item_grademin = 0;
     113        }
    98114    }
    99115
Note: See TracChangeset for help on using the changeset viewer.