recycling a course

recycling a course

by Gustav W Delius -
Number of replies: 12

Currently the procedure for recycling a course, i.e., making it available for a new batch of students, is the following:

  1. Backup the existing course with all data in it. (Requires 4 clicks)
  2. Rename the existing course (for example by adding a date) (Requires 3 clicks)
  3. Restore the existing course without user data (Requires 25 clicks because the user data has to be deselected individually for all modules)

Now this does not sound so bad until you come to the end of term and have to go through this procedure 30 times. It is quite time-consuming. So I was wondering whether this could not be made more comfortable:

  1. Select all courses that are to be recycled,
  2. Specify the suffix that should be added to the names of the old courses,
  3. Watch the script run while you have a cup of tea.

Now you will probably say that if I want to have the cup of tea then I should simply code the above. Unfortunately the backup and restore scripts are rather complicated. Perhaps Eloy could provide us with a simple function backup_and_restore($courseid) which does what the name suggests. Then all the rest will be simple (calling this function once for every course desired and then doing the renaming of the courses).

Average of ratings: -
In reply to Gustav W Delius

Re: recycling a course

by Bob Calder -
Gustav,
What would be the problem with un-enrolling students at the appropriate date? Then we wouldn't be adding whole blocks of duplicate records into the course and resource tables. The student's records should remain available but beyond that, the situation should be easier to code. Right now, I have to match current students to sort out the old ones. As far as variety in the curriculum goes, I just turn on and off my various additional lessons when I wander off on a tangent with a group that is more advanced than normal.

I also don't like the idea of archiving and restoring as a way of managing an activity in a database.
In reply to Gustav W Delius

Re: recycling a course

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
My plans here were for a function in each module called MODULENAME_empty_course($courseid) which knows how to delete all the user data from all instances of that module in a given course.

This could be used by a GUI to empty a lot of courses at the same time.  If you wish, you could run a scheduled backup on everything beforehand, but this would be separate.
In reply to Martin Dougiamas

Re: recycling a course

by Tim Allen -

A quick question about a side issue:

If I delete a course (after backing it up and restoring it to a new empty one), what happens to the users who are only enrolled in this course?  Are they still left in the site users list or are they somehow removed?  And are their files deleted or do they remain in moodledata?

If they remain registered then it still requires over 100 clicks to remove them as registered users of the site.  So it would seem very tedious to remove users at the end of the semester if this is the case!  mixed

Tim.

In reply to Tim Allen

Re: recycling a course

by Gustav W Delius -

I would guess they remain registered. There is not much harm in having users in the database that are no longer active. But I agree that it would be nice to have the option to remove all users that are no longer linked to any activity. This would be easy to do (though a bit time consuming) by calling the module_get_participants() functions.

This whole issue of site-wide user and course administration has not been addressed in Moodle. Unfortunately it is a difficult issue because everyone has a different set of requirements. Perhaps this is an area where we could learn from other VLE's. However I am going off topic in this forum. This thread was just intended to let Eloy know that there would be some use for backup and restore function calls in addition to backup and restore pages.

In reply to Martin Dougiamas

Re: recycling a course

by Ger Tielemans -

Would be a big relief to have such a function. (I understand earlier that there is a kind of phantom-user-protection-function to keep these users in the database as long as their answers on forums are still vivid in some courses.)

What I do is that I put several of this kind of functions, like your server-status-handy behind buttons on our admin page, only accessable for admins:

the use of the combination of backup and this new empty a course could be stressed/visualised in our local-page-layout.

In reply to Gustav W Delius

Re: recycling a course

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Gustav,

the backup_and_restore() functions seems to be really hard (although no impossible) to implement currently. Perhaps with Moodle 2.x and its OO future...

I can imagine two solutions to avoid that 25 (too much modules in your server!!) clicks for each restore.

- Add some "Enable/Disable User Data" button mark all the modules as required.
- Currently, if some module has "with user data" selected, it has priority over the "Restore Users" option (changing it automatically). We could change this approach making the "Restore Users" option the main one, forcing with its selection to every module "with user data" option.

This should avoid your (25-1)*30 = 720 clicks!! big grin

Any comment?

Ciao smile
In reply to Eloy Lafuente (stronk7)

Re: recycling a course

by Gustav W Delius -

Yes, making it possible to deselect user data for all activity modules at once would be a great help. approve.

Why would it be so difficult to wrap up the backup and the restore functionality into functions? It would seem to me to make the code simpler and more transparent rather than more complicated.

In reply to Eloy Lafuente (stronk7)

Re: recycling a course

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
For the userdata GUI, I have been thinking it should use two radio buttons instead of the little menu ... it would be much easier to work down the list clicking on yes or no. 

At the top could be two radio buttons for "all modules" that would change the radio button settings for all the modules (to yes or no).  I can help with the javascript for this.
In reply to Martin Dougiamas

Re: recycling a course

by Eloy Lafuente (stronk7) -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Peer reviewers Picture of Plugin developers Picture of Testers
Hi Gustav (and Martin),

Now the toggle to "all modules user data" is in CVS. It's implemented as two links and every individual activity continues having the little menu (I think it's more readable than radio or checks). Anyway, this and the appearance of the two links can be easily (relative) changed to fit your requirements. Now, your fingers (and your mouse) are going to save 720 clicks!! big grin

Enjoy and feedback, TIA and ciao smile
In reply to Gustav W Delius

Re: recycling a course

by Kal Jordan -

Hi everyone

I am brand new to Moodle and these forums, but I think this thread relates to my current problem. I need to have two very similar courses running concurrently. The content of each is almost identical, except that one is tutor-led and the other self-study, so the second course doesn't have all the same interactive add-ins like chat and attendance each week.

My question is: is there a simple way to duplicate an entire course and then alter the 2nd one? I have created my tutor-led course and I wish to duplicate it for self-study students but remove some features. Is this possible? If so, how do I go about it?

thanks in advance smile

Kal

In reply to Kal Jordan

Re: recycling a course

by Gustav W Delius -
This is very easy. First you make a backup of your course (you find the link in the administration box of the course) and then you restore it to a different course. Just try it out, it is all pretty self-explanatory. When you restore you can choose whether you want to include the user data or not. You probably want to restore without the user data.