Seperate groups not showing

Seperate groups not showing

von steven dauncey -
Anzahl Antworten: 6

I have created an 'offline assignment'.When i select a seperate group and click the link:"No attempts have been made on this assignment", i get the message "No users were found with permissions to submit this assignment"

Als Antwort auf steven dauncey

Re: Seperate groups not showing

von Ann Adamcik -
Steven,

Which version of Moodle? Did you set up the assignment itself with separate groups, or are you using a force group mode setting in the course?
Als Antwort auf Ann Adamcik

Re: Seperate groups not showing

von steven dauncey -

We are using moodle 1.9.  We set up the groups manually within the course then when we go to the assignment we select that group from he drop down box. 

Als Antwort auf steven dauncey

Re: Seperate groups not showing

von Tim Symonds -
I am having the same problem and canot seem to find an answer. Has anyone figured this out?
Als Antwort auf Tim Symonds

Re: Seperate groups not showing

von David Baugh -
I am sorry to do a "me to" on this one. When I had the course working with no groups everything worked fine. Even visible groups worked fine. But as soon as I did seperate groups it went pear shaped. This is the same even after an upgrade from 1.9.2 to 1.9.5 I have tired lots of options but to no avail
Als Antwort auf David Baugh

Re: Seperate groups not showing

von Catalina Escobar -
I have the same problem. Its very wierd. If I put the option "separate groups" I get the message:

No users were found with permissions to submit this assignment even there are members in the group

But if I use the option "all participants" I can see the assigments. Any solution?????
Als Antwort auf Catalina Escobar

Re: Separate groups not showing

von John Williams -

Hi,

We have this problem too but I think I have solved it - at least for our site !

There is an error in the sql statement in lib/accesslib.php.  I have only tested it where the role assigned to the members of the groups is the same as the default role for the site.  In this case the where statement refers to ra.userid ( from the mdl_role_assignments table ) but in this case the table does not appear in the SQL statement.  Hence the sql fails, nothing is returned and so the error statement appears.

I have only just put the fix into our system and am awaiting feedback from our users.  However it would be good if someone else could try it. 

We are on moodle version 1.9.4

In lib/accesslib.php change the get_users_by_capability function as below so that when the default role is in effect, the ra.userid is replaced by u.id :

    /// Groups
    if ($groups) {
        if (is_array($groups)) {
            $grouptest = 'gm.groupid IN (' . implode(',', $groups) . ')';
        } else {
            $grouptest = 'gm.groupid = ' . $groups;
        }
        if ($defaultroleinteresting) {
           $grouptest = 'u.id IN (SELECT userid FROM ' .
            $CFG->prefix . 'groups_members gm WHERE ' . $grouptest . ')';
        } else {
           $grouptest = 'ra.userid IN (SELECT userid FROM ' .
            $CFG->prefix . 'groups_members gm WHERE ' . $grouptest . ')';
        }

        if ($useviewallgroups) {
            $viewallgroupsusers = get_users_by_capability($context,
                    'moodle/site:accessallgroups', 'u.id, u.id', '', '', '', '', $exceptions);
            if ($defaultroleinteresting) {
               $wherecond['groups'] =  '('. $grouptest . ' OR u.id IN (' .
                                    implode(',', array_keys($viewallgroupsusers)) . '))';
            } else {
               $wherecond['groups'] =  '('. $grouptest . ' OR ra.userid IN (' .
                                    implode(',', array_keys($viewallgroupsusers)) . '))';
            }
        } else {
            $wherecond['groups'] =  '(' . $grouptest .')';
        }
    }

Any feedback most welcome