added template editor

This commit is contained in:
2023-07-26 15:51:44 -06:00
parent 9c547b3435
commit 87fc062dfb
14 changed files with 435 additions and 97 deletions

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

View File

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

View File

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