Skip to content

enhancement-967: questionView model code > questionModel#981

Merged
oliverfoster merged 3 commits into
masterfrom
enhancement-967
May 9, 2016
Merged

enhancement-967: questionView model code > questionModel#981
oliverfoster merged 3 commits into
masterfrom
enhancement-967

Conversation

@oliverfoster

Copy link
Copy Markdown
Member

#967

Work done:

  • all model code removed from questionView to questionModel
  • compatibility layer for question components which still use their view to define model behaviour

Outcome:

  • all questions can now have a proper model with defined behaviour

Next:

To test backwards compatibility:

  • download enhancement-967 of the framework
  • run adapt install and npm install
  • run grunt dev

To test components in the new style:

  • download enhancement-967 of the framework
  • change adapt.json mcq and gmcq options to "enhancement-967"
  • run adapt install and npm install
  • run grunt dev

'_isQuestionType': true,
'_canShowModelAnswer': true,
'_questionWeight': Adapt.config.get("_questionWeight"),
}, ComponentModel.prototype.defaults);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add _shouldDisplayAttempts here?

@tomgreenfield

Copy link
Copy Markdown
Contributor

+1

@chucklorenz

Copy link
Copy Markdown
Member

Tutor uses Notify to display feedback. It displays the component title at the top. It would be nice to be able to replace this with text of the author's choosing.

If the feedback model could be changed to something like this:

"_feedback":{
        "_correct": {
            "title": "That's right! Nice work.",
            "final": "Erie, Superior, and Michigan are all Great Lakes."
        },
        "_incorrect": {
            "title": "Unfortunately that is incorrect.",
            "notFinal": "Why not try again.",
            "final": "Erie, Superior, and Michigan are all Great Lakes, but Ricky Lake is not."
        },
        "_partlyCorrect": {
            "title": "That's partly correct.",
            "notFinal": "At least one of your choices is incorrect. Why not try again.",
            "final": "Erie, Superior, and Michigan are all Great Lakes, but Ricky Lake is not."
        }
    },

Then each of the three functions, SetupCorrectFeedback, SetupPartlyCorrectFeedback, and SetupIncorrectFeedback, could incorporate a line of code like:
feedbackTitle: this.model.get("_feedback")._correct.title || this.model.get('title'),

Granted having “final” as the primary “correct” value appears strange at first. But the parallelism with “_incorrect” and “_partlyCorrect” is probably better than _correct.correct. And maybe we go further and include _correct.notFinal. Who knows when someone might find a use case for it.

@oliverfoster

Copy link
Copy Markdown
Member Author

@moloko

moloko commented Apr 25, 2016

Copy link
Copy Markdown
Contributor

+1

2 similar comments
@lc-thomasberger

Copy link
Copy Markdown
Member

+1

@brian-learningpool

Copy link
Copy Markdown
Member

+1

@oliverfoster
oliverfoster merged commit fdf2840 into master May 9, 2016
@oliverfoster
oliverfoster deleted the enhancement-967 branch May 9, 2016 10:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants