Moodle
  1. Moodle
  2. MDL-33697

Teacher cannot set messaging preferences for assignment

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 2.3
    • Fix Version/s: 2.3
    • Component/s: Assignment, Messages
    • Labels:
    • Database:
      Any
    • Testing Instructions:
      Hide

      Test 1

      1. Login as a user who is only assigned a student role at a course level and no roles at any other level
      2. View the "My profile -> Messaging" page
      3. Messaging options for "Assignment notifications" should be visible

      Test 2

      1. Login as a user who is only assigned an "Editing Teacher" role at a course level and no roles at any other level
      2. View the "My profile -> Messaging" page
      3. Messaging options for "Assignment notifications" should be visible

      Test 3

      1. Login as a user who is assigned a "Student" role at a course level with an instance of the new assignment module
      2. Submit an assignment
      3. View the "Recent notification" messages in "My profile -> Messages"
      4. You should see a message about your assignment submission
      5. You see a message about your assignment submission
      Show
      Test 1 Login as a user who is only assigned a student role at a course level and no roles at any other level View the "My profile -> Messaging" page Messaging options for "Assignment notifications" should be visible Test 2 Login as a user who is only assigned an "Editing Teacher" role at a course level and no roles at any other level View the "My profile -> Messaging" page Messaging options for "Assignment notifications" should be visible Test 3 Login as a user who is assigned a "Student" role at a course level with an instance of the new assignment module Submit an assignment View the "Recent notification" messages in "My profile -> Messages" You should see a message about your assignment submission You see a message about your assignment submission
    • Workaround:
      Hide

      Give teachers 'mod/assign:grade' at site level.

      Show
      Give teachers 'mod/assign:grade' at site level.
    • Affected Branches:
      MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE
    • Pull Master Branch:
    • Rank:
      41703

      Description

      Similar to MDL-33598. The capability appears to be assessed at site level. If a teacher has 'mod/assign:grade' at a lower level then assign_grader_notification doesn't appear in their message config screen. If you're logged in as admin you'll see it but as a straight teacher you won't.

      Note that teachers still actually get the notifications. They will receive them by email, the default, but cannot choose to have then sent any other way.

      Also see MDL-33599.

        Issue Links

          Activity

          Hide
          Andrew Davis added a comment -

          Its probably not viable to simply remove the capability check as we did for the student notification. Doing that would mean that all users would see the assignment grader notification in their messaging settings.

          Show
          Andrew Davis added a comment - Its probably not viable to simply remove the capability check as we did for the student notification. Doing that would mean that all users would see the assignment grader notification in their messaging settings.
          Hide
          Andrew Davis added a comment - - edited

          The previous assignment module avoided this by using a single notification for both students and teachers.

          The quiz appears to be successfully using capabilities to regulate access to notification types. Im not sure how. See /mod/quiz/db/messages.php
          UPDATE: not it isnt. Quiz has exactly the same problem.

          Show
          Andrew Davis added a comment - - edited The previous assignment module avoided this by using a single notification for both students and teachers. The quiz appears to be successfully using capabilities to regulate access to notification types. Im not sure how. See /mod/quiz/db/messages.php UPDATE: not it isnt. Quiz has exactly the same problem.
          Hide
          Andrew Davis added a comment -

          The problem is in message_get_providers_for_user($userid) in /lib/messagelib.php. The capabilities are indeed checked against the system context.

          Show
          Andrew Davis added a comment - The problem is in message_get_providers_for_user($userid) in /lib/messagelib.php. The capabilities are indeed checked against the system context.
          Hide
          Damyon Wiese added a comment -

          I probably based this of the quiz so I'm not surprised

          Show
          Damyon Wiese added a comment - I probably based this of the quiz so I'm not surprised
          Hide
          Damyon Wiese added a comment -

          I can see 3 options here:

          1 - Address MDL-33599 which will resolve this issue
          2 - Remove the capability which means students will have an additional notification type that does not make sense to them
          3 - Combine the notifications into one and remove the capability. This is not ideal because someone can be an instructor in one course and a student in another and may only want to receive one or the other type of notification.

          Any preferences?

          Show
          Damyon Wiese added a comment - I can see 3 options here: 1 - Address MDL-33599 which will resolve this issue 2 - Remove the capability which means students will have an additional notification type that does not make sense to them 3 - Combine the notifications into one and remove the capability. This is not ideal because someone can be an instructor in one course and a student in another and may only want to receive one or the other type of notification. Any preferences?
          Hide
          Michael de Raadt added a comment -

          I think combining the providers now might be the simplest working solution. That is until we can consider the interaction effects of different context permissions on message providers.

          Show
          Michael de Raadt added a comment - I think combining the providers now might be the simplest working solution. That is until we can consider the interaction effects of different context permissions on message providers.
          Hide
          Andrew Davis added a comment -

          Code looks fine. Just need to clean up the testing instructions. Get rid of the expected result / actual result stuff. Just describe what the tester should see when running this code. What it did before isn't relevant to the tester.

          Show
          Andrew Davis added a comment - Code looks fine. Just need to clean up the testing instructions. Get rid of the expected result / actual result stuff. Just describe what the tester should see when running this code. What it did before isn't relevant to the tester.
          Hide
          Damyon Wiese added a comment -

          Testing instructions updated.

          Show
          Damyon Wiese added a comment - Testing instructions updated.
          Hide
          Andrew Davis added a comment -

          Submit this for integration whenever you're ready

          Show
          Andrew Davis added a comment - Submit this for integration whenever you're ready
          Hide
          Damyon Wiese added a comment -

          Thanks Andrew, off to integration it is.

          Show
          Damyon Wiese added a comment - Thanks Andrew, off to integration it is.
          Hide
          Dan Poltawski added a comment -

          Integrated this, thanks.

          Show
          Dan Poltawski added a comment - Integrated this, thanks.
          Hide
          Frédéric Massart added a comment -

          Test passed! Cheers!

          Show
          Frédéric Massart added a comment - Test passed! Cheers!
          Hide
          Eloy Lafuente (stronk7) added a comment -

          And this has been spread to every git and cvs repository out there, just in time to roll Moodle 2.3beta!

          Thanks! Closing, ciao

          Show
          Eloy Lafuente (stronk7) added a comment - And this has been spread to every git and cvs repository out there, just in time to roll Moodle 2.3beta! Thanks! Closing, ciao

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: