Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-35026

Missing string in multianswer question

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.4, 2.3.1, 2.4
    • Fix Version/s: 2.2.5, 2.3.2
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      1. You need a quiz, containing a multianswer question, that has been attempted by students.

      2. Go to the quiz edit page, and edit the multianswer question that is in the quiz. Add an extra subquestion at the end of the quiz. For example, add {:MULTICHOICE:=Yes#Correct~No#We have a different opinion}

      3. Click save changes. The form will re-display with a validation message about "Questions added ...". There should be no missing string errors.

      Show
      1. You need a quiz, containing a multianswer question, that has been attempted by students. 2. Go to the quiz edit page, and edit the multianswer question that is in the quiz. Add an extra subquestion at the end of the quiz. For example, add {:MULTICHOICE:=Yes#Correct~No#We have a different opinion} 3. Click save changes. The form will re-display with a validation message about "Questions added ...". There should be no missing string errors.
    • Affected Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE, MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      I was editing a multianswer question, using the following question text

      This question consists of some text with an answer embedded right here {1:MULTICHOICE:Wrong answer#Feedback for this wrong answer~Another wrong answer#Feedback for the other wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer}
       
      and right after that you will have to deal with this short answer {1:SHORTANSWER:Wrong answer#Feedback for this wrong answer~=Correct answer#Feedback for correct answer~%50%Answer that gives half the credit#Feedback for half credit answer}
       
      and finally we have a floating point number {2:NUMERICAL:=23.8:0.1#Feedback for correct answer 23.8~%50%23.8:2#Feedback for half credit answer in the nearby region of the correct answer}.
       
      The multichoice question can also be shown in the vertical display of the standard moodle multiple choice. {2:MCV:1. Wrong answer#Feedback for this wrong answer~2. Another wrong answer#Feedback for the other wrong answer~=3. Correct answer#Feedback for correct answer~%50%4. Answer that gives half the credit#Feedback for half credit answer}
       
      Or in an horizontal display that is included here in a table {2:MCH:a. Wrong answer#Feedback for this wrong answer~b. Another wrong answer#Feedback for the other wrong answer~=c. Correct answer#Feedback for correct answer~%50%d. Answer that gives half the credit#Feedback for half credit answer}
       
      A shortanswer question where case must match. Write moodle in upper case letters {1:SHORTANSWER_C:moodle#Feedback for moodle in lower case ~=MOODLE#Feedback for MOODLE in upper case ~%50%Moodle#Feedback for only first letter in upper case}
       
      Note that addresses like www.moodle.org and smileys :-) all work as normal:
       
      a) How good is this? {:MULTICHOICE:=Yes#Correct~No#We have a different opinion}
       
      b) What grade would you give it? {3:NUMERICAL:=3:2}

      This wild error appeared!

      Invalid get_string() identifier: 'questionsadded' or component 'qtype_multianswer'. Perhaps you are missing $string['questionsadded'] = ''; in /home/fred/www/repositories/stable_master/moodle/question/type/multianswer/lang/en/qtype_multianswer.php?
      line 6624 of /lib/moodlelib.php: call to debugging()
      line 7248 of /lib/moodlelib.php: call to core_string_manager->get_string()
      line 227 of /question/type/multianswer/edit_multianswer_form.php: call to get_string()
      line 204 of /question/type/edit_question_form.php: call to qtype_multianswer_edit_form->definition_inner()
      line 191 of /lib/formslib.php: call to question_edit_form->definition()
      line 113 of /question/type/edit_question_form.php: call to moodleform->moodleform()
      line 75 of /question/type/multianswer/edit_multianswer_form.php: call to question_edit_form->__construct()
      line 217 of /question/type/questiontypebase.php: call to qtype_multianswer_edit_form->__construct()
      line 200 of /question/question.php: call to question_type->create_editing_form()

      Test pre-requisites

      • Debug level developer
      • A quiz with 6 questions (calculated, numerical, short answer, essay, match, multianswer)
      • 2 attempts submitted to the quiz so that we can't add new questions

      Steps

      1. Edit the quiz
      2. Edit the multianswer question
      3. Change the question text to '.' and click save
      4. You're redirected back on the same page
      5. Now change the question text to the one specified here above
      6. Click on 'Save'
      7. The missing string text appear on the top of the page

        Gliffy Diagrams

          Activity

          Hide
          timhunt Tim Hunt added a comment -

          Fréd, not a great bug report. What exactly did you do after putting in that question text? Was it save changes, or Decode and verify question text?

          Show
          timhunt Tim Hunt added a comment - Fréd, not a great bug report. What exactly did you do after putting in that question text? Was it save changes, or Decode and verify question text?
          Hide
          fred Frédéric Massart added a comment -

          Hi Tim, I did not think that this was hard to reproduce but I agree, it is! I have just tried a couple of times and updated the issue description.

          Show
          fred Frédéric Massart added a comment - Hi Tim, I did not think that this was hard to reproduce but I agree, it is! I have just tried a couple of times and updated the issue description.
          Hide
          timhunt Tim Hunt added a comment -

          Aha! there is a suspicious string questionnadded in the lang file that is not used anywhere, and there is no questionsadded string anywhere. So, it looks like a polarity error

          Show
          timhunt Tim Hunt added a comment - Aha! there is a suspicious string questionnadded in the lang file that is not used anywhere, and there is no questionsadded string anywhere. So, it looks like a polarity error
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week.

          TIA and ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - The main moodle.git repository has just been updated with latest weekly modifications. You may wish to rebase your PULL branches to simplify history and avoid any possible merge conflicts. This would also make integrator's life easier next week. TIA and ciao
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Tim, and are we 100% sure that 'questionnadded' have not been used ever in those stable branches?

          I feel myself more confident by issuing one COPY for stables rather than a MOVE.

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Tim, and are we 100% sure that 'questionnadded' have not been used ever in those stable branches? I feel myself more confident by issuing one COPY for stables rather than a MOVE.
          Hide
          timhunt Tim Hunt added a comment -

          I am sure that questionnadded was always a typo. The code has only ever referred to questionsaded. Therefore Move is correct. Keeping around a useless string questionnadded is just a distraction for translators.

          Show
          timhunt Tim Hunt added a comment - I am sure that questionnadded was always a typo. The code has only ever referred to questionsaded. Therefore Move is correct. Keeping around a useless string questionnadded is just a distraction for translators.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Thanks for the confirmation, integrating...

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Thanks for the confirmation, integrating...
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          Integrated (22, 23 & master), thanks!

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - Integrated (22, 23 & master), thanks!
          Hide
          abgreeve Adrian Greeve added a comment -

          After asking Fred what a multi answer question is I got directed to Embedded Answers.
          Tested in 2.2, 2.3, master.
          No problems found.
          Test passed.

          Show
          abgreeve Adrian Greeve added a comment - After asking Fred what a multi answer question is I got directed to Embedded Answers. Tested in 2.2, 2.3, master. No problems found. Test passed.
          Hide
          stronk7 Eloy Lafuente (stronk7) added a comment -

          I'm so proud...of you, many thanks!

          http://youtu.be/n64CdfDRnZY

          Closing as fixed, ciao

          Show
          stronk7 Eloy Lafuente (stronk7) added a comment - I'm so proud...of you, many thanks! http://youtu.be/n64CdfDRnZY Closing as fixed, ciao

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                10/Sep/12