Hello Moodle Community,
I
am looking for a bit of guidance to see if something is possible
because I seem to be running into issues with getting something very
specific working that relates to me adding new fields to the
"edit_form.php". I am doing this instead of a new plugin because of the
user experience we are trying to create and this is too complex to go
into the course format. This is technically two parts and two separate
questions so I will explain them separately below.
First some info you may need:
I am on Moodle Version 4.0.1 installed on Debian GNU/Linux 10 (buster) which is running in a Docker container.
The fields are posting to a brand new DB table but the issue is not related to the DB directly.
The PHP version is PHP 7.4.12.
I think that is all that is relevant to the questions for now.
Question #1
I
have added some new "searchableselector" fields to the form all of them
allow multiple selections and I have been able to get the code ot
process and save to the database and everything to return in the UI afterwards. The one thing that I am having a bit
or trouble with is understanding how I might be able to add another field for each selection that is made.
For
example I have 3 searchableselector fields that have multiple select
for each of the fields on each selection we want a new text input field
where they can add a new data point that relates directly to the item
selected.
The Items are built out via JavaScript and the Mustache templates. Is it possible to do this with Moodle already or will I have to find a way to override this?
Question #2