Skip to content

Commit

Permalink
Should fix multiple submissions in brightspace
Browse files Browse the repository at this point in the history
  • Loading branch information
allomanta committed Sep 26, 2024
1 parent 078b854 commit 352f308
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 12 deletions.
33 changes: 23 additions & 10 deletions IguideME.Web/Services/LMSHandlers/BrightspaceHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -353,19 +353,32 @@ IEnumerable<User> users

using (
NpgsqlDataReader r = Query(
@$"SELECT grade_results.grade_object_id,
@$"
SELECT gr.grade_object_id,
users.username,
grade_results.points_numerator,
grade_results.points_denominator,
grade_results.grade_text,
grade_results.grade_released_date
FROM grade_results
gr.points_numerator,
gr.points_denominator,
gr.grade_text,
gr.grade_released_date
FROM (
SELECT grade_object_id,
user_id,
points_numerator,
points_denominator,
grade_text,
grade_released_date,
org_unit_id,
is_released,
ROW_NUMBER() OVER (PARTITION BY grade_object_id, user_id ORDER BY version DESC) ranked_order
FROM grade_results) gr
INNER JOIN users
ON users.user_id = grade_results.user_id
WHERE grade_results.org_unit_id = @courseID
ON users.user_id = gr.user_id
WHERE gr.org_unit_id = @courseID
AND gr.ranked_order = 1
AND (is_released is null or is_released = TRUE)
AND grade_results.user_id
IN ({string.Join(",", users.Select((_, index) => $"@userID{index}"))})",
AND gr.user_id
IN ({string.Join(",", users.Select((_, index) => $"@userID{index}"))})
;",
parameters
)
)
Expand Down
4 changes: 2 additions & 2 deletions charts/iguideme/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ apiVersion: v2
name: iguideme
description: IguideME
type: application
version: 0.2.93
appVersion: "0.2.93"
version: 0.2.94
appVersion: "0.2.94"

0 comments on commit 352f308

Please sign in to comment.