Re: the expiry date
I'm looking to dynamically produce the expiry date, based on the date of certificate issue/course completion, and print it on the certificate, which is not supported via Conditional Activities.
How would you go about doing this?
To tell you how I started, and where I'm getting hung up:
- I added a validdate form the $mform in certificate/mod_form.php (along with necessary lang strings)
- I added a validdate field to the certificate table in my db
- I added a function in locallib.php to calculate the expiry date based of completion date + the number of years entered into validdate field
Everything looks fine, but whenever I enter a value into the validdate field and update via the form, it doesn't save.
If I directly enter a value for this field in my db, then it comes up on the edit form, but trying to make any changes to it through the form do not update.
I know i've added other custom elements to other forms in my Moodle installation, and never have had this problem. I have not been able to figure out why the value is not being added to the object to save in the record.
So, a two-part question:
- Is this the best way to go about this?
- And if so, what am I missing with the update?
Thanks for your help!