renaming modules doesnt duplicate files anymore

This commit is contained in:
2023-11-28 10:25:22 -07:00
parent dd4ec9a761
commit c08e9b478b
9 changed files with 78 additions and 177 deletions

View File

@@ -1,3 +1,4 @@
using System.Runtime.CompilerServices;
using Microsoft.AspNetCore.Components;
namespace Management.Web.Shared.Components.Quiz;
@@ -41,7 +42,14 @@ public class DroppableQuiz : ComponentBase
);
var NewQuizList = currentModule.Quizzes
.Select(q => q.Name + q.Description != Quiz.Name + Quiz.Description ? q : q with { DueAt = defaultDueTimeDate })
.Select(q =>
q.Name + q.Description != Quiz.Name + Quiz.Description
? q :
q with {
DueAt = defaultDueTimeDate,
LockAt = q.LockAt > defaultDueTimeDate ? q.LockAt : defaultDueTimeDate
}
)
.ToArray();
var updatedModule = currentModule with { Quizzes = NewQuizList };

View File

@@ -17,6 +17,7 @@
planner.StateHasChanged -= reload;
}
private bool syncingAssignmentGroups { get; set; } = false;
private void AddAssignmentGroup()
{
if(planner.LocalCourse != null)
@@ -83,6 +84,13 @@
}
};
}
private async Task SyncAssignmentGroupsWithCanvas()
{
syncingAssignmentGroups = true;
await planner.SyncAssignmentGroups();
syncingAssignmentGroups = false;
}
}
@if(planner.LocalCourse != null)
@@ -119,4 +127,16 @@
+ Assignment Group
</button>
</div>
<button
class="btn btn-outline-secondary"
@onclick="SyncAssignmentGroupsWithCanvas"
disabled="@syncingAssignmentGroups"
>
Sync Assignment Groups With Canvas
</button>
@if(syncingAssignmentGroups)
{
<Spinner />
}
}

View File

@@ -56,6 +56,7 @@
}
}
}
}
<button

View File

@@ -141,11 +141,11 @@
if(!isSyncedWithCanvas)
{
<button
class="btn btn-outline-primarycanvasCourseId"
class="btn btn-outline-primary"
@onclick="Publish"
disabled="@publishing"
>
Publish
Add to Canvas
</button>
}
}