Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement-967: questionView model code > questionModel #981

Merged
merged 3 commits into from
May 9, 2016

Conversation

oliverfoster
Copy link
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
'_isQuestionType': true,
'_canShowModelAnswer': true,
'_questionWeight': Adapt.config.get("_questionWeight"),
}, ComponentModel.prototype.defaults);
Copy link
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
Contributor

+1

@chucklorenz
Copy link
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
Member Author

@moloko
Copy link
Contributor

moloko commented Apr 25, 2016

+1

2 similar comments
@lc-thomasberger
Copy link
Member

+1

@brian-learningpool
Copy link
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