From eab51fe1a9949d2cf37bc31f6fc5483f1ee9e96d Mon Sep 17 00:00:00 2001 From: Rotimi Best Date: Mon, 27 Sep 2021 08:38:23 +0300 Subject: [PATCH] CLASSROOMIO-T-14: Make exercises draggable + replace buttons with icons --- .../Lesson/Exercise/EditMode.svelte | 384 +++++++++++------- .../Lesson/Exercise/ViewMode.svelte | 2 +- .../components/Lesson/Exercise/index.svelte | 51 ++- .../components/Lesson/Exercises/index.svelte | 1 + src/components/PageBody/index.svelte | 4 +- src/components/QuestionContainer/index.svelte | 6 +- src/components/ToolTip/index.svelte | 18 +- src/utils/services/courses/index.js | 5 +- 8 files changed, 294 insertions(+), 177 deletions(-) diff --git a/src/components/Course/components/Lesson/Exercise/EditMode.svelte b/src/components/Course/components/Lesson/Exercise/EditMode.svelte index a0456e0e..3d0d949b 100644 --- a/src/components/Course/components/Lesson/Exercise/EditMode.svelte +++ b/src/components/Course/components/Lesson/Exercise/EditMode.svelte @@ -1,4 +1,5 @@ -
- - ($questionnaire.is_title_dirty = true)} - /> - { - $questionnaire.due_by = e.target.value; - $questionnaire.is_due_by_dirty = true; - }} - /> - ($questionnaire.is_description_dirty = true)} - /> - + (editDescription = false)} + bind:open={editDescription} + width="w-2/4" + modalHeading="Update description" +> +
+ + ($questionnaire.is_title_dirty = true)} + /> + { + $questionnaire.due_by = e.target.value; + $questionnaire.is_due_by_dirty = true; + }} + /> + ($questionnaire.is_description_dirty = true)} + /> + +
+
+
{#if Object.values(errors).length}
{/if} +
+ {#each questions as question (question.id)} + + { + question.is_dirty = true; + }} + > +
+
+ { + question.is_dirty = true; + }} + /> +
- {#each filterOutDeleted($questionnaire.questions) as question, index} - - { - question.is_dirty = true; - }} - > -
-
- { - console.log('title changed', question.title); - question.is_dirty = true; - }} - /> -
- - -