mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
before I dive too much more into adding pages in canvas
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
|
||||
namespace CanvasModel.Pages;
|
||||
public record PageModel (
|
||||
public record CanvasPage (
|
||||
[property: JsonPropertyName("page_id")] string PageId,
|
||||
[property: JsonPropertyName("url")] string Url,
|
||||
[property: JsonPropertyName("title")] string Title,
|
||||
|
||||
@@ -20,7 +20,6 @@ public record LocalAssignment: IModuleItem
|
||||
}
|
||||
}
|
||||
public string Description { get; init; } = "";
|
||||
// public bool LockAtDueDate { get; init; }
|
||||
public DateTime? LockAt { get; init; }
|
||||
public DateTime DueAt { get; init; }
|
||||
public string? LocalAssignmentGroupName { get; init; }
|
||||
|
||||
@@ -5,6 +5,7 @@ public record LocalCoursePage: IModuleItem
|
||||
public required string Name { get; init; }
|
||||
public required string Text { get; set; }
|
||||
public DateTime DueAt { get; init; }
|
||||
public string GetBodyHtml() => Markdig.Markdown.ToHtml(Text);
|
||||
|
||||
public string ToMarkdown()
|
||||
{
|
||||
@@ -34,6 +35,7 @@ public record LocalCoursePage: IModuleItem
|
||||
Text = text
|
||||
};
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -7,4 +7,11 @@ public record LocalModule
|
||||
public IEnumerable<LocalAssignment> Assignments { get; init; } = [];
|
||||
public IEnumerable<LocalQuiz> Quizzes { get; init; } = [];
|
||||
public IEnumerable<LocalCoursePage> Pages { get; init; } = [];
|
||||
|
||||
public IEnumerable<IModuleItem> SortedModuleItems =>
|
||||
Enumerable.Empty<IModuleItem>()
|
||||
.Concat(Assignments)
|
||||
.Concat(Quizzes)
|
||||
.Concat(Pages)
|
||||
.OrderBy(i => i.DueAt);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user