Extending a plugin

Re: Extending a plugin

by Tim Hunt -
Number of replies: 1
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

So, you really need to understand where this information is stored in the database (quiz_slots and question tables) and how that is used when to pick a real question for each slot when the student starts an attempt (quiz_start_new_attempt function in locallib.php).

This code is not currently developed in a way that makes it easy to modify by writing plugins. (Mainly because no-one has needed that badly enough to justify the work involved.) However, in principle there is no objection to having a type of sub-plugin for this. In the mean time, you will have to change the core code.

(Alternatively, think about how the categories are arranged in your question bank, so you don't need to change the Moodle code at all.)

In reply to Tim Hunt

Re: Extending a plugin

by lital l -

Hi,

I want to add an option of late submmition for specific users in scorm (like we have in assign).

I made some changes in the scorm module:

1. I created new table 'scorm_user_flag' in order to save there the information of the extand time.

2. I created a new form setting (addtimesettings_form.php) that contains the form definition (open time, close time - read only, and extand time).

3. I added a new column to the report table in report.php

4. The new column contains a link to /addtime.php?id=XXX&userid=XXX&action=grantextension&sesskey=XXXX 

- new addtime.php file that I created.

this file calls to addtimesettings_form, and display the form.

Now, my question is:

How can I now catch the button action and add the information to the 'scorm_user_flag' table?

when i now click on the button, I redirect to /additem.php and get error, that id parameter is missing.

Thanks.