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

Question engine: report methods should not require a list of slots

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.6.6, 3.7.2, 3.8
    • Fix Version/s: 3.8
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      This change should have no effect on how standard Moodle works. It just improve some APIs to make things easier for people writing plugins.

      The Unit tests should be a good test that this does not cause regressions.

      I extended the unit tests to cover the new code path (in question/engine/tests/datalib_reporting_queries_test.php).

      Show
      This change should have no effect on how standard Moodle works. It just improve some APIs to make things easier for people writing plugins. The Unit tests should be a good test that this does not cause regressions. I extended the unit tests to cover the new code path (in question/engine/tests/datalib_reporting_queries_test.php).
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • Fixed Branches:
      MOODLE_38_STABLE
    • Pull Master Branch:

      Description

      In the question engine, question_engine_data_mapper class in question/engine/datalib.php, there are methods like load_questions_usages_latest_steps, load_questions_usages_question_state_summary which require you to pass in a list of slots that you want data on.

      This makes sense in the context of mod_quiz, when there is always a fixed quiz structure, but in other scenarios (we are currently working on https://github.com/moodleou/moodle-report_embedquestion, and this probably also affects mod_studentquiz) there is no fixed list.

      In the other method load_average_marks, the $slots parameter is optional, in which case it returns data on all slots.

      I think we should change these two methods, so that $slots is always optional. This will be a backwards-compatible change.

        Attachments

          Activity

            People

            • Assignee:
              timhunt Tim Hunt
              Reporter:
              timhunt Tim Hunt
              Peer reviewer:
              Mahmoud Kassaei
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              CiBoT
              Participants:
              Component watchers:
              Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Fix Release Date:
                18/Nov/19

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 15 minutes
                15m