Moodle

"Unsubscribe users from courses after" apply for teachers?

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Minor Minor
  • Resolution: Unresolved
  • Affects Version/s: 1.8.2
  • Fix Version/s: None
  • Component/s: Enrolments
  • Labels:
    None
  • Affected Branches:
    MOODLE_18_STABLE

Description

Has casually found out, that after logtimenosee from a rate teachers are excluded. Is this option not for students?
One more strange effect: if the teacher then to include manually after start cron.php it will be again excluded.

Issue Links

Activity

Hide
Lukasz Sanokowski added a comment -

I think that I found solution for this issue. In file /admin/cron.php there is a function responsible for automatic unenrolling users. It is highlited in attached file crondotphp.gif. I think that all we need to do to solve this issue is to change function from line 247:

from:
if (role_unassign(0, $assign->userid, 0, $context->id)) {

to:

(role_unassign(0, $assign->userid, 0, $context->id)) {

One thing that I'm not sure is second part of that function which cleans remaining records. I don't know if there are changes needed according to modyfing function role_unassign().

Is my solution right?

Regards

Show
Lukasz Sanokowski added a comment - I think that I found solution for this issue. In file /admin/cron.php there is a function responsible for automatic unenrolling users. It is highlited in attached file crondotphp.gif. I think that all we need to do to solve this issue is to change function from line 247: from: if (role_unassign(0, $assign->userid, 0, $context->id)) { to: (role_unassign(0, $assign->userid, 0, $context->id)) { One thing that I'm not sure is second part of that function which cleans remaining records. I don't know if there are changes needed according to modyfing function role_unassign(). Is my solution right? Regards
Hide
Lukasz Sanokowski added a comment -

I'm sorry, the change is to:

(role_unassign(5, $assign->userid, 0, $context->id)) {

where is changed first parameter - roleid to 5 which describes role of student.

Regards

Show
Lukasz Sanokowski added a comment - I'm sorry, the change is to: (role_unassign(5, $assign->userid, 0, $context->id)) { where is changed first parameter - roleid to 5 which describes role of student. Regards
Hide
Tobias Marx added a comment -

This does happen to us, too. Teachers who haven't accessed their courses for the set limit in "longtimenosee" are removed from their courses and have to be added again, manually.

We are using 1.9.11.

Would be great to see a fix for this, even as 2.x is the future

Show
Tobias Marx added a comment - This does happen to us, too. Teachers who haven't accessed their courses for the set limit in "longtimenosee" are removed from their courses and have to be added again, manually. We are using 1.9.11. Would be great to see a fix for this, even as 2.x is the future

People

Vote (4)
Watch (2)

Dates

  • Created:
    Updated: