added quiz popup form and displaying on month

This commit is contained in:
2023-08-11 20:13:55 -06:00
parent d16cd53392
commit 93c1c754cd
12 changed files with 160 additions and 68 deletions

View File

@@ -1,4 +1,3 @@
@using Management.Web.Shared.Components.AssignmentForm
@inject DragContainer dragContainer
@inject CoursePlanner planner

View File

@@ -27,7 +27,8 @@
}
private IEnumerable<LocalAssignment> TodaysAssignments {
private IEnumerable<LocalAssignment> TodaysAssignments
{
get
{
if(planner.LocalCourse == null || date == null)
@@ -38,6 +39,19 @@
.Where(a => a.DueAt.Date == date?.Date);
}
}
private IEnumerable<LocalQuiz> todaysQuizzes
{
get
{
if(planner.LocalCourse == null || date == null)
return Enumerable.Empty<LocalQuiz>();
else
return planner.LocalCourse.Modules
.SelectMany(m => m.Quizzes)
.Where(q => q.DueAt.Date == date?.Date);
}
}
private string calculatedClass
{
get
@@ -78,7 +92,6 @@
void OnDrop()
{
@* System.Console.WriteLine("on drop"); *@
dragging = false;
if(dragContainer.DropCallback == null){
System.Console.WriteLine("no drop callback set");
@@ -105,5 +118,10 @@
{
<AssignmentInDay Assignment="assignment" @key="@assignment" />
}
@foreach(var quiz in todaysQuizzes)
{
<QuizInDay Quiz="quiz" @key="@quiz" />
}
</div>
</div>

View File

@@ -0,0 +1,29 @@
@using Management.Web.Shared.Components.Quiz
@inject DragContainer dragContainer
@inject CoursePlanner planner
@inject QuizEditorContext quizContext
@inherits DroppableQuiz
@code {
private void HandleDragStart()
{
dragContainer.DropCallback = dropCallback;
}
private void HandleDragEnd()
{
dragContainer.DropCallback = null;
}
}
<div
draggable="true"
@ondragstart="HandleDragStart"
@ondragend="HandleDragEnd"
@onclick="@(() => quizContext.Quiz = Quiz)"
role="button"
>
@Quiz.Name
</div>

View File

@@ -1,4 +1,5 @@
@using System.Linq
@using Management.Web.Shared.Semester.Day
@inject CoursePlanner planner