mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
fixed bug where rubric was resetting description
This commit is contained in:
@@ -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; }
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
Rubric = rubric,
|
||||
PointsPossible = totalRubricPoints,
|
||||
};
|
||||
Console.WriteLine(assignmentContext.Assignment.Description);
|
||||
assignmentContext.SaveAssignment(newAssignment);
|
||||
StateHasChanged();
|
||||
}
|
||||
|
||||
@@ -45,6 +45,7 @@ public class AssignmentEditorContext
|
||||
)
|
||||
.ToArray();
|
||||
|
||||
Assignment = newAssignment;
|
||||
planner.LocalCourse = planner.LocalCourse with { Modules = updatedModules };
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user