Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Def 3389 #17

Merged
merged 8 commits into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 16 additions & 6 deletions classes/privacy/provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
*/

namespace local_quizanon\privacy;
use core_privacy\local\metadata\collection;

/**
* Privacy Subsystem for local_quizanon implementing null_provider.
Expand All @@ -33,15 +34,24 @@
* @author Oscar Nadjar <oscar.nadjar@moodle.com>
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
*/
class provider implements \core_privacy\local\metadata\null_provider {
class provider implements \core_privacy\local\metadata\provider, \core_privacy\local\request\data_provider {

/**
* Get the language string identifier with the component's language
* file to explain why this plugin stores no data.
* Returns information about the user data stored in this component.
*
* @return string
* @param collection $collection A list of information about this component
* @return collection The collection object filled out with information about this component.
*/
public static function get_reason(): string {
return 'privacy:metadata';
public static function get_metadata(collection $collection): collection {

$collection->add_database_table(
'local_quizanon_usercodes',
[
'userid' => 'privacy:metadata:usercodes:userid',
],
'privacy:metadata:local_quizanon_usercodes'
);

return $collection;
}
}
1 change: 0 additions & 1 deletion db/install.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
<KEYS>
<KEY NAME="primary" TYPE="primary" FIELDS="id"/>
<KEY NAME="quizid" TYPE="foreign" FIELDS="quizid" REFTABLE="quiz" REFFIELDS="id"/>
<KEY NAME="usermodified" TYPE="foreign" FIELDS="usermodified" REFTABLE="user" REFFIELDS="id"/>
</KEYS>
</TABLE>
<TABLE NAME="local_quizanon_usercodes" COMMENT="Store the config for quizanon">
Expand Down
15 changes: 15 additions & 0 deletions db/upgrade.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,20 @@ function xmldb_local_quizanon_upgrade(int $oldversion) {
upgrade_plugin_savepoint(true, 2024040900, 'local', 'quizanon');
}

if ($oldversion < 2024120401) {
// Table local_quizanon to be modified.
$table = new xmldb_table('local_quizanon');
// Index to be dropped.
$index = new xmldb_index('usermodified', XMLDB_INDEX_NOTUNIQUE, ['usermodified']);

// Conditionally launch drop index for local_quizanon.
if ($dbman->table_exists($table) && $dbman->index_exists($table, $index)) {
$dbman->drop_index($table, $index);
}

// Quizanon savepoint reached.
upgrade_plugin_savepoint(true, 2024120401, 'local', 'quizanon');
}

return true;
}
3 changes: 3 additions & 0 deletions lang/en/local_quizanon.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@

$string['pluginname'] = 'Quiz Anonymizer';
$string['privacy:metadata'] = 'Quiz Anonymizer plugin does not store any personal data.';
$string['privacy:metadata:local_quizanon_usercodes'] = 'Table to store the user anonymous codes for the quiz anonymizer plugin.';
$string['privacy:metadata:usercodes:userid'] = 'User ID';
$string['privacy:metadata:usercodes:usercode'] = 'User Anonymous ID (random code), one for each userid/quizid pair.';
$string['usercode'] = 'Anonymous ID';
$string['enablequizanon'] = 'Enable Quiz Anonymizer';
$string['enablequizanon_desc'] = 'Enable the Quiz Anonymizer plugin to anonymize the quiz reports and reviews.';
Expand Down
2 changes: 1 addition & 1 deletion version.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

defined('MOODLE_INTERNAL') || die();

$plugin->version = 2024040900; // The current plugin version (Date: YYYYMMDDXX).
$plugin->version = 2024120401; // The current plugin version (Date: YYYYMMDDXX).
$plugin->requires = 2022112800; // Requires this Moodle version.
$plugin->component = 'local_quizanon'; // Full name of the plugin (used for diagnostics).
$plugin->maturity = MATURITY_STABLE;
Expand Down
Loading