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

Question preview submit does not work in moodle 4 #57

Open
mputzi opened this issue May 25, 2022 · 3 comments
Open

Question preview submit does not work in moodle 4 #57

mputzi opened this issue May 25, 2022 · 3 comments

Comments

@mputzi
Copy link
Contributor

mputzi commented May 25, 2022

When previewing a question of qtype_geogebra in moodle 4 (tested on 4.0.1+, 2022041901.02) with an authoring role a click on button "Check"or on "Submit and finish" has no effect: No reload is being triggered. There is no warning or error on the console.
In a quiz activity the questions are evaluated correctly.

Bildschirmfoto_2022-05-25_09-23-15

@PhMemmel
Copy link
Member

Substituting

$('#responseform').on('submit', this.getBase64andCheck);

with
document.getElementById('responseform').addEventListener('submit', this.getBase64andCheck);
the submitting works.

Apparently there is some jquery magic going on interrupting the submitting itself.

Also tested in student's view: Seems to work here, too. Can you confirm @mputzi?

@mputzi
Copy link
Contributor Author

mputzi commented May 27, 2022

Sorry, I have bad news:
Submitting works now and submit triggers a site reload, but something is wrong with the returnurl: I am getting an error type 403: Forbidden.
The URL when reload is triggered is:
https://mytestserver.de/question/bank/previewquestion/preview.php?id=2&previewid=9&cmid=5&returnurl=https%3A%2F%2Fmytestserver.de%2Fquestion%2Fedit.php%3Fcmid%3D5%26amp%3Bcat%3D2%252C16&variant=1&correctness=1&marks=2&markdp=2&feedback=1&generalfeedback=1&rightanswer=1&history=0
tested on moodle 4.1dev (Build: 20220527)

@PhMemmel
Copy link
Member

PhMemmel commented Jun 7, 2022

Just tried all possible ways again, cannot trigger a 403 in my dev environment (current MOODLE_400_STABLE with latest master of qtype_geogebra). Sure, this is not a "switched to student role in another tab before hitting the button" or anything like that? :-) Could you pls share a backup file of an example quiz you were able to trigger this error with?

EDIT: Also just updated to current core master, also works, no 403

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 a pull request may close this issue.

2 participants