-
Notifications
You must be signed in to change notification settings - Fork 83
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
Issue #9 Added 'Incorrect feedback text' support #10
base: master
Are you sure you want to change the base?
Issue #9 Added 'Incorrect feedback text' support #10
Conversation
supriyarajgopal-spi
commented
Sep 1, 2016
- 'Incorrect feedback text' field is added and showScore() is modified to show (in)correct feedback per drag-and-drop question.
- Also made the 'common' setting as 'false' and changed the label for 'Feedback' field so that it appears on every drag-and-drop question instead of for the whole question set
'Incorrect feedback text' field is added and showScore() is modified to show (in)correct feedback per drag-and-drop question. Also made the 'common' setting as 'false' and changed the label for 'Feedback' field so that it appears on every drag-and-drop question instead of for the whole question set
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work :)
Semantics for correct and incorrect feedback comes on top of the authoring tool, these should be moved to the bottom and probably placed inside a group
I have left a couple of comments that needs to be addressed before I can merge it in.
Note that when semantics are changed/added they must also be added to all language files (it is fine however to just add them in english).
Let me know if you want some help with implementing these changes!
*/ | ||
C.prototype.showScore = function () { | ||
var maxScore = this.calculateMaxScore(); | ||
if (this.options.behaviour.singlePoint) { | ||
maxScore = 1; | ||
} | ||
var scoreText = this.options.feedback.replace('@score', this.points).replace('@total', maxScore); | ||
var scoreText; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use two whitespaces instead of tabs, as described in H5P code style document.
"description": "Feedback text, variables available: @score and @total. Example: 'You got @score of @total points.'", | ||
"common": true | ||
"description": "Feedback text when correct answer is given, variables available: @score and @total. Example: 'You got @score of @total points.'", | ||
"common": false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Semantic common fields default to "false", there is no need to specify this. You can remove the "common": false line.
}, | ||
{ | ||
"label": "Incorrect feedback text", | ||
"name": "incorrect_feedback", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JavaScript variable should be in camelCase for consistency with other variables, i.e. change to "incorrectFeedback"
"label": "Incorrect feedback text", | ||
"name": "incorrect_feedback", | ||
"type": "text", | ||
"default": "Sorry, this answer is incorrect", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"description": "Feedback text when correct answer is given, variables available: @score and @total. Example: 'You got @score of @total points.'", | ||
"common": false | ||
}, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New semantics must be added to all language files
var scoreText = this.options.feedback.replace('@score', this.points).replace('@total', maxScore); | ||
var scoreText; | ||
if(this.points == maxScore) | ||
scoreText = this.options.feedback.replace('@score', this.points).replace('@total', maxScore); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use H5P code style guidelines for if clauses, i.e. curly braces
if(this.points == maxScore) | ||
scoreText = this.options.feedback.replace('@score', this.points).replace('@total', maxScore); | ||
else | ||
scoreText = this.options.incorrect_feedback.replace('@score', this.points).replace('@total', maxScore); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
incorrect_feedback is undefined for old content. It needs a default value set in JS. see extended options
Hey @thomasmars , Thanks so much for the feedback! I will surely work on it whenever possible and update this thread. |
- Indentation - Camel casing - Changes to semantics.json - Added default Incorrect Feedback text
Hi @thomasmars , I have implemented the changes to the same branch. Kindly reivew and merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks a lot better :)
When setting a feedback text and a user want to change it for both Correct feedback and Incorrect feedback the given solution is a bit awkward, because you must change both Correct feedback and Incorrect feedback fields, now if you imagine that an author wants to change the feedback for ALL "Drag-questions" within a course presentation, then he would have to go into all "drag-question" content types and change both of these specific fields for all of the content types.
Perhaps we could implement a compromise of a solution that generally uses a common field for all "drag-question" content types, but with the possibility of overriding these with a "correct feedback text" and an "incorrect feedback text", that would default to empty, and not used if empty. You can see an example of how this would work in the "true-false" content type semantics. What do you think ?
Right. So do you mean, @thomasmars , that we could keep the default common feedback field along with these specific Correct/Incorrect feedback fields. Your thoughts? |
@supriyarajgopal-spi : As I understand you, your opinion is that there is no need for making it possible to create a specific feedback when answering incorrectly. I'm thinking there might be use cases where that would be a nice feature. Do you disagree? |
No @fnoks , I meant: |
@supriyarajgopal-spi : Then we do agree :) |
So in order to move forward with merging this pull request in the following must be resolved:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The following changes are required before the PR can be merged into master
- Merge in master branch, resolve any conflicts
- Create a common field for feedback that will be used in general
- Make the specific feedback texts for correct and wrong default to empty
- Make the specific feedback texts only override the general feedback text when they are defined