Seperate groups not showing

Seperate groups not showing

by steven dauncey -
Number of replies: 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"

Average of ratings: -
In reply to steven dauncey

Re: Seperate groups not showing

by 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?
Average of ratings: Useful (1)
In reply to Ann Adamcik

Re: Seperate groups not showing

by 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. 

In reply to steven dauncey

Re: Seperate groups not showing

by Tim Symonds -
I am having the same problem and canot seem to find an answer. Has anyone figured this out?
In reply to Tim Symonds

Re: Seperate groups not showing

by 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
In reply to David Baugh

Re: Seperate groups not showing

by 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?????
In reply to Catalina Escobar

Re: Separate groups not showing

by 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

Average of ratings: Useful (1)