From baf706b5034260d2518721bd24312567917aa5b3 Mon Sep 17 00:00:00 2001 From: Tim Hunt Date: Thu, 30 Jun 2011 19:34:44 +0100 Subject: [PATCH] MDL-28132 truncate very long category names before using them in random question names. --- question/type/random/questiontype.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/question/type/random/questiontype.php b/question/type/random/questiontype.php index 95bb810da1199..836e88a19c351 100644 --- a/question/type/random/questiontype.php +++ b/question/type/random/questiontype.php @@ -139,7 +139,7 @@ public function question_name($category, $includesubcategories) { } 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) {