From 079c2d04ed113ec32ed6b42b1f92d90875a7255b Mon Sep 17 00:00:00 2001 From: Vitomir Budimir Date: Thu, 18 Jan 2024 12:07:30 +0100 Subject: [PATCH 1/3] fix(blank): droppable blank size and margins --- .../components/droppable-blank.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/droppable-blank.tsx b/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/droppable-blank.tsx index c84d50858c..d9845abf0d 100644 --- a/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/droppable-blank.tsx +++ b/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/droppable-blank.tsx @@ -37,12 +37,12 @@ export function DroppableBlank(props: DroppableBlankProps) { - {children} + {children || '_'} ) } From 1888f9aed1ff7aea2e4b6bbcf7b7146643d8789f Mon Sep 17 00:00:00 2001 From: Vitomir Budimir Date: Thu, 18 Jan 2024 14:09:44 +0100 Subject: [PATCH 2/3] fix(blank): add space between draggable answers + cursor grab --- .../components/blank-draggable-answer.tsx | 8 +++++--- .../src/plugins/fill-in-the-blanks-exercise/renderer.tsx | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/blank-draggable-answer.tsx b/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/blank-draggable-answer.tsx index c0f25194da..ef32e18c9d 100644 --- a/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/blank-draggable-answer.tsx +++ b/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/blank-draggable-answer.tsx @@ -8,11 +8,12 @@ export const blankDraggableAnswerDragType = 'blank-solution' interface BlankDraggableAnswerProps { text: string draggableId: DraggableId + isPending?: boolean isAnswerCorrect?: boolean } export function BlankDraggableAnswer(props: BlankDraggableAnswerProps) { - const { draggableId, text, isAnswerCorrect } = props + const { draggableId, text, isPending, isAnswerCorrect } = props const [, dragRef] = useDrag({ type: blankDraggableAnswerDragType, @@ -22,9 +23,10 @@ export function BlankDraggableAnswer(props: BlankDraggableAnswerProps) { return ( diff --git a/packages/editor/src/plugins/fill-in-the-blanks-exercise/renderer.tsx b/packages/editor/src/plugins/fill-in-the-blanks-exercise/renderer.tsx index 8f0ecfb623..e5850dfe05 100644 --- a/packages/editor/src/plugins/fill-in-the-blanks-exercise/renderer.tsx +++ b/packages/editor/src/plugins/fill-in-the-blanks-exercise/renderer.tsx @@ -131,7 +131,7 @@ export function FillInTheBlanksRenderer(props: FillInTheBlanksRendererProps) { {draggables.map((draggable, index) => locationOfDraggables.get(draggable.draggableId) ? null : ( - + ) )} From 01fe6c61c2e3d2a7684d51e36b82cc3a9d02472e Mon Sep 17 00:00:00 2001 From: Vitomir Budimir Date: Thu, 18 Jan 2024 16:00:53 +0100 Subject: [PATCH 3/3] fix(blank): increase space between draggable answers --- .../components/blank-draggable-answer.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/blank-draggable-answer.tsx b/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/blank-draggable-answer.tsx index ef32e18c9d..057f9d9a74 100644 --- a/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/blank-draggable-answer.tsx +++ b/packages/editor/src/plugins/fill-in-the-blanks-exercise/components/blank-draggable-answer.tsx @@ -26,7 +26,7 @@ export function BlankDraggableAnswer(props: BlankDraggableAnswerProps) { 'cursor-grab rounded-full border border-editor-primary-300 bg-editor-primary-100 px-2', isAnswerCorrect && 'border-green-500', isAnswerCorrect === false && 'border-red-500', - isPending && 'mr-1' + isPending && 'mr-2' )} ref={dragRef} >