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

Implement extra_answer_fields

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      This code main function is to help 3rd party question types. So probably the best way to test it is to install Preg question type from attached archive preg_25_rc.zip and run question/type/preg/tests/questiontype_test.php which contains advanced tests for user manipulating with both answers and extra_answers_fields. Preg uses options extra_answer_fields, that gives more testing cases than anything else.

      However, if you don't want to install additional question types, you could test it using shortanswer question.

      1. Create shortanswer question with 5 answers.
      2. Edit question and see that all 5 answers are in their place on the edit form.
      3. Clear 1-st, 3-rd and 5-th answers (you need to clear all answer, fraction and feedback fields to do it) and save question.
      4. Edit question and see there are 2 answers on form now (that was 2-nd and 4-th before).
      5. Add two new answers in the end and save question.
      6. Open question to edit and see that it contains 4 answers for now.
      7. Delete 2-nd and add new answer, saving form.
      8. Open question to edit and see that there are 4 answers: the ones that were 1-st, 3-rd and 4-th on the 6. step and the new one added there.

      Show
      This code main function is to help 3rd party question types. So probably the best way to test it is to install Preg question type from attached archive preg_25_rc.zip and run question/type/preg/tests/questiontype_test.php which contains advanced tests for user manipulating with both answers and extra_answers_fields. Preg uses options extra_answer_fields, that gives more testing cases than anything else. However, if you don't want to install additional question types, you could test it using shortanswer question. 1. Create shortanswer question with 5 answers. 2. Edit question and see that all 5 answers are in their place on the edit form. 3. Clear 1-st, 3-rd and 5-th answers (you need to clear all answer, fraction and feedback fields to do it) and save question. 4. Edit question and see there are 2 answers on form now (that was 2-nd and 4-th before). 5. Add two new answers in the end and save question. 6. Open question to edit and see that it contains 4 answers for now. 7. Delete 2-nd and add new answer, saving form. 8. Open question to edit and see that there are 4 answers: the ones that were 1-st, 3-rd and 4-th on the 6. step and the new one added there.
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_26_STABLE
    • Fixed Branches:
      MOODLE_27_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      Implement completely extra_answer_fields functionality to facilitate adding new fields to the answer blank. Will be good for PREG 2.0 version.

      Numerical question would be used as test and example if Tim doesn't have anything against this.

      The patch is going to be for 2.0 only.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                8 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/May/14