Moodle
  1. Moodle
  2. MDL-25823

True and false question in Lesson activity does not display properly on the feedback page.

    Details

    • Testing Instructions:
      Hide
      1. Create lesson module and add true/false question
      2. provide correct and wrong responses to the question
      3. preview and attempt the question

      make sure the feedback contents are not repeated.

      Show
      Create lesson module and add true/false question provide correct and wrong responses to the question preview and attempt the question make sure the feedback contents are not repeated.
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE, MOODLE_21_STABLE
    • Pull from Repository:
    • Pull Master Branch:
    • Rank:
      15222

      Description

      Feedback to a true and false question in a lesson does not display properly. As per attached screen shot, instead of displaying the words "True" or "False" beside "Your answer," the page repeats the feedback content. This happens in Preview and when I log in as a student. All the other question types display fine; only true/false questions appear to have this glitch. Thank you.

      1. MDL25823.patch
        0.6 kB
        Chris Follin
      1. true-false screen shot.png
        147 kB

        Issue Links

          Activity

          Hide
          Mat Dolton added a comment -

          Hope this gets resolved as I am having exactly the same issue. Thanks in advance
          Mat

          Show
          Mat Dolton added a comment - Hope this gets resolved as I am having exactly the same issue. Thanks in advance Mat
          Hide
          Joseph Rézeau added a comment -

          Very easy fix:
          in file mod/lesson/pagetypes/truefalse.php
          line 98
          replace
          $result->studentanswer = $result->userresponse = $result->response;
          with:
          $result->studentanswer = $answer->answer;

          Show
          Joseph Rézeau added a comment - Very easy fix: in file mod/lesson/pagetypes/truefalse.php line 98 replace $result->studentanswer = $result->userresponse = $result->response; with: $result->studentanswer = $answer->answer;
          Hide
          Mat Dolton added a comment -

          Sorry if I am not supposed to comment here as I am not a developer.

          Tried fix, uploaded file, when I go into a lesson nothing loads and it comes up with a plain white screen with error message triangle down bottom left hand (using IE8)

          Show
          Mat Dolton added a comment - Sorry if I am not supposed to comment here as I am not a developer. Tried fix, uploaded file, when I go into a lesson nothing loads and it comes up with a plain white screen with error message triangle down bottom left hand (using IE8)
          Hide
          Helmut Irle added a comment -

          I can confirm that the fix proposed by Joseph works.

          Mat, might a PHP syntax error have crept into your code by making the changes? If you made the change exactly as above, and nothing else, it should be working fine.

          Show
          Helmut Irle added a comment - I can confirm that the fix proposed by Joseph works. Mat, might a PHP syntax error have crept into your code by making the changes? If you made the change exactly as above, and nothing else, it should be working fine.
          Hide
          Helmut Irle added a comment -

          Although, I have now found one small irregularity. After applying the fix, and answering some True/False questions, the user's chosen answer sometimes gets saved as "NULL" in the "lesson_attempts" table.

          Haven't confirmed yet whether this is a direct result of the change, but will investigate.

          Show
          Helmut Irle added a comment - Although, I have now found one small irregularity. After applying the fix, and answering some True/False questions, the user's chosen answer sometimes gets saved as "NULL" in the "lesson_attempts" table. Haven't confirmed yet whether this is a direct result of the change, but will investigate.
          Hide
          Helmut Irle added a comment -

          I've confirmed that Joseph's fix requires a further tweak. The line should rather read:

          $result->studentanswer = $result->userresponse = $answer->answer;
          

          I've tested this, and it seems to work well so far.

          Show
          Helmut Irle added a comment - I've confirmed that Joseph's fix requires a further tweak. The line should rather read: $result->studentanswer = $result->userresponse = $answer->answer; I've tested this, and it seems to work well so far.
          Hide
          Mat Dolton added a comment -

          Many (MANY) thanks, have tried it and it seems to have worked. Can still see my lessons and it's showing the correct response with the answers. Thanks

          Show
          Mat Dolton added a comment - Many (MANY) thanks, have tried it and it seems to have worked. Can still see my lessons and it's showing the correct response with the answers. Thanks
          Hide
          Chris Follin added a comment -

          I'm attaching a patch based on Joseph's and Helmut's comments and pushing it forward for peer review.

          Show
          Chris Follin added a comment - I'm attaching a patch based on Joseph's and Helmut's comments and pushing it forward for peer review.
          Hide
          Rossiani Wijaya added a comment -

          Thanks everyone for providing the solution and testing it.

          Create patch for the issue and submitting it for integration review.

          Show
          Rossiani Wijaya added a comment - Thanks everyone for providing the solution and testing it. Create patch for the issue and submitting it for integration review.
          Hide
          Sam Hemelryk added a comment -

          Thanks Rosie, this has been integrated now.
          Hehe please try to remember to include your pull from repository

          Show
          Sam Hemelryk added a comment - Thanks Rosie, this has been integrated now. Hehe please try to remember to include your pull from repository
          Hide
          Ankit Agarwal added a comment -

          works perfectly!
          awesome work guys
          Test passed!
          Thanks

          Show
          Ankit Agarwal added a comment - works perfectly! awesome work guys Test passed! Thanks
          Hide
          Eloy Lafuente (stronk7) added a comment -

          Yes, you got this finally upstream, just in time for Moodle 2.2beta. Congrats and thanks!

          Ciao

          Show
          Eloy Lafuente (stronk7) added a comment - Yes, you got this finally upstream, just in time for Moodle 2.2beta. Congrats and thanks! Ciao

            People

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

              Dates

              • Created:
                Updated:
                Resolved: