Pick up where it left off in branching scenario

Forums: 

Hello everyone!

Is there a way to save branch scenario scores and retrieve them to start where I left off?

For example: in moodle I finished answering in the third content type which is an interactive video. After exiting moodle and returning to the branching scenario activity in question, it will pick up where it left off.

How can I do this?

best

Content types: 
otacke's picture

Hi Edsamo!

That's what the getCurrentState function is for. If the "save content state" feature is activated in the integration's settings, then H5P core will call that function regularly (and on some xAPI events) on a content type instance if the function is implemented. H5P will store the return value of that function and return it as previousState property of the third argument of the constructor when you open that content later and create a new instance. The content type can then re-create the previous state as needed from that state.

That means, any content type that should be able to retrieve the previous state should implement the getCurrentState function and return whatever it expects to get back in the previousState property. That also means, that a compound content type's children would need to use that mechanism if their state should be re-created as well, the contept type would need to collect the states of its children as part of its own getCurrentState implementation, and it needs to pass the respective previousState property to a child when instantiating it.

Cheers,

Oliver 

Hi,

Suppose compound content types (e.g., branching scenario) are made up of content types that you can save their content states. Do the compound content types automatically inherit the save content state from the compound content type's children? For example, I have a branching scenario comprising interactive videos and presentations. The 'stand-alone' interactive videos and presentations correctly save the content state in Moodle. However, the branching scenario always starts from the beginning in Moodle, WordPress, etc., and I feel I might be missing a config setting specific to branching scenario, as users should be able to resume from where they left off in branching scenarios even though it is not included in this post (https://h5p.org/node/1328913). Please let me know if it is genuinely the default behavior to always start from the beginning in a branching scenario or if I need to include a configuration setting specific to the branching scenario (as I can save content state in the various child content types). If the default behavior of a branching scenario is always to restart, would modifying it to save the content state be simple for a non-developer? Also, please point me to the code files so I can review the changes I need to make. Thanks.

Hi,

Suppose compound content types (e.g., branching scenario) are made up of content types that you can save their content states. Do the compound content types automatically inherit the save content state from the compound content type's children? For example, I have a branching scenario comprising interactive videos and presentations. The 'stand-alone' interactive videos and presentations correctly save the content state in Moodle. However, the branching scenario always starts from the beginning in Moodle, WordPress, etc., and I feel I might be missing a config setting specific to branching scenario, as users should be able to resume from where they left off in branching scenarios even though it is not included in this post (https://h5p.org/node/1328913). Please let me know if it is genuinely the default behavior to always start from the beginning in a branching scenario or if I need to include a configuration setting specific to the branching scenario (as I can save content state in the various child content types). If the default behavior of a branching scenario is always to restart, would modifying it to save the content state be simple for a non-developer? Also, please point me to the code files so I can review the changes I need to make. Thanks.

otacke's picture

Branching Scenario currently simply doesn't support the resume feature, but will in the upcoming next release.

Okay, thanks.