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

Calculate indicators way before the target is available

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4
    • Fix Version/s: 3.4
    • Component/s: Analytics
    • Labels:
    • Testing Instructions:
      Hide

      This test involves some hacking and CLI executions sorry, other ways to test it would involve much more work. This change includes unit tests as well.

      1. Install a new site
      2. Download the attached test-mdl-59067.php file and execute php test-mdl-59067.php createcourses
      3. Go to predictyeah course and add a page activity to topic 1
      4. Create a user, enrol it as student into predictyeah course and access the page activity as this user
      5. Back as an admin check that there is a log generated for this student and activity in report/log/index.php?id=X (just in case, it should be there)
      6. Execute php test-mdl-59067.php multiplylogs
      7. Go to admin/tool/analytics/index.php, enable "Students at risk of dropping out" model and select Quarters accumulative time splitting method
      8. Execute update mdl_analytics_models set trained = 1; in your SQL console
      9. Execute php admin/tool/task/cli/schedule_task.php --execute=\\tool_analytics\\task
        predict_models
        (ignore exceptions from model.php line 652 like the analytics/errorcantloadmodel one)
      10. Execute select * from mdl_analytics_indicator_calc where sampleorigin = 'user_enrolments' in your SQL console
      11. Some records SHOULD be returned, all of them with the same 'endtime' value (SELECT DISTINCT endtime from mdl_analytics_indicator_calc where sampleorigin = 'user_enrolments')
      12. Apply the following patch git fetch git://github.com/dmonllao/moodle.git MDL-59067_master-test ; git cherry-pick FETCH_HEAD
      13. Execute php admin/tool/task/cli/schedule_task.php --execute=\\tool_analytics\\task
        train_models
      14. You SHOULD see range 1 records found displayed in the screen a few times (no need to count them, but it is 1 for each indicator in that model)
      15. Execute SELECT DISTINCT endtime from mdl_analytics_indicator_calc where sampleorigin = 'user_enrolments' in your SQL console again
      16. 4 records SHOULD be returned
      Show
      This test involves some hacking and CLI executions sorry, other ways to test it would involve much more work. This change includes unit tests as well. Install a new site Download the attached test-mdl-59067.php file and execute php test-mdl-59067.php createcourses Go to predictyeah course and add a page activity to topic 1 Create a user, enrol it as student into predictyeah course and access the page activity as this user Back as an admin check that there is a log generated for this student and activity in report/log/index.php?id=X (just in case, it should be there) Execute php test-mdl-59067.php multiplylogs Go to admin/tool/analytics/index.php, enable "Students at risk of dropping out" model and select Quarters accumulative time splitting method Execute update mdl_analytics_models set trained = 1; in your SQL console Execute php admin/tool/task/cli/schedule_task.php --execute=\\tool_analytics\\task predict_models (ignore exceptions from model.php line 652 like the analytics/errorcantloadmodel one) Execute select * from mdl_analytics_indicator_calc where sampleorigin = 'user_enrolments' in your SQL console Some records SHOULD be returned, all of them with the same 'endtime' value (SELECT DISTINCT endtime from mdl_analytics_indicator_calc where sampleorigin = 'user_enrolments') Apply the following patch git fetch git://github.com/dmonllao/moodle.git MDL-59067 _master-test ; git cherry-pick FETCH_HEAD Execute php admin/tool/task/cli/schedule_task.php --execute=\\tool_analytics\\task train_models You SHOULD see range 1 records found displayed in the screen a few times (no need to count them, but it is 1 for each indicator in that model) Execute SELECT DISTINCT endtime from mdl_analytics_indicator_calc where sampleorigin = 'user_enrolments' in your SQL console again 4 records SHOULD be returned
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59067_master

      Description

      We now calculate all training data once the target is available. This can be a problem for time-based models because things change over time (activities that were visible to students may not be visible now). It would be more accurate to calculate indicators just after each of the model's
      time ranges finishes. This would be an important improvement for models like prediction of students at risk of dropping out of courses because most of the community of inquiry indicators are based on the available activities for the student, we now guess the activities that were available to the student.

      We could store those calculations in the database and attach them to the dataset once the target can be calculated. If the dates that define the range change we should throw this calculations to the garbage although we should also warn users about the consequences of changing dates.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/Nov/17