Plugin development resources

Plugin development resources

by Wes Vanlandingham -
Number of replies: 4

How challenging would it be to develop a plugin which would update a course completion date each time a user uploads a new submission for an assignment activity? 

Average of ratings: -
In reply to Wes Vanlandingham

Plugin development resources

by Joseph Thibault -
Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers

Sounds fun, flesh out your idea a little more: 

Are you assuming that completion for each item has a specific duration e.g. it takes 1 day to complete this task?
Is it based on other student time to completion? 
Is there an example of a course you can use as a guide? (X of assignments, for each assignment, estimated time to completion for each)

 

In reply to Wes Vanlandingham

Plugin development resources

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
If you have not already found it, check out the Developer Pathway at https://moodle.academy/. That is probably the best introduction to writing Moodle code. If you understood Moodle development, this sounds like a relatively easy plugin to make. (Observe assessible submitted events, update other thing.)
Average of ratings: Useful (2)
In reply to Wes Vanlandingham

Plugin development resources

by Alexa James -
That's an interesting use case! It would likely require a local or task plugin that listens for the submission event and then updates the course_completions table. For a solid foundation in how Moodle handles events and database updates, I highly recommend checking out the structured learning paths at Moodle Academy. It’s a great way to ensure your code follows Moodle’s development standards.
In reply to Wes Vanlandingham

Plugin development resources

by A K M SAFAT SHAHIN -
Picture of Core developers Picture of Moodle HQ Picture of Plugin developers
As the rest of the replies, definitely go through the academy course, but in terms of the difficulty of the requirement you mentioned, it does not seem very hard.

You will need the tool trigger plugin (https://moodle.org/plugins/tool_trigger) to listen to the assignment submission event.
Then you will need to build a plugin (possibly local) where you should write a webservice, and that webservice will do the reset or whatever logic you want to action.
And the tool trigger plugin can call that webservice for that user when a submission is done.

Including Moodle Academy, these are some useful resources:
Creating a new plugin: https://docs.moodle.org/501/en/Plugin_skeleton_generator
Writing a webservice: https://moodledev.io/docs/5.0/apis/subsystems/external/writing-a-service

Hope these help!
Average of ratings: Useful (1)