diff --git a/classes/privacy/provider.php b/classes/privacy/provider.php index 0c2e827..f41faa9 100644 --- a/classes/privacy/provider.php +++ b/classes/privacy/provider.php @@ -60,9 +60,9 @@ public static function get_metadata(collection $items) : collection { $items->add_database_table( 'verbalfeedback_submission', [ - 'verbalfeedback' => 'privacy:metadata:verbalfeedback', - 'fromuser' => 'privacy:metadata:verbalfeedback_submission:fromuser', - 'touser' => 'privacy:metadata:verbalfeedback_submission:touser', + 'instanceid' => 'privacy:metadata:instanceid', + 'fromuserid' => 'privacy:metadata:verbalfeedback_submission:fromuserid', + 'touserid' => 'privacy:metadata:verbalfeedback_submission:touserid', 'status' => 'privacy:metadata:verbalfeedback_submission:status', 'remarks' => 'privacy:metadata:verbalfeedback_submission:remarks', ], @@ -71,10 +71,10 @@ public static function get_metadata(collection $items) : collection { $items->add_database_table( 'verbalfeedback_response', [ - 'verbalfeedback' => 'privacy:metadata:verbalfeedback', + 'instanceid' => 'privacy:metadata:instanceid', 'item' => 'privacy:metadata:verbalfeedback_item', - 'fromuser' => 'privacy:metadata:verbalfeedback_submission:fromuser', - 'touser' => 'privacy:metadata:verbalfeedback_submission:touser', + 'fromuserid' => 'privacy:metadata:verbalfeedback_submission:fromuserid', + 'touserid' => 'privacy:metadata:verbalfeedback_submission:touserid', 'value' => 'privacy:metadata:verbalfeedback_response:value', ], 'privacy:metadata:verbalfeedback_response' @@ -100,14 +100,14 @@ public static function get_contexts_for_userid(int $userid) : contextlist { INNER JOIN {verbalfeedback} t ON t.id = cm.instance INNER JOIN {verbalfeedback_submission} ts - ON ts.verbalfeedback = t.id - WHERE ts.fromuser = :fromuser OR ts.touser = :touser"; + ON ts.instanceid = t.id + WHERE ts.fromuserid = :fromuserid OR ts.touserid = :touserid"; $params = [ 'modname' => 'verbalfeedback', 'contextlevel' => CONTEXT_MODULE, - 'fromuser' => $userid, - 'touser' => $userid, + 'fromuserid' => $userid, + 'touserid' => $userid, ]; $contextlist = new contextlist(); $contextlist->add_from_sql($sql, $params); @@ -159,8 +159,8 @@ protected static function export_submission_data($contextids, $user, $respondent t.name as verbalfeedbackname, ts.status, ts.remarks, - ts.fromuser, - ts.touser + ts.fromuserid, + ts.touserid FROM {context} ctx JOIN {course_modules} cm ON cm.id = ctx.instanceid AND ctx.contextlevel = :contextlevel @@ -169,16 +169,16 @@ protected static function export_submission_data($contextids, $user, $respondent JOIN {verbalfeedback} t ON t.id = cm.instance JOIN {verbalfeedback_submission} ts - ON ts.verbalfeedback = t.id + ON ts.instanceid = t.id WHERE ctx.id {$contextsql} %s ORDER BY cmid ASC"; if ($respondent) { - $sqluser = 'fromuser'; + $sqluser = 'fromuserid'; $userkey = 'recipient'; $parent = get_string('feedbackgiven', 'mod_verbalfeedback'); } else { - $sqluser = 'touser'; + $sqluser = 'touserid'; $userkey = 'respondent'; $parent = get_string('feedbackreceived', 'mod_verbalfeedback'); } @@ -196,9 +196,9 @@ protected static function export_submission_data($contextids, $user, $respondent ]; } if ($respondent) { - $relateduser = transform::user($submission->touser); + $relateduser = transform::user($submission->touserid); } else { - $relateduser = transform::user($submission->fromuser); + $relateduser = transform::user($submission->fromuserid); } $submissionsdata[$submission->cmid]['submissions'][$submission->id] = [ $userkey => $relateduser, @@ -241,8 +241,8 @@ protected static function export_responses_data($contextids, $user, $respondent tq.type, tq.category, tr.value, - tr.fromuser, - tr.touser + tr.fromuserid, + tr.touserid FROM {context} ctx JOIN {course_modules} cm ON cm.id = ctx.instanceid AND ctx.contextlevel = :contextlevel @@ -250,12 +250,12 @@ protected static function export_responses_data($contextids, $user, $respondent ON m.id = cm.module AND m.name = :modname JOIN {verbalfeedback} t ON t.id = cm.instance - JOIN {verbalfeedback_item} ti + JOIN {verbalfeedback_i_criterion} ti ON ti.verbalfeedback = t.id JOIN {verbalfeedback_question} tq ON tq.id = ti.question JOIN {verbalfeedback_response} tr - ON tr.verbalfeedback = t.id AND tr.item = ti.id + ON tr.instanceid = t.id AND tr.item = ti.id WHERE ctx.id {$contextsql} %s ORDER BY cmid ASC, ti.position ASC, @@ -264,11 +264,11 @@ protected static function export_responses_data($contextids, $user, $respondent $params = ['modname' => 'verbalfeedback', 'contextlevel' => CONTEXT_MODULE, 'userid' => $user] + $contextparams; if ($respondent) { - $sqluser = 'fromuser'; + $sqluser = 'fromuserid'; $userkey = 'recipient'; $parent = get_string('feedbackgiven', 'mod_verbalfeedback'); } else { - $sqluser = 'touser'; + $sqluser = 'touserid'; $userkey = 'respondent'; $parent = get_string('feedbackreceived', 'mod_verbalfeedback'); } @@ -357,8 +357,8 @@ public static function delete_data_for_user(approved_contextlist $contextlist) { continue; } $instanceid = $DB->get_field('course_modules', 'instance', ['id' => $context->instanceid], MUST_EXIST); - $select = 'verbalfeedback = :verbalfeedback AND (fromuser = :fromuser OR touser = :touser)'; - $params = ['verbalfeedback' => $instanceid, 'fromuser' => $userid, 'touser' => $userid]; + $select = 'verbalfeedback = :verbalfeedback AND (fromuser = :fromuserid OR touser = :touserid)'; + $params = ['verbalfeedback' => $instanceid, 'fromuserid' => $userid, 'touserid' => $userid]; $DB->delete_records_select('verbalfeedback_response', $select, $params); $DB->delete_records_select('verbalfeedback_submission', $select, $params); } @@ -383,53 +383,53 @@ public static function get_users_in_context(userlist $userlist) { // Fetch all users who gave non-anonymous feedback to other users. $fromsql = " - SELECT DISTINCT ts.fromuser + SELECT DISTINCT ts.fromuserid FROM {course_modules} cm JOIN {modules} m ON m.id = cm.module AND m.name = :modname JOIN {verbalfeedback} t ON t.id = cm.instance JOIN {verbalfeedback_submission} ts - ON ts.verbalfeedback = t.id + ON ts.instanceid = t.id WHERE cm.id = :cmid"; - $userlist->add_from_sql('fromuser', $fromsql, $params); + $userlist->add_from_sql('fromuserid', $fromsql, $params); $fromsql = " - SELECT DISTINCT tr.fromuser + SELECT DISTINCT tr.fromuserid FROM {course_modules} cm JOIN {modules} m ON m.id = cm.module AND m.name = :modname JOIN {verbalfeedback} t ON t.id = cm.instance JOIN {verbalfeedback_response} tr - ON tr.verbalfeedback = t.id - WHERE cm.id = :cmid AND tr.fromuser <> 0"; - $userlist->add_from_sql('fromuser', $fromsql, $params); + ON tr.instanceid = t.id + WHERE cm.id = :cmid AND tr.fromuserid <> 0"; + $userlist->add_from_sql('fromuserid', $fromsql, $params); // Fetch all users who received feedback from other users. $tosql = " - SELECT DISTINCT ts.touser + SELECT DISTINCT ts.touserid FROM {course_modules} cm JOIN {modules} m ON m.id = cm.module AND m.name = :modname JOIN {verbalfeedback} t ON t.id = cm.instance JOIN {verbalfeedback_submission} ts - ON ts.verbalfeedback = t.id + ON ts.instanceid = t.id WHERE cm.id = :cmid"; - $userlist->add_from_sql('touser', $tosql, $params); + $userlist->add_from_sql('touserid', $tosql, $params); $tosql = " - SELECT DISTINCT tr.touser + SELECT DISTINCT tr.touserid FROM {course_modules} cm JOIN {modules} m ON m.id = cm.module AND m.name = :modname JOIN {verbalfeedback} t ON t.id = cm.instance JOIN {verbalfeedback_response} tr - ON tr.verbalfeedback = t.id + ON tr.instanceid = t.id WHERE cm.id = :cmid"; - $userlist->add_from_sql('touser', $tosql, $params); + $userlist->add_from_sql('touserid', $tosql, $params); } /** @@ -456,8 +456,8 @@ public static function delete_data_for_users(approved_userlist $userlist) { $userids = $userlist->get_userids(); list($usersql, $userparams) = $DB->get_in_or_equal($userids, SQL_PARAMS_NAMED); - $fromselect = "verbalfeedback = :verbalfeedback AND fromuser $usersql"; - $toselect = "verbalfeedback = :verbalfeedback AND touser $usersql"; + $fromselect = "verbalfeedback = :verbalfeedback AND fromuserid $usersql"; + $toselect = "verbalfeedback = :verbalfeedback AND touserid $usersql"; $params = ['verbalfeedback' => $cm->instance] + $userparams; $DB->delete_records_select('verbalfeedback_submission', $fromselect, $params); $DB->delete_records_select('verbalfeedback_submission', $toselect, $params); diff --git a/lang/de/verbalfeedback.php b/lang/de/verbalfeedback.php index 0b28626..be3c733 100644 --- a/lang/de/verbalfeedback.php +++ b/lang/de/verbalfeedback.php @@ -137,15 +137,15 @@ $string['positive'] = 'Positiv'; $string['preserveids'] = 'Preserve IDs?'; $string['previewinfo'] = 'Vorschau des Fragebogens, klicken Sie hier, um zur vorherigen Ansicht zurückzukehren.'; -$string['privacy:metadata:verbalfeedback'] = 'Die ID der Verbales Feedback-Instanz'; +$string['privacy:metadata:instanceid'] = 'Die ID der Verbales Feedback-Instanz'; $string['privacy:metadata:verbalfeedback_item'] = 'Die ID des Verbales Feedback-Kriteriums'; $string['privacy:metadata:verbalfeedback_response'] = 'Diese Tabelle speichert die Antworten der Feedbackgeber auf die Feedbackfragen an den Feedbackempfänger'; $string['privacy:metadata:verbalfeedback_response:value'] = 'Der Wert der Antwort des Feedbackgebers auf die Feedbackfrage'; $string['privacy:metadata:verbalfeedback_submission'] = 'Diese Tabelle speichert die Informationen über den Status der verbalen Feedback-Abgaben zwischen den Teilnehmer/innen'; -$string['privacy:metadata:verbalfeedback_submission:fromuser'] = 'Die Nutzer-ID der Person, die das Feedback gibt'; +$string['privacy:metadata:verbalfeedback_submission:fromuserid'] = 'Die Nutzer-ID der Person, die das Feedback gibt'; $string['privacy:metadata:verbalfeedback_submission:remarks'] = 'Der Grund, warum der Befragte es abgelehnt hat, dem Feedback-Empfänger ein Feedback zu geben'; $string['privacy:metadata:verbalfeedback_submission:status'] = 'Der Status der Feedback-Abgabe'; -$string['privacy:metadata:verbalfeedback_submission:touser'] = 'Die Nutzer-ID des Feedback-Empfängers'; +$string['privacy:metadata:verbalfeedback_submission:touserid'] = 'Die Nutzer-ID des Feedback-Empfängers'; $string['privatecomment'] = 'Private Bemerkungen'; $string['providefeedback'] = 'Feedback geben'; $string['qtypecomment'] = 'Bemerkung'; diff --git a/lang/en/verbalfeedback.php b/lang/en/verbalfeedback.php index 315aae0..ece20cd 100644 --- a/lang/en/verbalfeedback.php +++ b/lang/en/verbalfeedback.php @@ -135,15 +135,15 @@ $string['positive'] = 'Positive'; $string['preserveids'] = 'Preserve IDs?'; $string['previewinfo'] = 'Questionnaire preview, click here to return to the previous view.'; -$string['privacy:metadata:verbalfeedback'] = 'The ID of the verbal feedback instance'; +$string['privacy:metadata:instanceid'] = 'The ID of the verbal feedback instance'; $string['privacy:metadata:verbalfeedback_item'] = 'The ID of the verbal feedback item'; $string['privacy:metadata:verbalfeedback_response'] = 'This table stores the responses of the feedback respondent to the feedback questions to the feedback recipient'; $string['privacy:metadata:verbalfeedback_response:value'] = 'The value of the respondent\'s response to the feedback question'; $string['privacy:metadata:verbalfeedback_submission'] = 'This table stores the information about the statuses of verbal feedback submissions between the participants'; -$string['privacy:metadata:verbalfeedback_submission:fromuser'] = 'The user ID of the person giving the feedback'; +$string['privacy:metadata:verbalfeedback_submission:fromuserid'] = 'The user ID of the person giving the feedback'; $string['privacy:metadata:verbalfeedback_submission:remarks'] = 'The reason why the respondent declined to give feedback to the feedback recipient'; $string['privacy:metadata:verbalfeedback_submission:status'] = 'The status of the feedback submission'; -$string['privacy:metadata:verbalfeedback_submission:touser'] = 'The user ID of the feedback recipient'; +$string['privacy:metadata:verbalfeedback_submission:touserid'] = 'The user ID of the feedback recipient'; $string['privatecomment'] = 'Private comment'; $string['providefeedback'] = 'Provide feedback'; $string['qtypecomment'] = 'Comment'; diff --git a/lang/fr/verbalfeedback.php b/lang/fr/verbalfeedback.php index 988f245..371a7bb 100644 --- a/lang/fr/verbalfeedback.php +++ b/lang/fr/verbalfeedback.php @@ -137,15 +137,15 @@ $string['positive'] = 'Positif'; $string['preserveids'] = 'Preserve IDs?'; $string['previewinfo'] = 'Prévisualisez le questionnaire, cliquez sur ici pour revenir à la vue précédente.'; -$string['privacy:metadata:verbalfeedback'] = 'L\'ID de l\'instance de feedback verbal'; +$string['privacy:metadata:instanceid'] = 'L\'ID de l\'instance de feedback verbal'; $string['privacy:metadata:verbalfeedback_item'] = 'L\'ID de l\'élément de feedback verbal'; $string['privacy:metadata:verbalfeedback_response'] = 'Ce tableau stocke les réponses du répondant aux questions de feedback au destinataire de la rétroaction'; $string['privacy:metadata:verbalfeedback_response:value'] = 'La valeur de la réponse du répondant à la question de feedback'; $string['privacy:metadata:verbalfeedback_submission'] = 'Ce tableau stocke les informations sur les statuts des réponses aux questions de feedback entre les participants'; -$string['privacy:metadata:verbalfeedback_submission:fromuser'] = 'L\'ID utilisateur de la personne qui donne le feedback'; +$string['privacy:metadata:verbalfeedback_submission:fromuserid'] = 'L\'ID utilisateur de la personne qui donne le feedback'; $string['privacy:metadata:verbalfeedback_submission:remarks'] = 'La raison pour laquelle la personne interrogée a refusé de donner un feedback au destinataire du feedback'; $string['privacy:metadata:verbalfeedback_submission:status'] = 'Le statut de la soumission du feedback'; -$string['privacy:metadata:verbalfeedback_submission:touser'] = 'L\'ID utilisateur du destinataire du feedback'; +$string['privacy:metadata:verbalfeedback_submission:touserid'] = 'L\'ID utilisateur du destinataire du feedback'; $string['privatecomment'] = 'Commentaire privé'; $string['providefeedback'] = 'Fournir un feedback'; $string['qtypecomment'] = 'Commentaire';