From e4cae72856c4cace44d609326f99820fdaff4eda Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Thu, 9 Nov 2023 15:27:34 -0700 Subject: [PATCH] got toggle help to still work --- Management.Web/Pages/QuizFormPage.razor | 60 +++++++++++++++++-- .../Quiz/Markdown/MarkdownQuizForm.razor | 55 +---------------- Management/Models/Local/LocalQuizQuestion.cs | 5 +- 3 files changed, 62 insertions(+), 58 deletions(-) diff --git a/Management.Web/Pages/QuizFormPage.razor b/Management.Web/Pages/QuizFormPage.razor index 01d5136..8ec6f35 100644 --- a/Management.Web/Pages/QuizFormPage.razor +++ b/Management.Web/Pages/QuizFormPage.razor @@ -102,6 +102,44 @@ $"https://snow.instructure.com/courses/{planner.LocalCourse?.Settings.CanvasId}/quizzes/{quizInCanvas?.Id}"; private int? quizPoints => quizContext.Quiz?.Questions.Sum(q => q.Points); + private bool showHelp = false; + + private readonly static string exampleMarkdownQuestion = @"QUESTION REFERENCE +--- +Points: 2 +this is a question? +*a) correct +b) not correct +--- +points: 1 +question goes here +[*] correct +[ ] not correct +[] not correct +--- +the points default to 1? +*a) true +b) false +--- +Markdown is supported + +- like +- this +- list + +[*] true +[ ] false +--- +This is a one point essay question +essay +--- +points: 4 +this is a short answer question +short_answer +--- +points: 4 +the underscore is optional +short answer"; }
@@ -149,8 +187,15 @@
+ class="flex-grow-1 w-100 d-flex justify-content-center border rounded-4 bg-dark-subtle" + style="min-height: 10%; max-width: 100%;"> + + @if(showHelp) + { +
+        @exampleMarkdownQuestion
+      
+ }
@if (quizContext.Quiz != null) { @@ -159,8 +204,15 @@
-
-
+
+ +
+
@if (quizContext.Quiz != null) {
diff --git a/Management.Web/Shared/Components/Quiz/Markdown/MarkdownQuizForm.razor b/Management.Web/Shared/Components/Quiz/Markdown/MarkdownQuizForm.razor index 1e2d120..96b51be 100644 --- a/Management.Web/Shared/Components/Quiz/Markdown/MarkdownQuizForm.razor +++ b/Management.Web/Shared/Components/Quiz/Markdown/MarkdownQuizForm.razor @@ -8,7 +8,6 @@ private LocalQuiz testQuiz; private string? error { get; set; } = null; - private bool showHelp = false; private string _quizMarkdownInput { get; set; } = ""; private string quizMarkdownInput { @@ -54,53 +53,11 @@ quizContext.StateHasChanged -= reload; } - private readonly static string exampleMarkdownQuestion = @"QUESTION REFERENCE ---- -Points: 2 -this is a question? -*a) correct -b) not correct ---- -points: 1 -question goes here -[*] correct -[ ] not correct -[] not correct ---- -the points default to 1? -*a) true -b) false ---- -Markdown is supported - -- like -- this -- list - -[*] true -[ ] false ---- -This is a one point essay question -essay ---- -points: 4 -this is a short answer question -short_answer ---- -points: 4 -the underscore is optional -short answer"; }
-
- @if(showHelp) - { -
-        @exampleMarkdownQuestion
-      
- } +
@*