mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
can create and drag and drop pages
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
@using Management.Web.Shared.Components
|
||||
@using Management.Web.Shared.Components.Quiz
|
||||
|
||||
@inject DragContainer dragContainer
|
||||
@inject QuizEditorContext quizContext
|
||||
@inject NavigationManager Navigation
|
||||
|
||||
@inherits DroppableQuiz
|
||||
|
||||
@code {
|
||||
private void HandleDragStart()
|
||||
{
|
||||
dragContainer.DropCallback = dropCallback;
|
||||
}
|
||||
|
||||
private void HandleDragEnd()
|
||||
{
|
||||
dragContainer.DropCallback = null;
|
||||
}
|
||||
private bool existsInCanvas =>
|
||||
planner.CanvasQuizzes != null
|
||||
? Quiz.QuizIsCreated(planner.CanvasQuizzes)
|
||||
: false;
|
||||
|
||||
|
||||
private void OnClick()
|
||||
{
|
||||
quizContext.Quiz = Quiz;
|
||||
Navigation.NavigateTo("/course/" + planner.LocalCourse?.Settings.Name + "/quiz/" + Quiz.Name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
<div
|
||||
draggable="true"
|
||||
@ondragstart="HandleDragStart"
|
||||
@ondragend="HandleDragEnd"
|
||||
@onclick="OnClick"
|
||||
role="button"
|
||||
>
|
||||
<ModuleItemLayout Name=Quiz.Name IsSyncedWithCanvas=existsInCanvas>
|
||||
@if(!existsInCanvas)
|
||||
{
|
||||
<div class="mx-3 text-body-tertiary">
|
||||
no quiz with same name in canvas
|
||||
</div>
|
||||
}
|
||||
|
||||
<div class="card-text overflow-hidden p-2">
|
||||
<div>Due At: @Quiz.DueAt</div>
|
||||
</div>
|
||||
</ModuleItemLayout>
|
||||
</div>
|
||||
Reference in New Issue
Block a user