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

Warning when selecting no answer in a single choice question.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1, 2.1, 2.2, 2.3
    • Fix Version/s: 2.1.5, 2.2.2
    • Component/s: Lesson
    • Labels:
    • Testing Instructions:
      Hide
      1. With DEBUG_DEVELOPER enabled (to display/log everything)
      2. As admin, create a lesson and add single answer multiplechoice question
      3. As student, attempt the lesson by clicking 'submit' button without selecting any answer.

      There should not be any error display/log

      Show
      With DEBUG_DEVELOPER enabled (to display/log everything) As admin, create a lesson and add single answer multiplechoice question As student, attempt the lesson by clicking 'submit' button without selecting any answer. There should not be any error display/log
    • Affected Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE, MOODLE_23_STABLE
    • Fixed Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      see screen capture

        Gliffy Diagrams

          Attachments

            Activity

            Hide
            efgpinto Eduardo Pinto added a comment -

            I created a patch to correct that. Will attach it.

            Show
            efgpinto Eduardo Pinto added a comment - I created a patch to correct that. Will attach it.
            Hide
            efgpinto Eduardo Pinto added a comment -

            fix patch

            Show
            efgpinto Eduardo Pinto added a comment - fix patch
            Hide
            tsala Helen Foster added a comment -

            Eduardo, thanks for your patch which will hopefully be reviewed soon.

            Show
            tsala Helen Foster added a comment - Eduardo, thanks for your patch which will hopefully be reviewed soon.
            Hide
            mudrd8mz David Mudrák added a comment -

            Eduardo, can you please describe how the patch is supposed to fix the undefined property problem? If $data->answerid is not set, the is_int() is still executed in your patched version.

            Show
            mudrd8mz David Mudrák added a comment - Eduardo, can you please describe how the patch is supposed to fix the undefined property problem? If $data->answerid is not set, the is_int() is still executed in your patched version.
            Hide
            efgpinto Eduardo Pinto added a comment -

            In fact, that patch was wrong. Now, it seems correct to me.

            Show
            efgpinto Eduardo Pinto added a comment - In fact, that patch was wrong. Now, it seems correct to me.
            Hide
            mudrd8mz David Mudrák added a comment -

            Sorry Eduardo but I believe that the patch is wrong again. You are changing the evaluation logic of the statement. Clearly if $data->answerid is 0 (zero), the current code deals with it differently than your patched version would. This might introduce nice regressions.

            Show
            mudrd8mz David Mudrák added a comment - Sorry Eduardo but I believe that the patch is wrong again. You are changing the evaluation logic of the statement. Clearly if $data->answerid is 0 (zero), the current code deals with it differently than your patched version would. This might introduce nice regressions.
            Hide
            efgpinto Eduardo Pinto added a comment -

            I must be missing something here then... Sorry for wasting your time.

            I'll review the patch and try to understand what I'm missing out. Thanks.

            Show
            efgpinto Eduardo Pinto added a comment - I must be missing something here then... Sorry for wasting your time. I'll review the patch and try to understand what I'm missing out. Thanks.
            Hide
            efgpinto Eduardo Pinto added a comment -

            Ok... Now we just see if it is not set.. If not, we enter the loop.. The other option is that that was already defined.

            Show
            efgpinto Eduardo Pinto added a comment - Ok... Now we just see if it is not set.. If not, we enter the loop.. The other option is that that was already defined.
            Hide
            rwijaya Rossiani Wijaya added a comment -

            Thanks Eduardo for providing the solutions.

            I think the last patch provide the best solution.

            Sending this for peer review.

            Show
            rwijaya Rossiani Wijaya added a comment - Thanks Eduardo for providing the solutions. I think the last patch provide the best solution. Sending this for peer review.
            Hide
            ankit_frenz Ankit Agarwal added a comment -

            Hi guys,
            Patch looks good,
            +1 to integrate
            Thanks

            Show
            ankit_frenz Ankit Agarwal added a comment - Hi guys, Patch looks good, +1 to integrate Thanks
            Hide
            rwijaya Rossiani Wijaya added a comment -

            Thanks Ankit for reviewing.

            Submitting for integration review.

            Show
            rwijaya Rossiani Wijaya added a comment - Thanks Ankit for reviewing. Submitting for integration review.
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Integrated, thanks! (21, 22 & master)

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Integrated, thanks! (21, 22 & master)
            Hide
            andyjdavis Andrew Davis added a comment -

            Works as described. Passing

            Show
            andyjdavis Andrew Davis added a comment - Works as described. Passing
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Well,

            I wish I said it every time
            you do the things you do.
            You always lend a helping hand,
            and I'm filled with gratitude.

            You are strong and generous
            for each and everyone one of us.
            I am eternally grateful,
            I cannot say thanks enough.

            Sorry for the (un)cool bit above, lol. Closing this as fixed. Ciao

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Well, I wish I said it every time you do the things you do. You always lend a helping hand, and I'm filled with gratitude. You are strong and generous for each and everyone one of us. I am eternally grateful, I cannot say thanks enough. Sorry for the (un)cool bit above, lol. Closing this as fixed. Ciao

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  12/Mar/12