Skip to content

Commit

Permalink
MDL-44054 quiz_statistics fix lang string concatenation.
Browse files Browse the repository at this point in the history
  • Loading branch information
timhunt committed May 29, 2014
1 parent 8e478c9 commit 7076b30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
7 changes: 5 additions & 2 deletions mod/quiz/report/statistics/lang/en/quiz_statistics.php
Expand Up @@ -26,8 +26,12 @@
$string['allattempts'] = 'all attempts';
$string['allattemptsavg'] = 'Average grade of all attempts';
$string['allattemptscount'] = 'Total number of complete graded attempts';
$string['analysisnameonly'] = '"{$a->name}"';
$string['analysisno'] = '({$a->number}) "{$a->name}"';
$string['analysisnovariant'] = '({$a->number}) "{$a->name}" variant {$a->variant}';
$string['analysisofresponses'] = 'Analysis of responses';
$string['analysisofresponsesfor'] = 'Analysis of responses for {$a}.';
$string['analysisofresponsesfor'] = 'Analysis of responses for {$a}';
$string['analysisvariant'] = '"{$a->name}" variant {$a->variant}';
$string['attempts'] = 'Attempts';
$string['attemptsall'] = 'all attempts';
$string['attemptsfirst'] = 'first attempt';
Expand Down Expand Up @@ -110,6 +114,5 @@
$string['statistics:view'] = 'View statistics report';
$string['statsfor'] = 'Quiz statistics (for {$a})';
$string['variant'] = 'Variant';
$string['variantno'] = 'Variant {$a}';
$string['whichtries'] = 'Analyze responses for';

18 changes: 12 additions & 6 deletions mod/quiz/report/statistics/report.php
Expand Up @@ -387,13 +387,19 @@ protected function output_individual_question_response_analysis($question, $vari

} else {
// Work out an appropriate title.
$questiontabletitle = '"' . $question->name . '"';
if (!empty($question->number)) {
$questiontabletitle = '(' . $question->number . ') ' . $questiontabletitle;
}
if (!is_null($variantno)) {
$questiontabletitle .= ' '.get_string('variantno', 'quiz_statistics', $variantno);
$a = clone($question);
$a->variant = $variantno;

if (!empty($question->number) && !is_null($variantno)) {
$questiontabletitle = get_string('analysisnovariant', 'quiz_statistics', $a);
} else if (!empty($question->number)) {
$questiontabletitle = get_string('analysisno', 'quiz_statistics', $a);
} else if (!is_null($variantno)) {
$questiontabletitle = get_string('analysisvariant', 'quiz_statistics', $a);
} else {
$questiontabletitle = get_string('analysisnameonly', 'quiz_statistics', $a);
}

if ($this->table->is_downloading() == 'xhtml') {
$questiontabletitle = get_string('analysisofresponsesfor', 'quiz_statistics', $questiontabletitle);
}
Expand Down

0 comments on commit 7076b30

Please sign in to comment.