Skip to content

Commit

Permalink
[Refactor:Developer] PeerFeedback query reformat (Submitty#9784)
Browse files Browse the repository at this point in the history
Was reviewing some stuff and came across this query. No change, just
indentation.
  • Loading branch information
ziesski authored Sep 19, 2023
1 parent 6ae544d commit 1c8fa89
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion site/app/libraries/database/DatabaseQueries.php
Original file line number Diff line number Diff line change
Expand Up @@ -4510,7 +4510,23 @@ public function getPeerGradingAssignment($gradeable_id) {
*/
public function getPeerFeedbackForUser($gradeable_id, $user_id, $anon = false) {
if ($anon) {
$this->course_db->query("SELECT ga.anon_id AS grader_id, p.user_id, p.feedback FROM peer_feedback p INNER JOIN gradeable_anon ga ON ga.user_id=p.grader_id WHERE p.g_id = ? AND p.user_id = ? ORDER BY p.grader_id", [$gradeable_id, $user_id]);
$this->course_db->query("
SELECT
ga.anon_id AS grader_id,
p.user_id,
p.feedback
FROM
peer_feedback p
INNER JOIN
gradeable_anon ga
ON
ga.user_id = p.grader_id
WHERE
p.g_id = ?
AND p.user_id = ?
ORDER BY
p.grader_id;
", [$gradeable_id, $user_id]);
}
else {
$this->course_db->query("SELECT grader_id, user_id, feedback FROM peer_feedback WHERE g_id = ? AND user_id = ? ORDER BY grader_id", [$gradeable_id, $user_id]);
Expand Down

0 comments on commit 1c8fa89

Please sign in to comment.