Skip to content

Commit c122be5

Browse files
committed
Added message to trigger save assessment
1 parent 7b5d34d commit c122be5

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

src/commons/application/Application.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ const Application: React.FC = () => {
135135
console.log(`FRONTEND: MCQAnswerMessage: ${message}`);
136136
dispatch(SessionActions.submitAnswer(message.questionId, message.choice));
137137
break;
138+
case MessageTypeNames.AssessmentAnswer:
139+
dispatch(SessionActions.submitAnswer(message.questionId, message.answer));
140+
break;
138141
}
139142
});
140143
// eslint-disable-next-line react-hooks/exhaustive-deps

src/features/vscode/messages.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,13 @@ const Messages = createMessages({
9191
chapter,
9292
variant
9393
}),
94-
ResetEditor: (
95-
workspaceLocation: VscWorkspaceLocation,
96-
initialCode: string,
97-
) => ({
94+
ResetEditor: (workspaceLocation: VscWorkspaceLocation, initialCode: string) => ({
9895
workspaceLocation,
99-
initialCode,
96+
initialCode
97+
}),
98+
AssessmentAnswer: (questionId: number, answer: string) => ({
99+
questionId,
100+
answer
100101
})
101102
});
102103

0 commit comments

Comments
 (0)