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

feat: Add flag to allow submission of summary score with interactive book #165

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions src/h5p-standalone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,9 @@ interface Options {
preventH5PInit?: boolean;
embedType?: 'div' | 'iframe';

// following options are ripped from interactive book https://github.com/h5p/h5p-interactive-book/blob/6373b8440b0ef5eaf25fe21cae8ad57e9f8d8a9e/src/scripts/app.js#L57-L61
reportingIsEnabled?: boolean;

contentUserData?: H5PContent['contentUserData'];
saveFreq?: number | false;
postUserStatistics?: boolean;
Expand Down Expand Up @@ -257,6 +260,8 @@ export class H5PStandalone {
H5PIntegration.urlLibraries = librariesPath;
H5PIntegration.postUserStatistics = !!options.postUserStatistics

H5PIntegration.reportingIsEnabled= options.reportingIsEnabled

//since the default is false, only set if it's a number?
if (options.saveFreq && typeof options.saveFreq === 'number') {
H5PIntegration.saveFreq = options.saveFreq;
Expand Down
1 change: 1 addition & 0 deletions src/h5p.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ export interface H5PIntegration {

saveFreq?: false | number;
postUserStatistics?: boolean; //makes sense if user is available
reportingIsEnabled?: boolean; //this option is from interactive book https://github.com/h5p/h5p-interactive-book/blob/6373b8440b0ef5eaf25fe21cae8ad57e9f8d8a9e/src/scripts/app.js#L57-L61
ajax: {
/**
* endpoint where to post results on completion.
Expand Down
Loading