From 8d83e0ecd4844264f66c3b36902b4c2af2a6f88e Mon Sep 17 00:00:00 2001 From: Alex Mickelson Date: Wed, 15 Nov 2023 11:23:36 -0700 Subject: [PATCH] added monaco editor to assignment page --- .vscode/launch.json | 33 ++++ .vscode/tasks.json | 41 +++++ Management.Web/Pages/AssignmentFormPage.razor | 5 +- Management.Web/Pages/_Host.cshtml | 8 +- .../AssignmentDescriptionEditor.razor | 21 +-- .../AssignmentForm/AssignmentForm.razor | 170 +++++++++--------- .../AssignmentForm/RubricMarkdownEditor.razor | 25 ++- .../Components/Forms/ButtonSelect.razor | 6 +- .../Shared/Components/MonacoTextArea.razor | 11 +- Management/Models/Local/LocalQuiz.cs | 2 + Management/Models/Local/LocalQuizQuestion.cs | 3 +- .../Models/Local/LocalQuizQuestionAnswer.cs | 2 +- .../Services/Canvas/CanvasQuizService.cs | 2 +- 13 files changed, 201 insertions(+), 128 deletions(-) create mode 100644 .vscode/launch.json create mode 100644 .vscode/tasks.json diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..e50248a --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,33 @@ +{ + // Use IntelliSense to learn about possible attributes. + // Hover to view descriptions of existing attributes. + // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 + "version": "0.2.0", + "configurations": [ + { + "name": ".NET Core Launch (web)", + "type": "coreclr", + "request": "launch", + "preLaunchTask": "build", + "program": "${workspaceFolder}/Management.Web/bin/Debug/net8.0/Management.Web.dll", + "args": [], + "cwd": "${workspaceFolder}/Management.Web", + "stopAtEntry": false, + "serverReadyAction": { + "action": "openExternally", + "pattern": "\\bNow listening on:\\s+(https?://\\S+)" + }, + "env": { + "ASPNETCORE_ENVIRONMENT": "Development" + }, + "sourceFileMap": { + "/Views": "${workspaceFolder}/Views" + } + }, + { + "name": ".NET Core Attach", + "type": "coreclr", + "request": "attach" + } + ] +} \ No newline at end of file diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..a44ef38 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,41 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "build", + "command": "dotnet", + "type": "process", + "args": [ + "build", + "${workspaceFolder}/Management.Web/Management.Web.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "publish", + "command": "dotnet", + "type": "process", + "args": [ + "publish", + "${workspaceFolder}/Management.Web/Management.Web.csproj", + "/property:GenerateFullPaths=true", + "/consoleloggerparameters:NoSummary;ForceNoAlign" + ], + "problemMatcher": "$msCompile" + }, + { + "label": "watch", + "command": "dotnet", + "type": "process", + "args": [ + "watch", + "run", + "--project", + "${workspaceFolder}/Management.Web/Management.Web.csproj" + ], + "problemMatcher": "$msCompile" + } + ] +} \ No newline at end of file diff --git a/Management.Web/Pages/AssignmentFormPage.razor b/Management.Web/Pages/AssignmentFormPage.razor index 75b2ae2..96c9ff5 100644 --- a/Management.Web/Pages/AssignmentFormPage.razor +++ b/Management.Web/Pages/AssignmentFormPage.razor @@ -56,7 +56,7 @@ } } - +
@if (loading) { @@ -65,4 +65,5 @@ @if (planner.LocalCourse != null && assignmentContext.Assignment != null) { -} \ No newline at end of file +} +
\ No newline at end of file diff --git a/Management.Web/Pages/_Host.cshtml b/Management.Web/Pages/_Host.cshtml index 3b5bc76..77bda7d 100644 --- a/Management.Web/Pages/_Host.cshtml +++ b/Management.Web/Pages/_Host.cshtml @@ -18,15 +18,17 @@ - - + + - + + + diff --git a/Management.Web/Shared/Components/AssignmentForm/AssignmentDescriptionEditor.razor b/Management.Web/Shared/Components/AssignmentForm/AssignmentDescriptionEditor.razor index da5f9dd..1114ff5 100644 --- a/Management.Web/Shared/Components/AssignmentForm/AssignmentDescriptionEditor.razor +++ b/Management.Web/Shared/Components/AssignmentForm/AssignmentDescriptionEditor.razor @@ -42,9 +42,8 @@ .AssignmentTemplates .FirstOrDefault(t => t.Id == TemplateId); - private void handleNewDescription(ChangeEventArgs e) + private void handleNewDescription(string newDescription) { - var newDescription = e.Value?.ToString(); if (newDescription != string.Empty) { descriptionForPreview = newDescription; @@ -65,25 +64,17 @@ @if(assignmentContext.Assignment != null && planner.LocalCourse != null) { -
-
- -
-
- HTML Preview -
-
-
+
-