Moodle

Scale-based assignment with no grades adds 100 points in Grade Book

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.8.4
  • Fix Version/s: None
  • Component/s: Assignment (2.2)
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE

Description

Steps to reproduce
============

1. create new assignment
2. set a scale as a grading method
3. do not grade any submission!
4. go to the grade book and see the assignment grades

What I expected
==========
The name of the scale should be displayed in the grade book.

What actually happened
===============
The assignment is considered as one with maximum grade "100" points. This leads to wrong final grade calculation because students never receive points in this assignment. That's why I set this as critical issue.

Activity

Hide
David Mudrak added a comment -

The patch attached fixes the issue.

Problem analysis
===========

mod/assignment/lib.php should return a scale name as a maxgrade for scale based assignments. If there are no grades yet, lib.php returns just empty string (that's the bug) and grade book replaces this by "100" (maybe some default value?)

The patch fixes assignment/lib.php so it returns the name of the scale in $return->maxgrade also in case there are no grades yet (as it should always do).

Show
David Mudrak added a comment - The patch attached fixes the issue. Problem analysis =========== mod/assignment/lib.php should return a scale name as a maxgrade for scale based assignments. If there are no grades yet, lib.php returns just empty string (that's the bug) and grade book replaces this by "100" (maybe some default value?) The patch fixes assignment/lib.php so it returns the name of the scale in $return->maxgrade also in case there are no grades yet (as it should always do).
Hide
David Mudrak added a comment -

See grade/lib.php at line 3148:

if ($grades["$mod->cname"]["$mod->modid"]["$mod->cminstance"]->maxgrade == '')
{
$grades["$mod->cname"]["$mod->modid"]["$mod->cminstance"]->maxgrade = 100;
}

This is probably the place where 100 points are assigned to an assignment with empty maxgrade.

Show
David Mudrak added a comment - See grade/lib.php at line 3148: if ($grades["$mod->cname"]["$mod->modid"]["$mod->cminstance"]->maxgrade == '') { $grades["$mod->cname"]["$mod->modid"]["$mod->cminstance"]->maxgrade = 100; } This is probably the place where 100 points are assigned to an assignment with empty maxgrade.
Hide
Petr Škoda (skodak) added a comment -

Anthony if you find some time, please review the patch, thanks

Show
Petr Škoda (skodak) added a comment - Anthony if you find some time, please review the patch, thanks
Hide
Anthony Borrow added a comment -

Mathieu - Sorry for passing the buck. Petr assigned this me I suspect because he read it as being a gradebook issue; however, since the patch actually fixes code in the assignment module and you seem to be the last one to have touched /mod/assignment/lib.php for the 18STABLE branch, I am going to assign this to you. The general theory seems to make sense to me but I am less familiar with how the assignment module handles scales so I just don't know what the implications would be for the assignment module but I think you could make a better determination about that than I could. Peace - Anthony

Show
Anthony Borrow added a comment - Mathieu - Sorry for passing the buck. Petr assigned this me I suspect because he read it as being a gradebook issue; however, since the patch actually fixes code in the assignment module and you seem to be the last one to have touched /mod/assignment/lib.php for the 18STABLE branch, I am going to assign this to you. The general theory seems to make sense to me but I am less familiar with how the assignment module handles scales so I just don't know what the implications would be for the assignment module but I think you could make a better determination about that than I could. Peace - Anthony
Hide
Anthony Borrow added a comment -

p.s. - feel free to assign this back to Petr but it is more of an assignment module issue than a gradebook issue - at least that is how I read it

Show
Anthony Borrow added a comment - p.s. - feel free to assign this back to Petr but it is more of an assignment module issue than a gradebook issue - at least that is how I read it
Hide
Helen Foster added a comment -

Reassigning to the assignment component lead.

Show
Helen Foster added a comment - Reassigning to the assignment component lead.
Hide
Robert Squires added a comment -

Hi Helen/ component lead,

I wonder if there has been any development on this. It's a bug that several of our faculty have noted.

Thanks,

Robert

Show
Robert Squires added a comment - Hi Helen/ component lead, I wonder if there has been any development on this. It's a bug that several of our faculty have noted. Thanks, Robert

People

Dates

  • Created:
    Updated: