Skip to content

Commit

Permalink
Release/v5 (#45)
Browse files Browse the repository at this point in the history
* Converted tabs to spaces, indentation amends

* Naming refactor

* Bower, example and readme updates

* Updated license and cross platform coverage
  • Loading branch information
guywillis authored Nov 13, 2019
1 parent 581498a commit dc7d921
Show file tree
Hide file tree
Showing 9 changed files with 568 additions and 539 deletions.
4 changes: 0 additions & 4 deletions .bowerrc

This file was deleted.

68 changes: 40 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,62 +31,74 @@ In addition to the attributes specifically listed below, [*question components*]
+ [**core model attributes**](https://github.com/adaptlearning/adapt_framework/wiki/Core-model-attributes): These are inherited by every Adapt component. They have no default values. Like the attributes below, their values are assigned in *components.json*.
+ [**core buttons**](https://github.com/adaptlearning/adapt_framework/wiki/Core-Buttons): Default values are found in *course.json*, but may be overridden by **Confidence Slider's** model in *components.json*.

**_component** (string): This value must be: `confidenceSlider`.
**\_component** (string): This value must be: `confidenceSlider`.

**_classes** (string): CSS class name to be applied to **Confidence Slider**’s containing `div`. The class must be predefined in one of the Less files. Separate multiple classes with a space.
**\_classes** (string): CSS class name to be applied to **Confidence Slider**’s containing `div`. The class must be predefined in one of the Less files. Separate multiple classes with a space.

**_layout** (string): This defines the horizontal position of the component in the block. Acceptable values are `full`, `left` or `right`.

**disabledBody** (string): This optional text appears in place of the **body** text when the confidence slider to which this one is linked has not been answered.
**\_layout** (string): This defines the horizontal position of the component in the block. Acceptable values are `full`, `left` or `right`.

**instruction** (string): This optional text appears above the component. It is frequently used to
guide the learner’s interaction with the component.

**_recordInteraction** (boolean) Determines whether or not the learner's answers will be recorded to the LMS via cmi.interactions. Default is `true`. For further information, see the entry for `_shouldRecordInteractions` in the README for [adapt-contrib-spoor](https://github.com/adaptlearning/adapt-contrib-spoor).
**disabledBody** (string): This optional text appears in place of the **body** text when the confidence slider to which this one is linked has not been answered.

**\_attempts** (integer): This specifies the number of times a learner is allowed to submit an answer. The default is `1` and must be left at this value.

**\_shouldDisplayAttempts** (boolean): Determines whether or not the text set in **remainingAttemptText** and **remainingAttemptsText** will be displayed. These two attributes are part of the [core buttons](https://github.com/adaptlearning/adapt_framework/wiki/Core-Buttons) attribute group. The default is `false`.

**\_canShowFeedback** (boolean): Setting this to `false` disables feedback, so it is not shown to the user. The default is `true`.

**_linkedToId** (string): The component ID of a slider to which this slider can be linked. This is optional and if set, will disable user interaction until a selection is submitted on the linked slider.
**\_canShowMarking** (boolean): Setting this to `false` prevents ticks and crosses being displayed on question completion. If you enable _canShowMarking it will work but will always mark as correct answer. The default is `false`.

**\_questionWeight** (number): A number which reflects the significance of the question in relation to the other questions in the course. This number is used in calculations of the final score reported to the LMS.

**\_recordInteraction** (boolean) Determines whether or not the learner's answers will be recorded to the LMS via cmi.interactions. Default is `true`. For further information, see the entry for `_shouldRecordInteractions` in the README for [adapt-contrib-spoor](https://github.com/adaptlearning/adapt-contrib-spoor).

**\_linkedToId** (string): The component ID of a slider to which this slider can be linked. This is optional and if set, will disable user interaction until a selection is submitted on the linked slider.

**labelStart** (string): Text/characters that appear at the start of the slider scale.

**labelEnd** (string): Text/characters that appear at the end of the slider scale.

**_scaleStart** (number): This value is the numeric start of the scale. It is used to calculate the slider's position on the scale.
**\_scaleStart** (number): This value is the numeric start of the scale. It is used to calculate the slider's position on the scale.

**_scaleEnd** (number): This value is the numeric end of the scale. It is used to calculate the slider's position on the scale.
**\_scaleEnd** (number): This value is the numeric end of the scale. It is used to calculate the slider's position on the scale.

**_showNumber** (boolean): When set to `true`, a numeric value appears on the marker described in **_showScaleIndicator**. The value indicates the slider's position on the scale. The default is `true`. Note that **_showScaleIndicator** must be set to `true` in order for this to work.
**\_scaleStep** (number): Defines the amount the scale should be incremented by.

**_showScaleIndicator** (boolean): When set to `true`, a marker for the position of the slider along the scale is shown. If **_showNumber** is `true` this marker will contain a numeric value. If **_showNumber** is `false` a blank marker is shown.
**\_showNumber** (boolean): When set to `true`, a numeric value appears on the marker described in **\_showScaleIndicator**. The value indicates the slider's position on the scale. The default is `true`. Note that **\_showScaleIndicator** must be set to `true` in order for this to work.

**_showScale** (boolean): When set to `false`, visual indications of the scale—range of numbers and short rules—are not displayed. The default is `true`.
**\_showScaleIndicator** (boolean): When set to `true`, a marker for the position of the slider along the scale is shown. If **_showNumber** is `true` this marker will contain a numeric value. If **_showNumber** is `false` a blank marker is shown.

**_showScaleNumbers** (boolean): When set to `false`, numbers are not shown over the scale items. Useful if you have a scale with very many steps where displaying that many numbers would make it look crowded or even unreadable. The default is `true`.
**\_showScale** (boolean): When set to `false`, visual indications of the scale—range of numbers and short rules—are not displayed. The default is `true`.

**_feedback** (object): If the [**Tutor** extension](https://github.com/adaptlearning/adapt-contrib-tutor) is enabled, these various texts will be displayed depending on the submitted answer. **_feedback** contains values for three seperate elements: generic, comparison and threshold feedback. Generic feedback is always presented to the user. Comparison feedback is presented on submission if the slider has been linked to another slider. Threshold feedback is determined according to the range in which the user's selection falls. All feedback elements are optional. Each element can be separated by one or more characters (such as a space) or, more commonly, by some HTML markup.
**\_showScaleNumbers** (boolean): When set to `false`, numbers are not shown over the scale items. Useful if you have a scale with very many steps where displaying that many numbers would make it look crowded or even unreadable. The default is `true`.

**_shouldStoreResponses** (boolean): Optional. When set to `true`, the user's response will be saved so that it can be restored in subsequent sessions. This functionality requires that the Spoor extension be installed. If **\_spoor.\_tracking.\_shouldStoreResponses** (see *config.json*) is set to `true`, the value specified here is ignored, therefore this attribute only needs to be set if you want to track the user's responses to a particular Confidence Slider component without also tracking all other user responses.

**\_feedback** (object): If the [**Tutor** extension](https://github.com/adaptlearning/adapt-contrib-tutor) is enabled, these various texts will be displayed depending on the submitted answer. **\_feedback** contains values for three seperate elements: generic, comparison and threshold feedback. Generic feedback is always presented to the user. Comparison feedback is presented on submission if the slider has been linked to another slider. Threshold feedback is determined according to the range in which the user's selection falls. All feedback elements are optional. Each element can be separated by one or more characters (such as a space) or, more commonly, by some HTML markup.

>**feedbackSeparator** (string): Optional text/markup that will separate each feedback element.
>**generic** (string): Text that will be shown whichever selection is made.
>**_comparison** (object): Text that will be shown on submission if the slider has been linked to another slider.
>**\_comparison** (object): Text that will be shown on submission if the slider has been linked to another slider.
>>**lower** (string): This text will be shown if the user has selected a lower value than was chosen on the linked slider.
>>**higher** (string): This text will be shown if the user has selected a higher value than was chosen on the linked slider.
>>**same** (string): This text will be shown if both values are the same.
>**_threshold** (object array): Multiple items may be created. Each item represents the feedback for a range of slider values.
>>**_values** (object): Specifies the range of slider values for which the associated **text** will be included in the feedback.
>**\_threshold** (object array): Multiple items may be created. Each item represents the feedback for a range of slider values.
>>>**_low** (number): The lower bound of the range (inclusive).
>>**\_values** (object): Specifies the range of slider values for which the associated **text** will be included in the feedback.
>>>**_high** (number): The upper bound of the range (inclusive).
>>>**\_low** (number): The lower bound of the range (inclusive).
>>**text** (string): The text that will be included in the feedback if the user's selection falls with the range specified by **_values**.
>>>**\_high** (number): The upper bound of the range (inclusive).
**_shouldStoreResponses** (boolean): Optional. When set to `true`, the user's response will be saved so that it can be restored in subsequent sessions. This functionality requires that the Spoor extension be installed. If **_spoor._tracking._shouldStoreResponses** (see *config.json*) is set to `true`, the value specified here is ignored, therefore this attribute only needs to be set if you want to track the user's responses to a particular Confidence Slider component without also tracking all other user responses.
>>**text** (string): The text that will be included in the feedback if the user's selection falls with the range specified by **\_values**.
### Accessibility
**Confidence Slider** has been assigned a label using the [aria-label](https://github.com/adaptlearning/adapt_framework/wiki/Aria-Labels) attribute: **ariaRegion**. This label is not a visible element. It is utilized by assistive technology such as screen readers. Should the region's text need to be customised, it can be found within the **globals** object in [*properties.schema*](https://github.com/adaptlearning/adapt-contrib-confidenceSlider/blob/master/properties.schema).
Expand All @@ -97,9 +109,9 @@ guide the learner’s interaction with the component.
No known limitations.

----------------------------
**Version number:** 2.2.0 <a href="https://community.adaptlearning.org/" target="_blank"><img src="https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg" alt="adapt learning logo" align="right"></a>
**Framework versions:** 2.0.17+
**Author / maintainer:** Adapt Core Team with [contributors](https://github.com/adaptlearning/adapt-contrib-confidenceSlider/graphs/contributors)
**Accessibility support:** WAI AA
**RTL support:** yes
**Cross-platform coverage:** Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, IE11, IE10, IE9, IE8, IE Mobile 11, Safari 10+11 for macOS+iOS, Opera
**Version number:** 3.0.0 <a href="https://community.adaptlearning.org/" target="_blank"><img src="https://github.com/adaptlearning/documentation/blob/master/04_wiki_assets/plug-ins/images/adapt-logo-mrgn-lft.jpg" alt="adapt learning logo" align="right"></a>
**Framework versions:** 5+
**Author / maintainer:** Adapt Core Team with [contributors](https://github.com/adaptlearning/adapt-contrib-confidenceSlider/graphs/contributors)
**Accessibility support:** WAI AA
**RTL support:** Yes
**Cross-platform coverage:** Chrome, Chrome for Android, Firefox (ESR + latest version), Edge, IE11, Safari 12+13 for macOS/iOS/iPadOS, Opera
12 changes: 6 additions & 6 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "adapt-contrib-confidenceSlider",
"version": "2.2.0",
"framework": ">=2.0.17",
"version": "3.0.0",
"framework": ">=5",
"homepage": "https://github.com/adaptlearning/adapt-contrib-confidenceSlider",
"issues": "https://github.com/adaptlearning/adapt-contrib-confidenceSlider/issues",
"component" : "confidenceSlider",
"displayName" : "Confidence Slider",
"description": "A contributed two-part component that measures user confidence, using a sliding scale.",
"main": "/js/adapt-contrib-confidenceSlider.js",
"displayName" : "Confidence Slider",
"component" : "confidenceSlider",
"keywords": [
"adapt-plugin",
"adapt-component"
],
"pluginDependencies": {
"adapt-contrib-slider": ">=2.4"
"adapt-contrib-slider": ">=3"
},
"license": "GPLv3"
"license": "GPL-3.0"
}
138 changes: 71 additions & 67 deletions example.json
Original file line number Diff line number Diff line change
@@ -1,71 +1,75 @@
{
"_id": "c-05",
"_parentId": "b-05",
"_type": "component",
"_component": "confidenceSlider",
"_classes": "",
"_layout": "full",
"title": "Confidence Slider component",
"displayTitle": "Confidence Slider",
"body": "Question text here",
"disabledBody": "You need to measure your confidence in the linked part before you can do this part.",
"instruction": "",
"_commentAttempts": "Can only be set to 1",
"_attempts": 1,
"_isResetOnRevisit": false,
"_canShowFeedback": true,
"_commentCanShowMarking": "If you enable _canShowMarking it will work but will always mark as correct answer",
"_canShowMarking": false,
"_recordInteraction": true,
"_commentLinkedToId": "ONLY ADD _linkedToId PROPERTY IF THIS SLIDER LINKS TO ANOTHER",
"_linkedToId": "c-03",
"_showNumber": true,
"_showScaleIndicator": true,
"_showScale": true,
"_showScaleNumbers": true,
"labelStart": "incomplete",
"labelEnd": "complete",
"_scaleStart": 0,
"_scaleEnd": 10,
"_scaleStep": 1,
"_buttons": {
"_submit": {
"buttonText": "Submit",
"ariaLabel": "Submit your answer by clicking here."
},
"_reset": {
"buttonText": "Reset",
"ariaLabel": "Reset the question by clicking here."
{
"_id": "c-05",
"_parentId": "b-05",
"_type": "component",
"_component": "confidenceSlider",
"_classes": "",
"_layout": "full",
"title": "Confidence Slider component",
"displayTitle": "Confidence Slider",
"body": "Question text here",
"instruction": "",
"disabledBody": "You need to measure your confidence in the linked part before you can do this part.",
"_commentAttempts": "Can only be set to 1",
"_attempts": 1,
"_shouldDisplayAttempts": false,
"_canShowFeedback": true,
"_commentCanShowMarking": "If you enable _canShowMarking it will work but will always mark as correct answer",
"_canShowMarking": false,
"_questionWeight": 1,
"_recordInteraction": true,
"_comment": "ONLY ADD _linkedToId PROPERTY IF THIS SLIDER LINKS TO ANOTHER",
"_linkedToId": "c-05",
"labelStart": "incomplete",
"labelEnd": "complete",
"_scaleStart": 0,
"_scaleEnd": 10,
"_scaleStep": 1,
"_showNumber": true,
"_showScaleIndicator": true,
"_showScale": true,
"_isResetOnRevisit": false,
"_shouldStoreResponses": true,
"_feedback": {
"feedbackSeparator": " ",
"generic": "Thanks for measuring your confidence.",
"_comparison": {
"lower": "Oh you like it less? That's a shame.",
"same": "Well, at least you don't like it less.",
"higher": "It looks like you're seeing the benefits more and more!"
},
"_threshold": [
{
"_values": {
"_low": 0,
"_high": 5
},
"text": "So you're not that confident eh? Don't worry, you will be soon."
},
{
"_values": {
"_low": 6,
"_high": 10
},
"text": "Feeling pretty confident huh? Let's see how you get on."
}
]
},
"_showFeedback": {
"buttonText": "Show feedback",
"ariaLabel": "View the question feedback again by clicking here."
}
},
"_feedback": {
"feedbackSeparator": " ",
"generic": "Thanks for measuring your confidence.",
"_comparison": {
"lower": "Oh you like it less? That's a shame.",
"same": "Well, at least you don't like it less.",
"higher": "It looks like you're seeing the benefits more and more!"
"_pageLevelProgress": {
"_isEnabled": true
},
"_threshold": [{
"_values": {
"_low": 0,
"_high": 5
"_buttons": {
"_submit": {
"buttonText": "Submit",
"ariaLabel": "Submit your answer by clicking here."
},
"text": "So you're not that confident eh? Don't worry, you will be soon."
}, {
"_values": {
"_low": 6,
"_high": 10
"_reset": {
"buttonText": "Reset",
"ariaLabel": "Reset the question by clicking here."
},
"text": "Feeling pretty confident huh? Let's see how you get on."
}]
},
"_pageLevelProgress": {
"_isEnabled": true
},
"_shouldStoreResponses": true
}
"_showFeedback": {
"buttonText": "Show feedback",
"ariaLabel": "View the question feedback again by clicking here."
}
}
}
Loading

0 comments on commit dc7d921

Please sign in to comment.