Skip to content

Commit

Permalink
Fix enableSolutionsButton contract
Browse files Browse the repository at this point in the history
  • Loading branch information
otacke committed Apr 7, 2023
1 parent 1771181 commit cacf6f8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/essay.js
Expand Up @@ -44,6 +44,7 @@ H5P.Essay = function ($, Question) {
inputFieldSize: 10,
enableCheckButton: true,
enableRetry: true,
enableSolutionsButton: true,
ignoreScoring: false,
pointsHost: 1
},
Expand Down Expand Up @@ -86,7 +87,12 @@ H5P.Essay = function ($, Question) {
* contract at {@link https://h5p.org/documentation/developers/contracts#guides-header-8} and
* {@link https://h5p.org/documentation/developers/contracts#guides-header-9}
*/
this.params.behaviour.enableSolutionsButton = (typeof this.params.solution.sample !== 'undefined' && this.params.solution.sample !== '');
this.params.behaviour.enableSolutionsButton =
this.params.behaviour.enableSolutionsButton &&
(
typeof this.params.solution.sample !== 'undefined' &&
this.params.solution.sample !== ''
);
this.params.behaviour.enableRetry = this.params.behaviour.enableRetry || false;

// Determine the minimum number of characters that should be entered
Expand Down

0 comments on commit cacf6f8

Please sign in to comment.