Open tanchon opened 4 years ago
Hi,
I made a short video of an attempt with an exercise on 11.chamilo.org : click here.
Thanks.
Tanchon.
hi @tanchon
Normally the action of blocking back is not avoided in the browser, I have made an adjustment for when quiz_prevent_backwards_move is active, by javascript it can block the back button
https://github.com/carlangas159/chamilo-lms/commit/d3b217b8ac7129024f73a47a9fce841b222328c8
Hi @carlangas159,
It works for me !
I just note a (very) little problem :
when i finish the exercise, i'm on the exercise_result page. When i try to go back, it is impossible : it's ok !
but if on the same exercise_result page, i refresh the page (F5), an error message occurs*, and if i go back two times from this message, i can access to another attempt with the quiz prevent backward desactivated.
_*The error message is : "Fatal error: Uncaught Error: Call to a member function getPreventBackwards() on null in /home/clients/xxxxxxxx0af45c47438a0195xxxxxxxxxx/web2/main/exercise/exercise_result.php:33 Stack trace: #0 {main} thrown in /home/clients/xxxxxxxx0af45c47438a0195xxxxxxxxxx/web2/main/exercise/exerciseresult.php on line 33"
Honestly, i think that the probability that a student discover this manipulation is very low. From my point of view, the security is good... but if it can be enhanced by avoiding the error message and its consequence, it would be a good thing.
Thanks a lot for this work.
Tanchon.
@carlangas159
The first test i made was on Firefox (see above).
With Chrome and Edge, the fix has no effect : the issue remains (it is possible to go back from the result page).
Thanks
Tanchon
PS : all tests realized with Windows 10.
@carlangas159
May be it's an idiot proposal, sorry by advance if it is, but do you think it is possible :
Hi @carlangas159
I've made some tests this evening. I give you a little backup :
on my platform, the last fix has no effect with FF/Chrome/Edge (the first fix had an effect with FF, but with the error message if the student went back).
with Edge/chrome, on my platform, no fix has an effect (the 1st and the 2nd).
Furthermore, I note that with Edge/chrome, Chamilo had a behavior that is a little bit different from FF with the initial bug. As we can see in my video (1st post), when the student begins a new attempt by going backward, the previous answers are not displayed with FF.
But with Edge/Chrome, if the exercise is "autoevaluation", previous answers are sometimes displayed in the new attempt (with "save correct answers" and "review anwers" are defined to NO) : it depends on the question type (for "fill blanks and QRM i note that previous answers are displayed... but not for hotspots...). But it is a different attempt from the 1st !
This issue is a little bit confusing :-)
Thanks.
Tanchon.
Hi @tanchon Thank you for your feedback. Due to the risky nature of this patch, we will not include it in Chamilo 1.11.14 (it has more harmful potential than fix potential because it modifies behaviour in a way we don't usually work - i.e. by blocking browser navigation functions). The bug will still exist in the stable 1.11.14, so preventing to go backwards should probably be combined with a "single attempt" option in the test configuration for now.
Hi,
If the teacher defines more than one attempt possible (and if the student didn't reach the max attempt), the quiz_prevent_backwards_move doesn't work properly (except at the first attempt).
For example, if the teacher set the max attempt to 2 :
To Reproduce Steps to reproduce the behavior (for a test with more than one attempt possible)
Expected behavior When the quiz_prevent_backwards_move is activated, it shouldn't be possible to go backward when an attempt has been close by clicking on the orange button.
The only way the student could try a new attempt should be by clicking on the blue button "new attempt" on the exercise result page => then, he could do his new attempt from the beginning (not from his last question of his last attempt). And the quiz prevent backward option should work everytime.
Server This issue is reproduced on 11.chamilo.org** : see here for example : https://11.chamilo.org/main/exercise/overview.php?cidReq=COURSTANCHON&id_session=0&gidReq=0&gradebook=0&origin=&exerciseId=318
Additional context It is very confusing for student because when he goes back, he cannot guess that it is a new attempt. The quiz prevent backward option is only reliable if the teacher defined the max attempt to 1.
Thanks.
Tanchon.