Hi,
I've proposed a small addition to the assign submission plugin API, to enable use other than the current single submission plugin per assignment. Unfortunately Damyon thinks isn't needed, and neither of us seems able to convince the other of our position.
Maybe if some more people could have a look at MDL-47880 and comment, they could help one of us come around
In summary...
Problem: I need students to submit an essay in a document format (e.g. PDF, MS Word), and enter a word count for it. (The word count should only include the essay text, excluding its references, thus excluding an automatic count.)
Possible solutions:
- Hack mod_assign locally, to add a wordcount field directly as part of the assign table.
- This would require maintaining the changes against core, and make upgrades increasingly difficult - bad.
- Hack mod_assign and get it committed to core, adding a wordcount field as part of the assign table.
- Whilst having this as part of core would solve my problem, it would be forcing it on all other Moodle users, probably only a small fraction have the exact same need - bad.
- Create a submission plugin which requires the student to enter the number of words, and store the result in a plugin table `assignsubmission_wordcount` - i.e. my Word count plugin.
- This means that a student entering a word count can submit the assignment, without uploading their assignment file - due to the OR check in submission_empty() - bad.
- Create a submission plugin, but also modify core assign so plugins can explicitly state if submission_empty() should check using something other than OR.
- Requires adding a function to the assign_plugin class, which - when provides the current behaviour if not implemented by plugins Solves the problem.
Solution 4 seems to be the only one that works for me.
In a broader context, this is a question about how to support non-core development - without my change, it seems impossible to create submission plugins that don't fit the exact model currently in the code.
Damyon has suggested changing the plugin's is_empty() to return true (even though it isn't empty), so the OR (number 3 above) would not be affected by my plugin. However, this isn't any use because it prevents the plugin value appearing in the Submission status table.
Possible resolutions (in order of preference):
- We figure out a way to get the right behaviour without any API changes.
- Recognise that there is a need for the API change, and make it.
- Recognise that the API is lacking here change, but decide that the increase in complexity outweighs the increased flexibility. (So I have to maintain the change outside of Moodle.)
Cheers,
Dave.