Skip to content

Commit

Permalink
Fix: Incorrect return early logic in onButtonsViewPostRender (fixes #102
Browse files Browse the repository at this point in the history
) (#103)

* Fix: Incorrect return early logic in onButtonsViewPostRender

* Fix: asString removed from TUTOR_TYPE throughtout.
  • Loading branch information
joe-allen-89 authored Aug 11, 2023
1 parent ffc89fc commit b8f1844
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/adapt-contrib-tutor.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ class Tutor extends Backbone.Controller {
: model.get('_tutor');
if (!config) return;

return TUTOR_TYPE(config._type?.toUpperCase()).asString;
return TUTOR_TYPE(config._type?.toUpperCase());
}

onComponentViewPostRender(view) {
const { model } = view;
if (!model.isTypeGroup('question')) return;
const type = this.getTutorType(model);
if (!type) return;
const shouldShowFeedback = (model.get('_canShowFeedback') && model.get('_isSubmitted') && type === TUTOR_TYPE.INLINE.asString);
const shouldShowFeedback = (model.get('_canShowFeedback') && model.get('_isSubmitted') && type === TUTOR_TYPE.INLINE);
if (!shouldShowFeedback) return;
model.setupFeedback();
Adapt.trigger('questionView:showFeedback', view);
Expand Down

0 comments on commit b8f1844

Please sign in to comment.