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

Unable to add a shortanswer question with an answer of 0

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 2.0.4, 2.1.1, 2.2
    • Fix Version/s: 2.0.5, 2.1.2
    • Component/s: Lesson
    • Labels:

      Description

      While testing MDL-29018 I discovered that it was impossible to create question answers with a value of 0.
      When I clicked to create a question it would simply not create the question answer in the table. This would in turn allow me to create questions without answers which would horribly break the lesson module.
      This is a pretty serious issue as you can kill the lesson module by attempting to create a question where the answer (correct or not) is 0.

      Cheers
      Sam

        Gliffy Diagrams

          Issue Links

            Activity

            Hide
            samhemelryk Sam Hemelryk added a comment -

            Hi Rosie, this needs more work at present.
            In all files lines have been changed from !empty to isset and != '' for the editor element which should be an array as per the last check. I don't think these lines need to change do they, essentially the !empty and is_array checks are perfect the only thing missing is the != '' however as they are an editor likely they will always contain some <p></p> so my -1 on the changes for these lines.
            The changes to check the answer !empty => isset look good.

            Cheers
            Sam

            Show
            samhemelryk Sam Hemelryk added a comment - Hi Rosie, this needs more work at present. In all files lines have been changed from !empty to isset and != '' for the editor element which should be an array as per the last check. I don't think these lines need to change do they, essentially the !empty and is_array checks are perfect the only thing missing is the != '' however as they are an editor likely they will always contain some <p></p> so my -1 on the changes for these lines. The changes to check the answer !empty => isset look good. Cheers Sam
            Hide
            rwijaya Rossiani Wijaya added a comment -

            Hi Sam,

            Thanks for reviewing.

            Empty field for answers won't contain <p></p> because most of the answer fields are not using editor. It uses textarea and convert it into an array form.

            Anyways, I modified the patch to your suggestion. Could you re-peer review when you have a chance?

            Show
            rwijaya Rossiani Wijaya added a comment - Hi Sam, Thanks for reviewing. Empty field for answers won't contain <p></p> because most of the answer fields are not using editor. It uses textarea and convert it into an array form. Anyways, I modified the patch to your suggestion. Could you re-peer review when you have a chance?
            Hide
            rwijaya Rossiani Wijaya added a comment -

            +1 from SamH to send it for integration through jabber.

            Show
            rwijaya Rossiani Wijaya added a comment - +1 from SamH to send it for integration through jabber.
            Hide
            nebgor Aparup Banerjee added a comment -

            Thanks Rosie, this has been integrated.

            Testers: Rosie will put in test instructions soon.
            ( beep her if not! )

            Show
            nebgor Aparup Banerjee added a comment - Thanks Rosie, this has been integrated. Testers: Rosie will put in test instructions soon. ( beep her if not! )
            Hide
            rajeshtaneja Rajesh Taneja added a comment -

            Works Great
            Thanks for fixing this Rossie.

            Show
            rajeshtaneja Rajesh Taneja added a comment - Works Great Thanks for fixing this Rossie.
            Hide
            nebgor Aparup Banerjee added a comment -

            fixes have been rolled merrily up the stream! Thanks everybody!

            Show
            nebgor Aparup Banerjee added a comment - fixes have been rolled merrily up the stream! Thanks everybody!

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  10/Oct/11