mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
halfway through localcourse transition
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace LocalModels;
|
||||
|
||||
public record RubricItem
|
||||
@@ -95,4 +97,12 @@ public record LocalAssignment
|
||||
assignmentGroups
|
||||
.FirstOrDefault(g => g.Id == LocalAssignmentGroupId)?
|
||||
.CanvasId;
|
||||
|
||||
|
||||
public string ToYaml()
|
||||
{
|
||||
var serializer = new SerializerBuilder().DisableAliases().Build();
|
||||
var yaml = serializer.Serialize(this);
|
||||
return yaml;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,6 +3,21 @@ namespace LocalModels;
|
||||
public record LocalCourse
|
||||
{
|
||||
public IEnumerable<LocalModule> Modules { get; init; } = Enumerable.Empty<LocalModule>();
|
||||
|
||||
public IEnumerable<LocalAssignmentGroup> AssignmentGroups { get; init; } =
|
||||
Enumerable.Empty<LocalAssignmentGroup>();
|
||||
public IEnumerable<DayOfWeek> DaysOfWeek { get; init; } = Enumerable.Empty<DayOfWeek>();
|
||||
public SimpleTimeOnly DefaultDueTime { get; init; } = new SimpleTimeOnly();
|
||||
public IEnumerable<AssignmentTemplate> AssignmentTemplates { get; init; } =
|
||||
Enumerable.Empty<AssignmentTemplate>();
|
||||
|
||||
public LocalCourseSettings Settings { get; set; }
|
||||
}
|
||||
|
||||
public record LocalCourseSettings
|
||||
{
|
||||
public IEnumerable<LocalAssignmentGroup> AssignmentGroups { get; init; } =
|
||||
Enumerable.Empty<LocalAssignmentGroup>();
|
||||
public string Name { get; init; } = string.Empty;
|
||||
public IEnumerable<DayOfWeek> DaysOfWeek { get; init; } = Enumerable.Empty<DayOfWeek>();
|
||||
public ulong? CanvasId { get; init; }
|
||||
@@ -11,8 +26,6 @@ public record LocalCourse
|
||||
public SimpleTimeOnly DefaultDueTime { get; init; } = new SimpleTimeOnly();
|
||||
public IEnumerable<AssignmentTemplate> AssignmentTemplates { get; init; } =
|
||||
Enumerable.Empty<AssignmentTemplate>();
|
||||
public IEnumerable<LocalAssignmentGroup> AssignmentGroups { get; init; } =
|
||||
Enumerable.Empty<LocalAssignmentGroup>();
|
||||
}
|
||||
|
||||
public record SimpleTimeOnly
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
using YamlDotNet.Serialization;
|
||||
|
||||
namespace LocalModels;
|
||||
|
||||
public record LocalQuiz
|
||||
@@ -25,4 +27,11 @@ public record LocalQuiz
|
||||
assignmentGroups
|
||||
.FirstOrDefault(g => g.Id == LocalAssignmentGroupId)?
|
||||
.CanvasId;
|
||||
|
||||
public string ToYaml()
|
||||
{
|
||||
var serializer = new SerializerBuilder().DisableAliases().Build();
|
||||
var yaml = serializer.Serialize(this);
|
||||
return yaml;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user