|
I met same problems. Teachers can always all events in a course because they have a right to do that by deafult setting.
After having look at code, there seems to be typo in the routine, I attached the patch for this issue even though I am not sure if this is right way or not (at least, the code seems to be different from what comment of routine says). We're running Moodle 1.8.1 (2007021510).
I'm seeing a similar issue: when a teacher creates an event for a group, it does not show up in the calendar. No one can see it – not teachers, not students and not even admins. Looking in the database, I can see my events in mdl_events and they do have a groupid associated with them. I tried the patch, but it had no effect on this problem.
Moodle 1.8.1 (2007021510) WIMP server, XP IIS 6, PHP Version 5.1.2, mysql 4.1.22
Course created, teacher assigned, student assigned, group created and student placed in group. I login as admin, I add a group event in a course.
I login as teacher, I add a group event in a course.
I login as student, I cannot see the group event. Hi, Kenneth,
> I tried the patch, but it had no effect on this problem. Could you let me know the version written in version.php? I am afraid that your moodle code does not include the fix which should be applied before applying my patch. Version 1.8.1+ (2007021510), Solaris 10/sparc, CoolStack 1.1 (Apache 2.2.3, mySql 5.0.33, PHP 5.2.0)
I upgraded to 1.8.1_STABLE yesterday and tried this patch. Here's what I'm seeing:
After a bit more testing -
Admins do see the group events if the calendar setting 'Admins See All' is checked (Administration->Appearance->Calendar). I have a test user who is a Course Creator in Course A, and a Teacher in Course B.
I noticed that I missed the anothre patch I made before. I attached the patch for calendar/lib.php (1.8+ today) and it would fix the problem that teachers cannot see events.
Motoyuki – I'm at Groups version 2007012400. Do I need to get a more current version from CVS?
Further testing: I set up a course, 2 groups, 1 student in each group, 1 group event for each group in calendar. Teacher is not a member of either group.
It doesn't seem to matter how I set up the course. I get the same results for each possible setting: course settings with no group mode set, no force but separate, no force but visible, forced separate, forced visible. Teacher sees both events, student 1 sees no events, student 2 sees no events, admin does not see shading on calendar or link in upcoming events, but DOES see the events if clicking on the calendar link to go to the daily view. I actually logged out and in as each role to verify (no switching). That bit about what the admin can see is a little different. Did anyone else actually click on the "go to calendar" link to verify events displayed there? I am using default role definitions. When I don't have "Admins See All" enabled, then I can see all events in the calendar. Otherwise I can see nothing.
I'm at Groups version 2007012400 running Moodle 1.8.1 (2007021510). If it matters, this site was created using Moodle 1.7.0 and our upgrade path was Moodle 1.7.0->Moodle 1.7.1->Moodle 1.8.0->Moodle 1.8.1. Here's the results of my most recent run through: Create a new course with group mode set to "separate". Login as faculty test account to new course. Create Group A, which consists of Joe Assign Joe to Group A Create an event for Group A taking place on 6/29 with no duration. Teacher can not see either event. Login as Joe. Joe can see Group A event created by the teacher. Login as site admin. Admin can not see any group events. Login as Joe. Joe can see the event. Login as Teacher. Teacher can't see the event; downshifting to the non-editing teacher or student roles doesn't show the events. If I change the group type to "visible" and try downshifting to student again, I still can't see the events. Hi, Kenneth,
Your code seems not to be old and enough new. The bug might be brought into newer code that you use. I try newest code (I do not actually use the newest code now). I tried on today's 1.8+.
After applying my two patches, group events are visible to members of students and teachers. BTW, if and only if 'group mode' is set to 'no' and 'force' is set to 'no', students and teachers cannot see event according to the code. I am not sure the reason though. In adittion, when 'adminseesall' is checked, admin can see all group events even in upcomming event in my environment (today's 1.8+). Speaking of editing the event, admin seems to be able to edit all events anytime according to the code. I figured out the problem, or at least my problem as it applies to teachers. Motoyuki's "calendar-lib.php.patch" points the way. The problem file is htdocs/calendar/lib.php.
See this query? $sql = "SELECT id, groupid FROM {$CFG->prefix}groups_courses_groups WHERE courseid IN (".implode(',', $groupids).')'; This produces something like this: SELECT id, groupid FROM mdl_groups_courses_groups WHERE courseid IN (740); Which returns results that look like this: ---
---
--- The 'id' here refers to the primary key for the "mdl_groups_courses_groups" table; the groupid is the primary key for the "mdl_groups" table Now if you look for this code from the calendar-lib.php.patch, around line 1196, you'll see the problem. foreach ($grouprecords as $grouprecord) { $grouprecord->id is referring to the primary key of the "mdl_groups_courses_groups" table NOT the actual id of the group, which is what's in the second column of the data returned. If we change "$grouprecord->id" to "$grouprecord->groupid", then we pull the right value from the data that was returned. This allows faculty to see the groups available in their courses. When I made this change, the events were displayed correctly on the courses page and on the calendar page. The original code has the same problem, but in a different way: $grouparray = array_merge($grouparray, array_keys($grouprecords)) This takes the keys of the array returned from the initial query, which are the same as the keys for the table "mdl_groups_courses_groups", but NOT the same as the actual groupid numbers in "mdl_groups". Hi, Kenneth,
You are right and sorry the patch file was different from my own patch file in my PC... BTW, I write down what I notice:
Sorry for my confusing you. Excellent, thanks. What do we need to do to get this into Moodle core for the 1.8.2 update?
Maybe we need to request it to the assignee or other people who are core member of Moodle.
Thanks for all your work guys... nonetheless, when I tried manually changing files in my 1.8+ installation, it did not resolve the issue. Any idea when is this fix going to be included in the daily built? We are just starting to use Moodle in our university, and it really did not look good when one of our most valued profs pointed this problem out and we still haven't been able to resolve the issue after more than a week
(updating, since I've made a mistake in the report)
Admin:
Teacher:
Bori and Elena: which versions of Moodle are you working on? I've only tried this under Moodle 1.8.1, not the newer builds (though I will be trying it under 1.8.2 when I update the development server on Wednesday).
I just tested this on http://test.moodle.com
Nicolas, can you get to the bottom of this? I'm pretty sure you need to be looking in calendar_set_filters() in calendar/lib.php ...
Yu seems to have taken it on.
Yu, have now tested on 1.8.2+ for creation of group events. It doesn't work: editing teacher can't create group events (whether it belongs to the group or no).
It's reproducible too on original 1.8! Seems same symptoms like on HEAD before your fix. Same problem here on
Version 1.8.2+ (2007021520) Thanks guys for the report and proposed fix, the problem is group related, Moodle 1.8 was caching the wrong groupids and groups were not returned correctly. Fixed in 1.8.
Hi Nicholas and Roger, I was unable to reproduce the problem of teachers unable to post, I can add group events as teacher. Could you please post more info on this? Do you get error messages? Can you post a screenshot? The fix on 1.9 is totally unrelated to this, the fix on 1.9 was on perf patch. Cheers, Yu I'm sorry to say that though it worked yesterday (before MOODLE_19_STABLE branching), it doesn't work anymore, on 1.9beta2 and 2.0dev too.
Hi Yu,
I just installed a fresh 1.8.3 Course created, teacher assigned, student assigned, 2 groups created and student placed in group 1, teacher in group 2. I login as admin, I add group events in a course, in multiple groups.
I login as teacher.
I login as student, I can see all my group events everywhere. Summary The remaining problem in 1.8.3 are the lacking view in the blocks for the admin and switching roles. Hi all.
I've have a similar problem. Perhaps it's related or perhaps its another issue with calendar. A teacher was seeing group events from groups she was not member of. And group events that she should be able to see were not appearing. Problem is in function calendar_set_filters() at calendar/lib.php. Look at the query: $sql = "SELECT id, groupid and change the order of the fields in the SELECT line: $sql = "SELECT groupid, id The $grouparray variable was not filled with groupids. That was our problem... hope this helps. Hi Nicolas, admins should now be able to see group events in a course. I think switch role in this situation is very tricky because the switched role does not have a course, nor a group, and I suspect the code follows the current user's group and courses set in session, thus the strange behavior.
Juan, I am not able to duplicate this problem, I see correct groups for my users. Could you please describe how to reproduce the problem in greater detail? I think using the ids of groups_courses_groups in 1.8 is correct. Cheers, Yu Hi Yu, delete my comment
Sorry for the noisy comment Well... i'm here again. It's quite dificult to reproduce in a normal way. You can reproduce the problem by inserting a row in mdl_groups_courses_groups where id (not groupid) is equal to the id of an existing group. This is the situation that makes the magic thing
Kenneth guess it before Sorry if i misunderstud something, but there are lots of comments now :-P Thanks for your work Yu Yu, sorry for the delay, I was on vacation :-D
The blocks problem is fixed in 1.8.3+. I have yet to test it in 1.9beta2. Yu, I just tested on 1.9beta2 (fresh from CVS).
The problem is still present Yu, I was talking of the initial issue : "When a teacher creates a group event and assigns it to a course group, it does not appear to students or teachers" which is now fixed on 1.8.x but not on 1.9beta2. Further, the problem is present too for admins.
Should I close this bug and open another one? Ciao Right, Yu, this works now. Verified on 1.9.beta2 (fresh from CVS).
Thank you I do not believe that this was fixed completely.
We had this issue in 1.8.3+, and it is still the same with 1.8.5 which we have got 2 days ago - students cannot see their group events. Other users are also reporting the same problem: http://moodle.org/mod/forum/discuss.php?d=89015 We have just upgraded to the latest 1.8.7+ and I am still seeing this issue. A group event in a course with either visible or separate groups is not shown to students.
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-Students doesn't see their group events.
-Teachers can see all the events (only if the teacher is not in the group). I think they should see their groups events.