Auto-subscribe all users?

Auto-subscribe all users?

by Vikki Jankowski -
Number of replies: 4

I've read some older posts regarding this subject, but wasn't clear on how to do this.  I would like to set all courses on my site so that all students are subscribed to the forums whether they post or not (since some students are "lurkers" and do not post, but want to receive all posts).  Is there a way to do this to make sure all current students in a course receive digest whether they subscribe themselves or not?

Thanks,

Vikki

La media da valetaziuns: -
In reply to Vikki Jankowski

Re: Auto-subscribe all users?

by Jon Bolton -
Maletg da 	Particularly helpful Moodlers Maletg da 	Testers
Hi Vikki

In your Forum settings page, you should have the option to Force everyone to be subscribed - either No; Yes, initially; or Yes, forever. You will need to set this for each Forum that you want to force their subscription.

From the Moodle help pages...

"...if you choose to force subscription on a particular forum then all course users will be subscribed automatically, even those that enrol at a later time.

"This is especially useful in the News forum and in forums towards the beginning of the course (before everyone has worked out that they can subscribe to these emails themselves).

"If you choose the option "Yes, initially" then all current and future course users will be subscribed initially but they can unsubscribe themselves at any time. If you choose "Yes, forever" then they will not be able to unsubscribe themselves.

"Note how the "Yes, initially" option behaves when you update an existing forum: Changing from "Yes, initially" to "No" will not unsubscribe existing users, it will only affect future course users. Similarly changing later to "Yes, initially" will not subscribe existing course users but only those enrolling later."

But...! This is different to them receiving a daily Email Digest. They will only receive the email posts/daily digest if they're subscribed to the Forums, so you will still need to do the above on each Forum that you want to force their subscription.

Hope this helps
Jon

La media da valetaziuns: Useful (1)
In reply to Jon Bolton

Re: Auto-subscribe all users?

by Judy Hsu -

Hi Jon and others, just found this thread and I have a follow-up question.

So from the code leve, how should I make changes so that the "default" setting from that pull-down menu would be set to "Yes, initially"??

I think I have identified the codes that deals with this, but I'm not that familiar with AddElement and formslib stuff, so if someone could help that would be great! Thanks!

Here is the codes that I found:

(from /mod/forum/mod_form.php at around link #41

        $options = array();
        $options[FORUM_TRACKING_OPTIONAL] = get_string('trackingoptional', 'forum');
        $options[FORUM_TRACKING_OFF] = get_string('trackingoff', 'forum');
        $options[FORUM_TRACKING_ON] = get_string('trackingon', 'forum');
        $mform->addElement('select', 'trackingtype', get_string('trackingtype', 'forum'), $options);
        $mform->setHelpButton('trackingtype', array('trackingtype', get_string('trackingtype', 'forum'), 'forum'));

Can I make changes here at this level, or do I need to go into the /mod/forum/lib.php to make changes in there? Thanks!

La media da valetaziuns: -
In reply to Judy Hsu

Re: Auto-subscribe all users?

by Jon Bolton -
Maletg da 	Particularly helpful Moodlers Maletg da 	Testers
Hi Judy - sorry for delay.

Right file, wrong place - the code you mentioned is for tracking unread posts rather than subscribing users, but around line 35...

$options = array();
$options[0] = get_string('no');
$options[1] = get_string('yesforever', 'forum');
$options[FORUM_INITIALSUBSCRIBE] = get_string('yesinitially', 'forum');
$options[FORUM_DISALLOWSUBSCRIBE] = get_string('disallowsubscribe','forum');
$mform->addElement('select', 'forcesubscribe', get_string('forcesubscribeq', 'forum'), $options);
$mform->setHelpButton('forcesubscribe', array('subscription2', get_string('forcesubscribeq', 'forum'), 'forum'));


Just add this line at the end of that section...

$mform->setDefault('forcesubscribe', '2');

where '2' can be replaced by...

'1' (for Yes, forever)
'2' (for Yes, initally)
'3' (for Subscriptions not allowed)

Does that help?
La media da valetaziuns: Useful (1)
In reply to Jon Bolton

Re: Auto-subscribe all users?

by Brian Hall -

Hey Guys,

Iam a newbie to this so bear with me. Iam running moodle 1.9.7 on fedora 8 (64bit) and I too was having an issue regarding the auto subscription of students to forums for their respective courses. I added the line mentioned above i.e

"$mform->setDefault('forcesubscribe', '2');:

and it was working for a period.

However its not working now and iam not sure why. Just a couple questions:

1) Would this change apply to courses created before the modification? So for example if i created a course on tuesday and then on friday i added the above line, would the tueday course be adjusted?

2) Would i have to restart apache or some other service in order to see the change?

In addition to that, students have been complaining that they receive their emails at times 2-3 days after the forum was posted. To my knowledge, the cron was set to run every 5 mins and 30mins. Iam not sure this is also occuring.

 

Could you guys please give me some assistance in this matter. It would be most appreciated.

 

Thanks in advnace,

Brian


La media da valetaziuns: -