jxn-30 / better-moodle

Improves UzL-Moodle by cool features and design improvements.
MIT License
21 stars 4 forks source link

[Feature request]: An `ArraySetting` class #354

Open YorikHansen opened 2 months ago

YorikHansen commented 2 months ago

Geht deine Idee aus einer Problemstellung hervor? / Is your feature related to a problem?

Some features might require i.e. an arbitrary number of strings as input. Currently this can be done by having a StringSetting and coma-seperating the different inputs and then splitting them when accessing the setting in the code.

Lösung oder Feature / Solution or Feature

I propose the class ArraySetting (or StringArraySetting), which always provides the user with an empty text input field if no empty input exists.

Alternativen / Alternatives

No response

Sonstiges / Additional

There is the potential for ArraySettings for the other types (like NumberArraySetting) or even MixedArraySetting.

Currently there is no mockup of this feature. I will add it as soon as I have time (which will hopefully help understanding the idea)

jxn-30 commented 2 months ago

Moodle does have a tags form element: https://docs.moodle.org/dev/lib/formslib.php_Form_Definition#tags I think this could be used for inspiration as that will also allow making the input field looking native.