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:
@@ -13,22 +13,29 @@
|
|||||||
private void reload()
|
private void reload()
|
||||||
{
|
{
|
||||||
if (assignmentContext.Assignment != null)
|
if (assignmentContext.Assignment != null)
|
||||||
|
{
|
||||||
|
if(description == string.Empty)
|
||||||
{
|
{
|
||||||
description = assignmentContext.Assignment.Description;
|
description = assignmentContext.Assignment.Description;
|
||||||
descriptionForPreview = description;
|
descriptionForPreview = description;
|
||||||
|
this.InvokeAsync(this.StateHasChanged);
|
||||||
|
}
|
||||||
|
if(TemplateId == string.Empty || TemplateId == null)
|
||||||
|
{
|
||||||
TemplateId = assignmentContext.Assignment.TemplateId;
|
TemplateId = assignmentContext.Assignment.TemplateId;
|
||||||
UseTemplate = TemplateId != null && TemplateId != "";
|
UseTemplate = TemplateId != null && TemplateId != "";
|
||||||
VariableValues = assignmentContext.Assignment.TemplateVariables;
|
VariableValues = assignmentContext.Assignment.TemplateVariables;
|
||||||
this.InvokeAsync(this.StateHasChanged);
|
this.InvokeAsync(this.StateHasChanged);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
assignmentContext.StateHasChanged -= reload;
|
assignmentContext.StateHasChanged -= reload;
|
||||||
}
|
}
|
||||||
|
|
||||||
private string description { get; set; } = default!;
|
private string description { get; set; } = string.Empty;
|
||||||
private string descriptionForPreview { get; set; } = default!;
|
private string descriptionForPreview { get; set; } = string.Empty;
|
||||||
public bool? UseTemplate { get; set; } = null;
|
public bool? UseTemplate { get; set; } = null;
|
||||||
|
|
||||||
public string? TemplateId { get; set; }
|
public string? TemplateId { get; set; }
|
||||||
|
|||||||
@@ -38,6 +38,7 @@
|
|||||||
Rubric = rubric,
|
Rubric = rubric,
|
||||||
PointsPossible = totalRubricPoints,
|
PointsPossible = totalRubricPoints,
|
||||||
};
|
};
|
||||||
|
Console.WriteLine(assignmentContext.Assignment.Description);
|
||||||
assignmentContext.SaveAssignment(newAssignment);
|
assignmentContext.SaveAssignment(newAssignment);
|
||||||
StateHasChanged();
|
StateHasChanged();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ public class AssignmentEditorContext
|
|||||||
)
|
)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
|
|
||||||
|
Assignment = newAssignment;
|
||||||
planner.LocalCourse = planner.LocalCourse with { Modules = updatedModules };
|
planner.LocalCourse = planner.LocalCourse with { Modules = updatedModules };
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user