Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-15457

Hidden activity and gradebook item

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.9.1
    • Fix Version/s: 2.0
    • Component/s: Gradebook
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      Step to reproduce:
      1. Add hidden activity test1.
      2. Visit Grader report.
      Expected result: hidden gradebook item test1 (may be gradebook must not have such item).

      At this moment I must go into gradebook and manually hide such item. Another unnecessary and strange step.

      Another problem: I hide activity. But gradebook item doesn't been hidding. Why? I don't understand logics in those cases.

      I see mdl-8850 and mdl-12270. I can understand logic why hidding gradebook item not hide course element. But can't understand logic in opposite case.

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            argentum Vlas Voloshin added a comment -

            Patch attached fixes this. Now when showing or hiding activity, set_coursemodule_visible function will show/hide corresponding grade item as well.
            Patch is applied with -p0 key.
            If there's a necessity to "lock" grade item from being shown by this functionality (for example: you have some grade items, which you want to be hidden all the time, but you also want to show/hide corresponding activities as it's necessary), you may move those grade items to some hidden category, and they will not be shown ever - but at first you should apply my MDL-17245 patch to gradebook.

            Show
            argentum Vlas Voloshin added a comment - Patch attached fixes this. Now when showing or hiding activity, set_coursemodule_visible function will show/hide corresponding grade item as well. Patch is applied with -p0 key. If there's a necessity to "lock" grade item from being shown by this functionality (for example: you have some grade items, which you want to be hidden all the time, but you also want to show/hide corresponding activities as it's necessary), you may move those grade items to some hidden category, and they will not be shown ever - but at first you should apply my MDL-17245 patch to gradebook.
            Hide
            skodak Petr Skoda added a comment -

            Resolving as duplicate, thanks for the report

            Show
            skodak Petr Skoda added a comment - Resolving as duplicate, thanks for the report
            Hide
            tsala Helen Foster added a comment -

            Linked issue MDL-19133 changed from duplicate to dependency. Reopening, as MDL-19133 is not yet fixed. When it is, this issue can be closed too.

            Watchers, thanks for your interest.

            Show
            tsala Helen Foster added a comment - Linked issue MDL-19133 changed from duplicate to dependency. Reopening, as MDL-19133 is not yet fixed. When it is, this issue can be closed too. Watchers, thanks for your interest.
            Hide
            andyjdavis Andrew Davis added a comment - - edited

            Committed and resolved. Now when you hide an activity within the grade book it only affects the gradebook (grader report, user report and overview report). However, if you hide an activity while viewing the course its hidden from students in the course view and also the gradebook. Presumably if you don't want an activity visible to students within the course you don't want it visible anywhere.

            If you want an activity hidden in the course but visible to students in the gradebook (for some reason) you can hide it in the course then go and unhide it in the gradebook.

            Show
            andyjdavis Andrew Davis added a comment - - edited Committed and resolved. Now when you hide an activity within the grade book it only affects the gradebook (grader report, user report and overview report). However, if you hide an activity while viewing the course its hidden from students in the course view and also the gradebook. Presumably if you don't want an activity visible to students within the course you don't want it visible anywhere. If you want an activity hidden in the course but visible to students in the gradebook (for some reason) you can hide it in the course then go and unhide it in the gradebook.
            Hide
            andyjdavis Andrew Davis added a comment -

            Somehow forgot to actually commit the changes. Code now committed.

            Show
            andyjdavis Andrew Davis added a comment - Somehow forgot to actually commit the changes. Code now committed.
            Hide
            mudrd8mz David Mudrak added a comment -

            Re-opening. This leads to a critical regression in MDL-24096. There may be more than one grade_item per activity module and the introduced call

            $grade_item = grade_item::fetch(array('itemtype'=>'mod', 'itemmodule'=>$modulename, 'iteminstance'=>$cm->instance, 'courseid'=>$cm->course));

            does not handle that. It must be changed to fetch_all() and then calling set_hidden() on each of them in the loop.

            Show
            mudrd8mz David Mudrak added a comment - Re-opening. This leads to a critical regression in MDL-24096 . There may be more than one grade_item per activity module and the introduced call $grade_item = grade_item::fetch(array('itemtype'=>'mod', 'itemmodule'=>$modulename, 'iteminstance'=>$cm->instance, 'courseid'=>$cm->course)); does not handle that. It must be changed to fetch_all() and then calling set_hidden() on each of them in the loop.
            Hide
            andyjdavis Andrew Davis added a comment -

            Following IM chat the proposed fix looks good. David to commit it. Thanks David for picking this up

            Show
            andyjdavis Andrew Davis added a comment - Following IM chat the proposed fix looks good. David to commit it. Thanks David for picking this up
            Hide
            mudrd8mz David Mudrak added a comment -

            Regression fixed and committed. Please retest.

            Show
            mudrd8mz David Mudrak added a comment - Regression fixed and committed. Please retest.
            Hide
            andyjdavis Andrew Davis added a comment -

            Looks good

            Show
            andyjdavis Andrew Davis added a comment - Looks good
            Hide
            annick Annick Fructoso added a comment -

            We use scorm packages for live exams. And we regularly hide and unhide the exams (scorm packages) activities within the course to make them available to the group during the live exam and unavailable when the exam ends.

            We would like the grade to be visible to students all the time, even when the activity is hidden.

            We make the scorm packages visible in the gradebook even if hidden in the course but every time somebody actions the open and hide option in the scorm settings to make it available for the live exam and then unavailable after the exam, this will automatically affect the gradebook,and the grades for this activity will automatically be hidden.

            Is there a way to to force the activity to be visible in the gradebook whatever we do in the course (ie; regularly hide and unhide the activity)

            Merci

            Show
            annick Annick Fructoso added a comment - We use scorm packages for live exams. And we regularly hide and unhide the exams (scorm packages) activities within the course to make them available to the group during the live exam and unavailable when the exam ends. We would like the grade to be visible to students all the time, even when the activity is hidden. We make the scorm packages visible in the gradebook even if hidden in the course but every time somebody actions the open and hide option in the scorm settings to make it available for the live exam and then unavailable after the exam, this will automatically affect the gradebook,and the grades for this activity will automatically be hidden. Is there a way to to force the activity to be visible in the gradebook whatever we do in the course (ie; regularly hide and unhide the activity) Merci

              People

              • Votes:
                3 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  24/Nov/10