mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
renaming modules doesnt duplicate files anymore
This commit is contained in:
@@ -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 };
|
||||
|
||||
@@ -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 />
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
<button
|
||||
|
||||
@@ -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>
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user