From 91769761515303359a709a47defb8172a95db8d9 Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Fri, 12 Sep 2008 08:33:40 +0000 Subject: [PATCH] MDL-16463 "Long group names can make drop down box too wide" added an if condition to test the length of the group name. If it is more than 20 characters then we use the string 'this group' instead of the group name. --- lang/en_utf8/quiz_overview.php | 1 + mod/quiz/report/overview/overviewsettings_form.php | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lang/en_utf8/quiz_overview.php b/lang/en_utf8/quiz_overview.php index d17165b6e6..2f8fbd26b9 100644 --- a/lang/en_utf8/quiz_overview.php +++ b/lang/en_utf8/quiz_overview.php @@ -50,4 +50,5 @@ $string['showinggraded'] = 'Showing only the attempt graded for each user.'; $string['showinggradedandungraded'] = 'Showing graded and ungraded attempts for each user. The one attempt for each user that is graded is highlighted. The grading method for this quiz is $a.'; $string['showdetailedmarks'] = 'Show / download marks for each question'; $string['studentingroup'] = '\'$a->coursestudent\' in group \'$a->groupname\''; +$string['studentingrouplong'] = '\'$a->coursestudent\' in this group'; ?> diff --git a/mod/quiz/report/overview/overviewsettings_form.php b/mod/quiz/report/overview/overviewsettings_form.php index 8441cab9cc..77ab6c35be 100644 --- a/mod/quiz/report/overview/overviewsettings_form.php +++ b/mod/quiz/report/overview/overviewsettings_form.php @@ -14,7 +14,11 @@ class mod_quiz_report_overview_settings extends moodleform { $a = new object(); $a->coursestudent = $COURSE->students; $a->groupname = groups_get_group_name($this->_customdata['currentgroup']); - $studentsstring = get_string('studentingroup', 'quiz_overview', $a); + if (20 < strlen($a->groupname)){ + $studentsstring = get_string('studentingrouplong', 'quiz_overview', $a); + } else { + $studentsstring = get_string('studentingroup', 'quiz_overview', $a); + } } $options = array(); if (!$this->_customdata['currentgroup']){ -- 2.39.5