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

Added additional condition to read 'showSolutionButton' property iff 'params.override' is not undefined #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
6 changes: 5 additions & 1 deletion js/questionset.js
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,11 @@ H5P.QuestionSet = function (options, contentId) {
var $template = $(template.render(params));
// Set overrides for questions
var override;
if (params.override.showSolutionButton || params.override.retryButton) {
//Modified by SUPRIYA RAJGOPAL on 28Jul16 to prevent 'Cannot read property showSolutionButton of undefined' error when used in Course Presentation
/*----------------------------------------------------------------------*/
//if (params.override.showSolutionButton || params.override.retryButton) {
if (params.override !== undefined && (params.override.showSolutionButton || params.override.retryButton)) {
/*----------------------------------------------------------------------*/
override = {};
if (params.override.showSolutionButton) {
// Force "Show solution" button to be on or off for all interactions
Expand Down