Skip to content

Commit

Permalink
Fixes #18
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertPeek committed Nov 15, 2018
1 parent b277455 commit afbd189
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 4 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ The Enhanced Question attribute group contains values for **_isEnabled**, **_ove
>>**_isEnabled** (boolean): If `enabled`, the partly correct score will be changed.
>>**close** (string): This text becomes the close button text.
>>**_questionWeight** (number): Defines the new question weight for a partly correct answer.
>**_feedbackIcons** (object): This `_feedbackIcons` attributes group stores the properties for when an image is added to the feedback. It contains values for **_isEnabled**, **_correctIcon**, **_partlyCorrectIcon**, and **_incorrectIcon**.
Expand Down Expand Up @@ -67,7 +69,7 @@ The Enhanced Question attribute group contains values for **_isEnabled**, **_ove
This cannot be used when adapt-contrib-tutor is installed, as there are issues with adapt-contrib-trickle events.

----------------------------
**Version number:** 2.2.0
**Version number:** 2.3.0
**Framework versions supported:** ^2.0.4
**Author / maintainer:** DeltaNet with [contributors](https://github.com/deltanet/adapt-enhanced-question/graphs/contributors)
**Accessibility support:** Yes
Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "adapt-enhanced-question",
"version": "2.2.0",
"version": "2.3.0",
"framework": "^2.0.4",
"homepage": "https://github.com/deltanet/adapt-enhanced-question",
"issues": "https://github.com/deltanet/adapt-enhanced-question/issues",
Expand Down
1 change: 1 addition & 0 deletions example.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

"_enhancedQuestion": {
"_isEnabled": true,
"close": "Close",
"_overidePartlyCorrect": {
"_isEnabled": true,
"_questionWeight": 0.5
Expand Down
11 changes: 9 additions & 2 deletions js/adapt-enhanced-question.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,17 @@ define([
feedbackTitle = feedbackIconTitle;
}

var buttonText = (view.model.get('_enhancedQuestion').close) ? view.model.get('_enhancedQuestion').close : Adapt.course.get('_globals')._accessibility._ariaLabels.closePopup;

// Set up new notify object
var alertObject = {
title: feedbackTitle,
body: view.model.get("feedbackMessage")
body: view.model.get("feedbackMessage"),
_prompts:[
{
promptText: buttonText
}
],
};

if (view.model.has('_isCorrect')) {
Expand All @@ -112,7 +119,7 @@ define([
}

if (!view.model.get('_enhancedQuestion')._inlineFeedback._isEnabled) {
Adapt.trigger('notify:popup', alertObject);
Adapt.trigger('notify:prompt', alertObject);
}

}
Expand Down
10 changes: 10 additions & 0 deletions properties.schema
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@
"validators": [],
"help": "If enabled, this component will have the enhanced question functionality."
},
"close": {
"type": "string",
"required": false,
"default": "Continue",
"title": "Close Button Text",
"inputType": "Text",
"validators": [],
"help": "Button label text for the button to close the feedback.",
"translatable": true
},
"_overidePartlyCorrect": {
"type":"object",
"required": true,
Expand Down

0 comments on commit afbd189

Please sign in to comment.