sorface / interview-platform

MIT License
0 stars 1 forks source link

Sync code editor with active question #202

Closed VladislavPetyukevich closed 1 month ago

VladislavPetyukevich commented 1 month ago

Update code editor value and content in room state when switch active question in room.

Also send ws events:

Type: "CodeEditor",
Value: {AdditionalData: { value: boolean }}
Type: "ChangeCodeEditor"
Value: "string" // empty string when question doesnt have code editor
blowin commented 1 month ago

@VladislavPetyukevich Now when querying Room/{id}/state instead of CodeEditorContent there will be an object of 2 fields, the object itself will always be filled (cannot be null), and inside the optional property “Content” and there is a sign whether the code editor is enabled “Enabled” (cannot be null).

blowin commented 1 month ago

@VladislavPetyukevich Added “room-code-editor-enabled” event, now you should use it to update the code editor. Example request: { “Type": ‘room-code-editor-enabled’, “Value“: ‘{\’Enabled\”: false }” }

This event is available for 2 different types:

Image