diff --git a/Management.Web/Shared/Components/AssignmentForm/AssignmentDescriptionEditor.razor b/Management.Web/Shared/Components/AssignmentForm/AssignmentDescriptionEditor.razor index c73a980..c2f3787 100644 --- a/Management.Web/Shared/Components/AssignmentForm/AssignmentDescriptionEditor.razor +++ b/Management.Web/Shared/Components/AssignmentForm/AssignmentDescriptionEditor.razor @@ -14,12 +14,19 @@ { if (assignmentContext.Assignment != null) { - description = assignmentContext.Assignment.Description; - descriptionForPreview = description; - TemplateId = assignmentContext.Assignment.TemplateId; - UseTemplate = TemplateId != null && TemplateId != ""; - VariableValues = assignmentContext.Assignment.TemplateVariables; - this.InvokeAsync(this.StateHasChanged); + if(description == string.Empty) + { + description = assignmentContext.Assignment.Description; + descriptionForPreview = description; + this.InvokeAsync(this.StateHasChanged); + } + if(TemplateId == string.Empty || TemplateId == null) + { + TemplateId = assignmentContext.Assignment.TemplateId; + UseTemplate = TemplateId != null && TemplateId != ""; + VariableValues = assignmentContext.Assignment.TemplateVariables; + this.InvokeAsync(this.StateHasChanged); + } } } public void Dispose() @@ -27,8 +34,8 @@ assignmentContext.StateHasChanged -= reload; } - private string description { get; set; } = default!; - private string descriptionForPreview { get; set; } = default!; + private string description { get; set; } = string.Empty; + private string descriptionForPreview { get; set; } = string.Empty; public bool? UseTemplate { get; set; } = null; public string? TemplateId { get; set; } diff --git a/Management.Web/Shared/Components/AssignmentForm/RubricEditor.razor b/Management.Web/Shared/Components/AssignmentForm/RubricEditor.razor index 3770553..a5323b5 100644 --- a/Management.Web/Shared/Components/AssignmentForm/RubricEditor.razor +++ b/Management.Web/Shared/Components/AssignmentForm/RubricEditor.razor @@ -38,6 +38,7 @@ Rubric = rubric, PointsPossible = totalRubricPoints, }; + Console.WriteLine(assignmentContext.Assignment.Description); assignmentContext.SaveAssignment(newAssignment); StateHasChanged(); } diff --git a/Management/Features/Configuration/AssignmentEditorContext.cs b/Management/Features/Configuration/AssignmentEditorContext.cs index df5f70d..d37a59c 100644 --- a/Management/Features/Configuration/AssignmentEditorContext.cs +++ b/Management/Features/Configuration/AssignmentEditorContext.cs @@ -45,6 +45,7 @@ public class AssignmentEditorContext ) .ToArray(); + Assignment = newAssignment; planner.LocalCourse = planner.LocalCourse with { Modules = updatedModules }; } }