Results and contentUserData - Python
Good morning.
I have been spending the last few weeks deconstructing the wordpress plugin and have built an implementation in Python for a project we are working on. I have run into some confusion around results and contentUserData. I'm currently trying to get the content type to display the learner's prior answer when they navigate back to an activity. I understand the contentUserData key/value in the json. What I don't understand is the contentUserData under the ajax key. I see the results table and that it's storing the max scores, etc and that the table for content_user_data is storing the answer from the learner. My questions are:
- What does preload, invalidate and data_id have to do with the learner and the activity?
- I see that the ajax url for contentUserData is requested on page load and then when they answer the activity. Why on page load?
- Why are results stored seperately from contentUserData?
- What is the sub id under the contentUserData key?
Thanks,
Greg
icc
Fri, 05/12/2017 - 10:08
Permalink
Hi Greg, it's cool to hear
Hi Greg, it's cool to hear that you're digging into H5P so let me try to answer your questions as best as possible:
rmello
Mon, 07/19/2021 - 17:31
Permalink
Async loading of contentUserData
In the case where the userData is not preloaded, the content comes from an asynchronous AJAX call. How can the content type (in this case a custom one) be notified that the contentUserData has arrived?