Moodle
  1. Moodle
  2. MDL-26496

Warning when selecting no answer in a single choice question.

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor 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

          Activity

          Hide
          Eduardo Pinto added a comment -

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

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

          fix patch

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

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

          Show
          Helen Foster added a comment - Eduardo, thanks for your patch which will hopefully be reviewed soon.
          Hide
          David Mudrak 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
          David Mudrak 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
          Eduardo Pinto added a comment -

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

          Show
          Eduardo Pinto added a comment - In fact, that patch was wrong. Now, it seems correct to me.
          Hide
          David Mudrak 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
          David Mudrak 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
          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
          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
          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
          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
          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
          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 Agarwal added a comment -

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

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

          Thanks Ankit for reviewing.

          Submitting for integration review.

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

          Integrated, thanks! (21, 22 & master)

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

          Works as described. Passing

          Show
          Andrew Davis added a comment - Works as described. Passing
          Hide
          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
          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: