mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
working on markdown quiz experience
This commit is contained in:
@@ -6,40 +6,53 @@
|
||||
|
||||
}
|
||||
|
||||
@((MarkupString)Question.HtmlText)
|
||||
<div class="row justify-content-between">
|
||||
<div class="col">
|
||||
@((MarkupString)Question.HtmlText)
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
@Question.QuestionType
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@foreach(var answer in Question.Answers)
|
||||
{
|
||||
string answerPreview = answer.HtmlText.StartsWith("<p>")
|
||||
? answer.HtmlText.Replace("<p>", "<p class='m-0'>")
|
||||
: answer.HtmlText;
|
||||
|
||||
<div class="mx-3 mb-1 bg-dark px-2 rounded rounded-2 d-flex flex-row border">
|
||||
<div>
|
||||
@if(answer.Correct)
|
||||
{
|
||||
<svg
|
||||
style="width: 1em;"
|
||||
class="me-1"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
d="M4 12.6111L8.92308 17.5L20 6.5"
|
||||
stroke="var(--bs-success)"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div
|
||||
class="me-1"
|
||||
style="width: 1em;"
|
||||
></div>
|
||||
}
|
||||
</div>
|
||||
<div>
|
||||
@((MarkupString)answer.HtmlText)
|
||||
@if(answer.Correct)
|
||||
{
|
||||
<svg
|
||||
style="width: 1em;"
|
||||
class="me-1 my-auto"
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
>
|
||||
<path
|
||||
d="M4 12.6111L8.92308 17.5L20 6.5"
|
||||
stroke="var(--bs-success)"
|
||||
stroke-width="2"
|
||||
stroke-linecap="round"
|
||||
stroke-linejoin="round"
|
||||
/>
|
||||
</svg>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div
|
||||
class="me-1 my-auto"
|
||||
style="width: 1em;"
|
||||
>
|
||||
@if(Question.QuestionType == QuestionType.MULTIPLE_ANSWERS)
|
||||
{
|
||||
<span>[ ]</span>
|
||||
}
|
||||
</div>
|
||||
}
|
||||
<div class="markdownQuizAnswerPreview p-1">
|
||||
@((MarkupString)answerPreview)
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
@@ -23,7 +23,7 @@
|
||||
error = null;
|
||||
testQuiz = newQuiz;
|
||||
}
|
||||
catch(Exception e)
|
||||
catch(QuizMarkdownParseException e)
|
||||
{
|
||||
error = e.Message;
|
||||
}
|
||||
@@ -38,8 +38,6 @@
|
||||
{
|
||||
if (quizContext.Quiz != null)
|
||||
{
|
||||
Console.WriteLine("reloading quiz editor");
|
||||
|
||||
if(quizMarkdownInput == "")
|
||||
{
|
||||
quizMarkdownInput = quizContext.Quiz.ToMarkdown();
|
||||
@@ -66,7 +64,7 @@
|
||||
|
||||
private void onHide()
|
||||
{
|
||||
quizMarkdownInput = "";
|
||||
_quizMarkdownInput = "";
|
||||
quizContext.Quiz = null;
|
||||
}
|
||||
}
|
||||
@@ -95,7 +93,7 @@
|
||||
<div class="col-6">
|
||||
@if(error != null)
|
||||
{
|
||||
<p class="text-danger">@error</p>
|
||||
<p class="text-danger text-truncate">@error</p>
|
||||
}
|
||||
<QuizPreview Quiz="testQuiz" />
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,6 @@
|
||||
}
|
||||
private void reload()
|
||||
{
|
||||
Console.WriteLine(JsonSerializer.Serialize(quizContext.Quiz));
|
||||
this.InvokeAsync(this.StateHasChanged);
|
||||
}
|
||||
public void Dispose()
|
||||
@@ -38,7 +37,7 @@
|
||||
@foreach(var question in Quiz.Questions)
|
||||
{
|
||||
|
||||
<div class="bg-dark-subtle mt-1 p-1 rounded rounded-2">
|
||||
<div class="bg-dark-subtle mt-1 p-1 ps-2 rounded rounded-2">
|
||||
<MarkdownQuestionPreview
|
||||
Question="question"
|
||||
@key="question"
|
||||
|
||||
Reference in New Issue
Block a user