can update stored quiz with markdown editor

This commit is contained in:
2023-10-12 15:23:40 -06:00
parent a12f6cb1fd
commit 1fb90756e1
2 changed files with 4 additions and 1 deletions

View File

@@ -22,6 +22,7 @@
var newQuiz = LocalQuiz.ParseMarkdown(_quizMarkdownInput);
error = null;
testQuiz = newQuiz;
quizContext.SaveQuiz(newQuiz);
}
catch(QuizMarkdownParseException e)
{

View File

@@ -30,10 +30,12 @@ public record LocalQuizQuestion
return $"{questionTypeIndicator}{textWithSpecificNewline}";
});
var answersText = string.Join(Environment.NewLine, answerArray);
var questionTypeIndicator = QuestionType == "essay" || QuestionType == "short_answer" ? QuestionType : "";
return $@"Points: {Points}
{Text}
{answersText}";
{answersText}
{questionTypeIndicator}";
}
private static readonly string[] validFirstAnswerDelimiters = new string[] { "*a)", "a)", "[ ]", "[*]" };