Details

    • Type: Sub-task Sub-task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.5
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      The answers/choices section of several question types have been improved. The structure of the forms hasn’t changed so you should still be able to edit existing questions, see valid data in the relevant fields, save the form and answer the question.

      Test editing both existing and creating new questions of these types:

      • Multiple choice
      • Short answer
      • Numerical
      • Matching
      • Calculated
      • Calculated simple
      • Calculate multiple choice

      CSS has been added in most of the question types due to the way css works and the individual nature of many question types. Has been tested in the latest Firefox, Chrome and IE9.

      Show
      The answers/choices section of several question types have been improved. The structure of the forms hasn’t changed so you should still be able to edit existing questions, see valid data in the relevant fields, save the form and answer the question. Test editing both existing and creating new questions of these types: Multiple choice Short answer Numerical Matching Calculated Calculated simple Calculate multiple choice CSS has been added in most of the question types due to the way css works and the individual nature of many question types. Has been tested in the latest Firefox, Chrome and IE9.
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_25_STABLE
    • Pull Master Branch:
    • Rank:
      46047

      Description

      Question types generally have very long forms. Where answer and choice sections appear they take up a large part of a form. The idea is to diplay the field Answer 1/Answer/Grade/Accepted errors all on one line.

      In moodle this involves putting the fields into a group. The drag and drop question type (ddwtos) is an example. The choices are now grouped inside a group form element.

      Different question types have different standards which may prevent this solution on particular question types. For example in multiple choice we now have html editors in lieu of edit boxes. So the solution needs considering on a question by question basis.

        Issue Links

          Activity

          Hide
          Colin Chambers added a comment -

          I've ported the changes from our OU code to latest moodle. This just puts the questions/choices into groups. We still need to make the fields easier to use.

          Some initial things still to address
          1. Should all forms be grouped? Some like multiple choice don't benefit.
          2. I added static labels to each field because labels of grouped fields aren't shown. Are they required
          3. Each answer/choice needs spacing to mark it out from other answers/choices

          Show
          Colin Chambers added a comment - I've ported the changes from our OU code to latest moodle. This just puts the questions/choices into groups. We still need to make the fields easier to use. Some initial things still to address 1. Should all forms be grouped? Some like multiple choice don't benefit. 2. I added static labels to each field because labels of grouped fields aren't shown. Are they required 3. Each answer/choice needs spacing to mark it out from other answers/choices
          Hide
          Colin Chambers added a comment -

          This is just a first draft RFC. It's not finished. I'd appreciate feedback. This set of fields is the most varied and complicated in the questiontypes.

          It may be best to do things per question but I couldn't see how to do that at first.

          So just need a sanity check first to see I whether I'm going in the right direction.

          Show
          Colin Chambers added a comment - This is just a first draft RFC. It's not finished. I'd appreciate feedback. This set of fields is the most varied and complicated in the questiontypes. It may be best to do things per question but I couldn't see how to do that at first. So just need a sanity check first to see I whether I'm going in the right direction.
          Hide
          Tim Hunt added a comment -

          Get getting workflow state back to development in progress.

          Show
          Tim Hunt added a comment - Get getting workflow state back to development in progress.
          Hide
          Colin Chambers added a comment -

          A year on from the previous commits and after reviewing the requirements with hindsight I decided to start again. Using Tims work on the Stack questions as a guide.

          We specified the core question types to address and how we’d like them to appear.

          All options/choices will be rendered under the answers header which is expanded by default. The ‘blanks for more’ button is also grouped inside the answers section.

          With the elements being grouped the label for each group is generally the same as the label for the first element in the group. Thus the label will render once for both the group and the element. In this case we hide the label for the first element in the group.

          To make it clear visually what answer each field relates to each answer has a border and background plus space between the bottom of one answer and the top of the next.

          Forms should still work the same way because field names haven’t been changed. Only the form order, groupings and style have changed. You should be able to edit an existing question and see all data in the correct fields then save it.

          We then went through each question type defining the answer/choice layout beginning with the Multiple Choice question type:

          Multiple choice

          Row 1 Question 1,
          Row 2 Answer
          All fields on separate lines.

          Short answer
          same as Multichoice.
          Row 1: Answer a little shorter. grade next to answer.
          Row 2: Feedback.

          Numerical
          Same as Multichoice
          Rows
          1: Answer, error, Grade
          2: Feedback
          Resize accepted error to match answer

          Calculated
          Same as Multichoice
          Rename correct answer formula to Answer formula =
          Rows
          1: Answer formula, Grade
          2: Tolerance, Type
          3: (Correct answer shows)Answer Display, Format (Use accesshide)
          4: Feedback
          Ensure answer groups are numbered correctly.

          Calculated Simple
          Inherits from Calculated.

          Calculate multi
          Same as Multichoice
          Put ^&*()( in a help icon
          Rows

          Choice 1( ^&*()(), Grade
          Answer shows, Format
          Feedback

          Matching
          Same as Multichoice.
          Row 1: Question 1,
          Row 2: Answer 1

          Show
          Colin Chambers added a comment - A year on from the previous commits and after reviewing the requirements with hindsight I decided to start again. Using Tims work on the Stack questions as a guide. We specified the core question types to address and how we’d like them to appear. All options/choices will be rendered under the answers header which is expanded by default. The ‘blanks for more’ button is also grouped inside the answers section. With the elements being grouped the label for each group is generally the same as the label for the first element in the group. Thus the label will render once for both the group and the element. In this case we hide the label for the first element in the group. To make it clear visually what answer each field relates to each answer has a border and background plus space between the bottom of one answer and the top of the next. Forms should still work the same way because field names haven’t been changed. Only the form order, groupings and style have changed. You should be able to edit an existing question and see all data in the correct fields then save it. We then went through each question type defining the answer/choice layout beginning with the Multiple Choice question type: Multiple choice Row 1 Question 1, Row 2 Answer All fields on separate lines. Short answer same as Multichoice. Row 1: Answer a little shorter. grade next to answer. Row 2: Feedback. Numerical Same as Multichoice Rows 1: Answer, error, Grade 2: Feedback Resize accepted error to match answer Calculated Same as Multichoice Rename correct answer formula to Answer formula = Rows 1: Answer formula, Grade 2: Tolerance, Type 3: (Correct answer shows)Answer Display, Format (Use accesshide) 4: Feedback Ensure answer groups are numbered correctly. Calculated Simple Inherits from Calculated. Calculate multi Same as Multichoice Put ^&*()( in a help icon Rows Choice 1( ^&*()(), Grade Answer shows, Format Feedback Matching Same as Multichoice. Row 1: Question 1, Row 2: Answer 1
          Hide
          Colin Chambers added a comment -

          Added a comment with the latest required functionality.

          Show
          Colin Chambers added a comment - Added a comment with the latest required functionality.
          Hide
          Tim Hunt added a comment -

          Great, thanks Colin.

          On further discussion with Colin, we decided to squash the branch down to a single commit, which is why the final branch is coming from my repo.

          Show
          Tim Hunt added a comment - Great, thanks Colin. On further discussion with Colin, we decided to squash the branch down to a single commit, which is why the final branch is coming from my repo.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Integrated, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - Integrated, thanks!
          Hide
          Michael de Raadt added a comment -

          Test result: Not successful.

          In the calculated mutichoice question type the tolerance field appears to be missing. As a consequence, the question cannot be validated. The following error is repeated three times on the page after attempting to save the question...

          Notice: Undefined index: tolerance in D:\xampp\htdocs\master_integration\question\type\calculatedmulti\edit_calculatedmulti_form.php on line 309
          
          Show
          Michael de Raadt added a comment - Test result: Not successful. In the calculated mutichoice question type the tolerance field appears to be missing. As a consequence, the question cannot be validated. The following error is repeated three times on the page after attempting to save the question... Notice: Undefined index: tolerance in D:\xampp\htdocs\master_integration\question\type\calculatedmulti\edit_calculatedmulti_form.php on line 309
          Hide
          Colin Chambers added a comment -

          Great spot michael. I've fixed that and in the process noticed that many of the changed fields no longer display answers. Need to display the errors on the group instead of the field.

          I fetched tims branch and created the fixes on that. The first adds the tolerance fields you requested. The second ensures the answer field errors display. I went through all question types affected:

          true/false
          multiple choice
          short answer
          numerical
          calculated
          calculated simple
          calculatedmulti
          matching

          Just under half needed fixing. The only problem is where fields were grouped and had a linked validation message.

          Show
          Colin Chambers added a comment - Great spot michael. I've fixed that and in the process noticed that many of the changed fields no longer display answers. Need to display the errors on the group instead of the field. I fetched tims branch and created the fixes on that. The first adds the tolerance fields you requested. The second ensures the answer field errors display. I went through all question types affected: true/false multiple choice short answer numerical calculated calculated simple calculatedmulti matching Just under half needed fixing. The only problem is where fields were grouped and had a linked validation message.
          Hide
          Colin Chambers added a comment -

          To review and test use https://github.com/colchambers/moodle/compare/master...MDL-36570

          There are two commits. The first adds the tolerance fields back to the calculatedmulti form. The second gets the errors for answer fields displaying on the relevant groups.

          To test I had to run through the relevant scenarios to trigger the errors defined for each form answer. The errors should now display above the group instead of directly alongside the specific field.

          Show
          Colin Chambers added a comment - To review and test use https://github.com/colchambers/moodle/compare/master...MDL-36570 There are two commits. The first adds the tolerance fields back to the calculatedmulti form. The second gets the errors for answer fields displaying on the relevant groups. To test I had to run through the relevant scenarios to trigger the errors defined for each form answer. The errors should now display above the group instead of directly alongside the specific field.
          Hide
          Eloy Lafuente (stronk7) added a comment -

          New commits integrated, sending this back to another testing round, thanks!

          Show
          Eloy Lafuente (stronk7) added a comment - New commits integrated, sending this back to another testing round, thanks!
          Hide
          Michael de Raadt added a comment -

          Test result: Success!

          Apart from loads of setType() warnings (reported elsewhere), that's working nicely.

          Thanks for your efforts, Colin and Tim.

          Show
          Michael de Raadt added a comment - Test result: Success! Apart from loads of setType() warnings (reported elsewhere), that's working nicely. Thanks for your efforts, Colin and Tim.
          Hide
          Dan Poltawski added a comment -

          Did you remember to call thankDevelopers() for 'this_weeks_work'? Defaulting to PARAM_SHODDY thanking.

          line 1289 of \lib\changes.php: call to debugging()
          line 281 of \lib\are.php: call to moodleform->detectMissingThanks()
          line 202 of \lib\now.php: call to moodleform->_is_poor_form()
          line 73 of \course\upstream.php: call to moodleform->forgetingToThank()

          Show
          Dan Poltawski added a comment - Did you remember to call thankDevelopers() for 'this_weeks_work'? Defaulting to PARAM_SHODDY thanking. line 1289 of \lib\changes.php: call to debugging() line 281 of \lib\are.php: call to moodleform->detectMissingThanks() line 202 of \lib\now.php: call to moodleform->_is_poor_form() line 73 of \course\upstream.php: call to moodleform->forgetingToThank()

            People

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

              Dates

              • Created:
                Updated:
                Resolved: