All short answers are marked wrong (gradedwrong)

Re: All short answers are marked wrong (gradedwrong)

by Duane Habecker -
Number of replies: 3

Tim and Joseph!

Many thanks to the both of you for helping this non-programmer get our short answer questions working again! Here is what I did, thanks to Joseph's debugging suggestion and Tim's most recent post...

On question/type/shortanswer/question.php we commented out lines 105 - 108

+ if (function_exists('normalizer_normalize')) {
+ $regexp = normalizer_normalize($regexp, Normalizer::FORM_C);
+ $string = normalizer_normalize($string, Normalizer::FORM_C);
+ }

Our short answer questions have returned to behaving as expected.

Thank you so much for your efforts and for being willing to help out a stranger.

Grateful,

Duane

In reply to Duane Habecker

Re: All short answers are marked wrong (gradedwrong)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Thanks for the feedback. I created MDL-37746 for this.

In reply to Tim Hunt

Re: All short answers are marked wrong (gradedwrong)

by Jamie Pratt -
I checked the pmatch contrib question type code and it shouldn't be affected by this issue, it is already checking for the existence of the Normalizer before using it.
In reply to Jamie Pratt

Re: All short answers are marked wrong (gradedwrong)

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The shortanswer code also checks that Normalizer is present. The issue is that even when it exists, it may return null "When an error occurs". The only clue we have is that, according to one of the user comments on the docs, input that is not UTF-8 may be an error, but it is not clear.