Skip to content

Commit

Permalink
fixed submission bug in AssignmentWorker
Browse files Browse the repository at this point in the history
  • Loading branch information
akirkinis committed Feb 24, 2024
1 parent b6100ef commit e6428e3
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion IguideME.Web/Services/Workers/AssignmentWorker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using IguideME.Web.Models.App;
using IguideME.Web.Models.Impl;
using IguideME.Web.Services.LMSHandlers;
using Microsoft.EntityFrameworkCore.Query.SqlExpressions;
using Microsoft.Extensions.Logging;

namespace IguideME.Web.Services.Workers
Expand Down Expand Up @@ -75,6 +76,8 @@ private void RegisterSubmissions(
Dictionary<int, (double, AppGradingType)> gradingTypes
)
{
_logger.LogInformation("Starting submission registry...");

double max;
AppGradingType type;
(double, AppGradingType) elem;
Expand Down Expand Up @@ -158,6 +161,7 @@ public void Start()
users
);
Dictionary<int, (double, AppGradingType)> gradingTypes = new();
List<AssignmentSubmission> assignmentSubmissionsWithTiles = new ();

foreach (AppAssignment assignment in assignments)
{
Expand All @@ -174,8 +178,18 @@ public void Start()
assignment.AssignmentID,
(assignment.PointsPossible, assignment.GradingType)
);

// We find all submissions for this assignment, and save them with the corresponding entryID that we found
foreach (AssignmentSubmission sub in submissions) {
if(sub.AssignmentID == assignment.AssignmentID){
sub.EntryID = entry.ID;
assignmentSubmissionsWithTiles.Add(sub);
}
}
}
this.RegisterSubmissions(submissions, gradingTypes);

// Finally we register the submissions
this.RegisterSubmissions(assignmentSubmissionsWithTiles, gradingTypes);
}
}
}

0 comments on commit e6428e3

Please sign in to comment.