Moodle

Weight doesn't disply decimals when editing a category in gradebook

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.9.5
  • Fix Version/s: 1.9.6
  • Component/s: Gradebook
  • Labels:
    None
  • Difficulty:
    Easy
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

When editing a category within gradebook the weight field doesn't display any decimal places.
It still saves any decimals you enter, if you switch to `full view` then you can see the full value (decimal places and all) that you entered. It simply does not display then on the edit screen.
I have attached a patch for category_form.php that I believe solves the problem however I wasn't able to produce the weight checkbox to ensure that this patch solved the bug nicely/entirely.

Activity

Hide
Petr Škoda (skodak) added a comment -

that setDefault was an old hack I guess, not needed anymore because we have following in category.php
} else if ($parent_category->aggregation == GRADE_AGGREGATE_SUM or $parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN2) { $category->grade_item_aggregationcoef = $category->grade_item_aggregationcoef == 0 ? 0 : 1; } else { $category->grade_item_aggregationcoef = format_float($category->grade_item_aggregationcoef, 4); }

Show
Petr Škoda (skodak) added a comment - that setDefault was an old hack I guess, not needed anymore because we have following in category.php } else if ($parent_category->aggregation == GRADE_AGGREGATE_SUM or $parent_category->aggregation == GRADE_AGGREGATE_WEIGHTED_MEAN2) { $category->grade_item_aggregationcoef = $category->grade_item_aggregationcoef == 0 ? 0 : 1; } else { $category->grade_item_aggregationcoef = format_float($category->grade_item_aggregationcoef, 4); }
Hide
Petr Škoda (skodak) added a comment -

fix committed, thanks a lot for the report and patch!!

Show
Petr Škoda (skodak) added a comment - fix committed, thanks a lot for the report and patch!!

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: