Skip to content
Snippets Groups Projects
Commit 5daaf4b1 authored by Chris Sangwin's avatar Chris Sangwin
Browse files

Fix to issue #1044.

parent 06eb9df3
Branches
No related tags found
No related merge requests found
...@@ -56,6 +56,7 @@ $string['stackversionregexp'] = 'The RegExp answer test is not supported after ...@@ -56,6 +56,7 @@ $string['stackversionregexp'] = 'The RegExp answer test is not supported after
$string['stackfileuseerror'] = 'One or more files (e.g. images) are associated internally with the {$a}, but none appear to be used in the current text itself.'; $string['stackfileuseerror'] = 'One or more files (e.g. images) are associated internally with the {$a}, but none appear to be used in the current text itself.';
// Strings used on the editing form. // Strings used on the editing form.
$string['generalerrors'] = 'There are errors in your question. Please check carefully below.';
$string['addanothernode'] = 'Add another node'; $string['addanothernode'] = 'Add another node';
$string['allnodefeedbackmustusethesameformat'] = 'All the feedback for all the nodes in a PRT must use the same text format.'; $string['allnodefeedbackmustusethesameformat'] = 'All the feedback for all the nodes in a PRT must use the same text format.';
$string['answernote'] = 'Answer note'; $string['answernote'] = 'Answer note';
...@@ -264,7 +265,7 @@ $string['optionsnotrequired'] = 'This input type does not require any options.'; ...@@ -264,7 +265,7 @@ $string['optionsnotrequired'] = 'This input type does not require any options.';
$string['penalty'] = 'Penalty'; $string['penalty'] = 'Penalty';
$string['penalty_help'] = 'The penalty scheme deducts this value from the result of each PRT for each different and valid attempt which is not completely correct.'; $string['penalty_help'] = 'The penalty scheme deducts this value from the result of each PRT for each different and valid attempt which is not completely correct.';
$string['penalty_link'] = '%%WWWROOT%%/question/type/stack/doc/doc.php/Authoring/Feedback.md'; $string['penalty_link'] = '%%WWWROOT%%/question/type/stack/doc/doc.php/Authoring/Feedback.md';
$string['penaltyerror'] = 'The penalty must be a numeric value between 0 and 1 or a variable (which is not checked).'; $string['penaltyf'] = 'The penalty must be a numeric value between 0 and 1 or a variable (which is not checked).';
$string['penaltyerror2'] = 'The penalty must empty, or be a numeric value between 0 and 1.'; $string['penaltyerror2'] = 'The penalty must empty, or be a numeric value between 0 and 1.';
$string['prtcorrectfeedback'] = 'Standard feedback for correct'; $string['prtcorrectfeedback'] = 'Standard feedback for correct';
$string['prtheading'] = 'Potential response tree: {$a}'; $string['prtheading'] = 'Potential response tree: {$a}';
......
...@@ -1765,6 +1765,7 @@ class qtype_stack extends question_type { ...@@ -1765,6 +1765,7 @@ class qtype_stack extends question_type {
// Convert the $errors array from our array of arrays format to the // Convert the $errors array from our array of arrays format to the
// standard array of strings format. // standard array of strings format.
$errorsexit = false;
foreach ($errors as $field => $messages) { foreach ($errors as $field => $messages) {
if ($messages) { if ($messages) {
foreach ($messages as $key => $val) { foreach ($messages as $key => $val) {
...@@ -1773,10 +1774,15 @@ class qtype_stack extends question_type { ...@@ -1773,10 +1774,15 @@ class qtype_stack extends question_type {
} }
} }
$errors[$field] = implode(' ', $messages); $errors[$field] = implode(' ', $messages);
$errorsexit = true;
} else { } else {
unset($errors[$field]); unset($errors[$field]);
} }
} }
if ($errorsexit) {
// Add a message next to the question name to create a more prominent error alert.
$errors['name'] = stack_string_error('generalerrors');
}
return $errors; return $errors;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment