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

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

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Fixed
    • Minor
    • 3.8
    • 3.6.6, 3.7.2, 3.8
    • Questions
    • MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE
    • MOODLE_38_STABLE
    • 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).

    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

            timhunt Tim Hunt
            timhunt Tim Hunt
            Mahmoud Kassaei Mahmoud Kassaei
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            CiBoT CiBoT
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:
              18/Nov/19

              Time Tracking

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