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 a812924 commit 16442e5cfdb48ff654fd714409cea3fd5fa8464c @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 16442e5

Please sign in to comment.