Skip to content

Commit

Permalink
MDL-20636 Fix a bunch of missing strings caused by separating questio…
Browse files Browse the repository at this point in the history
…n from quiz.
  • Loading branch information
timhunt committed Mar 2, 2011
1 parent f3ca24e commit 42663bb
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 17 deletions.
12 changes: 12 additions & 0 deletions lang/en/question.php
Expand Up @@ -23,6 +23,7 @@
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/

$string['addcategory'] = 'Add category';
$string['adminreport'] = 'Report on possible problems in your question database.';
$string['availableq'] = 'Available?';
$string['badbase'] = 'Bad base before **: {$a}**';
Expand Down Expand Up @@ -52,7 +53,9 @@
$string['categorycurrent'] = 'Current category';
$string['categorycurrentuse'] = 'Use this category';
$string['categorydoesnotexist'] = 'This category does not exist';
$string['categoryinfo'] = 'Category info';
$string['categorymoveto'] = 'Save in category';
$string['categorynamecantbeblank'] = 'The category name cannot be blank.';
$string['clicktoflag'] = 'Click to flag this question';
$string['clicktounflag'] = 'Click to un-flag this question';
$string['contexterror'] = 'You shouldn\'t have got here if you\'re not moving a category to another context.';
Expand All @@ -76,6 +79,8 @@
$string['defaultfor'] = 'Default for {$a}';
$string['defaultinfofor'] = 'The default category for questions shared in context \'{$a}\'.';
$string['deletecoursecategorywithquestions'] = 'There are questions in the question bank associated with this course category. If you proceed, they will be deleted. You may wish to move them first, using the question bank interface.';
$string['deletequestioncheck'] = 'Are you absolutely sure you want to delete \'{$a}\'?';
$string['deletequestionscheck'] = 'Are you absolutely sure you want to delete the following questions?<br /><br />{$a}';
$string['disabled'] = 'Disabled';
$string['disterror'] = 'The distribution {$a} caused problems';
$string['donothing'] = 'Don\'t copy or move files or change links.';
Expand All @@ -91,6 +96,7 @@
Categories are also used for random questions, as questions are selected from a particular category.';
$string['editcategories_link'] = 'question/category';
$string['editcategory'] = 'Edit category';
$string['editingcategory'] = 'Editing a category';
$string['editingquestion'] = 'Editing a question';
$string['editthiscategory'] = 'Edit this category';
Expand Down Expand Up @@ -218,6 +224,7 @@
$string['questionname'] = 'Question name';
$string['questionno'] = 'Question {$a}';
$string['questionsaveerror'] = 'Errors occur during saving question - ({$a})';
$string['questionsinuse'] = '(* Questions marked by an asterisk are already in use in some quizzes. These question will not be deleted from these quizzes but only from the category list.)';
$string['questionsmovedto'] = 'Questions still in use moved to "{$a}" in the parent course category.';
$string['questionsrescuedfrom'] = 'Questions saved from context {$a}.';
$string['questionsrescuedfrominfo'] = 'These questions (some of which may be hidden) were saved when context {$a} was deleted because they are still used by some quizzes or other activities.';
Expand Down Expand Up @@ -288,6 +295,7 @@
$string['howquestionsbehave_help'] = 'Students can interact with the questions in the quiz in various different ways. For example, you may wish the students to enter an answer to each question and then submit the entire quiz, before anything is graded or they get any feedback. That would be \'Deferred feedback\' mode. Alternatively, you may wish for students to submit each question as they go along to get immediate feedback, and if they do not get it right immediately, have another try for fewer marks. That would be \'Interactive with multiple tries\' mode.';
$string['importfromcoursefiles'] = '... or choose a course file to import.';
$string['importfromupload'] = 'Select a file to upload ...';
$string['includesubcategories'] = 'Also show questions from sub-categories';
$string['incorrect'] = 'Incorrect';
$string['incorrectfeedback'] = 'For any incorrect response';
$string['information'] = 'Information';
Expand All @@ -308,6 +316,7 @@
$string['notyetanswered'] = 'Not yet answered';
$string['notyourpreview'] = 'This preview does not belong to you';
$string['options'] = 'Options';
$string['parent'] = 'Parent';
$string['partiallycorrect'] = 'Partially correct';
$string['partiallycorrectfeedback'] = 'For any partially correct response';
$string['penaltyforeachincorrecttry'] = 'Penalty for each incorrect try';
Expand All @@ -322,6 +331,7 @@
$string['questionbehavioursorderexplained'] = 'Enter a comma separated list of behaviours in the order you want them to appear in dropdown menu';
$string['questionidmismatch'] = 'Question ids mismatch';
$string['questionname'] = 'Question name';
$string['questions'] = 'Questions';
$string['questionx'] = 'Question {$a}';
$string['questiontext'] = 'Question text';
$string['requiresgrading'] = 'Requires grading';
Expand All @@ -332,8 +342,10 @@
$string['saved'] = 'Saved: {$a}';
$string['saveflags'] = 'Save the state of the flags';
$string['settingsformultipletries'] = 'Settings for multiple tries';
$string['showhidden'] = 'Also show old questions';
$string['showmarkandmax'] = 'Show mark and max';
$string['showmaxmarkonly'] = 'Show max mark only';
$string['showquestiontext'] = 'Show question text in the question list';
$string['shown'] = 'Shown';
$string['shownumpartscorrect'] = 'Show the number of correct responses';
$string['specificfeedback'] = 'Specific feedback';
Expand Down
2 changes: 1 addition & 1 deletion mod/quiz/addrandomform.php
Expand Up @@ -82,7 +82,7 @@ function validation($fromform, $files) {
$errors = parent::validation($fromform, $files);

if (!empty($fromform['newcategory']) && trim($fromform['name']) == '') {
$errors['name'] = get_string('categorynamecantbeblank', 'quiz');
$errors['name'] = get_string('categorynamecantbeblank', 'question');
}

return $errors;
Expand Down
4 changes: 2 additions & 2 deletions mod/quiz/editlib.php
Expand Up @@ -1134,8 +1134,8 @@ protected function display_options($recurse = 1, $showhidden = false, $showquest
echo '<form method="get" action="edit.php" id="displayoptions">';
echo "<fieldset class='invisiblefieldset'>";
echo html_writer::input_hidden_params($this->baseurl, array('recurse', 'showhidden', 'showquestiontext'));
$this->display_category_form_checkbox('recurse', get_string('recurse', 'quiz'));
$this->display_category_form_checkbox('showhidden', get_string('showhidden', 'quiz'));
$this->display_category_form_checkbox('recurse', get_string('includesubcategories', 'question'));
$this->display_category_form_checkbox('showhidden', get_string('showhidden', 'question'));
echo '<noscript><div class="centerpara"><input type="submit" value="'. get_string('go') . '" />';
echo '</div></noscript></fieldset></form>';
}
Expand Down
8 changes: 0 additions & 8 deletions mod/quiz/lang/en/quiz.php
Expand Up @@ -31,7 +31,6 @@
$string['addaquestion'] = 'Add a question ...';
$string['addarandomquestion'] = 'Add a random question ...';
$string['addarandomquestion_help'] = 'When a random question is added, it results in a randomly-chosen question from the category being inserted into the quiz. This means that different students are likely to get a different selection of questions, and when a quiz allows multiple attempts then each attempt is likely to contain a new selection of questions.';
$string['addcategory'] = 'Add category';
$string['adddescriptionlabel'] = 'Add description/label';
$string['addingquestion'] = 'Adding a question';
$string['addingquestions'] = 'This side of the page is where you manage your database of questions. Questions are stored in categories to help you keep them organised, and can be used by any quiz in your course or even other courses if you choose to \'publish\' them. <br /><br />After you select or create a question category you will be able to create or edit questions. You can select any of these questions to add to your quiz over on the other side of this page.';
Expand Down Expand Up @@ -142,10 +141,8 @@
$string['category'] = 'Category';
$string['categoryadded'] = 'The category \'{$a}\' was added';
$string['categorydeleted'] = 'The category \'{$a}\' was deleted';
$string['categoryinfo'] = 'Category info';
$string['categorymove'] = 'The category \'{$a->name}\' contains {$a->count} questions (some of them may be old, hidden, questions that are still in use in some existing quizzes).<br />Please choose another category to move them to.';
$string['categorymoveto'] = 'Move them to this category';
$string['categorynamecantbeblank'] = 'The category name cannot be blank.';
$string['categorynoedit'] = 'You do not have editing privileges in the category \'{$a}\'.';
$string['categoryupdated'] = 'The category was successfully updated';
$string['close'] = 'Close window';
Expand Down Expand Up @@ -231,8 +228,6 @@
$string['delay1st2nd_help'] = 'If enabled, a student must wait for the specified time to elapse before being able to attempt the quiz a second time.';
$string['delay2'] = 'Time delay between later attempts';
$string['deleteattemptcheck'] = 'Are you absolutely sure you want to completely delete these attempts?';
$string['deletequestioncheck'] = 'Are you absolutely sure you want to delete \'{$a}\'?';
$string['deletequestionscheck'] = 'Are you absolutely sure you want to delete the following questions?<br /><br />{$a}';
$string['deleteselected'] = 'Delete selected';
$string['deletingquestionattempts'] = 'Deleting question attempts';
$string['description'] = 'Description';
Expand Down Expand Up @@ -549,7 +544,6 @@
$string['questions'] = 'Questions';
$string['questionsinclhidden'] = 'Questions (including hidden)';
$string['questionsinthisquiz'] = 'Questions in this quiz';
$string['questionsinuse'] = '(* Questions marked by an asterisk are already in use in some quizzes. These question will not be deleted from these quizzes but only from the category list.)';
$string['questionsperpage'] = 'Questions per page';
$string['questionsperpageselected'] = 'Questions per page has been set so the paging is currently fixed. As a result, the paging controls have been disabled. You can change this in {$a}.';
$string['questionsperpagex'] = 'Questions per page: {$a}';
Expand Down Expand Up @@ -710,11 +704,9 @@
$string['showdetailedmarks'] = 'Show mark details';
$string['showeachpage'] = 'Show one page at a time';
$string['showfeedback'] = 'After answering, show feedback?';
$string['showhidden'] = 'Also show old questions';
$string['showinsecurepopup'] = 'Use a \'secure\' popup window for attempts';
$string['shownoattempts'] = 'Show students with no attempts';
$string['shownoattemptsonly'] = 'Show only students with no attempts';
$string['showquestiontext'] = 'Show question text in the question list';
$string['showteacherattempts'] = 'Show teacher attempts';
$string['showuserpicture'] = 'Show the user\'s picture';
$string['showuserpicture_help'] = 'If enabled, the student\'s name and picture will be shown on-screen during the attempt, and on the review screen, making it easier to check that the student is logged in as themself in an invigilated (proctored) exam.';
Expand Down
8 changes: 4 additions & 4 deletions question/category_form.php
Expand Up @@ -44,7 +44,7 @@ function definition() {

$contexts = $this->_customdata['contexts'];
$currentcat = $this->_customdata['currentcat'];
//--------------------------------------------------------------------------------

$mform->addElement('header', 'categoryheader', get_string('addcategory', 'question'));

$questioncategoryel = $mform->addElement('questioncategory', 'parent', get_string('parentcategory', 'question'),
Expand All @@ -55,17 +55,17 @@ function definition() {
}
$mform->addHelpButton('parent', 'parentcategory', 'question');

$mform->addElement('text','name', get_string('name'),'maxlength="254" size="50"');
$mform->addElement('text', 'name', get_string('name'),'maxlength="254" size="50"');
$mform->setDefault('name', '');
$mform->addRule('name', get_string('categorynamecantbeblank', 'question'), 'required', null, 'client');
$mform->setType('name', PARAM_MULTILANG);

$mform->addElement('textarea', 'info', get_string('categoryinfo', 'question'), array('rows'=> '10', 'cols'=>'45'));
$mform->setDefault('info', '');
$mform->setType('info', PARAM_MULTILANG);
//--------------------------------------------------------------------------------

$this->add_action_buttons(false, get_string('addcategory', 'question'));
//--------------------------------------------------------------------------------

$mform->addElement('hidden', 'id', 0);
$mform->setType('id', PARAM_INT);
}
Expand Down
2 changes: 1 addition & 1 deletion question/question.php
Expand Up @@ -192,7 +192,7 @@
$PAGE->set_pagetype('question-type-' . $question->qtype);

// Create the question editing form.
if ($wizardnow!=='' && !$movecontext){
if ($wizardnow !== '' && !$movecontext){
$mform = $qtypeobj->next_wizard_form('question.php', $question, $wizardnow, $formeditable);
} else {
$mform = $qtypeobj->create_editing_form('question.php', $question, $category, $contexts, $formeditable);
Expand Down
2 changes: 1 addition & 1 deletion question/type/random/edit_random_form.php
Expand Up @@ -34,7 +34,7 @@
* @copyright 2007 Jamie Pratt me@jamiep.org
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class question_edit_random_form extends question_edit_form {
class qtype_random_edit_form extends question_edit_form {
/**
* Build the form definition.
*
Expand Down

0 comments on commit 42663bb

Please sign in to comment.