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

Show the prediction date

    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
      Note
      1. If you ever have to reset your analytics data the following queries will do the job. WARNING only perform these queries on a development environment you are comfortable with breaking.

        DELETE FROM mdl_analytics_indicator_calc;
        DELETE FROM mdl_analytics_models_log;
        DELETE FROM mdl_analytics_predict_samples;
        DELETE FROM mdl_analytics_prediction_actions;
        DELETE FROM mdl_analytics_predictions;
        DELETE FROM mdl_analytics_train_samples;
        DELETE FROM mdl_analytics_used_files;
        DELETE FROM mdl_files WHERE component = 'analytics';
        

      Test 1
      1. Install a fresh Moodle site.
      2. Visit the database and look at the table 'analytics_predictions' and confirm there is a 'timestart' and 'timeend' field.
      Test 2
      1. Upgrade a site from stable -> integration.
      2. Visit the database and look at the table 'analytics_predictions' and confirm there is a 'timestart' and 'timeend' field.
      3. Confirm the default values (allows null etc) are the same as when you install a fresh site.
      Test 3
      1. Visit 'Site administration' > 'Analytics' > 'Analytic settings'.
      2. Disable the 'onlycli' setting.
      3. Create a course with a start date a few months in the past and an end date a day in the past.
      4. Enrol 3 students.
      5. Add a Page activity.
      6. Log in as 2 students and click on the Page activity 20 times to generate logs.
      7. Perform the following SQL on your database - UPDATE mdl_logstore_standard_log SET timecreated = TIME - 432000 WHERE courseid = COURSEID where TIME is the current unixtime and COURSEID is the id of the course you created above.
      8. Edit the file lib/classes/analytics/target/course_dropout.php and put return true at the top of is_valid_sample().
      9. Edit the file analytics/classes/local/analyser/base.php and comment out the line $this->filter_out_train_samples($sampleids, $timesplitting);.
      10. Visit 'Site administration' > 'Analytics' > 'Analytic models'.
      11. Ensure the 'Students at risk of dropping out' target is enabled.
      12. Edit the target and set the 'Time-splitting method' to 'Quarters Accumulative'.
      13. Click on 'Actions' and select 'Get predictions'.
      14. Click 'Continue'.
      15. Select the name of the course in the drop-down under the 'Insights' column.
      16. Confirm the 'Students at risk of dropping out' prediction table is shown with the users and only two columns "Name" and "Actions".
      17. Click on "Actions" and select "View prediction details".
      18. Confirm you can see the table for the user you selected with accurate predication details ('Time predicted' and 'Time range').
      19. Switch to clean and check both pages (list of users and prediction details for a user) look acceptable.
      Test 4
      1. Go to 'Site administration' > 'Development' > 'Template library'.
      2. Do a search for 'insight'.
      3. Confirm the template examples show correctly.
      Show
      Note If you ever have to reset your analytics data the following queries will do the job. WARNING only perform these queries on a development environment you are comfortable with breaking. DELETE FROM mdl_analytics_indicator_calc; DELETE FROM mdl_analytics_models_log; DELETE FROM mdl_analytics_predict_samples; DELETE FROM mdl_analytics_prediction_actions; DELETE FROM mdl_analytics_predictions; DELETE FROM mdl_analytics_train_samples; DELETE FROM mdl_analytics_used_files; DELETE FROM mdl_files WHERE component = 'analytics'; Test 1 Install a fresh Moodle site. Visit the database and look at the table 'analytics_predictions' and confirm there is a 'timestart' and 'timeend' field. Test 2 Upgrade a site from stable -> integration. Visit the database and look at the table 'analytics_predictions' and confirm there is a 'timestart' and 'timeend' field. Confirm the default values (allows null etc) are the same as when you install a fresh site. Test 3 Visit 'Site administration' > 'Analytics' > 'Analytic settings'. Disable the 'onlycli' setting. Create a course with a start date a few months in the past and an end date a day in the past. Enrol 3 students. Add a Page activity. Log in as 2 students and click on the Page activity 20 times to generate logs. Perform the following SQL on your database - UPDATE mdl_logstore_standard_log SET timecreated = TIME - 432000 WHERE courseid = COURSEID where TIME is the current unixtime and COURSEID is the id of the course you created above. Edit the file lib/classes/analytics/target/course_dropout.php and put return true at the top of is_valid_sample() . Edit the file analytics/classes/local/analyser/base.php and comment out the line $this->filter_out_train_samples($sampleids, $timesplitting); . Visit 'Site administration' > 'Analytics' > 'Analytic models'. Ensure the 'Students at risk of dropping out' target is enabled. Edit the target and set the 'Time-splitting method' to 'Quarters Accumulative'. Click on 'Actions' and select 'Get predictions'. Click 'Continue'. Select the name of the course in the drop-down under the 'Insights' column. Confirm the 'Students at risk of dropping out' prediction table is shown with the users and only two columns "Name" and "Actions". Click on "Actions" and select "View prediction details". Confirm you can see the table for the user you selected with accurate predication details ('Time predicted' and 'Time range'). Switch to clean and check both pages (list of users and prediction details for a user) look acceptable. Test 4 Go to 'Site administration' > 'Development' > 'Template library'. Do a search for 'insight'. Confirm the template examples show correctly.
    • Affected Branches:
      MOODLE_34_STABLE
    • Fixed Branches:
      MOODLE_34_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-59106_master

      Description

      Each prediction should contain information about when the prediction was done and also the time range that was considered to perform that prediction.

      Showing the prediction time should be easy, (we have a analytics_predictions timecreated column) the not that straight forward part is to show the time ranges that were considered to make this prediction. There is a rangeindex field that (in theory) could be used to extract the period of time of the logs we looked at to make that prediction but we should avoid it because analysables (let's say course, it is easy to imagine it in our mind) start and end times (course start date and course end date) can change along time (courses can be reused...) so we need to add 2 new fields to analytics_predictions table, start time and end time, so they are set when we get the prediction. At the moment we are using rangeindex to select the most recent prediction for each element (e.g. if we get predictions for a student after 3 months and another one after 6 months the 6 months one is displayed) we could also do it with analytics_predictions timecreated field though. I see positive and negative aspects for both removing rangeindex (there is just 1 prediction for each sampleid and rangeindex and is cleaner to sort by a incremental number than by a timestamp) and keeping it (it seems kind of redundant). I vote for keeping rangeindex as we don't need to keep these records synced and it is just a few digits int on the other hand joining with timestamps is not a good idea in general (see core_analytics\model::get_predictions)

      Feel free to contact UX team about where to fit this information, for what I've talked with Barbara what seems to make more sense is a new column in the insights list table.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              markn Mark Nelson
              Reporter:
              dmonllao David Monllaó
              Peer reviewer:
              David Monllaó
              Integrator:
              Jake Dallimore
              Tester:
              Jake Dallimore
              Participants:
              Component watchers:
              Elizabeth Dalton, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

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