Support Forums

Development Forum

My first patch: Disabling Course Auto Approval


You must be signed-in to post.

AuthorSubject
  Page: 1 | 2
jfmateos

Avatar for jfmateos
jfmb_0001.zip
Subject: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
My first patch: Disabling Course Auto Approval

I have finished the development of my first patch (you can find it attached to this message)… although I feel that I still have a lot to learn.

This patch works on ATutor 1.6.1 and is totally free.

The description of my patch is the following:

***
"Includes the options "Auto Approve Courses" and "Course Request Email Notification" in System Preferences.
If the administrator disables the "Auto Approve Courses" option, the instructors will not be able to create courses automatically; they will have to configure the course and wait for the administrator approval.
The administrator can manage the course requests using Courses>Course Requests.
Enabling "Course Request Email Notification" will send a message to the administrator whenever an instructor request a new course that requires approval."
***

What should I do to get this patch integrated into the official ATutor source code?
Posted: 2008-09-20 07:10:22
greg

Avatar for greg
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
We'll try it out soon, and let you know if we can include it in the public code.
Posted: 2008-09-20 08:37:51
vegard

Avatar for vegard
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
hia, I'd like to try this out and give some feedback then, could you post it again but choose "public" instead of "private" so we can download it?

in general I think that this is a very good idea, I'm personally very reluctant to make people instructor as I lose control of which courses are made then..
Posted: 2008-09-29 08:45:12
jfmateos

Avatar for jfmateos
jfmb_0001.zip
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
Of course vegard . Here it is.
smile
Posted: 2008-09-29 10:17:45
jfmateos

Avatar for jfmateos
jfmb_0001.zip

Attachment: jfmb_0001.zip
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
Upsss... I posted it privately again in my previous message.
Sorry...
wink
Posted: 2008-09-29 10:21:12
vegard

Avatar for vegard
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
cool! for some reason I had to unzip it and then zip it again locally to get it installed, but when done it works as you describe it, and *functionality-wise* I definately think this would be a good addition to core!

the developers would have to have a look at the code to see that it meets their standards, though.

another thing that struck me, which is more of a general observation, is that the system preferences page is getting a bit crowded and there might be a good idea to have a look at it in the future and try to group elements a bit more, so it's easier to manage (especially for inexperienced admins).
Posted: 2008-09-30 03:58:58
vegard

Avatar for vegard
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
one / two very small bugs: when denying a course and selecting "Inapropriate subject matter" or "The courser description requires more detali" you have an extra "/n" added to the e-mails sent to the instructor in spe:

Your request for ATutor course sniff has been denied.
\nInappropriate subject matter.

Your request for ATutor course deny me has been denied.
\nThe course description requires more detail.
Posted: 2008-09-30 04:05:52
jfmateos

Avatar for jfmateos
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
Thank you very much for your report vegard.

I also agree that the preferences page is a bit crowded.

A soon as Greg tells me what should I modify to get this patch included in aTutor official code, I will solve the little bug you have detected with \n.

I am also plannig to develop a more specific privileges system for some aTutor modules.

Best regards from Madrid.
Posted: 2008-09-30 10:00:31
greg

Avatar for greg
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
The file won't unzip for me.

I've fixed the extra /n updated the repository.

I can't find the original post, but Vegard, the directory is now templated, and should show up in tonight's build.
Posted: 2008-09-30 16:14:44
jfmateos

Avatar for jfmateos
jfmb_0001.zip

Attachment: jfmb_0001.zip
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
Yes it seems that the file I uploaded was compressed twice.

Try this one.
Posted: 2008-09-30 17:37:05
jfmateos

Avatar for jfmateos
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
This is very odd. I have uploaded the file again but it again does not unzip properly.

Try to download it using this link: www.villatic.org/carpetaJuanfe/jfmb_0001.zip
Posted: 2008-09-30 17:41:24
greg

Avatar for greg
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
That one worked.

Your addition seems to work well.

You should add a box to the admin home page, or perhaps modify the existing instructor requests box, to list the number of new course requests, when course request approvals are required.

Also where you are adding or modifying code in the core, include a comment explaining what the code does, and give yourself credit: mention your name.

Make some suggestions for updating the Handbook to describe the new functionality. The admin and instructors handbooks will need some modifications.

I'm curious why you duplicated the courses table as course_approvals. Why not use the existing courses table and add an approve field. Or maybe create a two field table with course_id and approve fields. Our preference would be to minimize the amount of code and the size of the database where ever possible.

There are still a few weeks left before the next release. If you want to make those few adjustments, and justify the new table, or replace/remove it and/or adjust the courses table with a new field, we'll consider adding your changes. I think they'll make a nice addition.
Posted: 2008-10-01 08:52:59
jfmateos

Avatar for jfmateos
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
Dear Greg,

Thank you very much for considering my patch.

The box in the admin page is already implemented in the patch I posted (it only appears when there is at least one course that requires approval)... You can see it in this image (http://img114.imageshack.us/my.php?image=courserequestsxy8.jpg). Doesn't it work in your installation?

I will include comments in all the modifications to the core code.

I will write a description explaining this feature and indicating where the handbooks are affected.

My first intention was to use the original courses table, but I discarded it due to the following subjective issues:

1. I wanted to keep the parallelism with instructor requests feature, and as this features rely on the instructor_approvals table …

2. This is the most subjective: I do not like jumps in the auto_increment fields of tables and as it is very probable that many requested courses will end up being denied… (of course, I assume that deleting a course also inserts a jump in the id field, but I suppose that deleting courses is less probable than denying them).

3. Using the courses table would require including at least to new fields: approved and initial_content. In future, perhaps we will want to include even more fields that only affect to the course request feature, such as "Why are you requesting this course", "Who is this course intended for", …

4. I think it is more easy to understand for potential developers the original structure of the course table (it only contains information about the real courses) than trying to find out what is the meaning of the field "approved" (or any others that are only relevant for the requests, and whose significance disappears once approved or denied).

As you can see, all my arguments are quite subjective. Anyway, if your prefer it, I will modify the patch to use the courses table.

I am very impressed with the quick and high communication level you maintain in this forum. Thank you very much Greg.
Posted: 2008-10-01 11:18:50
greg

Avatar for greg
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
1. It think the course_approvals table should be removed. Its really just taking up space.

2. Consecutive increments are nice, but unnecessary. No one ever sees the course IDs listed in ATutor. Please do add an approve field to the end of courses table.

3. Maybe in the future, but for now the course description field could be used to collect this information, perhaps updating the language associated with the create course screen to ask for that info when making a request. We can always create another small table for this info in the future if necessary.

4. I don't think adding an approve field with make the table any more difficult to understand. the approve field appears in a number of places in ATutor, and they generally all mean the same thing (allow only after approved)

Be sure when your putting this together that the original functionality is still available, so those using create course as it is currently, can continue using it that way.
Posted: 2008-10-01 12:27:16
jfmateos

Avatar for jfmateos
Subject: Re: My first patch: Disabling Course Auto ApprovalQuote this post in your reply
OK Greg, I will add the approved and initial_content fields to the courses table and modify the patch.

Thanks
Posted: 2008-10-01 14:41:07
 Page: 1 | 2

You must be signed-in to post.