mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
added quiz popup form and displaying on month
This commit is contained in:
@@ -15,8 +15,6 @@
|
||||
if (assignmentContext.Assignment != null)
|
||||
{
|
||||
Description = assignmentContext.Assignment.Description;
|
||||
Console.WriteLine("loaded description");
|
||||
Console.WriteLine(Description);
|
||||
Preview = Markdown.ToHtml(Description);
|
||||
TemplateId = assignmentContext.Assignment.TemplateId;
|
||||
UseTemplate = TemplateId != null && TemplateId != "";
|
||||
|
||||
@@ -118,39 +118,37 @@
|
||||
<Body>
|
||||
@if (assignmentContext.Assignment != null)
|
||||
{
|
||||
<form @onsubmit:preventDefault="true">
|
||||
<div class="m-1">
|
||||
<label class="form-label">
|
||||
Name
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
@bind="name"
|
||||
@oninput="handleNameChange"
|
||||
/>
|
||||
</div>
|
||||
<div class="m-1">
|
||||
<AssignmentDescriptionEditor />
|
||||
</div>
|
||||
<div class="m-1">
|
||||
<label class="form-label">
|
||||
Name
|
||||
</label>
|
||||
<input
|
||||
class="form-control"
|
||||
@bind="name"
|
||||
@oninput="handleNameChange"
|
||||
/>
|
||||
</div>
|
||||
<div class="m-1">
|
||||
<AssignmentDescriptionEditor />
|
||||
</div>
|
||||
|
||||
<div class="form-check m-1">
|
||||
<input
|
||||
class="form-check-input"
|
||||
id="lockAtDueDate"
|
||||
type="checkbox"
|
||||
@bind="lockAtDueDate"
|
||||
@oninput="handleLockAtDueDateChange"
|
||||
/>
|
||||
<label
|
||||
class="form-check-label"
|
||||
for="lockAtDueDate"
|
||||
>
|
||||
Lock At Due Date
|
||||
</label>
|
||||
</div>
|
||||
<RubricEditor />
|
||||
<SubmissionTypeSelector />
|
||||
</form>
|
||||
<div class="form-check m-1">
|
||||
<input
|
||||
class="form-check-input"
|
||||
id="lockAtDueDate"
|
||||
type="checkbox"
|
||||
@bind="lockAtDueDate"
|
||||
@oninput="handleLockAtDueDateChange"
|
||||
/>
|
||||
<label
|
||||
class="form-check-label"
|
||||
for="lockAtDueDate"
|
||||
>
|
||||
Lock At Due Date
|
||||
</label>
|
||||
</div>
|
||||
<RubricEditor />
|
||||
<SubmissionTypeSelector />
|
||||
}
|
||||
</Body>
|
||||
<Footer>
|
||||
|
||||
@@ -1,42 +1,41 @@
|
||||
@using Management.Web.Shared.Components
|
||||
@inject QuizEditorContext quizContext
|
||||
|
||||
@code {
|
||||
public LocalModule Module { get; set; } = default!;
|
||||
private Modal? modal { get; set; }
|
||||
|
||||
[Parameter]
|
||||
[EditorRequired]
|
||||
public LocalQuiz Quiz
|
||||
protected override void OnInitialized()
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = default!;
|
||||
|
||||
[Parameter]
|
||||
[EditorRequired]
|
||||
public bool Show { get; set; }
|
||||
|
||||
[Parameter]
|
||||
public Action OnHide { get; set; } = () => { };
|
||||
private Modal? Modal { get; set; }
|
||||
|
||||
private void submitHandler ()
|
||||
quizContext.StateHasChanged += reload;
|
||||
}
|
||||
private void reload()
|
||||
{
|
||||
|
||||
if (quizContext.Quiz != null)
|
||||
{
|
||||
//initialize
|
||||
modal?.Show();
|
||||
this.InvokeAsync(this.StateHasChanged);
|
||||
}
|
||||
}
|
||||
public void Dispose()
|
||||
{
|
||||
quizContext.StateHasChanged -= reload;
|
||||
}
|
||||
}
|
||||
|
||||
<Modal @ref="Modal" OnHide="@(() => OnHide())">
|
||||
<Modal @ref="modal" OnHide="() => quizContext.Quiz = null" >
|
||||
<Title>
|
||||
@Quiz.Name
|
||||
@quizContext.Quiz?.Name
|
||||
</Title>
|
||||
<Body>
|
||||
<form @onsubmit:preventDefault="true" @onsubmit="submitHandler">
|
||||
|
||||
</form>
|
||||
</Body>
|
||||
<Footer>
|
||||
<button class="btn btn-primary" @onclick="submitHandler">
|
||||
Save
|
||||
<button
|
||||
class="btn btn-primary"
|
||||
@onclick="() => modal?.Hide()"
|
||||
>
|
||||
Done
|
||||
</button>
|
||||
</Footer>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user