before I dive too much more into adding pages in canvas

This commit is contained in:
2024-01-12 15:57:35 -07:00
parent 9f19704724
commit bca8497255
17 changed files with 472 additions and 60 deletions

View File

@@ -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,

View File

@@ -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; }

View File

@@ -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
};
}
}

View File

@@ -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);
}