MDL-28132 truncate very long category names before using them in random question...
authorTim Hunt <T.J.Hunt@open.ac.uk>
Thu, 30 Jun 2011 18:34:44 +0000 (19:34 +0100)
committerTim Hunt <T.J.Hunt@open.ac.uk>
Thu, 30 Jun 2011 18:35:35 +0000 (19:35 +0100)
question/type/random/questiontype.php

index 95bb810..836e88a 100644 (file)
@@ -139,7 +139,7 @@ class qtype_random extends question_type {
         } else {
             $string = 'randomqname';
         }
-        return get_string($string, 'qtype_random', $category->name);
+        return get_string($string, 'qtype_random', shorten_text($category->name, 100));
     }
 
     protected function set_selected_question_name($question, $randomname) {