Add default activity to a course creation process.

Add default activity to a course creation process.

Ravishankar Somasundaram -
回帖数:23
Help needed

As a general forum gets added by default when a course is created, i would like to add my custom activity or resource like that (typically i want to add a quiz with a default true or false question). which appears by default when a course is created.

i know this need to be hard coded, expecting a heads up which and where if somebody has already worked or pretty familiar with this.
回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

sathish kamaraj -
What version of moodle u r using?
回复sathish kamaraj

Re: Add default activity to a course creation process.

Ravishankar Somasundaram -
1.9.4 and sometimes 1.9.4+


i guess theres no much diff between the core files of these two versions
回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

Uma Vellayappan -

Hi Ravishankar,

Is there any block that is available to add activity to a course during the creation?

Thanks!

回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

Hartmut Scherer -
Hi Ravishanka,

I use a template for new courses. Whatever resources and/or activities I want to have in a new course, I just add them to the template. With "Restore" in the admin block in the template course, I start creating a new course.

With kind regards,

Hartmut
回复Hartmut Scherer

Re: Add default activity to a course creation process.

Ravishankar Somasundaram -
Dear Hartmut Scherer,

But i wanted it to be part of moodles regular behavior on creating a course.

I kind of figured out and implemented how to add activities and resources on default course creation process, will soon write a config in course settings where you can set the required activities and resources and customize them to get them as a part of a course when ever you create one.
回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

Daniel Neis Araujo -
Core developers的头像 Plugin developers的头像 Translators的头像
Hello Ravishankar,

here at Universidade Federal de Santa Catarina, Brazil, we have similar needs, but we also need the creation of categories. I have proposed this, but didn't got much interest at http://moodle.org/mod/forum/discuss.php?d=139465 .
Maybe we could work together at this.
回复Daniel Neis Araujo

Re: Add default activity to a course creation process.

Ravishankar Somasundaram -
Sure Daniel, happy to help you.

went through the forum topic to which you have linked to,Am not sure that i understood the complications involved for a teacher to go to grades section and manage the calculations straight away.

can you please give me some more explanation to understand whats happening and what are you looking for ? so that we can proceed.
回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

Daniel Neis Araujo -
Core developers的头像 Plugin developers的头像 Translators的头像
Hello, Ravishankar

here is what i am looking for:

- An interface where the admin can setup not only an activity to be automatically created with the course, but setup the entire grade structure (with categories, aggregation and so on) to be created automatically with the course. This way, the majority of the teachers (which in our case use 0.3 * out-of-class-works + 0.7 * avg-of-tests) won't need to create this structure.
回复Daniel Neis Araujo

Re: Add default activity to a course creation process.

Ravishankar Somasundaram -
Dear Daniel,

I have few questions

1. These activities which are going to be common, how long they live, i mean how frequent are they subjected to change ?

2. Assuming the course is created with default activities, now when the teacher creates new activities, how are you planning to make him add that newly created activity to the category which was created ?

based on your answers to the above questions i can suggest an architecture and ways of achieving the same.
回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

Daniel Neis Araujo -
Core developers的头像 Plugin developers的头像 Translators的头像
Hello, Ravishankar

about the first question, maybe i couldn't explain myself yet. Let's try one example of use case:

- Suppose i am a professor at my university. If i want to you moodle in a class, i go to moodle.usfc.br, log in, go to a box that says "my classes" and click in a link "make available class FOO". Then, this course is created in moodle based on info from the official database of the university (the teacher and the students are enrolled, the syllabus become the summary, etc).
- Now that i have my course created, i can enter it and start using it.

The classes here are semiannual, so every semester the professor have to ask for the creation of another course in moodle. Even if is the same discipline (let's say, introduction to calculus), in the next semester is another class and another course in moodle.

My idea is, for each created course, create grade structure based on the common case. The professor can then start using the course normally and alter the structure in gradebook, exactly like what is done today, if he needs. All automagically created categories and activities will be common ones, and the professor could create new activities and set the categories in the same way that is done nowadays.

Hope I have answered you questions.
回复Daniel Neis Araujo

Re: Add default activity to a course creation process.

Ravishankar Somasundaram -
I think i got answers for the above posted two questions

  1. 6 months (semiannuall = half year ?)
  2. Teacher uses the usuall moodle way of clicking on grades in course administration block and selecting grader report from list to view the report / click edit/create categories to create new categories, rebase the activity,resource inside an category and apply an appropriate formula if needed
Is my understanding correct Daniel ?

And am pretty impressed with the automation stuff which you have mentioned in the earlier part of your reply, do i get a chance to see some of them in action if possible ?

screen shots also will do good, you can email them if you like to my email id which i have'd pm you
回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

Daniel Neis Araujo -
Core developers的头像 Plugin developers的头像 Translators的头像
Hello,

1. yes, semiannuall = 6 months = half year. But in fact, we have classes for 4 months.
2. yes, teacher uses the usual moodle way of edit grades.

About the automation stuff, i would be happy in share it with you. I will check if the repository is open world wide, and then i send you the link. I will made some screenshots as soon as possible and send them too, because the code is in portuguese and they (the screenshots) can say more.
回复Daniel Neis Araujo

Re: Add default activity to a course creation process.

Ravishankar Somasundaram -
Dear Daniel,

Ok, 4 to 6 months is quite a good duration and teachers are anyways using the normal method to access and change the category in which the activity/resource falls.

I asked the second question to understand whether the teacher is aware of how to actually set categories, place gradable items in them and make formula around them, or you are trying to avoid the educating time to teachers for using default moodle options to achieve.

Asked the first question to understand the gravity of the requirement in having a block in course page. For a period of 4 to 6 months its not really going to do a big difference in user experience for teacher role IMHO.

Am under the impression that the formula to calculate course grade is already hard coded and when ever teacher creates new course, the course also has the default 3 categories you were talking about along with the hard coded formula applied to them.

i have in mind that you wanted to achieve this

>
Our idea is to move this creation (that is hard coded in our scripts) to a screen, to let the administrator mount the structure as needed, and let the non-standard teachers redefine the scheme if they need.

Now am having all kinds of confusion on what do you mean by you have hard coded the formula, wont the hard coded formula be available in formula editor text area of the created new course by default ?

If not, will making the above happen will fit your requirement (this part "the non-standard teachers redefine the scheme if they need") ?

If answer is yes for above ^ question, then you can achieve the admin part ("administrator mount the structure as needed") by moving the formula formulation code from raw php to simply a another field in the default course settings page.

Thus achieving GUI entirely for your requirement without much work re-base.

Please correct me if i have some wrong understanding in some place on the requirement.

回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

Esh Nagappan -
Dear Ravishankar,

I would like to create a template with a set of available moodle activities.

Let me explain it with example, i want to create a template 'Enterprise module' which will be a combination of conditional activities such as start with viewing a resource, followed by submit an assignment, take up a quiz and finally write a wiki entry on the module. when the user selects this 'Enterprise Module' template, the user should be able to setup these various activities and add them to a course at once using this template.

Later, we are planning to make this template be available to the user as an activity.

I would really appreciate if you could point me to a direction to start with . It would be great if you could share some thoughts on how to save a combination of activities and populate them by default on creating a course.

Thanks
Esh
回复Esh Nagappan

Re: Add default activity to a course creation process.

Ravishankar Somasundaram -
Dear esh,

Nice requirement that you are trying out, seems like you want ideas/help on architectural level to achieve this requirement.So i better stick to it ;)

Am assuming this selection of templates which is going to hold scripts to create modules automatically is a one time process and cannot be (does'nt make sense to be) changed some time in the middle after the course is opened for students.

The architecture which i suggested to Daniel can help your kind of requirement also

1. You can allow people who are going to create a course to select a template from listed different template types in the course creation page.

2. In Site Administration -> Course create a new phase link called templates to manage the contents of template

3. So when a admin goes to Site Administration -> Course -> templates, he gets to create a new template,edit,delete,(this one is advanced)club multiple templates.

4. On creation of new template you need to set what are the activities,resources which needs to take part in that template and in which order with what conditions.

5. Voila ;)


Now moving to the second part.

Later, we are planning to make this template be available to the user as an activity.

I wouldn't advice doing this way, moodle has separated everything under two categories namely "resource" and "activities" for a reason.

I see them this way
Activities are something which interact with people and makes the facilitator aware of the same whereas
Resources are supportive materials for student to have a healthy interaction when he enters any activity.

so having your own template which is going to create resources as well as activities inside any of those (activity or resource drop down menu) is bad BAD.


Now the last part.

I would really appreciate if you could point me to a direction to start with . It would be great if you could share some thoughts on how to save a combination of activities and populate them by default on creating a course

To comment on this, i need to know your comfortness with moodle development as a whole.

Only then i can suggest you things you need to look at and work with to attain the above said.

Like for example if you are a starter this is the best place to kick it off

How moodle developement works
Developer guidelines

In what stage are you till today on this template thing ?
回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

Esh Nagappan -
Dear Ravishankar,

Thanks a ton for providing such detailed information 微笑

I am a starter in moodle development and i will read through the links to understand how moodle development works.

We have just finished gathering our requirements and yet to start with implementation. On reading your suggestion, i understand it is not a good practice to mix resources and activities. We were planning to make this template available as one activity as there might be instances when the user might not need to use this set of activities but just simply add a resource or activity. As an alternative, i am thinking of separating the resources and activities available as separate options i.e. one 'Enterprise Resource' option under resources which will populate the set of required resources and ' Enterprise Activity' option under activity which will populate the set of required activities. Basically these options will be a template of set of resources or activities with conditions set on them as per our need.

Let me know your suggestion on this.

Many thanks,
Esh
回复Esh Nagappan

Re: Add default activity to a course creation process.

Ravishankar Somasundaram -
Dear Esh,

Please clarify one thing, when you say you are planning to make it a single activity and resource template, so that the course creator/teacher can create this template and if at some point of time he feels that its not required he can delete the entire set which he created ?

If yes, you can go for a extra list box called "templates" which will list out all templates created within for a course which when selected populates the course automatically with decided activities and resources, instead of putting templates separately for activity and resources. and in this case you can skip the first point which i have mentioned above, you can allow teachers to select the template at any given time from inside the course itself.

And since you are a starter, i would suggest you first get to know the basics of moodle coding and then straight away get into the process of looking at how each activity and resource behaves on receiving a request for creation.

You can turn up here anytime, i would feel happy to help you.




~ ~ ~ Peace, Ravishankar Somasundaram ~ ~ ~



回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

Daniel Neis Araujo -
Core developers的头像 Plugin developers的头像 Translators的头像
Hello,

back to work, I find some time to look at this.

Based on the actual tables for store the grades structure, it seems that we have three ways to look:

- If we want just one template, we can hack the existing classes (grade_item, grade_outcomes, grade_categories) to save the template to course 1, and then in the course creation process we copy the items, categories and outcomes from that course.

- If we want various templates, one approach would be create new tables to store the items, categories and outcomes, relate them to the template instead of the course id and create new classes what seems to be a big effort

- Also in various templates, instead of copiyng the tables we could use an approach like the one of contexts, and hack the existing classes to deal with it.

What do you think?
回复Daniel Neis Araujo

Re: Add default activity to a course creation process.

Daniel Neis Araujo -
Core developers的头像 Plugin developers的头像 Translators的头像
Hello,

i was looking at the course backup/restore process of moodle and it covers the grade structure too.
So, i think an easier approach would be to let the admin backup just the grade structure of a course, save the resulting XML in the server, and set a course configuration to restore the grade structure from the file.
This way what we need to do is reuse some of the code that already exists in backup libraries, add a course configuration, and a button somewhere to let the admin backup the structure.

What do you think?
回复Daniel Neis Araujo

Re: Add default activity to a course creation process.

Ravishankar Somasundaram -
People sorry for not following this thread, because of the inactivity here for few weeks i let loose.

It would be very nice if we have a system in moodle which provides an indication to the user if some growth has been happening in the posts,threads which he intiated or posted to isnt it ? have added a entry here

Dear Daniel Neis Araujo,

Yes i agree with you, that would save a lot of coding efforts, follow more clean methodology to achieve this objective.

But

To argue for the sake of finding potential issues with this.

Is it user-friendly ? As an end user who has limited knowledge on administration ?

One way to achieve One thing is always highly encouraged unless the user requests for an shortcut or his specific point of usability factors taken into consideration while development ?


回复Ravishankar Somasundaram

Re: Add default activity to a course creation process.

Daniel Neis Araujo -
Core developers的头像 Plugin developers的头像 Translators的头像
Hello, Ravishankar

sorry for the delay, i was busy solving another problems at Universidade Federal de Santa Catarina.

I hope you can take a look at this again...

I am attaching a beta version of what i have proposed.

This patch does the following:

* Adds an option (moodlecourse/gradebook_file) to course default settings that let the admin set the path to the file. I was thinking about how to make it relative to moodledata, but didn't work on this, so the full path must be informed.
* Adds one button to simple/full view of gradebook to let the user export the gradebook structure to a xml file.
* Adds a file input to simple/full view of gradebook to let the user import the gradebook structure. The course must have no grade categories or items beside the top/course to import to work. If the user tries to import a grade structure in a course with categories and/or items, he/she is told to delete them first
* Finally, it adds some code to course/edit.php , in the creation process, to restore create the gradebook strucure if a valid file was set at course default setting.

I didn't test it very much, so it may have some bugs and still let some inconsistencies around (like backup files not deleted, etc).

I would be happy if you or someone else could take a closer look and post the impressions.

Thanks,
Daniel
回复Daniel Neis Araujo

Re: Add default activity to a course creation process.

Daniel Neis Araujo -
Core developers的头像 Plugin developers的头像 Translators的头像

Hello,

just an update: in the External Database Enrol Plugin for Moodle 2.0 it is possible to specify the shortname of a course to be used as template.

Regards,

Daniel

回复Daniel Neis Araujo

Re: Add default activity to a course creation process.

Marcelo Murad -

Hi Daniel,

I'm looking for some way to add a quiz automatically to a new course. I have the backuped zip file and now I'm trying to figure out where and how to call restore function when a course is created. Can you please share the code you have developed?

 

Thanks,

Marcelo Murad