Skip to content

Commit

Permalink
Should fix error retrieving submissions for too many users
Browse files Browse the repository at this point in the history
  • Loading branch information
allomanta committed Nov 24, 2024
1 parent f38082f commit 0211ba4
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
12 changes: 11 additions & 1 deletion IguideME.Web/Services/LMSHandlers/CanvasHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,17 @@ private AppGradingType mapGradingType(GradingType type)
/// <inheritdoc />
public IEnumerable<AssignmentSubmission> GetSubmissions(int courseID, List<User> users)
{
_logger.LogInformation("Getting submissions for users:\n{}", users.Select(user => user.UserID));
List<AssignmentSubmission> submissions = new();
for (int i = 0; i < users.Count; i += 100)
{
submissions.Concat(GetSubmissionsBatch(courseID, users.GetRange(i, Math.Min(100, users.Count - i))));
};
return submissions;

}

public IEnumerable<AssignmentSubmission> GetSubmissionsBatch(int courseID, List<User> users)
{
return Connector
.FindCourseById(courseID)
.GetSubmissions(users.Select(user => user.UserID).ToArray(), false)
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.3.239
appVersion: "0.3.239"
version: 0.3.240
appVersion: "0.3.240"

0 comments on commit 0211ba4

Please sign in to comment.