Participant list problem

Participant list problem

by Nad Nouicer -
Number of replies: 8

Hi

I am running 1.6, but I cannot fix this problem.

I did login as a student then I went to my course to my edit profile, when I do that I can see the word "participant" on top, I click on it and I will have the list of all students for that course (or any other course) I am enrolled in.

****As an admin/teacher I do not want to allow students to see the participants on that course or neither to communicate with each others.

I went to variables / permission and I did setup showsiteparticipantslist: site teachers and then all teachers, but still not working.

Can you please help I don't want my students to see the particpants list, how can i do that?

Thanks
Nad 

Average of ratings: -
In reply to Nad Nouicer

Re: Participant list problem

by Thomas Robb -
The setting you changed only concerns viewing the participants at site level, not within individual courses. With version 1.7 you can probably control this, but with 1.6 the only way that I can think of is to hack the code. If no one else can come up with a simpler answer, please get back to me and I'll show you the place in the code that you would need to comment out so that the participant list would not be available.
In reply to Thomas Robb

Re: Participant list problem

by Nad Nouicer -

Hi Thomas

Thanks for your reply, could you please let me know (show me) where the code is?

Thanks

Nad.

In reply to Nad Nouicer

Re: Participant list problem

by Thomas Robb -
This hack probably only works with 1.6:

Go to moodle/blocks/block_participants.php

You will find these lines towards the bottom of the page:

 $this->content->items[] = '<a title="'.get_string('listofallpeople').'" href="'.
$CFG->wwwroot.'/user/index.php?id='.$this->instance->pageid.'">'.get_string('participants').'</a>';
$this->content->icons[] = '<img src="'.$CFG->pixpath.'/i/users.gif" height="16" width="16" alt="" />';


Surround the above lines with these lines:

if(isteacherinanycourse()) {

}

This will allow teachers of any course to use the "participants" link but not students.

In reply to Thomas Robb

Re: Participant list problem

by Nad Nouicer -

Hi Thomas

I tried many combinations of the lines but still showing, I even took the whole lines off and still showing, maybe I am missing something (or not that expert). Can you please write the exact lines as you want them to be modified.

Thanks.

In reply to Nad Nouicer

Re: Participant list problem

by Thomas Robb -
Did you log in as a student? The link should still show for teachers or admins.

--Tom
In reply to Thomas Robb

Re: Participant list problem

by Thomas Robb -
I tried again on my version of 1.6 with and without the lines that restrict viewing to teachers only, and it works for me. I'm attaching the whole file since it is small. Please keep a copy of your original file elsewhere just in case.
In reply to Thomas Robb

Re: Participant list problem

by Nad Nouicer -

Hi Tom

I got your file, I loged in as 3 different students (and teacher), but still I can see participants, its bizarre!! Any idea whats happening?!?!

I even left a comletely empty file block_participants.php I still see the list of students!!

Nad

In reply to Nad Nouicer

Re: Participant list problem

by Nad Nouicer -

Hi

The closest I got is I went to user/index.php and I changed the beloww parameters to zero, but still showing # of students, and this line!!  Warning: Division by zero in /public_html/training/lib/weblib.php on line 4437


'USER_SMALL_CLASS', 0);   // Below this is considered small
    define('USER_LARGE_CLASS', 0);  // Above this is considered large
    define('DEFAULT_PAGE_SIZE', 0);

Nad