Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive Book does not return any results to the calling LMS #154

Open
csidirop opened this issue Jul 8, 2024 · 11 comments
Open

Interactive Book does not return any results to the calling LMS #154

csidirop opened this issue Jul 8, 2024 · 11 comments

Comments

@csidirop
Copy link

csidirop commented Jul 8, 2024

The Interactive Book module does not return any results to the calling LMS (in our case ILIAS).

Other H5P modules like Blanks or Drag Text returning how many tasks were solved correctly (from all of them).

I'm sure other LMSs using the results too. Something like:

  • Test1: 2/2 (if two out of two were correct answered)
  • Test2: 0/1

I couldn't verify this, but I believe IB is missing a file presave.js (like presave.js in drag-text) or presave.jsin blanks. For example, it validates the content for the Blanks module, calculates the maximum score based on the number of blanks in the questions, and ensures that the required parameters are present before saving the content. If any problems are found, it throws an error, otherwise it validates the score and calls the completion callback.

Is that correct? Can we have that too?

If yes, I could provide help or implement it myself if you don't have resources left for that kind of task.

@otacke
Copy link

otacke commented Jul 8, 2024

The presave.js file is not a requirement. It's an optional addition (only used by Edlib to the best of my knowledge) that would allow to determine the number of maximum points before the content is rendered for the first time (if you desperately required to know the maximum possible score server side immediately after saving the content), but it has nothing to do with the xAPI data that is used for reporting.

Interactive Book only reports scores when the user hits the "Submit Report" button on the Summary page (just like Interactive Video only reports scores when the user submits them or like Course Presentation only submits them when the user enters the summary slide). That's more likely the cause.

If you don't see the "Submit Report" button on ILIAS, you should reach out to Studer&Raimann, the maintainers of the ILIAS module. They'd have to ensure that their H5P integration sets the "environment" variable H5PIntegration.reportingIsEnabled to true.

@csidirop
Copy link
Author

csidirop commented Jul 8, 2024

Thanks for the quick clarification!

If you don't see the "Submit Report" button on ILIAS, you should reach out to Studer&Raimann, the maintainers of the ILIAS module. They'd have to ensure that their H5P integration sets the "environment" variable H5PIntegration.reportingIsEnabled to true.

Where exactly should this button be located? On the result page of the module or is it Ilias content outside the h5p iframe?

Because we don't have that button on the result page:
grafik

@csidirop
Copy link
Author

csidirop commented Jul 19, 2024

A little addendum:

If I force H5PIntegration.reportingIsEnabled to true somewhere after:

this.isSubmitButtonEnabled = false;
this.isAnswerUpdated = true;
if (contentData.isScoringEnabled !== undefined || contentData.isReportingEnabled !== undefined) {
this.isSubmitButtonEnabled = (contentData.isScoringEnabled || contentData.isReportingEnabled);
}
else if (H5PIntegration.reportingIsEnabled !== undefined) { // (Never use H5PIntegration directly in a content type. It's only here for backwards compatibility)
this.isSubmitButtonEnabled = H5PIntegration.reportingIsEnabled;
}

I'm getting the submit button. Thats what it looks like for those who wonder:
grafik

After a bit of searching I found a forum post: Interactive Book: Missing "Submit Report" Button in which you gave the hint to:

... tick the option "Enable LRS dependent content types" in the plugin settings of H5P which will then set a flag for reporting being enabled (H5PIntegration.reportingIsEnabled as mentioned on the issue tracker). It's a non-intuitive procedure unfortunately.

Unfortunately that didn't changed anything in my tests (ILIAS r_7 & r_8). But added it for future reference. Is this variable even in use anymore? I couldn't find any trace of H5PIntegration.reportingIsEnabled or reportingIsEnabled other than here and at the H5P Documentation Tool. (grep over the whole ILIAS dir)

@csidirop
Copy link
Author

csidirop commented Jul 30, 2024

you should reach out to Studer&Raimann, the maintainers of the ILIAS module. They'd have to ensure that their H5P integration sets the "environment" variable H5PIntegration.reportingIsEnabled to true.

Ticket: SUPPORT-15210

@0xMurage
Copy link

0xMurage commented Jan 3, 2025

I should leave this here for reference:

The isScoringEnabled and isReportingEnabled flags are not supported by the H5P core library. The core library's third parameter only sends the following in the third parameter, as seen here
https://github.com/h5p/h5p-php-library/blob/fb5100a53517c4c9b5477aaa114338ce816c3e81/js/h5p.js#L939.

{
  standalone: true,
  metadata?: Object,
  previousState?: Object,
  subContentId?: string,
}

@otacke
Copy link

otacke commented Jan 3, 2025

@0xMurage As I explained before, it is the H5PIntegration object that should carry the reportingIsEnabled flag. It is not set by H5P Core (as we know it), but should be defined by the respective H5P integration (hence the object name) aka plugin.
Please compare the two H5P integrations for moodle as a reference:

Here's where the H5PIntegration object is built for the ILIAS plugin and where adding the reportingIsEnabled can be done in one single line of code: https://github.com/srsolutionsag/H5P/blob/1d3cff9ea9c96695601c984986bc1544e3c895cd/classes/Integration/class.ilH5PClientDataProvider.php#L198

@0xMurage
Copy link

0xMurage commented Jan 3, 2025

Thank you for this explanation @otacke .

But unless I misunderstand something, shouldn't the reporting be enabled if the H5PIntegration.postUserStatistics and H5PIntegration.ajax.setFinished properties are set?

Screenshot 2025-01-03 at 15 45 57 This is a screenshot from https://h5p.org/creating-your-own-h5p-plugin

I used these docs when documenting the H5P standalone docs.

Support forH5PIntegration.reportingIsEnabled flag has already been added to h5p standalone specifically for interactive book.

@otacke
Copy link

otacke commented Jan 3, 2025

@0xMurage A fair share of H5P's official documentation is outdated. H5PGroup chose to use that explicit flag instead of deriving the information from other sources. You will have to ask them about the reason, however.

@csidirop
Copy link
Author

Hi, just wanted to mention that the H5P Plugin for ILIAS got an update (see commit 8575604) where they:

  • Improved the result handling so users can submit multiple results, if "solve contents only once" is not active.
  • Improved the result overview of H5P contents inside repository objects.
  • Improved the content overview of H5P repository objects.

https://github.com/srsolutionsag/H5P/blob/1d3cff9ea9c96695601c984986bc1544e3c895cd/CHANGELOG.md?plain=1#L5-L7

But it still dont fixes that issue.

@otacke
Copy link

otacke commented Jan 15, 2025

@csidirop Mentioning this here does not make a difference. As long as the ILIAS plugin does not set the H5PIntegration.reportingIsEnabled flag in https://github.com/srsolutionsag/H5P/blob/release_8/classes/Integration/class.ilH5PClientDataProvider.php#L162-L207 you will not notice anything changing.

@csidirop
Copy link
Author

Yes I know, just wanted to mention that for the sake of completeness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants