Activities on site front page

Activities on site front page

by Gustav W Delius -
Number of replies: 44

Currently it is possible to add instances of all activity modules on the site front page. However unfortunately many modules behave unpredictably on the site front page because it is not quite clear who should be considered to be a student and who should be considered a teacher on the site front page. The front page is internally a course with the id='1'

These are the possible conventions for who is a teacher on the site front page:

  1. Everyone who is teacher on at least one course,
  2. Only teachers for course '1' (including the admin),
  3. Only admins.

These are the possible conventions for who is a student on the site front page:

  1. Everyone who is a student in at least one course,
  2. Only students explicitly enrolled for course '1',
  3. Every site user.

The forum module is using convention 2 for teachers and 3 for students. This seems reasonable and convenient. Shall I try to convert as many of the activity modules to this convention as possible? Or are there any modules that should use a different convention?

Making all activity modules work consistently on the site front page will involve some effort with some modules because rather than using a datatlib function to determine teachers and student they access the user_students and user_teachers tables directly. Perhaps there are some modules that we will never need on the site front page? How about workshop and exercise modules for example? Shall I just disable them on the site front page? Any others?

Average of ratings: -
In reply to Gustav W Delius

Re: Activities on site front page

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Thanks for looking at this. approve Some of the logic is not well-thought out for the site course. 2 and 3 (like forum does it) makes sense to me.

Many of them have their own functions to get module data so that they can use a more efficient JOIN to get all the data for a class at once - unfortunately this has led to some logic inconsistencies between modules so your attention is welcome!
In reply to Martin Dougiamas

Re: Activities on site front page

by Gustav W Delius -
It seems to me that the simplest way to fix things would be to enroll all users automatically in the site course. So whenever an entry in the user table is created a corresponding entry in the user_students table should be created with the courseid set to the siteid. Are there any problems with that approach?
In reply to Gustav W Delius

Re: Activities on site front page

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Not a bad idea!

It could make the user_students table significantly bigger - thus slowing down stuff all over (think of those joins).  Might need some testing ..
In reply to Martin Dougiamas

Re: Activities on site front page

by Gustav W Delius -

I think most modules are not suitable for the front page anyways. You wouldn't really want to have a workshop activity on the front page, for example. I propose to simply disable all activity modules that are not explicitly front-page certified. How about an extra field 'frontpage' in the module table? This is something that I feel needs to be sorted out before the release of 1.4. I would be happy to go through all modules and certify them for the front page where possible.

In reply to Gustav W Delius

Re: Activities on site front page

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
OK, good idea. Yes, please. Please post the list here. 


Note this should be a "technical suitability" rather than a "usefulness suitability".  For all we know someone may really want to use X on the home page regardless of what we think - at that point they can help make X work properly there.

Modules can always update their own entries when and if they do start working correctly on the front page.
In reply to Martin Dougiamas

Re: Activities on site front page

by Gustav W Delius -

OK, thanks for the go-ahead. I will go through the modules and make sure that they have the following behaviour when on the front page:

  • All confirmed site users are viewed as students (using function get_course_students).
  • Admins as well as teachers explicitly added to the site course are viewed as teachers(using function get_course_teachers).

I will then post the list of conforming modules here.

In reply to Gustav W Delius

Re: Activities on site front page

by Gustav W Delius -
As Martin just explained to me in another thread, the forum module should not follow the above behaviour. Not all site users should be treated as students by front page activities but only those that are enrolled in a course or are teachers or administrators. The reason is that users don't have a way to delete their account on the site. So there may be many site users who don't actually want to be site users any more. These should be ignored by the forum module and I now think that for the same reason they should be ignored also by all other front page activities. So the rule I will follow now is that acitivity modules on the site front page should determine the list of students using the get_site_users() function rather than the get_users() function.
In reply to Gustav W Delius

Re: Activities on site front page

by Gustav W Delius -

I am afraid that I am still confused about who should be considered as a site user for the purpose of front page activities. There are two possibilities:

  1. All people who have a confirmed, undeleted account on the site.
  2. All people who are enrolled in a course, are teaching on a course, or are an administrator.

I keep changing my mind about which choice is best. Currently I am back to favouring option 1 which has the big advantage that it is in agreement with the list of users shown in the participants list. I think it would be confusing if the participants list followed convention 1 but activities followed convention 2.

The problem is that, as argued in a different thread, for the news forum convention 2 has advantages over convention 1 because if all people from 1 were force subscribed they would have no way to get out of those mailings because it is not currently possible for a user to delete their account on a site. But if we follow convention 2 for the forums and convention 1 for other activities then that again is confusing.

What shall I do? sad

I currently think the best solution would be:

  1. keep convention 2 for the forum and make that clear in the documentation
  2. use convention 1 for all other activities
  3. allow users to delete their accounts (provided they are not enrolled or teaching)
In reply to Gustav W Delius

Re: Activities on site front page

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
I still think (2) because the front page is really like another super-course, not the site as such.    Accounts are cheap ...

But it might help to see that list of the activities that work on the front page, and for us to think about why one would need to put activities on the front page ...
In reply to Martin Dougiamas

Re: Activities on site front page

by Gustav W Delius -

I have now made sure that all modules in the core distribution will work consistently on the front page. The rule followed is now:

  • Any student enrolled in at least one course is considered a student on the site
  • Only admins and teachers explicitly assigned to the site course are teachers on the site
  • The above two groups together make up the site users.

So users who are not enrolled in any course, are not teaching and are not admins are not considered users for the purpose of the front page activities. However they are still allowed to view things, even without logging in. They only get shut out once the activities become user specific.

I think it is all quite logical now approve.

In reply to Gustav W Delius

Re: Activities on site front page

by N Hansen -
Delius-Does this mean that if one were to create a forum on the front page and forced everyone to subscribe to it, that all people enrolled in courses would receive messages from it? It would be useful if that functionality were implemented for "site news" so that messages relevant to all site users could be sent out at once.
In reply to N Hansen

Re: Activities on site front page

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
That's exactly how Site news works with forced subscription already.
In reply to Martin Dougiamas

Re: Activities on site front page

by Gustav W Delius -
That is right, I made no changes to the forum module, just made sure that other modules behave similarly sensibly.
In reply to Martin Dougiamas

Re: Activities on site front page

by N Hansen -
But I don't see any setting for forcing subscriptions of site news.
In reply to N Hansen

Re: Activities on site front page

by W Page -
Hi N!

  1. Go to the "Site News" forum as an "Admin".
  2. Look in the right upper part of the page. You will see a form button named "Update this Forum".
  3. When you are on the "Forum Update" page look for "Force everyone to be subscribed?:" and select "Yes" from the dropdown menu.
  4. Click on "Save Changes" at the bottom of the page

Hope this helps.

WP1
In reply to Gustav W Delius

Re: Activities on site front page

by Gustav W Delius -
It may all be quite logical, but is it really what site admins want? There just was a post in the chat forum where this rule caused confusion. We really have to be very sure before releasing Moodle 1.4 that this is really what we want. There is still time to change to the conventions proposed in http://moodle.org/mod/forum/discuss.php?d=8452#53473. I am happy with the way it is now, I just want to make sure others are as well.
In reply to Gustav W Delius

Re: Activities on site front page

by Gustav W Delius -

The new rules are:

  • Any user enrolled in or teaching on at least one course is considered a student on the site
  • Only admins and teachers explicitly assigned to the site course are teachers on the site
  • The above two groups together make up the site users.

In reply to Gustav W Delius

Re: Activities on site front page

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Hmmm ... we never really made that list and talked about this before you went ahead with it.  mixed   I'd only really thought about the Forums until now - it's quite hard to see what it should be for the others.

First attempt ...

1 = any site user is considered a student
2 = anybody who is enrolled in a course is considered a student

Assignment  2 - grades
Chat 1 - no risk to be open?
Choice 1 - open polls are useful?
Exercise 2 - grades
Forum 2 - force subscribing
Glossary
1 - useful for FAQs?
Journal
2 - grades
Lesson
1 - introductions/evaluation?
Quiz
2 - grades
Scorm
1 - just displaying content
Survey
2 - not useful otherwise
Wiki
1 - it's the wiki way
Workshop
2 - serious engagement?

Many of these 2s culd just as easily be 1s ... apart from the forced subscription issue on forums it would actually be quite fine to standardise on (1), I think ...  surprise
In reply to Martin Dougiamas

Re: Activities on site front page

by Gustav W Delius -

I think it would be quite useful to standardise on either 1 or 2. That is the way Moodle is set up really. There is only one isstudent() function and one require_login() function that is used by all modules.

I would be most happy to go with (1). The forced subsciption issue on forums can easily get its exception.

I will come back in three hours and will implement (1) if it is still the favourite choice then.

In reply to Gustav W Delius

Re: Activities on site front page

by N Hansen -
I have to admit I don't understand exactly the ins and outs of 1s and 2s, but here is what I want to be able to do, perhaps you can understand whether your proposed idea will be able to do it:

1-I am setting up a "free course," that all site users have the option to enroll in and participate in, and I anticipate they also would like to receive announcements from my site.
2-I anticipate there are some people who will not want to enroll in the free course, but still will want to receive announcements from my site, and therefore I want them to have the ability to subscribe to site news only
3-I want both enrollees in the free course and subscribers to the site news to recieve the site news without any extra effort on my part.
4-I do not want enrollees in the free course to also inadvertently think they must subscribe to site news to receive it, and then receive double emails.
5-The ability to have site news that allows for individuals to receive it alone without having to enroll in courses as well as all course enrollees receiving it would be a huge benefit for those of us who are business users and want an easy way to communicate with both potential enrollees and enrollees alike about new course opportunities and the like.

Any structure that will allow the above to happen will make me happy.
In reply to N Hansen

Re: Activities on site front page

by N Hansen -
Perhaps to narrow my wishes down a bit to what is still not possible: as is, there seems to be no ability at the moment to do number 2 on my list. If this can be enabled, it would be great.
In reply to N Hansen

Re: Activities on site front page

by Jeff Wood -

n,

To the best of my knowledge

1 - This is already possible.  Your FREE COURSE is created as usual, just do NOT use an enrolment key.  ALL registered uses (whether they have enrolled in a course or not) will receive ALL site news (if everyone is subscribe is enabled).

2. Already exists - see above. They must have confirmed their registration, but have the option to not enrol in any courses.

3. Already exists - ALL registered users receive SITE NEWS. No matter how many courses they have enrolled in.

4. If enabled (I believe this is default) there is no need to subscribe to site news as everyone is by default.

5. Already exists - see above.

Hope this helps and that I'm not too far off base.

Cheers,

Jeff

In reply to Gustav W Delius

Re: Activities on site front page

by Gustav W Delius -

New suggestion: let the admin decide.

So by default we would have

  • all users who are students in at least one course are students on the front page
  • all admins are teachers on the front page

The admin could then choose whether or not

  • all users who are teachers in at least one course are also students on the front page
  • all users who are teachers in at least one course are also teachers on the front page
  • all users with a confirmed, undeleted account are students on the front page

The way I would handle this internally would be that those extra students and teachers get added to the user_students and user_teachers tables explicitly for course 1.

Would this please everybody? I need quick responses because this has to be done before 1.4 goes out.

In reply to Gustav W Delius

Re: Activities on site front page

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Looks like this release is definitely going to be later tomorrow. wink

That plan sounds OK to me, but in the interests of reducing possible last-minute security difficulties, please leave out the teachers stuff until a later release (maybe 1.4.1).

Just one variable will do it for now:

     $CFG->allusersaresitestudents = true;

I'll put all the configuration stuff for this variable in if you'll do the user selection logic and testing for various modules.  Thanks!

In reply to Martin Dougiamas

Re: Activities on site front page

by Gustav W Delius -

This won't take too long to implement. I'll get on to it right away. We have a stormy bank holiday over here.

So this is what we will get in Moodle 1.4:

There will be a configuration variable $CFG->allusersaresiteusers. When set to false then

  • all users who are enrolled in or are teaching on at least one course are site students
  • all admins are site teachers

When $CFG->allusersaresiteusers then

  • all non-admin users with a confirmed, undeleted account are site students
  • all admins are site teachers

In any case the union of site students and site teachers are the site users.

All modules will use these rules with only one exception: the forum force subscription will only apply to those site users who would be site users even with $CFG->allusersaresiteusers  = false.

In Moodle 1.5 the admin will get more control along the lines of my previous suggestion. Internally I will implement $CFG->allusersaresiteusers by adding the additional users explicitly to the user_students table.

In reply to Gustav W Delius

Re: Activities on site front page

by W Page -
Hello All!

I am not trying to "stimulate" anything too much here, but, would not an "opt in" Mailing List combined with enrolled students be more targeted towards those who want to receive information from a site? Especially for those business users?

  • Would there not be a way to combine the names and e-mail addresses of mailing list subscribers and enrollees so there would not be duplicate e-mails?
  • Also, would there not be a way to know who was a mailing list subscriber vs enrollee so that separate and specific e-mails could be sent out to either without some individuals receiving both.

I would think the database could be manipulated to do this with the proper tables and fields [Yes, I am learning bit by bit].

What do you folks think about this approach?

WP1
In reply to W Page

Re: Activities on site front page

by N Hansen -
WP1-Are you working on this mailing list option? I think the idea is perfect. I've been fooling around with a variety of alternative options and nothing really makes me totally happy.
In reply to N Hansen

Re: Activities on site front page

by W Page -
Hi N!

No I am not working on that.  School is now cutting into my time.  I had intented to work on the course_pay script and the bookmark_not script next.  My coding skills are still what I would call minimal so I am working with scripts that are essentially already completed and trying to learn some PHP by getting them to fit into another setting.

I do think a mailing list block would be helpful.  Especially for the Business folk.  Also, I think someone is working on some type of "Contact" Form Module.   Cannot remember who right now.

WP1
In reply to Gustav W Delius

Re: Activities on site front page

by Tim Allen -

"All modules will use these rules with only one exception: the forum force subscription will only apply to those site users who would be site users even with $CFG->allusersaresiteusers  = false."

Yesterday I sent out some an email from the site news forum that had been set to "forced" mode and this exception was not made: all my users got the email regardless of whether or not they were enrolled in at least one course or not.

This was in 1.4 stable.  My obvious question is: has this exception in fact not been coded, or is it not working properly?

Thanks in advance,  smile
Tim.

In reply to Gustav W Delius

Re: Activities on site front page

by N Hansen -
As long as "all users with a confirmed, undeleted account are students on the front page" is an option, regardless of whether it is by default or by admin's choice, I'm ok with it.
In reply to Gustav W Delius

Re: Activities on site front page

by Ron Banks -

I would like to give my input and desires here.

I am running Moodle as community as well as non-formal courses.  I have students who have taken courses and have developed relationships with other students.  They now are not enrolled in any course but are still registered users.  I would like them to be able to stay in the community and keep those relationships with their mentors and other learners while other courses are being developed for them.

We are finding through community that our mentor/protege relationships are a form of learning in and of itself.  For us to be able to easiy maintain that would be great.

So my vote is for registered units to at least use chats and forums on the main page without being enrolled in a course at the present time.

Thanks,
Ron  Banks

In reply to Ron Banks

Re: Activities on site front page

by Gustav W Delius -
Fine, Ron, you are getting this. However one thing you might consider doing is keeping all those former students in a dedicated alumni course. That will make the continuing relationship feel even more personal than if it only goes via the front page.
Average of ratings: Useful (1)
In reply to Gustav W Delius

Re: Activities on site front page

by Ron Banks -

Hmmm ... good point.  Much like the Using Moodle "course" is doing, I am assuming.  This would allow for other features as well, not just chats and forums.  Great idea.  I will muse and ponder on this one today.

Thanks,
Ron

In reply to Gustav W Delius

Re: Activities on site front page

by Petr Skoda -
Picture of Core developers Picture of Documentation writers Picture of Peer reviewers Picture of Plugin developers
Just wanted to ask whether I implemented 2/3 access for book module correctly.

I used following code to limit student/teacher access:

if ($CFG->forcelogin) {
  require_login();
}
if ($course->category) {
  require_login($course->id);
}
$isteacher = isTeacher($course->id);

I thought that front page has no category defined.

thanks
In reply to Petr Skoda

How to test login

by Gustav W Delius -
You can always use require_login($course->id), this works even if the course is actually the site and is then equivalent to require_login().
In reply to Gustav W Delius

Re: How to test login

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
What Petr had was correct though, because we don't want to force login on site-level activities.
In reply to Martin Dougiamas

Re: How to test login

by Gustav W Delius -
I am afraid I am hopelessly confused. Why don't we want to force login on site-level activities? What are we going to do with grades and other activity data if we can't associate it with a user?
In reply to Gustav W Delius

Re: How to test login

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
If the activity necessarily has grades and activity data, then it needs login.

But resources, books, forums, glossaries, and wikis work fine without a login, so they don't need to require one.
In reply to Martin Dougiamas

Re: How to test login

by Gustav W Delius -

Right, so the rule is that wherever guests can go, front page visitors should be able to go without logging in, provided $CFG->forcelogin is off. Is that right?

In reply to Gustav W Delius

Something other than course list or forum?

by Michael Penney -
Hi Gustav, is there any way this work could enable something other than the forum or the course list to inhabit the center block on the front page?

I'd love it if we could have a simple content block like the top block of a topics course, where a more generic, always editable! (without going into the databasesad, and 'pretty' site introduction could go.

Something like the book module in the center block would also be great for large installs like mine, where we would like to have descriptions of each college and department come up on the front page, readable (like the forum) without logging in.