Moodle
  1. Moodle
  2. MDL-32698

A couple of typos in question/engine/datalib.php function load_question_attempt

    Details

    • Rank:
      39653

      Description

      The load_question_attempt function has the following typos:

      Missing '}' after 'question_attempts'
      'current($records);' instead of '$records->current();'

      I'll attach a patch as soon as I have an issue number

        Activity

        Hide
        Davo Smith added a comment -

        Patch attached

        Show
        Davo Smith added a comment - Patch attached
        Hide
        Tim Hunt added a comment -

        I was sure I reviewed this and commented yesterday but I must have imagined it!

        I can't believe this bug has been sitting there for the last year and nobody noticed. Clearly this method is not used in core Moodle code. I would be interested to know how you found it.

        Anyway, I have submitted for integration, I am trusting you to rebase, and cherry-pick the fix to the 2.2 and 2.1 stable branches, after this week's weekly.

        Thank you for finding and fixing this.

        Show
        Tim Hunt added a comment - I was sure I reviewed this and commented yesterday but I must have imagined it! I can't believe this bug has been sitting there for the last year and nobody noticed. Clearly this method is not used in core Moodle code. I would be interested to know how you found it. Anyway, I have submitted for integration, I am trusting you to rebase, and cherry-pick the fix to the 2.2 and 2.1 stable branches, after this week's weekly. Thank you for finding and fixing this.
        Hide
        Davo Smith added a comment -

        Working on an external anonymous marking plugin for a particular question type, which needs to pull out selected attempt data and display it outside of the normal quiz context, which is why I used the function that isn't used in core (there may be other, better ways of achieving what is needed, but what I've got seems to be working).

        I'll rebase and cherry-pick in a bit.

        Show
        Davo Smith added a comment - Working on an external anonymous marking plugin for a particular question type, which needs to pull out selected attempt data and display it outside of the normal quiz context, which is why I used the function that isn't used in core (there may be other, better ways of achieving what is needed, but what I've got seems to be working). I'll rebase and cherry-pick in a bit.
        Hide
        Dan Poltawski added a comment -

        Hi,

        I've integrated this thanks and cherry-picked to 2.1 and 2.2.

        Is there any testing we can do on the core stuff?

        Show
        Dan Poltawski added a comment - Hi, I've integrated this thanks and cherry-picked to 2.1 and 2.2. Is there any testing we can do on the core stuff?
        Hide
        Davo Smith added a comment -

        I don't think there is any core testing that can be done - if it had every been used in core, it would have died immediately due to these typos.

        Show
        Davo Smith added a comment - I don't think there is any core testing that can be done - if it had every been used in core, it would have died immediately due to these typos.
        Hide
        Dan Poltawski added a comment -

        OK, passing the test

        Show
        Dan Poltawski added a comment - OK, passing the test
        Hide
        Eloy Lafuente (stronk7) added a comment -

        This is now part of Moodle and a few millions people around the globe will be using it soon. Isn't that awesome?

        Many, many thanks and don't forget http://youtu.be/4N7dPaP5Z8U

        Closing, ciao

        Show
        Eloy Lafuente (stronk7) added a comment - This is now part of Moodle and a few millions people around the globe will be using it soon. Isn't that awesome? Many, many thanks and don't forget http://youtu.be/4N7dPaP5Z8U Closing, ciao

          People

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

            Dates

            • Created:
              Updated:
              Resolved: