Moodle
  1. Moodle
  2. MDL-21218

Hidden activity in Gradebook causes course grade to disappear from student Overview Report

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.9
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      26645

      Description

      If any activity is hidden from within the gradebook, the course total will not appear in the overview report for the student.

      Admins can see the course totals correctly in the Overview report. When logged in as a student, the overview report only displays grades for courses which contain no hidden activities. Courses which contain hidden activities have a - dash where the course total should be.

      The dash was replicated on Moodlerooms servers as well as on the 1.9.7 Moodle4Mac install. On demo.moodle.org, a 0 appeared instead of a dash.

      When the student goes to their user report, their course total displays as it should.

      To replicate:
      1. Assign a few grades to a student.
      2. Hide one of the activities from within the gradebook.
      3. Login as the student and view the overview report.

        Issue Links

          Activity

          Hide
          Martin Dougiamas added a comment -

          Allisun, the problem with this (I'm sure there's a number of bugs filed on it) is what to show ... a hyphen is probably the best thing.

          However, whatever we use should definitely be ALWAYS the same on the overview report as on the student user report, so that could be a bug here.

          Andrew, one for you!

          Can you replicate the issue in latest 1.9 and HEAD?

          Show
          Martin Dougiamas added a comment - Allisun, the problem with this (I'm sure there's a number of bugs filed on it) is what to show ... a hyphen is probably the best thing. However, whatever we use should definitely be ALWAYS the same on the overview report as on the student user report, so that could be a bug here. Andrew, one for you! Can you replicate the issue in latest 1.9 and HEAD?
          Hide
          Andrew Davis added a comment -

          This will be fixed more comprehensibly as part of MDL-19704

          Show
          Andrew Davis added a comment - This will be fixed more comprehensibly as part of MDL-19704
          Hide
          Andrew Davis added a comment -

          I'm waiting on a review of patches for MDL-19704 fixing a related issue. I had intended to fix this issue and MDL-19704 at once but that will make the patches more complex than they need to be.

          If the course contains one or more hidden items, currently, if you are a student the user report always shows the course total and the overview report never shows the course total.

          I think we should use a new setting on both the user and overview reports to choose what to do when there are hidden items. Either hide the course total or output a course total minus marks from the hidden items. We shouldn't just be outputting the course total including the points contributed by hidden items as that potentially allows students to infer their score on a hidden item.

          Show
          Andrew Davis added a comment - I'm waiting on a review of patches for MDL-19704 fixing a related issue. I had intended to fix this issue and MDL-19704 at once but that will make the patches more complex than they need to be. If the course contains one or more hidden items, currently, if you are a student the user report always shows the course total and the overview report never shows the course total. I think we should use a new setting on both the user and overview reports to choose what to do when there are hidden items. Either hide the course total or output a course total minus marks from the hidden items. We shouldn't just be outputting the course total including the points contributed by hidden items as that potentially allows students to infer their score on a hidden item.
          Hide
          Andrew Davis added a comment -

          Attached is a patch that allows you to alter how category/course totals are handled when they contain one or more hidden items.

          The patch adds a new setting to the user and overview report. There are two options:
          1) hide the category/course total if it contains a hidden item.
          2) show the category/course total minus marks contributed by hidden items.

          Seems to be working pretty well.

          This patch is for 1.9. The area I've been working in has warnings around it like "This is a really ugly hack, it will be fixed in 2.0" This leads me to believe that adding this functionality to 2 will be more of a reimplementation than a merge.

          I have one bug yet to iron out. If you set the reports to show totals minus hidden items, hide a subcategory then show an item within that category and view the user report as a student the item is included in the category total calculation but won't be visible on the report.

          For example is you have one item not in a subcategory that the student got 80% for and another in a subcategory for which the student got 40%. Hide the category then show the subcategory item. The subcategory item will be invisible on the user report but the course total will be 60% indicating the shown yet hidden item is being included.

          Show
          Andrew Davis added a comment - Attached is a patch that allows you to alter how category/course totals are handled when they contain one or more hidden items. The patch adds a new setting to the user and overview report. There are two options: 1) hide the category/course total if it contains a hidden item. 2) show the category/course total minus marks contributed by hidden items. Seems to be working pretty well. This patch is for 1.9. The area I've been working in has warnings around it like "This is a really ugly hack, it will be fixed in 2.0" This leads me to believe that adding this functionality to 2 will be more of a reimplementation than a merge. I have one bug yet to iron out. If you set the reports to show totals minus hidden items, hide a subcategory then show an item within that category and view the user report as a student the item is included in the category total calculation but won't be visible on the report. For example is you have one item not in a subcategory that the student got 80% for and another in a subcategory for which the student got 40%. Hide the category then show the subcategory item. The subcategory item will be invisible on the user report but the course total will be 60% indicating the shown yet hidden item is being included.
          Hide
          Andrew Davis added a comment - - edited

          After discussion with Martin I've opened a new issue (MDL-21367) to deal with the bug in the show/hide logic.

          I'll get the patch reviewed before committing.

          Show
          Andrew Davis added a comment - - edited After discussion with Martin I've opened a new issue ( MDL-21367 ) to deal with the bug in the show/hide logic. I'll get the patch reviewed before committing.
          Hide
          Petr Škoda added a comment -

          I think adding more complexity to hiding wrong way
          1/ imho we should add new category flag in grade category table
          2/ the hacky recalculation of student grades (affected by hiding) has to go

          I personally think that any change in 1.9.x would make things only worse, definitely nothing should be changed in 1.9.x before we decide how to actually fix things in 2.0

          Pretty please could we solve all hiding issues in HEAD first?

          Show
          Petr Škoda added a comment - I think adding more complexity to hiding wrong way 1/ imho we should add new category flag in grade category table 2/ the hacky recalculation of student grades (affected by hiding) has to go I personally think that any change in 1.9.x would make things only worse, definitely nothing should be changed in 1.9.x before we decide how to actually fix things in 2.0 Pretty please could we solve all hiding issues in HEAD first?
          Hide
          Andrew Davis added a comment - - edited

          re Petr's comments:
          1) what would the new category flag in the grade category table do?
          2) the hacky recalculation of grades affected by hiding was already there. I just shifted it to an area where it could be reused and made it work.

          Implementing fixes for this in 1.9 and 2 are pretty much independent tasks as the code base has diverged so widely. I can start in trunk in future if that is preferable

          Show
          Andrew Davis added a comment - - edited re Petr's comments: 1) what would the new category flag in the grade category table do? 2) the hacky recalculation of grades affected by hiding was already there. I just shifted it to an area where it could be reused and made it work. Implementing fixes for this in 1.9 and 2 are pretty much independent tasks as the code base has diverged so widely. I can start in trunk in future if that is preferable
          Hide
          Petr Škoda added a comment -

          1/ the new flag would indicate hiding of category separately from it's grade item
          2/ I already proposed to replace the hidden until by kinf of buffer sitting between the activity and gradebook, the grades would be in raw state waiting till somebody or something says they may enter the gradebook, it would miraculously solve many issues ppl have with hiding+quiz

          Show
          Petr Škoda added a comment - 1/ the new flag would indicate hiding of category separately from it's grade item 2/ I already proposed to replace the hidden until by kinf of buffer sitting between the activity and gradebook, the grades would be in raw state waiting till somebody or something says they may enter the gradebook, it would miraculously solve many issues ppl have with hiding+quiz
          Hide
          Andrew Davis added a comment - - edited

          I'll look into how this will be implemented in 2 then we can decide what is to be done in 1.9. (havent done this yet)

          One simple option is to have 1.9 always hide totals dependent on hidden items. Then in 2 once we've got hiding/showing working more logically (MDL-21367) we can add the optional ability to show totals recalculated to exclude hidden items.

          The current situation in 1.9, where totals are shown including hidden items allowing students to infer what they got for hidden items, is definitely the worst possible way it could work.

          Show
          Andrew Davis added a comment - - edited I'll look into how this will be implemented in 2 then we can decide what is to be done in 1.9. (havent done this yet) One simple option is to have 1.9 always hide totals dependent on hidden items. Then in 2 once we've got hiding/showing working more logically ( MDL-21367 ) we can add the optional ability to show totals recalculated to exclude hidden items. The current situation in 1.9, where totals are shown including hidden items allowing students to infer what they got for hidden items, is definitely the worst possible way it could work.
          Hide
          Martin Dougiamas added a comment -

          OK, the recent comments have got a bit off track from the bug here, which is about what should be shown for the course total when it involves hidden items.

          This definitely needs a setting for the user and overview reports, because people want different things:

          1. Hide any totals that are dependent on a hidden item (show a hyphen there) [DEFAULT]
          2. Display totals excluding the hidden items
          3. Display full totals including the hidden items (even though it may allow students to back-calculate hidden grades)

          So I am sure we should add this setting to 1.9.8 and 2.0 to clean up the buggy behaviour we currently have.

          (Regarding the whole picture, it's being documented here: http://docs.moodle.org/en/Development:Grades#Hidden_grades_and_categories
          The hidden flag on the category table is implemented in 2.0 already MDL-19704. It makes the hiding of the category independent of the hiding of the course total. Hiding the category still hides all the items in it (as always). However, with MDL-21367 the category is always unhidden if any of the items are unhidden. This should keep everything consistent and efficient, and WYSIWYG WRT calculations)

          Show
          Martin Dougiamas added a comment - OK, the recent comments have got a bit off track from the bug here, which is about what should be shown for the course total when it involves hidden items. This definitely needs a setting for the user and overview reports, because people want different things: 1. Hide any totals that are dependent on a hidden item (show a hyphen there) [DEFAULT] 2. Display totals excluding the hidden items 3. Display full totals including the hidden items (even though it may allow students to back-calculate hidden grades) So I am sure we should add this setting to 1.9.8 and 2.0 to clean up the buggy behaviour we currently have. (Regarding the whole picture, it's being documented here: http://docs.moodle.org/en/Development:Grades#Hidden_grades_and_categories The hidden flag on the category table is implemented in 2.0 already MDL-19704 . It makes the hiding of the category independent of the hiding of the course total. Hiding the category still hides all the items in it (as always). However, with MDL-21367 the category is always unhidden if any of the items are unhidden. This should keep everything consistent and efficient, and WYSIWYG WRT calculations)
          Hide
          Andrew Davis added a comment -

          Setting fix version to 1.9.8

          This is committed into the 1.9 branch. Will commit into trunk once Netbeans starts behaving itself.

          Show
          Andrew Davis added a comment - Setting fix version to 1.9.8 This is committed into the 1.9 branch. Will commit into trunk once Netbeans starts behaving itself.
          Hide
          Andrew Davis added a comment -

          Committed to trunk.

          Show
          Andrew Davis added a comment - Committed to trunk.
          Hide
          Michael Woods added a comment -

          Hi,

          I've been testing this change in 1.9.8 (build 20100326) and I believe a bug exists where the global default for 'Hide totals if contain hidden items' setting is not respected for the Overview Report.

          Steps to reproduce:
          1. Site Admin -> Grades -> Report settings -> Overview report -> Hide totals if contain hidden items -> "Show totals excluding hidden items"
          2. In a course, set up at least 2 graded activities, but hide the grade of one of them.
          3. Log in as a student and view the 'User Report' and the 'Overview Report'. The 'User Report' displays the correct total course grade (it excludes the hidden item's grade value) but the 'Overview Report' displays an incorrect total course grade (it INCLUDES the hidden item's grade value).
          4. Current workaround: In the course (as an admin/teacher), go to Grades -> Settings and change 'Hide totals if contain hidden items' from 'Default (Show totals excluding hidden items)' to 'Show totals excluding hidden items'. The correct course total is then shown to the student in the overview report.

          Basically, the setting is respected if explicitly set at a course level, but not when inherited from the global default settings. Can this be reviewed please?

          Thanks
          Michael

          Show
          Michael Woods added a comment - Hi, I've been testing this change in 1.9.8 (build 20100326) and I believe a bug exists where the global default for 'Hide totals if contain hidden items' setting is not respected for the Overview Report. Steps to reproduce: 1. Site Admin -> Grades -> Report settings -> Overview report -> Hide totals if contain hidden items -> "Show totals excluding hidden items" 2. In a course, set up at least 2 graded activities, but hide the grade of one of them. 3. Log in as a student and view the 'User Report' and the 'Overview Report'. The 'User Report' displays the correct total course grade (it excludes the hidden item's grade value) but the 'Overview Report' displays an incorrect total course grade (it INCLUDES the hidden item's grade value). 4. Current workaround: In the course (as an admin/teacher), go to Grades -> Settings and change 'Hide totals if contain hidden items' from 'Default (Show totals excluding hidden items)' to 'Show totals excluding hidden items'. The correct course total is then shown to the student in the overview report. Basically, the setting is respected if explicitly set at a course level, but not when inherited from the global default settings. Can this be reviewed please? Thanks Michael
          Hide
          Helen Foster added a comment -

          Michael, thanks for your comments. Reopening for review, as suggested.

          Show
          Helen Foster added a comment - Michael, thanks for your comments. Reopening for review, as suggested.
          Hide
          David Mudrak added a comment - - edited

          Please note the referenced help file lang/en_utf8/help/grade/hidetotalifhiddenitems.html is missing. this is my suggestion (to be reworded by Helen, thanks):

          <h1>Hide totals if contain hidden items?</h1>
          <p>How to display total grade if it aggregates one or more hidden items:</p>
          <ul>
              <li><strong>Hide</strong> - hide total grades, too</li>
              <li><strong>Show totals excluding hidden items</strong> - display total grade as it would be if hidden grades are ignored</li>
              <li><strong>Show totals including hidden items</strong> - display total grade calculated from hidden grades, too (beware - students may guess the value of hidden grade items)</li>
          </ul>
          
          
          Show
          David Mudrak added a comment - - edited Please note the referenced help file lang/en_utf8/help/grade/hidetotalifhiddenitems.html is missing. this is my suggestion (to be reworded by Helen, thanks): <h1>Hide totals if contain hidden items?</h1> <p>How to display total grade if it aggregates one or more hidden items:</p> <ul> <li><strong>Hide</strong> - hide total grades, too</li> <li><strong>Show totals excluding hidden items</strong> - display total grade as it would be if hidden grades are ignored</li> <li><strong>Show totals including hidden items</strong> - display total grade calculated from hidden grades, too (beware - students may guess the value of hidden grade items)</li> </ul>
          Hide
          Helen Foster added a comment -

          Suggested lang string rewording:

          $string['hidetotalifhiddenitems'] = 'Hide totals if they contain hidden items';

          Suggested help file wording:

          <h1>Hide totals if they contain hidden items</h1>
          <p>This setting specifies whether totals which contain hidden grade items are shown to students or replaced with a hyphen . If shown, the total may be calculated either excluding or including hidden items.</p>
          <p>If hidden items are excluded, the total will be different to the total seen by the teacher, since the teacher always sees totals calculated from all items, hidden or unhidden.</p>
          <p>If hidden items are included, students may be able to calculate the hidden items.</p>

          Show
          Helen Foster added a comment - Suggested lang string rewording: $string ['hidetotalifhiddenitems'] = 'Hide totals if they contain hidden items'; Suggested help file wording: <h1>Hide totals if they contain hidden items</h1> <p>This setting specifies whether totals which contain hidden grade items are shown to students or replaced with a hyphen . If shown, the total may be calculated either excluding or including hidden items.</p> <p>If hidden items are excluded, the total will be different to the total seen by the teacher, since the teacher always sees totals calculated from all items, hidden or unhidden.</p> <p>If hidden items are included, students may be able to calculate the hidden items.</p>
          Hide
          Helen Foster added a comment - - edited

          Another suggested lang string rewording:

          $string['hidetotalifhiddenitemsdescription'] = 'Whether totals which contain hidden grade items are shown to students (calculated either excluding or including hidden items) or replaced with a hyphen.';

          (Amended as suggested by David.)

          Show
          Helen Foster added a comment - - edited Another suggested lang string rewording: $string ['hidetotalifhiddenitemsdescription'] = 'Whether totals which contain hidden grade items are shown to students (calculated either excluding or including hidden items) or replaced with a hyphen.'; (Amended as suggested by David.)
          Hide
          Helen Foster added a comment -

          Lang string amendments and help file committed to cvs as recommended by David.

          This issue just requires reviewing now, as suggested by Michael. Hopefully when Andrew returns from his honeymoon he'll have chance to do so.

          Show
          Helen Foster added a comment - Lang string amendments and help file committed to cvs as recommended by David. This issue just requires reviewing now, as suggested by Michael. Hopefully when Andrew returns from his honeymoon he'll have chance to do so.
          Hide
          Elena Ivanova added a comment -

          I was able to replicate the issue Michael mentioned.

          And I have a suggestion for the help file: "the total will be different to the total seen by the teacher, since the teacher always sees totals calculated from all items, hidden or unhidden."

          It is true for the Grader report only. So if a teacher looks at Grader, he will see different total, but if he will look on the User report for some student, then he will see the same grade as student does (which is great)
          May be we can add that tip to the help file?

          Show
          Elena Ivanova added a comment - I was able to replicate the issue Michael mentioned. And I have a suggestion for the help file: "the total will be different to the total seen by the teacher, since the teacher always sees totals calculated from all items, hidden or unhidden." It is true for the Grader report only. So if a teacher looks at Grader, he will see different total, but if he will look on the User report for some student, then he will see the same grade as student does (which is great) May be we can add that tip to the help file?
          Hide
          Andrew Davis added a comment -

          I've committed a fix for the problem Michael spotted in both the 1.9 and 2.0 branches. Thanks for the report

          Show
          Andrew Davis added a comment - I've committed a fix for the problem Michael spotted in both the 1.9 and 2.0 branches. Thanks for the report
          Hide
          Michael Woods added a comment -

          I tested the code change and it appears to work fine now.

          Cheers.

          Show
          Michael Woods added a comment - I tested the code change and it appears to work fine now. Cheers.
          Hide
          Helen Foster added a comment -

          Elena, thanks for your help file suggestion which I have followed.

          Andrew, thanks for the fix and Michael, thanks for testing.

          Show
          Helen Foster added a comment - Elena, thanks for your help file suggestion which I have followed. Andrew, thanks for the fix and Michael, thanks for testing.
          Hide
          Elena Ivanova added a comment -

          I am not sure where to Comment, so please let me know if another ticket would be more appropriate.
          I am looking at 1.9.8 and the new setting "Hide totals if they contain hidden items"

          Set up a Category. Hide one of the items. Go to Settings and review.
          If you set it to "Hide totals if they contain hidden items" to:
          1) Hide - Students see dashes in Category Total fro: Grade, Percentage and Rank.
          BUT they still see the Range. Thus they can still figure out that there is something hidden and out of how many points.

          2) Show Excluding hidden item - Students now see everything for Total: Grade, Percentage, Rank, Range.
          Showing Grade is fine here.
          But Percentage, Rank and Range - tip them about hidden items, so it defeats the purpose of the control.

          3) Show Including hidden items - Shows everything, but that's OK behavior

          Basically, I think that with:
          Hide - students should see the dash for the Range in Cat. Total.
          Show Excluding hidden items - students should see dashes for Percentage, Rank and Range in Cat. Total.

          One way to avoid this "tipping of", is to hide Percentage and Rank columns altogether for the User Report in Settings.
          But one still cannot hide the Range column at all: MDL-20617

          Thank you for looking

          Show
          Elena Ivanova added a comment - I am not sure where to Comment, so please let me know if another ticket would be more appropriate. I am looking at 1.9.8 and the new setting "Hide totals if they contain hidden items" Set up a Category. Hide one of the items. Go to Settings and review. If you set it to "Hide totals if they contain hidden items" to: 1) Hide - Students see dashes in Category Total fro: Grade, Percentage and Rank. BUT they still see the Range. Thus they can still figure out that there is something hidden and out of how many points. 2) Show Excluding hidden item - Students now see everything for Total: Grade, Percentage, Rank, Range. Showing Grade is fine here. But Percentage, Rank and Range - tip them about hidden items, so it defeats the purpose of the control. 3) Show Including hidden items - Shows everything, but that's OK behavior Basically, I think that with: Hide - students should see the dash for the Range in Cat. Total. Show Excluding hidden items - students should see dashes for Percentage, Rank and Range in Cat. Total. One way to avoid this "tipping of", is to hide Percentage and Rank columns altogether for the User Report in Settings. But one still cannot hide the Range column at all: MDL-20617 Thank you for looking
          Hide
          Andrew Davis added a comment -

          I don't think we'd want to automatically hide the range column. Some will want it hidden and some won't. MDL-20617 sounds like the way to go so people can decide for themselves.

          Show
          Andrew Davis added a comment - I don't think we'd want to automatically hide the range column. Some will want it hidden and some won't. MDL-20617 sounds like the way to go so people can decide for themselves.
          Hide
          Elena Ivanova added a comment -

          yep, I agree that we do not want to hide the columns, but I think we still need to show dashes in those columns in thefirst two cases, otherwise students still can figure out everything

          Show
          Elena Ivanova added a comment - yep, I agree that we do not want to hide the columns, but I think we still need to show dashes in those columns in thefirst two cases, otherwise students still can figure out everything
          Hide
          Howard Miller added a comment -

          I just got tripped up badly by this new setting in a client's site.

          My big complaint was that this - which is a new feature, surely, not a bug fix - was not included in the release notes. This change dramatically affected the display of grades for sites using hidden activities. Grrrr etc.

          Show
          Howard Miller added a comment - I just got tripped up badly by this new setting in a client's site. My big complaint was that this - which is a new feature, surely, not a bug fix - was not included in the release notes. This change dramatically affected the display of grades for sites using hidden activities. Grrrr etc.
          Hide
          Helen Foster added a comment -

          Howard, thanks for your comment. I've just added a note about this new feature to http://docs.moodle.org/en/Moodle_1.9.9_release_notes

          Show
          Helen Foster added a comment - Howard, thanks for your comment. I've just added a note about this new feature to http://docs.moodle.org/en/Moodle_1.9.9_release_notes

            People

            • Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: