Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: view form validation errors #155

Open
wants to merge 3 commits into
base: feat/use-guzzle-and-handle-request-errors
Choose a base branch
from

Conversation

janbritz
Copy link
Contributor

@janbritz janbritz commented Feb 3, 2025

Closes #152. Abhängig von #154.

image

Falls es Fehlermeldungen gibt, die keinem bestimmten Element zugeordnet werden können, werden sie unter dem 'Question name'-Element angezeigt.

image

Am saubersten wäre es, im Server einen /validate-options-form-Enpoint zu erstellen, welcher nur die Options Form validiert und bei einem Erfolg den Statuscode 200 zurückgibt. Wie seht ihr das?

PS:
Ich wollte die Fehlerbehandlung direkt beim Abspeichern der Frage bzw. beim Aufruf von save_question_options vollziehen, da dadurch nur ein Request zum Server gemacht werden muss. Das war in einer früheren Moodle Version auch möglich, jetzt aber nicht mehr:

Otherwise, the editing form will be redisplayed with validation errors, from validation_errors field, which is itself an object, shown next to the form fields. (I don't think this accurate any more.)

(aus question/type/questiontypebase.php)

@janbritz janbritz linked an issue Feb 3, 2025 that may be closed by this pull request
@janbritz janbritz force-pushed the feat/view-form-validation-errors branch 7 times, most recently from e8c28df to 7b44e80 Compare February 6, 2025 13:28
@janbritz janbritz force-pushed the feat/view-form-validation-errors branch from 6302780 to df54a19 Compare February 6, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ausgabe der Validierungsfehler
1 participant