Question Set - Save Content State

When resuming a question set that's been finished, the user is returned to the last question. They should be returned to the results page.

This bug occurs in Wordpress with H5P.QuestionSet-1.10

Steps to reproduce:

  • Create and save a question set.
  • Turn on Save Content State.
  • Answer all questions and finish the question set.
  • When the results page appears, leave the question set.
  • Resume the question set. You will be returned to the last question.
  • The user should be returned to the results page, just like in course presentation.

Thank you.

 

 

BV52's picture

Hi user2352352,

This is not a "bug" but actually by design. I think this is so that the user can at least review his/her answers.

-BV52

I would argue that this definitely is a bug, or at least a design flaw for two reasons. The most important reason is:

  1. At this point the user has already submitted their responses. A completion event has already been registered. We are forcing the user to submit another completion and therefore another attempt. This is not right. A course presentation does not do this. In a course presentation the user is taken to the results page and can then CHOOSE if they want to retry or not. Which brings us to the second point.
  2. There is a lack of consistency here. Why not bring the user back to the last slide in a course presentation? If the argument is that we're giving the user a chance to review their answers (which makes no sense because they've already clicked the Finish button) then why not be consistent across objects? Why not make course presentations behave this way also? Because it's wrong. The user has already completed the task. The user should be brought to the results page when returning to a question set that's been finished.
falcon's picture

I'm sorry to hear that you're having trouble with this feature and I can fully understand your frustration and confusion.

The save user state doesn't save everything yet. It saves the user's answer for most content types, it saves the "page" the user is on for Question Set and Course Presentation (iirc) and what time the user is on for Interactive Video. In Course Presentation the summary isn't a page the same way it is in Course Presentation unfortunately.

We plan to expand what save user state saves for many content types, but it haven't been done yet, and there are lots of things we could save. The things you mention are among the most important things coming up. The original save feature was funded, but we only got funding to save the things mentioned above.

For anyone who stumbles upon this thread looking for a temporary hack for question set when Save Content State is turned on, here it is:

Edit questionset.js

Line 708

      var request = new XMLHttpRequest();
      var hackToken = H5PIntegration.tokens.contentUserData;
      var postdata = 'data=&preload=1&invalidate=1&token=' + hackToken;
      var fullUrl = window.location.protocol + "//" + window.location.host + '\
/content/contentsUserData?content_id=' + contentId + '&data_type=state&sub_content_id=0';

      request.open('POST', fullUrl, true);
      request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8');
      request.setRequestHeader('X-CSRF-TOKEN', hackToken);
      request.send(postdata);

This simply resets the user's content state in the data field of the h5p_contents_user_data table when the user clicks the Finish button. Upon resuming the question set, the user is returned to the first question with all questions cleared. 

I can guarantee there's a much better way to implement this and I'm sure, at some point, the fine people at h5p will fix question set the right way. This is just a quick and dirty hack that works and makes question set function properly when Save Content State is turned on.