Skip to content

Commit

Permalink
Fixes #20
Browse files Browse the repository at this point in the history
  • Loading branch information
RobertPeek committed Sep 1, 2021
1 parent edb3e8f commit 1ea9faa
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Several elements of **Text Entry** have been assigned a label using the [aria-la
No known limitations.

----------------------------
**Version number:** 4.3.0
**Version number:** 4.3.1
**Framework versions supported:** 4+
**Author / maintainer:** DeltaNet with [contributors](https://github.com/deltanet/adapt-textEntry-audio/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-textEntry-audio",
"version": "4.3.0",
"version": "4.3.1",
"framework": ">=4",
"homepage": "https://github.com/deltanet/adapt-textEntry-audio",
"issues": "https://github.com/deltanet/adapt-textEntry-audio/issues",
Expand Down
25 changes: 25 additions & 0 deletions js/textEntryAudioView.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ define([
initialize: function() {
ComponentView.prototype.initialize.call(this);
this.setUpViewData();

this.listenTo(Adapt.config, 'change:_activeLanguage', this.resetUserAnswers);
},

setUpViewData: function() {
Expand Down Expand Up @@ -118,6 +120,29 @@ define([
this.updateCounter();
},

resetUserAnswers: function() {
this.model.set('userAnswer', "");

this.$('.textEntry-audio-item-textbox').val(this.model.get('userAnswer'));

this.model.set('_isSubmitted', false);

this.$('.buttons-action').removeClass('disabled').attr('disabled', false);
this.$('.buttons-action-fullwidth').removeClass('disabled').attr('disabled', false);

this.$('.textEntry-audio-item-textbox').attr('disabled', false);

if (this.model.get('_canShowFeedback')) {
this.$('.buttons-feedback').attr('disabled', true);
}

this.updateCounter();

this.model.reset(true);

Adapt.offlineStorage.set(this.model.get('_id'), this.model.get("userAnswer"));
},

onInputChanged: function(event) {
if (event) event.preventDefault();

Expand Down

0 comments on commit 1ea9faa

Please sign in to comment.