There is this moodle plug-in that has an external app url hard-coded. But I wish it to…
- User
There is this moodle plug-in that has an external app url hard-coded. But I wish it to be a field in its settings. How are moodle plug-ins structured and how do I do this?
Assistant
Here are the main steps to make a Moodle plugin setting configurable rather than hard-coded:
-
Open the plugin's version.php file and increment the version number. This tells Moodle that the plugin has been updated.
-
In the plugin's settings.php file, add a new setting using the get_config class. For example:
$settings->add(new admin_setting_configtext('myplugin/external_url', 'External App URL', '', ''));- Where the external URL is currently hard-coded, replace it with:
-
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.