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

Beta enhancements #20

Merged
merged 35 commits into from
Jun 21, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
af97e67
Change input format to lower case to disable case sensitivity
Typiqally Jun 9, 2022
3692ab5
Cleanup code
Typiqally Jun 9, 2022
979acb8
Log supported formats when exporter could not be determined
Typiqally Jun 9, 2022
8b06666
Add extra formats to excel module exporter
Typiqally Jun 9, 2022
e4a03d2
Fix outcomes being capped at 100
i404788 Jun 14, 2022
fa75ccc
Remove inappropriate try catch
Typiqally Jun 14, 2022
0d8bbbf
Remove obsolete this reference
Typiqally Jun 14, 2022
9261978
Add score property to outcome result
Typiqally Jun 14, 2022
250da5c
Add rubric assessment and rating data models
Typiqally Jun 14, 2022
49e5746
Add submission data model
Typiqally Jun 14, 2022
32bbb3c
Add submissions to module data model
Typiqally Jun 14, 2022
0864f60
Add submission service
Typiqally Jun 14, 2022
af7aa0c
Remove loggers from canvas services
Typiqally Jun 14, 2022
2c34536
Replace assignments list with submission list for core logic
Typiqally Jun 14, 2022
8b7a201
Cleanup startup and remove try catch
Typiqally Jun 14, 2022
393ae22
Merge branch 'feat/beta-enhancements' into master
Typiqally Jun 14, 2022
95fdf49
Fix build errors
Typiqally Jun 14, 2022
061f255
Merge pull request #21 from i404788/master
Typiqally Jun 14, 2022
01c78d4
Replace argument exceptions with validation results
Typiqally Jun 15, 2022
8ced417
Rename data namespace to model
Typiqally Jun 15, 2022
6c23432
Remove unused properties
Typiqally Jun 15, 2022
92cbf13
Rename services namespace for consistency
Typiqally Jun 15, 2022
fdca9b6
Rename count to limit for consistency
Typiqally Jun 15, 2022
288bd9d
Merge remote-tracking branch 'origin/feat/beta-enhancements' into fea…
Typiqally Jun 15, 2022
ffa3f1b
Cleanup code from pagination implementation
Typiqally Jun 15, 2022
2122c65
Add outcome description to excel export
Typiqally Jun 16, 2022
cc7a961
Trim excessive spaces
Typiqally Jun 16, 2022
57df77d
Modify column widths to show content clearer
Typiqally Jun 16, 2022
88e0f8a
Remove unused using directives
Typiqally Jun 16, 2022
7b27410
Update application demo gif
Typiqally Jun 16, 2022
f6d5661
Adding functionality for a short outcome description.
NealGeilen Jun 18, 2022
70156ca
Replace multiple endpoints with one single-purpose endpoint
Typiqally Jun 21, 2022
d4eeb8d
Added score to xls export
NealGeilen Jun 21, 2022
2a2c750
Added score to xls export
NealGeilen Jun 21, 2022
054df8d
Merge branch 'master' into feat/beta-enhancements
NealGeilen Jun 21, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Epsilon.Abstractions/Export/ICanvasModuleExporter.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using Epsilon.Canvas.Abstractions.Data;
using Epsilon.Canvas.Abstractions.Model;

namespace Epsilon.Abstractions.Export;

Expand Down
2 changes: 2 additions & 0 deletions Epsilon.Abstractions/Export/IModuleExporterCollection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

public interface IModuleExporterCollection
{
public IEnumerable<string> Formats();

public IDictionary<string, ICanvasModuleExporter> DetermineExporters(IEnumerable<string> formats);
}
8 changes: 8 additions & 0 deletions Epsilon.Canvas.Abstractions/Converter/IConverter.cs
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 Epsilon.Canvas.Abstractions/Converter/ILinkHeaderConverter.cs
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);
}
13 changes: 0 additions & 13 deletions Epsilon.Canvas.Abstractions/Data/Assignment.cs

This file was deleted.

18 changes: 0 additions & 18 deletions Epsilon.Canvas.Abstractions/Data/Module.cs

This file was deleted.

8 changes: 0 additions & 8 deletions Epsilon.Canvas.Abstractions/Data/Outcome.cs

This file was deleted.

11 changes: 0 additions & 11 deletions Epsilon.Canvas.Abstractions/Data/OutcomeResult.cs

This file was deleted.

4 changes: 2 additions & 2 deletions Epsilon.Canvas.Abstractions/ICanvasModuleCollectionFetcher.cs
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);
}
9 changes: 9 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/Alignment.cs
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
);
10 changes: 10 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/Assignment.cs
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
);
9 changes: 9 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/LinkHeader.cs
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; }
}
15 changes: 15 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/Module.cs
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; }
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Text.Json.Serialization;

namespace Epsilon.Canvas.Abstractions.Data;
namespace Epsilon.Canvas.Abstractions.Model;

public record ModuleItem(
[property: JsonPropertyName("id")] int Id,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace Epsilon.Canvas.Abstractions.Data;
namespace Epsilon.Canvas.Abstractions.Model;

public enum ModuleItemType
{
Expand Down
9 changes: 9 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/Outcome.cs
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
);
9 changes: 9 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/OutcomeResult.cs
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
);
9 changes: 9 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/OutcomeResultCollection.cs
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 Epsilon.Canvas.Abstractions/Model/OutcomeResultCollectionLink.cs
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);
}
10 changes: 10 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/OutcomeResultLink.cs
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
);
9 changes: 9 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/RubricAssessment.cs
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
);
12 changes: 12 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/RubricRating.cs
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; }
}
10 changes: 10 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/Submission.cs
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
);
12 changes: 12 additions & 0 deletions Epsilon.Canvas.Abstractions/Model/User.cs
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 Epsilon.Canvas.Abstractions/Service/IAssignmentHttpService.cs
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);
}
10 changes: 10 additions & 0 deletions Epsilon.Canvas.Abstractions/Service/IModuleHttpService.cs
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 Epsilon.Canvas.Abstractions/Service/IOutcomeHttpService.cs
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);
}
6 changes: 6 additions & 0 deletions Epsilon.Canvas.Abstractions/Service/IPaginatorHttpService.cs
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 Epsilon.Canvas.Abstractions/Service/ISubmissionHttpService.cs
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);
}
8 changes: 0 additions & 8 deletions Epsilon.Canvas.Abstractions/Services/IAssignmentService.cs

This file was deleted.

10 changes: 0 additions & 10 deletions Epsilon.Canvas.Abstractions/Services/IModuleService.cs

This file was deleted.

9 changes: 0 additions & 9 deletions Epsilon.Canvas.Abstractions/Services/IOutcomeService.cs

This file was deleted.

Loading