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.
Merge pull request #20 from Typiqally/feat/beta-enhancements
Beta enhancements
- Loading branch information
Showing
52 changed files
with
658 additions
and
401 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
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace Epsilon.Canvas.Abstractions.Converter; | ||
|
||
public interface IConverter<TTo, TFrom> | ||
{ | ||
TTo ConvertFrom(TFrom from); | ||
|
||
TFrom ConvertTo(TTo to); | ||
} |
8 changes: 8 additions & 0 deletions
8
Epsilon.Canvas.Abstractions/Converter/ILinkHeaderConverter.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 Epsilon.Canvas.Abstractions.Model; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Converter; | ||
|
||
public interface ILinkHeaderConverter : IConverter<LinkHeader, string> | ||
{ | ||
public LinkHeader ConvertFrom(HttpResponseMessage response); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
Epsilon.Canvas.Abstractions/ICanvasModuleCollectionFetcher.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,8 +1,8 @@ | ||
using Epsilon.Canvas.Abstractions.Data; | ||
using Epsilon.Canvas.Abstractions.Model; | ||
|
||
namespace Epsilon.Canvas.Abstractions; | ||
|
||
public interface ICanvasModuleCollectionFetcher | ||
{ | ||
public Task<IEnumerable<Module>> Fetch(int courseId); | ||
public Task<IEnumerable<Module>> GetAll(int courseId); | ||
} |
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 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public record Alignment( | ||
[property: JsonPropertyName("id")] string Id, | ||
[property: JsonPropertyName("name")] string Name, | ||
[property: JsonPropertyName("html_url")] Uri Url | ||
); |
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,10 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public record Assignment( | ||
[property: JsonPropertyName("id")] int Id, | ||
[property: JsonPropertyName("name")] string Name, | ||
[property: JsonPropertyName("html_url")] Uri Url, | ||
[property: JsonPropertyName("submission")] Submission? Submission | ||
); |
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.Canvas.Abstractions.Model; | ||
|
||
public record LinkHeader | ||
{ | ||
public string? FirstLink { get; set; } | ||
public string? PrevLink { get; set; } | ||
public string? NextLink { get; set; } | ||
public string? LastLink { get; set; } | ||
} |
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,15 @@ | ||
using System.Text.Json.Serialization; | ||
using Epsilon.Canvas.Abstractions.Response; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public record Module( | ||
[property: JsonPropertyName("id")] int Id, | ||
[property: JsonPropertyName("name")] string Name, | ||
[property: JsonPropertyName("items_count")] int Count, | ||
[property: JsonPropertyName("items")] IEnumerable<ModuleItem>? Items | ||
) | ||
{ | ||
[JsonIgnore] | ||
public OutcomeResultCollection Collection { get; set; } | ||
} |
2 changes: 1 addition & 1 deletion
2
...on.Canvas.Abstractions/Data/ModuleItem.cs → ...n.Canvas.Abstractions/Model/ModuleItem.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
2 changes: 1 addition & 1 deletion
2
...anvas.Abstractions/Data/ModuleItemType.cs → ...nvas.Abstractions/Model/ModuleItemType.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
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 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public record Outcome( | ||
[property: JsonPropertyName("id")] int Id, | ||
[property: JsonPropertyName("title")] string Title, | ||
[property: JsonPropertyName("description")] string Description | ||
); |
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 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public record OutcomeResult( | ||
[property: JsonPropertyName("mastery")] bool? Mastery, | ||
[property: JsonPropertyName("score")] double? Score, | ||
[property: JsonPropertyName("links")] OutcomeResultLink Link | ||
); |
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 @@ | ||
using System.Text.Json.Serialization; | ||
using Epsilon.Canvas.Abstractions.Model; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Response; | ||
|
||
public record OutcomeResultCollection( | ||
[property: JsonPropertyName("outcome_results")] IEnumerable<OutcomeResult> OutcomeResults, | ||
[property: JsonPropertyName("linked")] OutcomeResultCollectionLink? Links | ||
); |
17 changes: 17 additions & 0 deletions
17
Epsilon.Canvas.Abstractions/Model/OutcomeResultCollectionLink.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,17 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public record OutcomeResultCollectionLink( | ||
[property: JsonPropertyName("outcomes")] IEnumerable<Outcome>? Outcomes, | ||
[property: JsonPropertyName("alignments")] IEnumerable<Alignment>? Alignments | ||
) | ||
{ | ||
public IDictionary<string, Outcome> OutcomesDictionary => Outcomes | ||
.DistinctBy(static o => o.Id) | ||
.ToDictionary(static o => o.Id.ToString(), static o => o); | ||
|
||
public IDictionary<string, Alignment> AlignmentsDictionary => Alignments | ||
.DistinctBy(static a => a.Id) | ||
.ToDictionary(static a => a.Id, static a => a); | ||
} |
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,10 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public record OutcomeResultLink( | ||
[property: JsonPropertyName("user")] string? User, | ||
[property: JsonPropertyName("learning_outcome")] string? Outcome, | ||
[property: JsonPropertyName("alignment")] string? Alignment, | ||
[property: JsonPropertyName("assignment")] string? Assignment | ||
); |
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 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public record RubricAssessment( | ||
[property: JsonPropertyName("score")] double? Score, | ||
[property: JsonPropertyName("artifact_attempt")] int Attempt, | ||
[property: JsonPropertyName("data")] IEnumerable<RubricRating> Ratings | ||
); |
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,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public record RubricRating( | ||
[property: JsonPropertyName("points")] double? Points, | ||
[property: JsonPropertyName("learning_outcome_id")] int? OutcomeId | ||
) | ||
{ | ||
[JsonIgnore] | ||
public Outcome? Outcome { get; set; } | ||
} |
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,10 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public record Submission( | ||
[property: JsonPropertyName("submitted_at")] DateTime? SubmittedAt, | ||
[property: JsonPropertyName("graded_at")] DateTime? GradedAt, | ||
[property: JsonPropertyName("full_rubric_assessment")] RubricAssessment? RubricAssessment, | ||
[property: JsonPropertyName("assignment")] Assignment? Assignment | ||
); |
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,12 @@ | ||
using System.Text.Json.Serialization; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Model; | ||
|
||
public class User | ||
{ | ||
[JsonPropertyName("id")] | ||
public int Id { get; set; } | ||
|
||
[JsonPropertyName("name")] | ||
public string Name { get; set; } | ||
} |
9 changes: 9 additions & 0 deletions
9
Epsilon.Canvas.Abstractions/Service/IAssignmentHttpService.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,9 @@ | ||
using Epsilon.Canvas.Abstractions.Model; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Service; | ||
|
||
public interface IAssignmentHttpService | ||
{ | ||
Task<IEnumerable<Assignment>?> GetAll(int courseId, IEnumerable<string> include); | ||
Task<Assignment?> GetById(int courseId, int id); | ||
} |
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,10 @@ | ||
using Epsilon.Canvas.Abstractions.Model; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Service; | ||
|
||
public interface IModuleHttpService | ||
{ | ||
Task<IEnumerable<Module>?> GetAll(int courseId, IEnumerable<string> include); | ||
Task<Module?> GetById(int courseId, int id); | ||
Task<IEnumerable<ModuleItem>?> GetAllItems(int courseId, int moduleId, int limit = 100); | ||
} |
10 changes: 10 additions & 0 deletions
10
Epsilon.Canvas.Abstractions/Service/IOutcomeHttpService.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,10 @@ | ||
using Epsilon.Canvas.Abstractions.Model; | ||
using Epsilon.Canvas.Abstractions.Response; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Service; | ||
|
||
public interface IOutcomeHttpService | ||
{ | ||
Task<Outcome?> Find(int id); | ||
Task<OutcomeResultCollection?> GetResults(int courseId, IEnumerable<string> include); | ||
} |
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.Canvas.Abstractions.Service; | ||
|
||
public interface IPaginatorHttpService | ||
{ | ||
public Task<IEnumerable<T>> GetAllPages<T>(HttpMethod method, string uri); | ||
} |
8 changes: 8 additions & 0 deletions
8
Epsilon.Canvas.Abstractions/Service/ISubmissionHttpService.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 Epsilon.Canvas.Abstractions.Model; | ||
|
||
namespace Epsilon.Canvas.Abstractions.Service; | ||
|
||
public interface ISubmissionHttpService | ||
{ | ||
public Task<IEnumerable<Submission>> GetAllFromStudent(int courseId, IEnumerable<string> include, int limit = 100); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.