Skip to content

1.8.13

Choose a tag to compare

@Duvan-BuenData Duvan-BuenData released this 11 Nov 01:28
· 8 commits to MOODLE_405_STABLE since this release
e950cc9

Compatibility note: This version is compatible only with Moodle 4.5.

Response to the MindFree security re-evaluation. Each entry that closes a MindFree finding names its code, and every entry names the tests that back it (the CDR-SEC-007 removal deletes the only test of the removed folder). The entries without a code are not MindFree findings: the 4.5-only line, the guard for an older Datacurso AI provider and the upgrade fix for sites already on 1.8.12.

Changed

  • This line supports only Moodle 4.5
    The plugin now has one branch per Moodle line: MOODLE_405_STABLE for Moodle 4.5 and MOODLE_503_STABLE for Moodle 5.0 to 5.3. On this line $plugin->supported is [405, 405], the Jenkins check runs only MOODLE_405_STABLE (MariaDB and PostgreSQL), and the README lists Moodle 4.5. Tests: tests/ci/jenkinsfile_supported_branches_test.php

Removed

  • CDR-SEC-007: the plugin no longer ships GitHub workflows
    The .github/ folder (the manual plugin-ci.yml workflow) is removed, together with tests/ci/workflow_security_test.php, which only tested that folder. The automatic check before any change reaches a stable branch is the Jenkins check required by the branch ruleset, which runs the plugin suite; no workflow in the plugin can run with a token any more

Fixed

  • The site keeps working when the Datacurso AI provider is older than 1.7.0
    A site that updated this plugin while keeping a Datacurso AI provider older than 1.7.0 (version 2026110400) fell over on every page with Class "aiprovider_datacurso\local\plugin_settings" not found, because the plugin asked that class, added in provider 1.7.0, whether it is enabled. Every use of it now goes through one guard, \local_coursedynamicrules\local\provider_dependency. With an older provider the plugin counts as not enabled: the course navigation entry is not added, the observers queue nothing, the scheduled and adhoc tasks skip with a log line asking to update the provider, and the plugin pages and the dynamic grade form refuse with a notice. A site administrator is told to update the Datacurso AI provider to 1.7.0 or later, with a link to the plugins overview; anyone else gets a generic notice. With provider 1.7.0 or later nothing changes. Tests: tests/local/provider_dependency_test.php, tests/plugin_disabled_test.php
  • CDR-PRIV-002-R1: a restored gate stays reachable by privacy requests after core strips its marker
    On restore, core re-encodes a module's whole availability tree when another condition changed (a completion restriction always does) and drops the plugin's ownership marker; the restore then only re-adopted the node, flagged as deduced, so the student's id stayed in the restored course without being exported or erased. AI activities restored on another site were left out too, because their key is keyed with the site identifier. The course backup now records, for every restriction the plugin wrote, the activity, the action and a fingerprint (SHA-256 of the action id and the sorted user ids). The restore marks again, as written by the plugin, the single node of the restored activity that matches it, and rewrites the AI activity key for the restored action on this site. Two identical matching restrictions (a teacher's restriction listing exactly the same students) are attributed to nobody and reported in the restore log. Backups made before this release restore as before. Tests: tests/privacy/restored_gate_privacy_test.php (test_a_restored_gate_whose_marker_core_stripped_is_exported_and_erased, test_restore_does_not_claim_a_teachers_identical_restriction, test_ai_activity_restored_on_another_site_is_reattributed)
  • CDR-PRIV-001-R2: the requests kept by the course service are recorded, exported and their erasure requested
    Every AI activity starts with /activity/init, and the course service keeps that thread (activity instructions, request configuration and generated activity). The plugin now records each thread against its student, course, action and generated activity in the new table local_coursedynamicrules_aireq. The privacy provider puts the course context in the student's context list and exports the recorded requests. A pending erasure is durable: a privacy erasure, an account deletion and a course deletion record on the rows when the erasure was requested (new column erasurerequested), and the rows are deleted only once the course service confirms. The new scheduled task remote_erasure_task (hourly) sends every pending erasure again on each run until the service confirms, so a request is never given up, unlike an adhoc task, which core abandons after 12 attempts. The service was never told the course of a request, so the plugin asks it to erase by thread, or by user only when every request of the student is to be erased; it never sends a course-scoped request with an empty thread list, and a request without a thread id (recorded by the upgrade) stays pending until every request of the student is to be erased. The requests of a deleted course stay reachable through the student's own context (context list, export and erasure). The export shows when each erasure was requested. The privacy metadata declares the new table and what the course service keeps. The erasure is sent to the course service as described in the next entry. The upgrade records the students of the existing AI activities (found through their key) without a thread id; requests whose activity was never created, was deleted or lost its ID number cannot be recovered, nor can a request whose /activity/init answer was lost (no thread id), which only a user-wide erasure reaches. Tests: tests/privacy/remote_lifecycle_test.php (test_init_records_the_thread_for_the_student, test_user_with_remote_data_is_in_contextlist, test_export_lists_the_remote_requests, test_erasure_calls_the_service_scoped_to_this_plugin_and_forgets_rows, test_failed_remote_erasure_keeps_rows_pending_for_the_scheduled_task, test_user_deleted_marks_requests_pending_without_calling_the_service, test_scheduled_task_erases_pending_requests_once_the_service_confirms, test_the_production_client_without_a_provider_reports_not_done, test_upgrade_backfills_requests_from_keyed_activities), tests/privacy/pending_remote_erasure_test.php (test_pending_erasure_outlives_the_adhoc_retry_limit_and_is_sent_once_the_service_answers, test_scheduled_task_leaves_requests_nobody_asked_to_erase_alone, test_a_client_failure_keeps_the_request_pending, test_course_scoped_erasure_sends_only_that_courses_threads, test_course_scoped_erasure_never_sends_an_empty_thread_list, test_course_deletion_marks_its_requests_pending_and_keeps_them_reachable, test_production_client_never_lets_a_request_be_forgotten, test_scheduled_task_ships_hourly_with_a_defined_name), tests/privacy/provider_test.php (test_get_metadata_declares_the_remote_requests_and_what_the_service_keeps)
  • CDR-PRIV-001-R2: the course service is asked to erase a student's requests
    The production remote erasure client now sends POST /privacy/erase to the course service, through the Datacurso AI provider's course client (same base URL as /activity/init), with the student, the service id local_coursedynamicrules, the scope (threads or user) and the thread ids. The provider's transport pseudonymises the student and adds the site. At most 1000 thread ids go in one call; a longer list is sent in several calls, and the erasure counts as done only when every call answers {"status": "erased"}. Anything else (an error, a site without token balance or with an inactive subscription, which the service refuses with 403, any other answer) leaves the requests pending, and the hourly scheduled task sends them again. Nothing about the request is logged. Tests: tests/local/course_service_remote_erasure_client_test.php (test_sends_exactly_the_contract_body, test_anything_but_erased_is_not_confirmed, test_a_transport_failure_is_not_confirmed, test_a_refused_request_is_not_confirmed, test_long_thread_lists_are_sent_in_chunks_of_1000, test_one_unconfirmed_chunk_leaves_the_erasure_unconfirmed, test_exactly_1000_threads_fit_in_one_call, test_an_empty_thread_scoped_erasure_is_not_sent, test_di_resolves_the_course_service_client)
  • The request table reaches sites already on 1.8.12
    1.8.12 was released with the version number of the first upgrade step of the request table, so a site already on 1.8.12 would have skipped it. The two steps are merged into one step numbered after the release; it creates the table, adds the erasure column to a table built without it, records the existing requests and is safe to run on a site that already has them. Tests: tests/upgrade_reaches_1812_sites_test.php