Permalink
Browse files

MDL-38355 qtype_multianswer: input boxes too big in Russian.

... and any other language where the characters take multiple
bytes in UTF-8.

This fix was worked out by Dušan Ristić. I am just committing it.
  • Loading branch information...
1 parent 2e4d9a0 commit c81175f53288426c45b8b7416541cf73e84a08cf @timhunt timhunt committed Mar 14, 2013
Showing with 2 additions and 2 deletions.
  1. +2 −2 question/type/multianswer/renderer.php
@@ -189,9 +189,9 @@ public function subquestion(question_attempt $qa, question_display_options $opti
}
// Work out a good input field size.
- $size = max(1, strlen(trim($response)) + 1);
+ $size = max(1, textlib::strlen(trim($response)) + 1);
foreach ($subq->answers as $ans) {
- $size = max($size, strlen(trim($ans->answer)));
+ $size = max($size, textlib::strlen(trim($ans->answer)));
}
$size = min(60, round($size + rand(0, $size*0.15)));
// The rand bit is to make guessing harder.

0 comments on commit c81175f

Please sign in to comment.