add imutable ids to some exam arrays to detect and log changes between two exams.

This commit is contained in:
Joao Correia
2025-03-02 00:10:57 +00:00
parent 4e3cfec9e8
commit 32cd8495d6
12 changed files with 309 additions and 225 deletions

View File

@@ -18,6 +18,7 @@ import { toast } from 'react-toastify';
import { DragEndEvent } from '@dnd-kit/core';
import { handleMatchSentencesReorder } from '@/stores/examEditor/reorder/local';
import PromptEdit from '../Shared/PromptEdit';
import { uuidv4 } from '@firebase/util';
const MatchSentences: React.FC<{ exercise: MatchSentencesExercise, sectionId: number }> = ({ exercise, sectionId }) => {
const { currentModule, dispatch } = useExamEditorStore();
@@ -98,6 +99,7 @@ const MatchSentences: React.FC<{ exercise: MatchSentencesExercise, sectionId: nu
sentences: [
...local.sentences,
{
uuid: uuidv4(),
id: newId,
sentence: "",
solution: ""