marcusgreen / moodle-qtype_wordselect

langHighlight words by clicking e.g. select all nouns in this sentence
2 stars 10 forks source link

Styling lost in read-only paragraph mode if the Whether correct option is off #36

Closed HuongNV13 closed 3 years ago

HuongNV13 commented 3 years ago

Hi @marcusgreen, I found a bug related to the paragraph mode. Steps to replicate

  1. Create Wordselect question
  2. Preview it
  3. Change Whether correct option to off in the Display option
  4. Press Submit and Finish button

Observer the correct answer

Thanks,

marcusgreen commented 3 years ago

I noticed your message, then I noticed you contributed code. Wonderful!. Will investigate.

marcusgreen commented 3 years ago

HI, Could you give more details on the exact situation this covers. What question behaviour and is it specific to paragraph/multi word mode. I have been experimenting with question previews but I am not certain what changes under what circumstances.

HuongNV13 commented 3 years ago

image

I'm sorry that I forgot to attach an image. You can see in the picture, all the correct answers were lost the styling (The border, the yellow background also) I think that this issue is not depend on the question behavior, and it is specific to multi word mode.

You can see at: https://github.com/marcusgreen/moodle-qtype_wordselect/blob/master/renderer.php#L107-L117 I think we missed to add the multiword class to the case: Correct place

I hope that make sense.

marcusgreen commented 3 years ago

Could you show a screen shot of how it appears after your patch?

HuongNV13 commented 3 years ago

Below are the screenshots. Observe the "Je suis en vacances à Nice pour cinq jours."

Before the patch: image

After the patch: image

marcusgreen commented 3 years ago

My apologies for the delay in responding to this. I will spend some time on it over the next few days.

marcusgreen commented 3 years ago

Can you confirm that you can reproduce this error if you are running the code in the master branch in my repo here. I have noticed that your repo is significantly behind mine. If I apply the changes you have in renderer.php it all works as I expect, but it also seems to work as I expect without that change. If you can confirm that you can reproduce the issue when running my master code, I will merge your code. Sorry about the delay with this.

HuongNV13 commented 3 years ago

I pulled the latest master code, the issue still happen

image

marcusgreen commented 3 years ago

Many thanks for your contribution, apologies for the delay in integration. I will add a credit/explanation note to changelog.md and it will go into the next release to the plugins database.