moodle-mod_hvp
moodle-mod_hvp copied to clipboard
Points lost at logout in Moodle!
Hello,
There seems to be a bug in at least in two question types
- summary
- drag and drop-question
if you logout after completing the activity you lose points you have gained from these question types. It seems like savestate-option doesn't always save point data.
See attached video, original h5p is also attached for testing purposes.
Tested on
- Moodle 3.9.12
- mod_hvp 1.22.4
- h5p save state set on
- Summary (1.10.11)
- Drag and Drop (1.13.15)
https://user-images.githubusercontent.com/53904029/159245165-76b34290-d40d-4ed7-b564-cb0980c90892.mp4
https://user-images.githubusercontent.com/53904029/159245193-cc2eef43-67b0-4c46-8d12-eded11f61f98.mp4
@thomasmars
@Urpokarhu1
The first one might in fact not be related to any content type but caused by H5P core's 3 second delay that it takes after an xAPI completed or progressed event (here emitted by Course Presentation when you go to the summary slide / go to a different slide) to save the state. You can see that the previous state still holds the slide with the Drag and Drop Question and only one element dropped although you ended at the summary slide. You could confirm that by waiting 3 seconds after going to the summary slide before logging out.
The second one seems to be a problem with "Summary" not computing the score correctly when resuming.
Hello, thanks for the answer, is there anything holding us back changing the default time from 3000 to 1000?
@Jarvil You'll have to ask the H5P core team. I'm sure that delay was set for a reason.
Hello,
ok. Should savestate save the points even if I don't reach summary-page?
If admins have set the saveContentState option, H5P is supposed to store the current content's state for the user
- every
saveFreqseconds (the interval that you have set in the options) PLUS - 3 seconds after an xAPI event with the verb
completed(in Course Presentation triggered when you enter the summary screen) orprogressed(in Course Presentation triggered whenever you go to a different slide) PLUS - when the browser triggers an
unload,beforeunload,pagehideevent. The latter is pretty unreliable though.
Hello,
I have set "content_state_frequency" from 30 to 1 and waited 4 seconds on "total score" -page after answering to the summary-question -> I still lose points after log out and log in from "total score"-page (summary-question pages shows them correctly)


@Urpokarhu1 As I said, it's a bug in Summary. What you see on screen and what the getScore function returns to Course Presentation are two different things.
Hello, Ah ok, thanks for the clarification. I will now test if other types of questions are saved after waiting 4 seconds on the question page after answering and then logout/login.
Hello,
I tested with drag'n'drop question in course presentation -> gave the answers -> click check-button -> got 3/3 correct -> waited at least 10 seconds -> log out -> log in -> nothing is saved, it doesn't display 3/3 correct. See attached video.
Does this mean saving is only triggered in course presentation on summary slide / total score page?
https://user-images.githubusercontent.com/53904029/159450065-e868ab12-b08b-4be3-8c24-0f45bb52a5ed.mp4
@Urpokarhu1 Yes, because you didn't go to a different slide, and thus no xAPI progressed statement was triggered by Course Presentation.
There's a pull request that would also react to the answered statement from Drag and Drop that's triggered by checking the exercise, but that's pending.
So is it a reliable way to tell end users that after answering any type of question (expect summary-question) their progress is saved after proceeding to the next slide? Advancing to next slide always triggers progressed-statement and points are saved?
@Urpokarhu1 With a three second delay.
Hello,
I tested again with that same course presentation that has Drag'n'Drop question but added second page to that course presentation -> answered to the question and got 3/3 -> proceeded to the next page -> waited at least 10 seconds on it -> log out -> log in -> 3/3 score was not saved.
Didn't you say that progressed-statement should have trigged on page change?
https://user-images.githubusercontent.com/53904029/159459255-c3047f10-306b-407b-8056-42512c14d222.mp4
@Urpokarhu1 Everything seems to work as expected. "Drag and Drop" has stored the answers that were given, but it doesn't store and re-create the complete "view" state that it was in (e.g. showing results, showing solutions) - only very few content types do.
Thanks for the information.
What about a situtation where I have course presentation with 10 pages and I have question on page 2 and question on page 8.
Do H5P save score from the question on page 2 even if I keep on going to page 5,6,7,8,9,10 ? Or do you need to stop on page 3 for 4 seconds for it to save?
@Urpokarhu1 The position does not matter. The state is always stored for the whole Course Presentation including all the subcontents.