Skip to content

Commit

Permalink
JI-3168 Fix when user has selected the work mark it as answered (#88)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravimajithia authored Jan 31, 2022
1 parent c694f08 commit 453b94c
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions scripts/mark-the-words.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ H5P.MarkTheWords = (function ($, Question, Word, KeyboardNav, XapiGenerator) {
// Add keyboard navigation to this element
var selectableWord = new Word($(this), self.params);
if (selectableWord.isAnswer()) {
self.isAnswered = true;

This comment has been minimized.

Copy link
@otacke

otacke Nov 10, 2022

Contributor

@ravimajithia I do not understand why this line was added. It is called whenever the task is instantiated and contains at least one word that needs to be chosen (so virtually always unless the user forgot to add a word). That means the task will always be considered to have been answered by the user.

Check out https://h5p.org/node/1315679 or https://otacke.h5p.com/content/1291795364813009417 for instance. The fourth exercise in that QuestionSet is already marked as answered in the navigation bar at the bottom when you open the content.

Normally, I'd say, well, a bug. But in this commit this single line was added deliberately, so I am not sure what it was supposed to do as it doesn't match the commit message.

This comment has been minimized.

Copy link
@ravimajithia

ravimajithia Nov 11, 2022

Author Contributor

Yes seems like this line is a mistake. It is better removed here. Nice spot and thank you for explaining in detail.

I have created a pull request for this - #100

This comment has been minimized.

Copy link
@otacke

otacke Nov 11, 2022

Contributor

@ravimajithia Thanks. And you're welcome :-D Somebody else spotted the problem - I just investigated the cause ;-) Just make sure that removing that line doesn't break what you originally wanted to fix.

self.answers += 1;
}
self.selectableWords.push(selectableWord);
Expand Down

0 comments on commit 453b94c

Please sign in to comment.