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

Implement an analytics engine in Moodle

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Prepare the environment for this test:

      1. Download the attached test-mdl-57791.php file and place it in moodle root
      2. Execute php test-mdl-57791.php createcourses, this will create 3 courses, 1 for no teachers model, and 2 more for students at risk of dropping out: a course for training the machine learning algorithm and another one to get predictions. These courses start and end dates are set accordingly to what is needed:
        • no teachers course starts in less than 1 week
        • students at risk of dropping out training course is already finished
        • students at risk of dropping out prediction course just passed 50% of the course duration
      3. In predictyeah and trainingyeah courses create a page activity and a resource activity in topic 2
      4. Enrol 5 new users as students into predictyeah and trainingyeah new courses, in predictyeah course log in as 2 of these users and access the page and the resource refresh page like 10 times as we need some activity logs; in trainingyeah course log in as 2 of these users and access the page and the resource, also refresh page like 10 times as we need some activity logs
      5. Enrol a user as a teacher to predictyeah course, login as this teacher and go to "Notification preferences" to enable "Insights generated by prediction models" web notifications if it is not already enabled
      6. Execute php test-mdl-57791.php movelogsback this will update the logs timecreated attribute to some time ago so they make sense according to start and end course dates

      Researcher role

      1. Log in as admin
      2. Create a researcher role with the following capabilities:
        • moodle/site:configview
        • moodle/analytics:managemodels
        • moodle/analytics:listinsights
      3. Assign a user to that role (system level) and log in as that user
      4. Go to 'site admin' > reports > analytics models

      No teaching model:

      1. Execute "Get predictions" action for "No teaching" model
      2. Back in admin/tool/analytics/index.php, select "All predictions" from "No teaching"'s "Insights" column
      3. You should see a list of courses without teacher
      4. Expand "Actions" menu, you should only see 1 link to view the course, click on it, researcher user may not have permissions to access the course, but you should at least be redirected to course/view.php?id=XXX

      Students at risk of dropping out model:

      1. Execute "Evaluate" action for "Students at risk of dropping out" model
      2. Do not worry about the results as long as at least 1 course is used for training (most of your site courses will be skipped because they are not finished yet, do not have enough student's activity...) and it successfully finishes
      3. Do the same using php admin/tool/analytics/cli/evaluate_model.php --modelid=X where X is the mdl_analytics_model record with target ending in "*course_dropout", at the end it will ask you to select a time splitting method, just type none.
      4. Return to the web interface (site admin > reports > analytic models) and view "Students at risk of dropping out" log (in actions drop down menu)
      5. You should see 1 record for each time you evaluated the model + for each time splitting method (by default 3 time splitting methods are enabled and if you followed this instructions strictly you run it twice, web and cli, so total 6 logs)
      6. Check that you see the list of indicators, a time splitting method and a accuracy percentage
      7. Edit "Students at risk of dropping out" model, remove all assign, book and workshop indicators, tick "Enabled" and select "Quarters accumulative" time splitting method. Save changes and check that the updated information appears in admin/tool/models/index.php
      8. Select "Get predictions" action from "Students at risk of dropping out" model in admin/tool/models/index.php
      9. You should not see the id of trainingyeah course under "Training results" and you should see it under "Prediction results"
      10. You should see the id of predictyeah course under "Training results" and you should not see it under "Prediction results"
      11. Click "Continue" to return to admin/tool/models/index.php, you should see a dropdown menu in "Insights" column -> "Students at risk of dropping out" row. Select "predictyeah"
      12. You should see 3 student at risk and 2 not at risk.
      13. Go to CLI and run php admin/tool/task/cli/schedule_task.php --execute=
        tool_analytics

        task
        train_models and php admin/tool/task/cli/schedule_task.php --execute=
        tool_analytics

        task
        predict_models
      14. They should finish ok although you will see info about skipped courses if you have debugging mode enabled. No new courses will be trained nor you will get more predictions as there is no new stuff to calculate.

      Insights:

      1. In the web interface, log out as researcher, log in as admin go to admin/tool/models/index.php and select "Students at risk of dropping out" "predictyeah" course insights again
      2. Verify that you can click on the students pic and go to their course profile
      3. Select "Actions" menu's "View prediction details" link for both students
      4. You should see a list of notifications with some percents, the ones belonging to the student that is at risk should be 0% or close, the ones belonging to the user that is not at risk will be 100% or close

      Insights notifications:

      1. Log out and log in as predictyeah course teacher
      2. You should have a notification about new insights, click on it
      3. You should see the list of insights in that context
      4. Click all links in "Actions" menu and verify that they work correctly

      New site:

      1. Install a new site (integration master)
      2. Check that mdl_analytics_models table have 2 records, one of them with enabled and train = 1 and timesplitting = \core\analytics\time_splitting\single_range
      Show
      Prepare the environment for this test: Download the attached test-mdl-57791.php file and place it in moodle root Execute php test-mdl-57791.php createcourses , this will create 3 courses, 1 for no teachers model, and 2 more for students at risk of dropping out: a course for training the machine learning algorithm and another one to get predictions. These courses start and end dates are set accordingly to what is needed: no teachers course starts in less than 1 week students at risk of dropping out training course is already finished students at risk of dropping out prediction course just passed 50% of the course duration In predictyeah and trainingyeah courses create a page activity and a resource activity in topic 2 Enrol 5 new users as students into predictyeah and trainingyeah new courses, in predictyeah course log in as 2 of these users and access the page and the resource refresh page like 10 times as we need some activity logs; in trainingyeah course log in as 2 of these users and access the page and the resource, also refresh page like 10 times as we need some activity logs Enrol a user as a teacher to predictyeah course, login as this teacher and go to "Notification preferences" to enable "Insights generated by prediction models" web notifications if it is not already enabled Execute php test-mdl-57791.php movelogsback this will update the logs timecreated attribute to some time ago so they make sense according to start and end course dates Researcher role Log in as admin Create a researcher role with the following capabilities: moodle/site:configview moodle/analytics:managemodels moodle/analytics:listinsights Assign a user to that role (system level) and log in as that user Go to 'site admin' > reports > analytics models No teaching model: Execute "Get predictions" action for "No teaching" model Back in admin/tool/analytics/index.php, select "All predictions" from "No teaching"'s "Insights" column You should see a list of courses without teacher Expand "Actions" menu, you should only see 1 link to view the course, click on it, researcher user may not have permissions to access the course, but you should at least be redirected to course/view.php?id=XXX Students at risk of dropping out model: Execute "Evaluate" action for "Students at risk of dropping out" model Do not worry about the results as long as at least 1 course is used for training (most of your site courses will be skipped because they are not finished yet, do not have enough student's activity...) and it successfully finishes Do the same using php admin/tool/analytics/cli/evaluate_model.php --modelid=X where X is the mdl_analytics_model record with target ending in "*course_dropout", at the end it will ask you to select a time splitting method, just type none. Return to the web interface (site admin > reports > analytic models) and view "Students at risk of dropping out" log (in actions drop down menu) You should see 1 record for each time you evaluated the model + for each time splitting method (by default 3 time splitting methods are enabled and if you followed this instructions strictly you run it twice, web and cli, so total 6 logs) Check that you see the list of indicators, a time splitting method and a accuracy percentage Edit "Students at risk of dropping out" model, remove all assign, book and workshop indicators, tick "Enabled" and select "Quarters accumulative" time splitting method. Save changes and check that the updated information appears in admin/tool/models/index.php Select "Get predictions" action from "Students at risk of dropping out" model in admin/tool/models/index.php You should not see the id of trainingyeah course under "Training results" and you should see it under "Prediction results" You should see the id of predictyeah course under "Training results" and you should not see it under "Prediction results" Click "Continue" to return to admin/tool/models/index.php, you should see a dropdown menu in "Insights" column -> "Students at risk of dropping out" row. Select "predictyeah" You should see 3 student at risk and 2 not at risk. Go to CLI and run php admin/tool/task/cli/schedule_task.php --execute= tool_analytics task train_models and php admin/tool/task/cli/schedule_task.php --execute= tool_analytics task predict_models They should finish ok although you will see info about skipped courses if you have debugging mode enabled. No new courses will be trained nor you will get more predictions as there is no new stuff to calculate. Insights: In the web interface, log out as researcher, log in as admin go to admin/tool/models/index.php and select "Students at risk of dropping out" "predictyeah" course insights again Verify that you can click on the students pic and go to their course profile Select "Actions" menu's "View prediction details" link for both students You should see a list of notifications with some percents, the ones belonging to the student that is at risk should be 0% or close, the ones belonging to the user that is not at risk will be 100% or close Insights notifications: Log out and log in as predictyeah course teacher You should have a notification about new insights, click on it You should see the list of insights in that context Click all links in "Actions" menu and verify that they work correctly New site: Install a new site (integration master) Check that mdl_analytics_models table have 2 records, one of them with enabled and train = 1 and timesplitting = \core\analytics\time_splitting\single_range
    • Affected Branches:
      MOODLE_33_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Epic Name:
      Analytics Engine (Inspire)
    • Pull from Repository:
    • Pull Master Branch:
      analytics-34

      Description

      Project page: https://docs.moodle.org/dev/Project_Inspire

      This epic is used to collect issues related to this project.

        Attachments

        1. faildump.png
          256 kB
          Andrew Nicols
        2. test-mdl-57791.php
          3 kB
          David Monllaó

          Issue Links

            Activity

              People

              • Votes:
                6 Vote for this issue
                Watchers:
                22 Start watching this issue

                Dates

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