mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
added template editor
This commit is contained in:
18
Management/Models/Local/AssignmentTemplate.cs
Normal file
18
Management/Models/Local/AssignmentTemplate.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
namespace LocalModels;
|
||||
|
||||
public record AssignmentTemplate
|
||||
{
|
||||
public string Id { get; set; } = String.Empty;
|
||||
public string Name { get; set; } = String.Empty;
|
||||
public string Markdown { get; set; } = String.Empty;
|
||||
|
||||
public static IEnumerable<string> GetVariables(string markdown)
|
||||
{
|
||||
string pattern = "{{(.*?)}}";
|
||||
MatchCollection matches = Regex.Matches(markdown, pattern);
|
||||
|
||||
return matches.Select(match => match.Groups[1].Value);
|
||||
}
|
||||
}
|
||||
@@ -8,16 +8,16 @@ public record RubricItem
|
||||
|
||||
public enum SubmissionType
|
||||
{
|
||||
online_text_entry,
|
||||
online_upload,
|
||||
online_quiz,
|
||||
none,
|
||||
on_paper,
|
||||
discussion_topic,
|
||||
external_tool,
|
||||
online_upload,
|
||||
online_text_entry,
|
||||
online_url,
|
||||
media_recording,
|
||||
student_annotation,
|
||||
none,
|
||||
}
|
||||
|
||||
public record LocalAssignment
|
||||
@@ -9,6 +9,8 @@ public record LocalCourse
|
||||
public DateTime StartDate { get; init; }
|
||||
public DateTime EndDate { get; init; }
|
||||
public SimpleTimeOnly DefaultDueTime { get; init; } = new SimpleTimeOnly();
|
||||
public IEnumerable<AssignmentTemplate> AssignmentTemplates { get; init; } =
|
||||
Enumerable.Empty<AssignmentTemplate>();
|
||||
}
|
||||
|
||||
public record SimpleTimeOnly
|
||||
|
||||
Reference in New Issue
Block a user