refactored assignment markdown parsing and creation to their own classes

This commit is contained in:
2024-01-05 08:31:39 -07:00
parent e6cc3c2a3c
commit 9f4c7bf380
3 changed files with 53 additions and 51 deletions

View File

@@ -50,11 +50,11 @@ public static class LocalAssignmentMarkdownParser
private static List<string> parseSubmissionTypes(string input)
{
input = input.Replace("\r\n", "\n");
List<string> submissionTypes = new List<string>();
List<string> submissionTypes = [];
// Define a regular expression pattern to match the bulleted list items
string startOfTypePattern = @"- (.+)";
Regex regex = new Regex(startOfTypePattern);
Regex regex = new(startOfTypePattern);
var words = input.Split("SubmissionTypes:");
var inputAfterSubmissionTypes = words[1];