Skip to content
This repository has been archived by the owner on Sep 4, 2023. It is now read-only.

Add KPI table component #108

Open
wants to merge 23 commits into
base: develop
Choose a base branch
from
Open

Add KPI table component #108

wants to merge 23 commits into from

Conversation

HansenSven
Copy link
Collaborator

No description provided.

@HansenSven HansenSven changed the title Feat/kpi table Add kpi table component Jun 26, 2023
@HansenSven HansenSven marked this pull request as ready for review June 26, 2023 20:30
@Typiqally
Copy link
Owner

Fix lint issues

@Typiqally Typiqally changed the title Add kpi table component Add KPI table component Jun 27, 2023
Comment on lines 78 to 120
foreach (var submission in course.SubmissionsConnection!.Nodes.Select(sm => sm.SubmissionsHistories.Nodes
.Where(sub => sub.SubmittedAt > startDate && sub.SubmittedAt < endDate)
.MaxBy(static h => h.Attempt)))
{
if (submission is
{
Assignment.Rubric: not null,
RubricAssessments.Nodes: not null,
})
{
var rubricCriteria = submission.Assignment.Rubric.Criteria?.ToArray();

if (rubricCriteria is not null)
{
foreach (var outcome in GetValidOutcomes(rubricCriteria))
{
var assessmentRatings = submission.RubricAssessments.Nodes.FirstOrDefault()?.AssessmentRatings;

var grade = assessmentRatings?.FirstOrDefault(ar => ar?.Criterion?.Outcome?.Id == outcome?.Id)?.Grade;

if (grade != null)
{
var assignmentName = submission!.Assignment!.Name!;
var htmlUrl = submission.Assignment.HtmlUrl;
var assessmentRating = assessmentRatings?.FirstOrDefault(ar => ar?.Criterion?.Outcome?.Id == outcome?.Id);

if (assessmentRating is not null)
{

if (kpiTableEntries.ContainsKey(outcome.Id))
{
UpdateKpiTableEntry(kpiTableEntries, outcome, submission.Assignment, grade);
}
else
{
AddKpiTableEntry(kpiTableEntries, outcome, submission.Assignment, grade);
}
}
}
}
}
}
}

Check notice

Code scanning / CodeQL

Missed opportunity to use Where

This foreach loop [implicitly filters its target sequence](1) - consider filtering the sequence explicitly using '.Where(...)'.
Epsilon/Component/KpiTableComponentFetcher.cs Fixed Show fixed Hide fixed
Epsilon/Component/KpiTableComponentFetcher.cs Fixed Show fixed Hide fixed
@HansenSven HansenSven requested a review from NealGeilen June 30, 2023 08:44
@HansenSven HansenSven requested review from Typiqally and removed request for Typiqally June 30, 2023 10:26
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants