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

Allow model configurations to be imported and exported

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Export

      1. # Enable analytics and make sure everything is working, refer to the docs on how to set it up if you don't have it already.
      2. Go to admin>analytics models
      3. Make sure there is no option to export static models or models that have no time splitting method defined.
      4. Try exporting any other model.
      5. You should get a JSON file downloaded with contents similar in pattern to the description of this issue.

      Import

      1. Go to admin>analytics>import analytics model.
      2. Make sure the file area allows only .json files.
      3. Import the downloaded file and make sure you get a success message.
      4. Make sure a new model identical to the exported one is created.
      5. Edit the JSON file and remove moodleversion.
      6. Make sure now you get an error during the import.
      7. Edit the JSON file again and add back a moodleversion 1 greater than the original one.
      8. Make sure this time you get a warning but the model gets imported as expected.
      Show
      Export # Enable analytics and make sure everything is working, refer to the docs on how to set it up if you don't have it already. Go to admin>analytics models Make sure there is no option to export static models or models that have no time splitting method defined. Try exporting any other model. You should get a JSON file downloaded with contents similar in pattern to the description of this issue. Import Go to admin>analytics>import analytics model. Make sure the file area allows only .json files. Import the downloaded file and make sure you get a success message. Make sure a new model identical to the exported one is created. Edit the JSON file and remove moodleversion. Make sure now you get an error during the import. Edit the JSON file again and add back a moodleversion 1 greater than the original one. Make sure this time you get a warning but the model gets imported as expected.
    • Affected Branches:
      MOODLE_35_STABLE
    • Pull Master Branch:
      MDL-60944-master

      Description

      This idea came from a discussion in Moodle HQ analytics chat room.

      Admins and researchers should be able to share the models they found to be useful. I am not talking about the training data nor the trained models weights, but about the model configuration.

      Models are composed by:

      • A target
      • A set of indicators
      • A time-splitting method

      I would suggest a basic export to .json file which would contain something like:

      {
          "target": "mod\awesomeness\analytics\target\potential_mentors",
          "time_splitting": "core\analytics\time_splitting\single_range",
          "indicators": [
              "\mod\awesomeness\analytics\indicator\gentle",
              "\mod\awesomeness\analytics\indicator\formal",
              "\mod\awesomeness\analytics\indicator\skilled",
              "\mod\awesomeness\analytics\indicator\gentle",
              "\mod\assign\analytics\indicator\submits_before_deadline",
          ],
          "moodleversion": "2017010100"
      }
      

      The system would obviously notify users if:

      • Error: Any of the specified classes is not available on the system.
      • Warning: The Moodle major version the model was created for differs from the user site major version

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated: