rwthmoodle / moodle-mod_cardbox

The Card Box activity can help your students memorize vocabulary, technical terms, formulas and definitions.
2 stars 2 forks source link

BUG: Equations in Answer text not displayed correctly #55

Open bkasel opened 1 month ago

bkasel commented 1 month ago

Hi I am using cardbox 1.0.3 on Moodle 4.4.

Equations in the answer text are not being rendered through mathjax when in practice mode (equations in the prompt are displayed correctly at the same time), while in th overview pane, all equations render correctly.

bkasel commented 1 month ago

It seems I fixed the issue by inverting the logic for trimming html tags etc for on these lines

I believe it should be if (!$disableautocomplete) so that formulae may be displayed correctly when no autocorrect is needed.

Amrita1991 commented 1 week ago

Thank you for reporting and suggesting solutions. We haven't yet checked the plugin's compatibility with Moodle 4.4 since we are currently at 4.3.5. We need to check first which versions have this problem and then test out your solution. Please bear with us as we work on this.

bkasel commented 1 week ago

thanks for the response. I think it it is a logical problem not related to versions. if $disableautocorrect is true you don't want to trim tags, which is what the code does.

Amrita1991 commented 5 days ago

I tried implementing your solution however when answer contains just text and no equations and the student gives the right answer, it is evaluated as wrong. Did you face this?

bkasel commented 3 days ago

I was not using auto-correct, but you are right, the <p> tags are not being removed if you want the user to type in the correct answer, but that points to the fact there is another issue. Somehow the if clause does not get executed if auto correct is not disabled (i.e. enabled)

grafik

bkasel commented 3 days ago

is $disableautocorrect always set to false if you want auto correction for the user?