diff --git a/Epsilon.Abstractions/Component/ICompetenceProfileConverter.cs b/Epsilon.Abstractions/Component/ICompetenceProfileConverter.cs deleted file mode 100644 index 12bb7b0d..00000000 --- a/Epsilon.Abstractions/Component/ICompetenceProfileConverter.cs +++ /dev/null @@ -1,11 +0,0 @@ -using Epsilon.Abstractions.Model; -using Epsilon.Canvas.Abstractions.Model; -using Epsilon.Canvas.Abstractions.Model.GraphQl; -using Epsilon.Canvas.Abstractions.QueryResponse; - -namespace Epsilon.Abstractions.Component; - -public interface ICompetenceProfileConverter -{ - public CompetenceProfile ConvertFrom(GetAllUserCoursesSubmissionOutcomes getAllUserCoursesSubmissionOutcomes,IHboIDomain domain, IEnumerable terms); -} \ No newline at end of file diff --git a/Epsilon.Abstractions/Model/CompetenceProfile.cs b/Epsilon.Abstractions/Model/CompetenceProfile.cs deleted file mode 100644 index 096eb4fb..00000000 --- a/Epsilon.Abstractions/Model/CompetenceProfile.cs +++ /dev/null @@ -1,12 +0,0 @@ -using Epsilon.Canvas.Abstractions.Model; - -namespace Epsilon.Abstractions.Model; - -public record CompetenceProfile( - IHboIDomain HboIDomain, - IEnumerable ProfessionalTaskOutcomes, - IEnumerable ProfessionalSkillOutcomes, - IEnumerable Terms, - IEnumerable DecayingAveragesPerTask, - IEnumerable DecayingAveragesPerSkill -); \ No newline at end of file diff --git a/Epsilon.Canvas.Abstractions/Model/EnrollmentTermCollection.cs b/Epsilon.Canvas.Abstractions/Model/EnrollmentTermCollection.cs index c53eb04e..184a382f 100644 --- a/Epsilon.Canvas.Abstractions/Model/EnrollmentTermCollection.cs +++ b/Epsilon.Canvas.Abstractions/Model/EnrollmentTermCollection.cs @@ -1,5 +1,4 @@ -using System.Collections; -using System.Text.Json.Serialization; +using System.Text.Json.Serialization; namespace Epsilon.Canvas.Abstractions.Model; diff --git a/Epsilon.Canvas.Abstractions/Model/GraphQl/AssessmentRating.cs b/Epsilon.Canvas.Abstractions/Model/GraphQl/AssessmentRating.cs index f5cae158..8d570e6a 100644 --- a/Epsilon.Canvas.Abstractions/Model/GraphQl/AssessmentRating.cs +++ b/Epsilon.Canvas.Abstractions/Model/GraphQl/AssessmentRating.cs @@ -3,6 +3,9 @@ namespace Epsilon.Canvas.Abstractions.Model.GraphQl; public record AssessmentRating( - [property: JsonPropertyName("points")] double? Points, - [property: JsonPropertyName("outcome")] Outcome? Outcome -); \ No newline at end of file + [property: JsonPropertyName("criterion")] Criterion? Criterion, + [property: JsonPropertyName("points")] double? Points +) +{ + public bool IsMastery => Points >= Criterion?.MasteryPoints; +} \ No newline at end of file diff --git a/Epsilon.Canvas.Abstractions/Model/GraphQl/Assignment.cs b/Epsilon.Canvas.Abstractions/Model/GraphQl/Assignment.cs index af584ad5..ebc20383 100644 --- a/Epsilon.Canvas.Abstractions/Model/GraphQl/Assignment.cs +++ b/Epsilon.Canvas.Abstractions/Model/GraphQl/Assignment.cs @@ -4,5 +4,6 @@ namespace Epsilon.Canvas.Abstractions.Model.GraphQl; public record Assignment( [property: JsonPropertyName("name")] string? Name, - [property: JsonPropertyName("modules")] List? Modules + [property: JsonPropertyName("modules")] IEnumerable? Modules , + [property: JsonPropertyName("rubric")] Rubric? Rubric ); \ No newline at end of file diff --git a/Epsilon.Canvas.Abstractions/Model/GraphQl/Outcome.cs b/Epsilon.Canvas.Abstractions/Model/GraphQl/Outcome.cs index d4ecff00..6bdbd704 100644 --- a/Epsilon.Canvas.Abstractions/Model/GraphQl/Outcome.cs +++ b/Epsilon.Canvas.Abstractions/Model/GraphQl/Outcome.cs @@ -4,6 +4,5 @@ namespace Epsilon.Canvas.Abstractions.Model.GraphQl; public record Outcome( [property: JsonPropertyName("_id")] int Id, - [property: JsonPropertyName("title")] string? Title, - [property: JsonPropertyName("masteryPoints")] double? MasteryPoints + [property: JsonPropertyName("title")] string Title ); \ No newline at end of file diff --git a/Epsilon.Canvas.Abstractions/Model/GraphQl/RubricAssessmentNode.cs b/Epsilon.Canvas.Abstractions/Model/GraphQl/RubricAssessmentNode.cs index 7381f0bb..e2f0ef08 100644 --- a/Epsilon.Canvas.Abstractions/Model/GraphQl/RubricAssessmentNode.cs +++ b/Epsilon.Canvas.Abstractions/Model/GraphQl/RubricAssessmentNode.cs @@ -3,6 +3,5 @@ namespace Epsilon.Canvas.Abstractions.Model.GraphQl; public record RubricAssessmentNode( - [property: JsonPropertyName("assessmentRatings")] List? AssessmentRatings, - [property: JsonPropertyName("user")] User? User + [property: JsonPropertyName("assessmentRatings")] IReadOnlyList? AssessmentRatings ); \ No newline at end of file diff --git a/Epsilon.Canvas.Abstractions/Model/GraphQl/RubricAssessmentsConnection.cs b/Epsilon.Canvas.Abstractions/Model/GraphQl/RubricAssessmentsConnection.cs index a68992fd..0c01078e 100644 --- a/Epsilon.Canvas.Abstractions/Model/GraphQl/RubricAssessmentsConnection.cs +++ b/Epsilon.Canvas.Abstractions/Model/GraphQl/RubricAssessmentsConnection.cs @@ -3,5 +3,5 @@ namespace Epsilon.Canvas.Abstractions.Model.GraphQl; public record RubricAssessmentsConnection( - [property: JsonPropertyName("nodes")] List? Nodes + [property: JsonPropertyName("nodes")] IEnumerable? Nodes ); \ No newline at end of file diff --git a/Epsilon.Canvas.Abstractions/Model/GraphQl/SubmissionsConnectionNode.cs b/Epsilon.Canvas.Abstractions/Model/GraphQl/SubmissionsConnectionNode.cs index 5ed7dfd6..013fdbb2 100644 --- a/Epsilon.Canvas.Abstractions/Model/GraphQl/SubmissionsConnectionNode.cs +++ b/Epsilon.Canvas.Abstractions/Model/GraphQl/SubmissionsConnectionNode.cs @@ -3,8 +3,8 @@ namespace Epsilon.Canvas.Abstractions.Model.GraphQl; public record SubmissionsConnectionNode( - [property: JsonPropertyName("updatedAt")] DateTime? UpdatedAt, [property: JsonPropertyName("postedAt")] DateTime? PostedAt, - [property: JsonPropertyName("assignment")] Assignment? Assignment, - [property: JsonPropertyName("rubricAssessmentsConnection")] RubricAssessmentsConnection? RubricAssessmentsConnection + [property: JsonPropertyName("assignment")] Assignment? Assignment, + [property: JsonPropertyName("submissionHistoriesConnection")] SubmissionsHistoriesConnection SubmissionsHistories, + [property: JsonPropertyName("rubricAssessmentsConnection")] RubricAssessmentsConnection RubricAssessmentsConnection ); \ No newline at end of file diff --git a/Epsilon.Canvas.Abstractions/Model/OutcomeResultCollection.cs b/Epsilon.Canvas.Abstractions/Model/OutcomeResultCollection.cs index 09e169c2..9cbf3ac6 100644 --- a/Epsilon.Canvas.Abstractions/Model/OutcomeResultCollection.cs +++ b/Epsilon.Canvas.Abstractions/Model/OutcomeResultCollection.cs @@ -6,20 +6,4 @@ public record OutcomeResultCollection( [property: JsonPropertyName("outcome_results")] IEnumerable OutcomeResults, [property: JsonPropertyName("linked")] OutcomeResultCollectionLink? Links -) -{ - public double GetDecayingAverage() - { - var decayingAverage = 0.0; - - foreach(var grade in OutcomeResults) - { - if (grade.Score != null) - { - decayingAverage = decayingAverage * 0.35 + grade.Score.Value * 0.65; - } - } - - return decayingAverage; - } -} \ No newline at end of file +); \ No newline at end of file diff --git a/Epsilon.Canvas.Abstractions/QueryResponse/GetAllUserCoursesSubmissionOutcomes.cs b/Epsilon.Canvas.Abstractions/QueryResponse/GetAllUserCoursesSubmissionOutcomes.cs deleted file mode 100644 index 35b61f2b..00000000 --- a/Epsilon.Canvas.Abstractions/QueryResponse/GetAllUserCoursesSubmissionOutcomes.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Text.Json.Serialization; -using Epsilon.Canvas.Abstractions.Model.GraphQl; - -namespace Epsilon.Canvas.Abstractions.QueryResponse; - -public record GetAllUserCoursesSubmissionOutcomes( - [property: JsonPropertyName("data")] GetAllUserCoursesSubmissionOutcomes.CourseData? Data -) -{ - public record CourseData( - [property: JsonPropertyName("allCourses")] List? Courses - ); -}; \ No newline at end of file diff --git a/Epsilon.Canvas.Abstractions/QueryResponse/GetUserCourseSubmissionOutcomes.cs b/Epsilon.Canvas.Abstractions/QueryResponse/GetUserCourseSubmissionOutcomes.cs deleted file mode 100644 index 785035d7..00000000 --- a/Epsilon.Canvas.Abstractions/QueryResponse/GetUserCourseSubmissionOutcomes.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Text.Json.Serialization; -using Epsilon.Canvas.Abstractions.Model.GraphQl; - -namespace Epsilon.Canvas.Abstractions.QueryResponse; - -public record GetUserCourseSubmissionOutcomes( - [property: JsonPropertyName("data")] GetUserCourseSubmissionOutcomes.CourseData? Data -) -{ - public record CourseData( - [property: JsonPropertyName("course")] Course? Course - ); -}; \ No newline at end of file diff --git a/Epsilon.Host.Frontend/src/components/Competance/KpiMatrix.vue b/Epsilon.Host.Frontend/src/components/Competance/KpiMatrix.vue deleted file mode 100644 index 4f3b9d57..00000000 --- a/Epsilon.Host.Frontend/src/components/Competance/KpiMatrix.vue +++ /dev/null @@ -1,102 +0,0 @@ - - - - - diff --git a/Epsilon.Host.Frontend/src/components/Competance/KpiTable.vue b/Epsilon.Host.Frontend/src/components/Competance/KpiTable.vue deleted file mode 100644 index dfaea46e..00000000 --- a/Epsilon.Host.Frontend/src/components/Competance/KpiTable.vue +++ /dev/null @@ -1,72 +0,0 @@ - - - - - diff --git a/Epsilon.Host.Frontend/src/components/Competance/PersonalDevelopmentMatrix.vue b/Epsilon.Host.Frontend/src/components/Competance/PersonalDevelopmentMatrix.vue deleted file mode 100644 index 2de16a80..00000000 --- a/Epsilon.Host.Frontend/src/components/Competance/PersonalDevelopmentMatrix.vue +++ /dev/null @@ -1,86 +0,0 @@ - - - - - \ No newline at end of file diff --git a/Epsilon.Tests/Epsilon.Tests.csproj b/Epsilon.Tests/Epsilon.Tests.csproj index 21b261e1..e17df0cb 100644 --- a/Epsilon.Tests/Epsilon.Tests.csproj +++ b/Epsilon.Tests/Epsilon.Tests.csproj @@ -33,8 +33,4 @@ - - - - diff --git a/Epsilon/Component/Converters/CompetenceProfileConverter.cs b/Epsilon/Component/Converters/CompetenceProfileConverter.cs deleted file mode 100644 index c30cbff6..00000000 --- a/Epsilon/Component/Converters/CompetenceProfileConverter.cs +++ /dev/null @@ -1,100 +0,0 @@ -using Epsilon.Abstractions.Component; -using Epsilon.Abstractions.Model; -using Epsilon.Canvas.Abstractions.Model; -using Epsilon.Canvas.Abstractions.Model.GraphQl; -using Epsilon.Canvas.Abstractions.QueryResponse; - -namespace Epsilon.Component.Converters; - -public class CompetenceProfileConverter : ICompetenceProfileConverter -{ - public IEnumerable GetDecayingAverageTasks(IHboIDomain domain, IEnumerable taskResults) - { - return domain.ArchitectureLayers.Select(layer => new DecayingAveragePerLayer(layer.Id, - domain.Activities.Select(activity => - { - var decayingAverage = taskResults - .Where(task => task.ArchitectureLayer == layer.Id && task.Activity == activity.Id) - .Aggregate(0, - (current, outcome) => current * 0.35 + outcome.Grade * 0.65); - - return new DecayingAveragePerActivity(activity.Id, decayingAverage); - }))); - } - - public IEnumerable GetDecayingAverageSkills(IHboIDomain domain, IEnumerable skillResults) - { - return domain.ProfessionalSkills.Select(skill => - { - var decayingAverage = skillResults.Where(outcome => outcome.Skill == skill.Id) - .Aggregate(0, - (current, outcome) => current * 0.35 + outcome.Grade * 0.65); - - return new DecayingAveragePerSkill(skill.Id, decayingAverage); - }); - } - - public CompetenceProfile ConvertFrom(GetAllUserCoursesSubmissionOutcomes getAllUserCoursesSubmissionOutcomes, - IHboIDomain domain, IEnumerable enrollmentTerms) - { - var taskResults = new List(); - var professionalResults = new List(); - - foreach (var course in getAllUserCoursesSubmissionOutcomes.Data.Courses) - { - foreach (var submission in course.SubmissionsConnection.Nodes.Where(static s => s.PostedAt != null)) - { - var assessmentRatings = submission.RubricAssessmentsConnection?.Nodes; - - foreach (var assessmentRating in assessmentRatings) - { - foreach (var (points, outcome) in assessmentRating.AssessmentRatings.Where(static ar => - ar is {Points: not null, Outcome: not null} && ar.Points >= ar.Outcome.MasteryPoints)) - { - if (FhictConstants.ProfessionalTasks.TryGetValue(outcome!.Id, out var professionalTask)) - { - taskResults.Add( - new ProfessionalTaskResult( - professionalTask.Layer, - professionalTask.Activity, - professionalTask.MasteryLevel, - points!.Value, - submission.PostedAt!.Value - ) - ); - } - else if (FhictConstants.ProfessionalSkills.TryGetValue(outcome.Id, out var professionalSkill)) - { - professionalResults.Add( - new ProfessionalSkillResult( - professionalSkill.Skill, - professionalSkill.MasteryLevel, - points!.Value, - submission.PostedAt!.Value - ) - ); - } - } - } - } - } - - var filteredTerms = enrollmentTerms - .Where(static term => term is {StartAt: not null, EndAt: not null}) - .Where(term => taskResults.Any(taskOutcome => - taskOutcome.AssessedAt >= term.StartAt && taskOutcome.AssessedAt <= term.EndAt) - || professionalResults.Any(skillOutcome => - skillOutcome.AssessedAt > term.StartAt && skillOutcome.AssessedAt < term.EndAt)) - .Distinct() - .OrderBy(static term => term.StartAt); - - return new CompetenceProfile( - domain, - taskResults, - professionalResults, - filteredTerms, - GetDecayingAverageTasks(domain, taskResults), - GetDecayingAverageSkills(domain, professionalResults) - ); - } -} \ No newline at end of file