Of course, there is always a way.
How do I change the default behavior of a core moodle form?
I set off to find the code that was setting this and to change it. Not an overly complex request. I found this forum that discussed this very scenario, but the answer was for an older version of moodle.After looking at the URL in moodle when in the user uploads mode, I was eventually lead into the following file.
webroot/sitename/admin/tool/uploaduser/user.form.php
After a bit of trial and error, I realized the $choices array that contained the options for the select box did not have a default selection! The others around it did, but not the one I was after. This is the line of code I added to the file that was successful in changing the default selection to ALL
$mform->setDefault('uuforcepasswordchange', 2); // starting at 0, 2 is represents the last option.
In the end, I added my fix to the forum discussion for moodle 2.3.
No comments:
Post a Comment