Active
Project:
Gradebook
Version:
6.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2009 at 11:54 UTC
Updated:
8 Feb 2010 at 02:08 UTC
As the quiz has begin and end date would be great to use it to establish the dates of the assignments and not to be asked twice. Patch attached.
| Comment | File | Size | Author |
|---|---|---|---|
| gradebookapi.diff | 5.72 KB | manolopm |
Comments
Comment #1
MGN commentedI see a couple of problems. First, it looks like the diff is reversed, so the patch wont work as is. But there is also a bigger problem - the approach itself fails if someone has a node type called quiz that is *not* created by the quiz module (or doesn't have the fields you specified).
Generally, I think its a bad idea to create dependencies on specific modules (like quiz in this case), but I understand what you are trying to do. Here are a couple of suggestions to get the functionality you are after:
1. Allow the date fields - both publish date and due date - to be optional. If publish date is present, then hook_cron is used to control the publishing of the node. Otherwise its automatically active.
2. Allow the teacher to decide if a given assignment implements the date fields or not, as a checkbox on the create assignment form.
3. If necessary, build appropriate hooks into the gradebookapi that allows for a proper (optional) gradebook_quiz integration submodule. This way, those not using quiz are not affected by the unneeded code.
To accomplish #3, first describe what functionality you need. If it can't be done with the current api, then we can consider extending it.
Not knowing anything about the quiz module....It looks like you want to omit the date fields that are added by gradebookapi_hook_form_alter, and use the date fields provided by quiz. I believe the right way to do this is to make a submodule that implements hook_form_alter (to delete the gradebookapi date form elements when the node type is quiz...) and use hook_nodeapi to substitute the quiz date fields before storing the assignment in the database.
I think it would also be possible to implement you other feature request #418028: Provide better integration with the quiz module in the same submodule.
Now that I think of it, 1 and 2 aren't really needed for you feature request, but they are still a good idea. I'll develop that part of it, if you can work on developing the gradebook_quiz submodule. What do you think?
Comment #2
manolopm commentedOk We have some work this week but we try to make the submodule the next week (or in the weekend)
Comment #3
MGN commentedMarked #707414: Grade from Quizzes not being auto-filled in Grade-book? as a duplicate feature request to improve quiz integration. @manolopm, did you get around to working on this?