Moodle
  1. Moodle
  2. MDL-21933

search form in course participant list not available to teacher

    Details

    • Database:
      MySQL
    • Testing Instructions:
      Hide

      Login as Admin;

      Got to a course with > 20 participants

      • Select Participants menu item
      • Check the search box appears at the bottom
      • Click "Show all xx" and confirm the box disappears.

      Switch role to Editing Teacher

      • Select Participants menu item
      • Ensure you have 20 per page as the setting
      • Check the search box appears at the bottom
      • Click "Show all xx"
      • Confirm the search box disappears.

      Reset your role

      • Select "Site Pages" > "Particpants"
      • Confirm the search box appears
      • Select "Show all xxx"
      • Confirm the search box disappears.
      • Copy the URL to later use.

      Login as a non-admin user

      • Paste the earlier copied URL. Confirm no permission is given.
      Show
      Login as Admin; Got to a course with > 20 participants Select Participants menu item Check the search box appears at the bottom Click "Show all xx" and confirm the box disappears. Switch role to Editing Teacher Select Participants menu item Ensure you have 20 per page as the setting Check the search box appears at the bottom Click "Show all xx" Confirm the search box disappears. Reset your role Select "Site Pages" > "Particpants" Confirm the search box appears Select "Show all xxx" Confirm the search box disappears. Copy the URL to later use. Login as a non-admin user Paste the earlier copied URL. Confirm no permission is given.
    • Affected Branches:
      MOODLE_19_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Fixed Branches:
      MOODLE_23_STABLE, MOODLE_24_STABLE, MOODLE_25_STABLE
    • Pull 2.4 Branch:
    • Pull 2.5 Branch:
    • Pull Master Branch:
      MDL-21933_master
    • Rank:
      1197

      Description

      In Moodle courses, default editingteacher role has capability to access the participant list (moodle/course:viewparticipants).

      With this permission, the user search form does not appears at the bottom of the page when there are many participants. Looking at the code, the search form requires 'moodle/site:viewparticipants', which is a site level permission.

      Giving the following:
      1. search form is really useful to teacher when dealing with large classes
      2. the search appears to be context based, so a teacher can search within participants

      would probably be better to change the capability to show the search form with moodle/course:viewparticipants.

        Activity

        Hide
        Helen Foster added a comment -

        Just noting that this issue is still affecting the latest version (2.2.3) and adding a link to a forum discussion about it: http://moodle.org/mod/forum/discuss.php?d=202454

        Show
        Helen Foster added a comment - Just noting that this issue is still affecting the latest version (2.2.3) and adding a link to a forum discussion about it: http://moodle.org/mod/forum/discuss.php?d=202454
        Hide
        Nathan Mares added a comment -

        I have a patch for this here:

        https://bitbucket.org/ngmares/moodle/changeset/d13c4dc73bb15487798a3ec52dc840d5

        Note: I haven't changed the number of pages of users that there must be for the search box to appear as was suggested in the forums, only the permissions checking.

        Show
        Nathan Mares added a comment - I have a patch for this here: https://bitbucket.org/ngmares/moodle/changeset/d13c4dc73bb15487798a3ec52dc840d5 Note: I haven't changed the number of pages of users that there must be for the search box to appear as was suggested in the forums, only the permissions checking.
        Hide
        Russell Smith added a comment -

        This also affects 2.3.2 as well. I've not checked MOODLE_23_STABLE or HEAD. I suspect it's affecting all versions.

        Show
        Russell Smith added a comment - This also affects 2.3.2 as well. I've not checked MOODLE_23_STABLE or HEAD. I suspect it's affecting all versions.
        Hide
        Roberto Pinna added a comment -

        Any news about when this could be fixed?
        Still affect MOODLE_24_STABLE and MOODLE_25_STABLE.

        Show
        Roberto Pinna added a comment - Any news about when this could be fixed? Still affect MOODLE_24_STABLE and MOODLE_25_STABLE.
        Hide
        Russell Smith added a comment -

        I now have more development skill than when I first got involved with this issue. As there is a patch, I'll see if I can get this fix integrated.

        I will change the rules to greater than a single page and do course:view participants as in Nathan's patch. Now is the time to speak if you have an opinion on this.

        Show
        Russell Smith added a comment - I now have more development skill than when I first got involved with this issue. As there is a patch, I'll see if I can get this fix integrated. I will change the rules to greater than a single page and do course:view participants as in Nathan's patch. Now is the time to speak if you have an opinion on this.
        Hide
        Roberto Pinna added a comment -

        The fix was already suggested by Andrea when he submitted the issue.

        We just need to change the word "site" with the word "course" in capability check in moodle/user/index.php around lines 800-820 and all the things are done.

        Show
        Roberto Pinna added a comment - The fix was already suggested by Andrea when he submitted the issue. We just need to change the word "site" with the word "course" in capability check in moodle/user/index.php around lines 800-820 and all the things are done.
        Hide
        Marina Glancy added a comment -

        Hi guys, the issue is in the backlog but you are very welcome to submit it for integration (or peer review) yourself to jump the queue. You need to use github branch though.

        Show
        Marina Glancy added a comment - Hi guys, the issue is in the backlog but you are very welcome to submit it for integration (or peer review) yourself to jump the queue. You need to use github branch though.
        Hide
        Russell Smith added a comment -

        I will create the back branches after a successful peer review. Just in case some rework is required.

        Show
        Russell Smith added a comment - I will create the back branches after a successful peer review. Just in case some rework is required.
        Hide
        Russell Smith added a comment -

        And lucky your Marina! Being able to directly submit to integration

        Show
        Russell Smith added a comment - And lucky your Marina! Being able to directly submit to integration
        Hide
        Marina Glancy added a comment -

        lucky me, Russell, I can even integrate
        Thanks for submitting the patch. It looks fine to me and also the capability check is not needed at all, these capabilities are required in the very top or the page. So just removing the capability check completely works fine here. Please make changes and I'll submit for integration. Thanks again

        Show
        Marina Glancy added a comment - lucky me, Russell, I can even integrate Thanks for submitting the patch. It looks fine to me and also the capability check is not needed at all, these capabilities are required in the very top or the page. So just removing the capability check completely works fine here. Please make changes and I'll submit for integration. Thanks again
        Hide
        Marina Glancy added a comment -

        also it looks reasonable to me to display the search form if there is more that just one page of participants

        Show
        Marina Glancy added a comment - also it looks reasonable to me to display the search form if there is more that just one page of participants
        Hide
        Marina Glancy added a comment -

        Thanks Russell, submitting for integration

        Show
        Marina Glancy added a comment - Thanks Russell, submitting for integration
        Hide
        Sam Hemelryk added a comment -

        Thanks guys this has been integrated now

        Show
        Sam Hemelryk added a comment - Thanks guys this has been integrated now
        Hide
        Adrian Greeve added a comment -

        Tested on the 2.3, 2.4, 2.5 and master integration branches.
        No problems encountered.
        Test passed.

        Show
        Adrian Greeve added a comment - Tested on the 2.3, 2.4, 2.5 and master integration branches. No problems encountered. Test passed.
        Hide
        Dan Poltawski added a comment -

        Thanks for your contributions!

        _main:
        @ BB#0:
                push    {r7, lr}
                mov     r7, sp
                sub     sp, #4
                movw    r0, :lower16:(L_.str-(LPC0_0+4))
                movt    r0, :upper16:(L_.str-(LPC0_0+4))
        LPC0_0:
                add     r0, pc
                bl      _printf
                movs    r1, #0
                movt    r1, #0
                str     r0, [sp]                @ 4-byte Spill
                mov     r0, r1
                add     sp, #4
                pop     {r7, pc}
        
                .section        __TEXT,__cstring,cstring_literals
        L_.str:                                 @ @.str
                .asciz   "This code is now upstream!"
        
        Show
        Dan Poltawski added a comment - Thanks for your contributions! _main: @ BB#0: push {r7, lr} mov r7, sp sub sp, #4 movw r0, :lower16:(L_.str-(LPC0_0+4)) movt r0, :upper16:(L_.str-(LPC0_0+4)) LPC0_0: add r0, pc bl _printf movs r1, #0 movt r1, #0 str r0, [sp] @ 4- byte Spill mov r0, r1 add sp, #4 pop {r7, pc} .section __TEXT,__cstring,cstring_literals L_.str: @ @.str .asciz "This code is now upstream!"

          People

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

            Dates

            • Created:
              Updated:
              Resolved: