mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-25 23:28:33 -06:00
can update stored quiz with markdown editor
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
var newQuiz = LocalQuiz.ParseMarkdown(_quizMarkdownInput);
|
var newQuiz = LocalQuiz.ParseMarkdown(_quizMarkdownInput);
|
||||||
error = null;
|
error = null;
|
||||||
testQuiz = newQuiz;
|
testQuiz = newQuiz;
|
||||||
|
quizContext.SaveQuiz(newQuiz);
|
||||||
}
|
}
|
||||||
catch(QuizMarkdownParseException e)
|
catch(QuizMarkdownParseException e)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -30,10 +30,12 @@ public record LocalQuizQuestion
|
|||||||
return $"{questionTypeIndicator}{textWithSpecificNewline}";
|
return $"{questionTypeIndicator}{textWithSpecificNewline}";
|
||||||
});
|
});
|
||||||
var answersText = string.Join(Environment.NewLine, answerArray);
|
var answersText = string.Join(Environment.NewLine, answerArray);
|
||||||
|
var questionTypeIndicator = QuestionType == "essay" || QuestionType == "short_answer" ? QuestionType : "";
|
||||||
|
|
||||||
return $@"Points: {Points}
|
return $@"Points: {Points}
|
||||||
{Text}
|
{Text}
|
||||||
{answersText}";
|
{answersText}
|
||||||
|
{questionTypeIndicator}";
|
||||||
}
|
}
|
||||||
|
|
||||||
private static readonly string[] validFirstAnswerDelimiters = new string[] { "*a)", "a)", "[ ]", "[*]" };
|
private static readonly string[] validFirstAnswerDelimiters = new string[] { "*a)", "a)", "[ ]", "[*]" };
|
||||||
|
|||||||
Reference in New Issue
Block a user