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

Issue #9 Added 'Incorrect feedback text' support #10

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

supriyarajgopal-spi
Copy link

  • '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
Copy link
Member

@thomasmars thomasmars left a 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;
Copy link
Member

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
Copy link
Member

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",
Copy link
Member

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",
Copy link
Member

Choose a reason for hiding this comment

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

I think default text should tell the score. I think it is fine to keep the default text that was here previously, and let authors customize this if they want. i.e. change to "You got @score of @ToTal points".

"description": "Feedback text when correct answer is given, variables available: @score and @total. Example: 'You got @score of @total points.'",
"common": false
},
{
Copy link
Member

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);
Copy link
Member

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);
Copy link
Member

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

@supriyarajgopal-spi
Copy link
Author

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
@supriyarajgopal-spi
Copy link
Author

Hi @thomasmars ,

I have implemented the changes to the same branch. Kindly reivew and merge.

thomasmars
thomasmars previously approved these changes Oct 25, 2016
Copy link
Member

@thomasmars thomasmars left a 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 ?

@supriyarajgopal-spi
Copy link
Author

supriyarajgopal-spi commented Oct 25, 2016

Right. So do you mean, @thomasmars , that we could keep the default common feedback field along with these specific Correct/Incorrect feedback fields.
And then, override the common feedback field with the specific Correct feedback field if set?
I think the Incorrect feedback field is better not to be considered for overriding.

Your thoughts?

@fnoks
Copy link
Contributor

fnoks commented Oct 26, 2016

@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?

@supriyarajgopal-spi
Copy link
Author

No @fnoks , I meant:
Suppose we implement specific Correct/Incorrect feedback fields and the common,default feedback field as well.
Now, if an author sets all the above three fields viz. specific Correct/Incorrect feedback fields and the common,default feedback field, then..the 'specific correct feedback field' should override the common feedback field.
I hope I am clear.

@fnoks
Copy link
Contributor

fnoks commented Oct 26, 2016

@supriyarajgopal-spi : Then we do agree :)

@thomasmars
Copy link
Member

So in order to move forward with merging this pull request in the following must be resolved:

  1. Merge in master
  2. Create a common field for feedback that will be used in general
  3. Make the specific feedback texts for correct and wrong default to empty
  4. Make the specific feedback texts only override the general feedback text when they are defined

@thomasmars thomasmars dismissed their stale review November 17, 2016 10:22

More requirements

Copy link
Member

@thomasmars thomasmars left a 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

  1. Merge in master branch, resolve any conflicts
  2. Create a common field for feedback that will be used in general
  3. Make the specific feedback texts for correct and wrong default to empty
  4. Make the specific feedback texts only override the general feedback text when they are defined

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants