fixed self closing tag issue

This commit is contained in:
2023-10-24 15:43:17 -06:00
parent c2f916f2c3
commit 860c387c8d
3 changed files with 29 additions and 2 deletions

View File

@@ -79,7 +79,8 @@ public static partial class AssignmentSyncronizationExtensions
var localHtmlDescription = localAssignment
.GetDescriptionHtml()
.Replace("<hr />", "<hr>")
.Replace("<hr />", "<hr>") // self closing tags are hard
.Replace("<br />", "<br>")
.Replace("&gt;", "")
.Replace("&lt;", "")
.Replace(">", "")
@@ -94,6 +95,7 @@ public static partial class AssignmentSyncronizationExtensions
canvasHtmlDescription = CanvasLinkTagRegex().Replace(canvasHtmlDescription, "");
canvasHtmlDescription = canvasHtmlDescription
.Replace("<hr />", "<hr>")
.Replace("<br />", "<br>")
.Replace("&gt;", "")
.Replace("&lt;", "")
.Replace(">", "")

View File

@@ -47,7 +47,13 @@ public record LocalAssignment
public DateTime? LockAt { get; init; }
public DateTime DueAt { get; init; }
public string? LocalAssignmentGroupId { get; init; }
public int PointsPossible { get; init; }
public int PointsPossible
{
get
{
return Rubric.Sum(r => r.IsExtraCredit ? 0 : r.Points);
}
}
public IEnumerable<string> SubmissionTypes { get; init; } = Array.Empty<string>();
public string GetRubricHtml()