This repository has been archived by the owner on Sep 4, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add competence profile data model (#76)
* Initial proof of concept for competence profile data model * Refactor competence profile return type * Created endpoint with updated HboIDomain and Mockdata. Also created GraphQL endpoint for student data * Cleanup records to seperate GraphQL folder * Fix GraphQL records --------- Co-authored-by: Jelle Maas <typiqally@gmail.com> Co-authored-by: Sven Hansen <76601644+1SvenHansen@users.noreply.github.com>
- Loading branch information
1 parent
7cbd454
commit c607762
Showing
24 changed files
with
197 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
namespace Epsilon.Abstractions.Model; | ||
|
||
public record CompetenceProfile( | ||
HboIDomain HboIDomain, | ||
IEnumerable<CompetenceProfileOutcome> CompetenceProfileOutcomes | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace Epsilon.Abstractions.Model; | ||
|
||
public record CompetenceProfileOutcome( | ||
string ArchitectureLayer, | ||
string Activity, | ||
int MasteryLevel, | ||
int Grade, | ||
DateTime AssessedAt | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
namespace Epsilon.Abstractions.Model; | ||
|
||
public record HboIDomain( | ||
IEnumerable<ArchitectureLayer> ArchitectureLayers, | ||
IEnumerable<Activity> Activities, | ||
IEnumerable<MasteryLevel> MasteryLevels | ||
) | ||
{ | ||
public static readonly HboIDomain HboIDomain2018 = new( | ||
new[] | ||
{ | ||
new ArchitectureLayer("Hardware Interfacing", "#8D9292"), | ||
new ArchitectureLayer("Infrastructure", "#6EA7D4"), | ||
new ArchitectureLayer("Organisational Processes", "#D16557"), | ||
new ArchitectureLayer("User Interaction", "#E29C53"), | ||
new ArchitectureLayer("Software", "#96B9C0") | ||
}, | ||
new[] | ||
{ | ||
new Activity("Manage & Control"), | ||
new Activity("Analysis"), | ||
new Activity("Advise"), | ||
new Activity("Design"), | ||
new Activity("Realisation") | ||
}, | ||
new[] | ||
{ | ||
new MasteryLevel(1, "#00B0F0"), | ||
new MasteryLevel(2, "#00B050"), | ||
new MasteryLevel(3, "#FFFC00"), | ||
new MasteryLevel(4) | ||
} | ||
); | ||
} | ||
|
||
public record ArchitectureLayer(string Value, string? Color = null); | ||
public record Activity(string Value, string? Color = null); | ||
public record MasteryLevel(int Value, string? Color = null); |
8 changes: 8 additions & 0 deletions
8
Epsilon.Canvas.Abstractions/Model/GraphQL/AssessmentRating.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record AssessmentRating( | ||
[property: JsonPropertyName("points")] double? Points, | ||
[property: JsonPropertyName("outcome")] Outcome? Outcome | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record Assignment( | ||
[property: JsonPropertyName("name")] string Name, | ||
[property: JsonPropertyName("modules")] List<Module>? Modules | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record Course( | ||
[property: JsonPropertyName("name")] string Name, | ||
[property: JsonPropertyName("submissionsConnection")] SubmissionsConnection? SubmissionsConnection | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record Module( | ||
[property: JsonPropertyName("name")] string Name | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record Node( | ||
[property: JsonPropertyName("assignment")] Assignment? Assignment, | ||
[property: JsonPropertyName("rubricAssessmentsConnection")] RubricAssessmentsConnection? RubricAssessmentsConnection | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record Outcome( | ||
[property: JsonPropertyName("title")] string? Title | ||
); |
8 changes: 8 additions & 0 deletions
8
Epsilon.Canvas.Abstractions/Model/GraphQL/RubricAssessmentNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record RubricAssessmentNode( | ||
[property: JsonPropertyName("assessmentRatings")] List<AssessmentRating>? AssessmentRatings, | ||
[property: JsonPropertyName("user")] User? User | ||
); |
7 changes: 7 additions & 0 deletions
7
Epsilon.Canvas.Abstractions/Model/GraphQL/RubricAssessmentsConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record RubricAssessmentsConnection( | ||
[property: JsonPropertyName("nodes")] List<RubricAssessmentNode>? Nodes | ||
); |
7 changes: 7 additions & 0 deletions
7
Epsilon.Canvas.Abstractions/Model/GraphQL/SubmissionsConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record SubmissionsConnection( | ||
[property: JsonPropertyName("nodes")] List<Node>? Nodes | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record User( | ||
[property: JsonPropertyName("name")] string Name | ||
); |
11 changes: 4 additions & 7 deletions
11
Epsilon.Canvas.Abstractions/Model/GraphQl/AssessmentRating.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,8 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQl; | ||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record AssessmentRating( | ||
[property: JsonPropertyName("criterion")] Criterion? Criterion, | ||
[property: JsonPropertyName("points")] double? Points | ||
) | ||
{ | ||
public bool IsMastery => Points >= Criterion?.MasteryPoints; | ||
} | ||
[property: JsonPropertyName("points")] double? Points, | ||
[property: JsonPropertyName("outcome")] Outcome? Outcome | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,8 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQl; | ||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record Assignment( | ||
[property: JsonPropertyName("name")] string? Name, | ||
[property: JsonPropertyName("modules")] IEnumerable<Module>? Modules , | ||
[property: JsonPropertyName("rubric")] Rubric? Rubric | ||
[property: JsonPropertyName("name")] string Name, | ||
[property: JsonPropertyName("modules")] List<Module>? Modules | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQl; | ||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record Course( | ||
[property: JsonPropertyName("name")] string? Name, | ||
[property: JsonPropertyName("name")] string Name, | ||
[property: JsonPropertyName("submissionsConnection")] SubmissionsConnection? SubmissionsConnection | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQl; | ||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record Outcome( | ||
[property: JsonPropertyName("_id")] int Id, | ||
[property: JsonPropertyName("title")] string Title | ||
[property: JsonPropertyName("title")] string? Title | ||
); |
5 changes: 3 additions & 2 deletions
5
Epsilon.Canvas.Abstractions/Model/GraphQl/RubricAssessmentNode.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQl; | ||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record RubricAssessmentNode( | ||
[property: JsonPropertyName("assessmentRatings")] IReadOnlyList<AssessmentRating?>? AssessmentRatings | ||
[property: JsonPropertyName("assessmentRatings")] List<AssessmentRating>? AssessmentRatings, | ||
[property: JsonPropertyName("user")] User? User | ||
); |
4 changes: 2 additions & 2 deletions
4
Epsilon.Canvas.Abstractions/Model/GraphQl/RubricAssessmentsConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQl; | ||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record RubricAssessmentsConnection( | ||
[property: JsonPropertyName("nodes")] IEnumerable<RubricAssessmentNode>? Nodes | ||
[property: JsonPropertyName("nodes")] List<RubricAssessmentNode>? Nodes | ||
); |
4 changes: 2 additions & 2 deletions
4
Epsilon.Canvas.Abstractions/Model/GraphQl/SubmissionsConnection.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQl; | ||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record SubmissionsConnection( | ||
[property: JsonPropertyName("nodes")] IReadOnlyCollection<SubmissionsConnectionNode>? Nodes | ||
[property: JsonPropertyName("nodes")] List<Node>? Nodes | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model.GraphQl; | ||
namespace Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
public record User( | ||
[property: JsonPropertyName("name")] string? Name | ||
[property: JsonPropertyName("name")] string Name | ||
); |
13 changes: 13 additions & 0 deletions
13
Epsilon.Canvas.Abstractions/QueryResponse/GetUserSubmissionOutcomes.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System.Text.Json.Serialization; | ||
using Epsilon.Canvas.Abstractions.Model.GraphQL; | ||
|
||
namespace Epsilon.Canvas.Abstractions.QueryResponse; | ||
|
||
public record GetUserSubmissionOutcomes( | ||
[property: JsonPropertyName("data")] GetUserSubmissionOutcomes.CourseData? Data | ||
) | ||
{ | ||
public record CourseData( | ||
[property: JsonPropertyName("course")] Course? Course | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace Epsilon.Canvas; | ||
|
||
public static class QueryConstants | ||
{ | ||
public const string GetUserSubmissionOutcomes = @" | ||
query GetUserSubmissionOutcomes { | ||
course(id: $courseId) { | ||
name | ||
submissionsConnection { | ||
nodes { | ||
assignment { | ||
name | ||
modules { | ||
name | ||
} | ||
} | ||
rubricAssessmentsConnection { | ||
nodes { | ||
assessmentRatings { | ||
points | ||
outcome { | ||
title | ||
} | ||
} | ||
user { | ||
name | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
"; | ||
} |