{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/coderpad/json-schema/coderpad-playback-events-schema.json",
  "title": "playback_events",
  "description": "what the candidate did while answering a question, as replayed in the detailed report",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/coderpad-tests-api-openapi.yml#/components/schemas/playback_events",
  "type": "object",
  "properties": {
    "events": {
      "type": "array",
      "description": "the events, in playback order. Empty when the question has no playback: tests taken before January 2021, and questions other than coding ones before June 2023",
      "items": {
        "$ref": "#/$defs/playback_event"
      }
    }
  },
  "$defs": {
    "playback_answer_diagnostic": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "message of the diagnostic"
        },
        "severity": {
          "type": "string",
          "description": "severity of the diagnostic, absent when the editor reported an unknown one",
          "enum": [
            "ERROR",
            "WARNING",
            "INFO",
            "HINT"
          ]
        },
        "range": {
          "$ref": "#/$defs/playback_text_range"
        },
        "source": {
          "type": "string",
          "description": "tool that reported the diagnostic"
        },
        "tags": {
          "type": "array",
          "description": "tags of the diagnostic, as reported by the editor",
          "items": {
            "type": "string",
            "description": "tags of the diagnostic, as reported by the editor"
          }
        }
      },
      "description": "every diagnostic shown after the change"
    },
    "playback_answer_diagnostics_changed_data": {
      "type": "object",
      "properties": {
        "diagnostics": {
          "type": "array",
          "description": "every diagnostic shown after the change",
          "items": {
            "$ref": "#/$defs/playback_answer_diagnostic"
          }
        }
      }
    },
    "playback_answer_diagnostics_changed_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "ANSWER_DIAGNOSTICS_CHANGED (verbose): the errors, warnings and hints shown in the answer editor of a CODE question changed",
          "enum": [
            "ANSWER_DIAGNOSTICS_CHANGED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_answer_diagnostics_changed_data"
        }
      },
      "description": "the diagnostics of the answer editor changed"
    },
    "playback_answer_edited_data": {
      "type": "object",
      "properties": {
        "edit_type": {
          "type": "string",
          "description": "how the text changed: typed, paste (text copied from the test itself), external_paste (text that does not come from the test, likely copied from outside), cut, undo or redo"
        },
        "offset": {
          "type": "integer",
          "description": "zero based position, in characters, where the change starts",
          "format": "int32"
        },
        "replaced_length": {
          "type": "integer",
          "description": "number of characters replaced, 0 for a plain insertion",
          "format": "int32"
        },
        "inserted_text": {
          "type": "string",
          "description": "inserted text, empty for a plain deletion"
        }
      }
    },
    "playback_answer_edited_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "ANSWER_EDITED: the candidate edited the answer of a coding or text question",
          "enum": [
            "ANSWER_EDITED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_answer_edited_data"
        }
      },
      "description": "the candidate edited the answer"
    },
    "playback_answer_recording_data": {
      "type": "object",
      "properties": {
        "recording_id": {
          "type": "string",
          "description": "id of the recording, as in answer.video_answer.recordings[].id of GET /tests/{id}",
          "format": "uuid"
        }
      }
    },
    "playback_answer_recording_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "CAMERA_ENABLED / CAMERA_DISABLED, MICROPHONE_ENABLED / MICROPHONE_DISABLED: the candidate turned their camera or microphone on / off during a recording. ANSWER_RECORDING_STOPPED: the candidate stopped a recording",
          "enum": [
            "CAMERA_ENABLED",
            "CAMERA_DISABLED",
            "MICROPHONE_ENABLED",
            "MICROPHONE_DISABLED",
            "ANSWER_RECORDING_STOPPED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_answer_recording_data"
        }
      },
      "description": "the candidate acted on a recording of a VIDEO question"
    },
    "playback_answer_recording_started_data": {
      "type": "object",
      "properties": {
        "recording_id": {
          "type": "string",
          "description": "id of the recording, as in answer.video_answer.recordings[].id of GET /tests/{id}",
          "format": "uuid"
        },
        "camera_enabled": {
          "type": "boolean",
          "description": "whether the camera was enabled when the recording started"
        },
        "microphone_enabled": {
          "type": "boolean",
          "description": "whether the microphone was enabled when the recording started"
        }
      }
    },
    "playback_answer_recording_started_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "ANSWER_RECORDING_STARTED: the candidate started a recording of a VIDEO question",
          "enum": [
            "ANSWER_RECORDING_STARTED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_answer_recording_started_data"
        }
      },
      "description": "the candidate started a recording of a VIDEO question"
    },
    "playback_breakpoint": {
      "type": "object",
      "properties": {
        "breakpoint_id": {
          "type": "string",
          "description": "id of the breakpoint, shared by the events about the same breakpoint"
        },
        "enabled": {
          "type": "boolean",
          "description": "whether the breakpoint is enabled"
        },
        "path": {
          "type": "string",
          "description": "path of the file, on a line breakpoint"
        },
        "line": {
          "type": "integer",
          "description": "line of the breakpoint, on a line breakpoint",
          "format": "int32"
        },
        "column": {
          "type": "integer",
          "description": "column of the breakpoint, on a line breakpoint",
          "format": "int32"
        },
        "function_name": {
          "type": "string",
          "description": "function the breakpoint stops in, on a function breakpoint"
        },
        "condition": {
          "type": "string",
          "description": "condition the breakpoint stops on"
        },
        "log_message": {
          "type": "string",
          "description": "message logged instead of stopping, on a logpoint"
        }
      },
      "description": "a breakpoint set in the IDE of a PROJECT question"
    },
    "playback_breakpoint_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "BREAKPOINT_ADDED / BREAKPOINT_CHANGED / BREAKPOINT_REMOVED: the candidate added / changed / removed a breakpoint",
          "enum": [
            "BREAKPOINT_ADDED",
            "BREAKPOINT_CHANGED",
            "BREAKPOINT_REMOVED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_breakpoint"
        }
      },
      "description": "the candidate added, changed or removed a breakpoint in a PROJECT question"
    },
    "playback_debug_session_data": {
      "type": "object",
      "properties": {
        "debug_session_id": {
          "type": "string",
          "description": "id of the debug session, shared with its other event"
        },
        "name": {
          "type": "string",
          "description": "name of the debug configuration"
        }
      }
    },
    "playback_debug_session_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "DEBUG_SESSION_STARTED / DEBUG_SESSION_ENDED: the candidate started / a debug session ended",
          "enum": [
            "DEBUG_SESSION_STARTED",
            "DEBUG_SESSION_ENDED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_debug_session_data"
        }
      },
      "description": "a debug session started or ended in a PROJECT question"
    },
    "playback_editor_initialized_data": {
      "type": "object",
      "properties": {
        "programming_language_id": {
          "type": "string",
          "description": "programming language id, as in code_details.programming_language_id. Absent on a question without a programming language, such as a TEXT question"
        },
        "content": {
          "type": "string",
          "description": "the whole content of the editor, code or text"
        }
      }
    },
    "playback_editor_initialized_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "EDITOR_INITIALIZED: the editor was loaded with a language and a code, each time the candidate opened the question or reloaded the page, or switched languages. The playback also adds one when the code saved for the candidate differs from the edits replayed so far, so the replay always ends on the submitted code",
          "enum": [
            "EDITOR_INITIALIZED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_editor_initialized_data"
        }
      },
      "description": "the editor was loaded"
    },
    "playback_event": {
      "type": "object",
      "description": "an event of the playback. Its type tells which data it carries. The verbose types are only returned with include_verbose_events=true",
      "oneOf": [
        {
          "$ref": "#/$defs/playback_signal_event"
        },
        {
          "$ref": "#/$defs/playback_editor_initialized_event"
        },
        {
          "$ref": "#/$defs/playback_answer_edited_event"
        },
        {
          "$ref": "#/$defs/playback_test_run_started_event"
        },
        {
          "$ref": "#/$defs/playback_test_run_ended_event"
        },
        {
          "$ref": "#/$defs/playback_text_copied_event"
        },
        {
          "$ref": "#/$defs/playback_statement_text_copied_event"
        },
        {
          "$ref": "#/$defs/playback_mcq_answer_changed_event"
        },
        {
          "$ref": "#/$defs/playback_file_upload_answer_changed_event"
        },
        {
          "$ref": "#/$defs/playback_answer_recording_event"
        },
        {
          "$ref": "#/$defs/playback_answer_recording_started_event"
        },
        {
          "$ref": "#/$defs/playback_file_edited_event"
        },
        {
          "$ref": "#/$defs/playback_file_event"
        },
        {
          "$ref": "#/$defs/playback_file_renamed_event"
        },
        {
          "$ref": "#/$defs/playback_terminal_command_started_event"
        },
        {
          "$ref": "#/$defs/playback_terminal_command_ended_event"
        },
        {
          "$ref": "#/$defs/playback_test_results_changed_event"
        },
        {
          "$ref": "#/$defs/playback_ide_session_started_event"
        },
        {
          "$ref": "#/$defs/playback_ide_tab_event"
        },
        {
          "$ref": "#/$defs/playback_ide_active_view_changed_event"
        },
        {
          "$ref": "#/$defs/playback_ide_extension_added_event"
        },
        {
          "$ref": "#/$defs/playback_ide_extension_removed_event"
        },
        {
          "$ref": "#/$defs/playback_breakpoint_event"
        },
        {
          "$ref": "#/$defs/playback_debug_session_event"
        },
        {
          "$ref": "#/$defs/playback_task_execution_started_event"
        },
        {
          "$ref": "#/$defs/playback_task_execution_ended_event"
        },
        {
          "$ref": "#/$defs/playback_file_uploaded_event"
        },
        {
          "$ref": "#/$defs/playback_terminal_command_output_emitted_event"
        },
        {
          "$ref": "#/$defs/playback_text_selection_changed_event"
        },
        {
          "$ref": "#/$defs/playback_project_text_selection_changed_event"
        },
        {
          "$ref": "#/$defs/playback_answer_diagnostics_changed_event"
        },
        {
          "$ref": "#/$defs/playback_project_answer_diagnostics_changed_event"
        },
        {
          "$ref": "#/$defs/playback_file_content_event"
        }
      ]
    },
    "playback_file_content_data": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "path of the file in the project"
        },
        "content": {
          "type": "string",
          "description": "the whole content of the file, its initial content on FILE_CREATED; absent on a notebook opened in the editor"
        }
      }
    },
    "playback_file_content_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "FILE_CREATED: the candidate created a file from the editor. FILE_OPENED (verbose): the candidate opened a file. FILE_CREATED_ON_DISK / FILE_CHANGED_ON_DISK (verbose): a file was created / changed outside the editor, for instance by a command of the terminal",
          "enum": [
            "FILE_CREATED",
            "FILE_OPENED",
            "FILE_CREATED_ON_DISK",
            "FILE_CHANGED_ON_DISK"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_file_content_data"
        }
      },
      "description": "a file of a PROJECT question was created, opened, or created or changed outside the editor"
    },
    "playback_file_data": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "path of the file in the project"
        }
      }
    },
    "playback_file_diagnostic": {
      "type": "object",
      "properties": {
        "message": {
          "type": "string",
          "description": "message of the diagnostic"
        },
        "severity": {
          "type": "string",
          "description": "severity of the diagnostic, absent when the editor reported an unknown one",
          "enum": [
            "ERROR",
            "WARNING",
            "INFO",
            "HINT"
          ]
        },
        "range": {
          "$ref": "#/$defs/playback_text_range"
        },
        "source": {
          "type": "string",
          "description": "tool that reported the diagnostic"
        }
      },
      "description": "every diagnostic of the file after the change"
    },
    "playback_file_edited_data": {
      "type": "object",
      "properties": {
        "edit_type": {
          "type": "string",
          "description": "how the text changed, for instance typed, paste (text copied from the workspace) or external_paste (text that does not come from the workspace, likely copied from outside)"
        },
        "path": {
          "type": "string",
          "description": "path of the file in the project"
        },
        "offset": {
          "type": "integer",
          "description": "zero based position, in characters, where the change starts",
          "format": "int32"
        },
        "replaced_length": {
          "type": "integer",
          "description": "number of characters replaced, 0 for a plain insertion",
          "format": "int32"
        },
        "inserted_text": {
          "type": "string",
          "description": "inserted text, empty for a plain deletion"
        },
        "notebook_cell_index": {
          "type": "integer",
          "description": "zero based index of the notebook cell edited, on a notebook file only",
          "format": "int32"
        }
      }
    },
    "playback_file_edited_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "FILE_EDITED: the candidate edited a file of a PROJECT question in the editor",
          "enum": [
            "FILE_EDITED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_file_edited_data"
        }
      },
      "description": "the candidate edited a file of a PROJECT question"
    },
    "playback_file_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "FILE_DELETED / FILE_SAVED: the candidate deleted / saved a file from the editor. FILE_CLOSED (verbose): the candidate closed a file. FILE_DELETED_ON_DISK (verbose): a file was deleted outside the editor, for instance by a command of the terminal",
          "enum": [
            "FILE_DELETED",
            "FILE_SAVED",
            "FILE_CLOSED",
            "FILE_DELETED_ON_DISK"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_file_data"
        }
      },
      "description": "a file of a PROJECT question was closed, saved or deleted"
    },
    "playback_file_renamed_data": {
      "type": "object",
      "properties": {
        "old_path": {
          "type": "string",
          "description": "previous path of the file in the project"
        },
        "new_path": {
          "type": "string",
          "description": "new path of the file in the project"
        }
      }
    },
    "playback_file_renamed_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "FILE_RENAMED: the candidate renamed or moved a file of a PROJECT question",
          "enum": [
            "FILE_RENAMED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_file_renamed_data"
        }
      },
      "description": "the candidate renamed or moved a file of a PROJECT question"
    },
    "playback_file_upload_answer_changed_data": {
      "type": "object",
      "properties": {
        "filename": {
          "type": "string",
          "description": "name of the uploaded file, absent when there is none"
        },
        "comment": {
          "type": "string",
          "description": "comment of the candidate"
        }
      }
    },
    "playback_file_upload_answer_changed_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "FILE_UPLOAD_ANSWER_CHANGED: the candidate uploaded a file, removed it or edited their comment on a FILE_UPLOAD question",
          "enum": [
            "FILE_UPLOAD_ANSWER_CHANGED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_file_upload_answer_changed_data"
        }
      },
      "description": "the candidate changed their answer on a FILE_UPLOAD question"
    },
    "playback_file_uploaded_data": {
      "type": "object",
      "properties": {
        "filename": {
          "type": "string",
          "description": "name of the uploaded file"
        },
        "mime_type": {
          "type": "string",
          "description": "MIME type of the uploaded file"
        },
        "size_bytes": {
          "type": "integer",
          "description": "size of the uploaded file, in bytes",
          "format": "int64"
        },
        "target_path": {
          "type": "string",
          "description": "where the file was uploaded in the project"
        }
      }
    },
    "playback_file_uploaded_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "FILE_UPLOADED: the candidate uploaded a file to the project",
          "enum": [
            "FILE_UPLOADED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_file_uploaded_data"
        }
      },
      "description": "the candidate uploaded a file to the project of a PROJECT question"
    },
    "playback_ide_active_view_changed_data": {
      "type": "object",
      "properties": {
        "view_id": {
          "type": "string",
          "description": "id of the view in the IDE"
        }
      }
    },
    "playback_ide_active_view_changed_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "IDE_ACTIVE_VIEW_CHANGED: the candidate switched to another view of the IDE, such as the explorer, the search or the debugger",
          "enum": [
            "IDE_ACTIVE_VIEW_CHANGED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_ide_active_view_changed_data"
        }
      },
      "description": "the candidate switched to another view of the IDE of a PROJECT question"
    },
    "playback_ide_extension_added_data": {
      "type": "object",
      "properties": {
        "extension_id": {
          "type": "string",
          "description": "id of the extension"
        },
        "installed_by_default": {
          "type": "boolean",
          "description": "whether the IDE installs the extension by default, rather than the candidate"
        }
      }
    },
    "playback_ide_extension_added_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "IDE_EXTENSION_ADDED: an extension was installed or enabled in the IDE",
          "enum": [
            "IDE_EXTENSION_ADDED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_ide_extension_added_data"
        }
      },
      "description": "an extension was installed or enabled in the IDE of a PROJECT question"
    },
    "playback_ide_extension_removed_data": {
      "type": "object",
      "properties": {
        "extension_id": {
          "type": "string",
          "description": "id of the extension"
        }
      }
    },
    "playback_ide_extension_removed_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "IDE_EXTENSION_REMOVED: an extension was removed or disabled in the IDE",
          "enum": [
            "IDE_EXTENSION_REMOVED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_ide_extension_removed_data"
        }
      },
      "description": "an extension was removed or disabled in the IDE of a PROJECT question"
    },
    "playback_ide_session_started_data": {
      "type": "object",
      "properties": {
        "active_tab": {
          "$ref": "#/$defs/playback_ide_tab"
        },
        "visible_tabs": {
          "type": "array",
          "description": "the visible tabs",
          "items": {
            "$ref": "#/$defs/playback_ide_tab"
          }
        },
        "open_tabs": {
          "type": "array",
          "description": "every open tab",
          "items": {
            "$ref": "#/$defs/playback_ide_tab"
          }
        },
        "breakpoints": {
          "type": "array",
          "description": "the breakpoints already set",
          "items": {
            "$ref": "#/$defs/playback_breakpoint"
          }
        },
        "installed_extension_ids": {
          "type": "array",
          "description": "ids of the installed extensions",
          "items": {
            "type": "string",
            "description": "ids of the installed extensions"
          }
        }
      }
    },
    "playback_ide_session_started_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "IDE_SESSION_STARTED: an IDE session of a PROJECT question started, with the state of the IDE at that moment",
          "enum": [
            "IDE_SESSION_STARTED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_ide_session_started_data"
        }
      },
      "description": "an IDE session of a PROJECT question started"
    },
    "playback_ide_tab": {
      "type": "object",
      "properties": {
        "label": {
          "type": "string",
          "description": "label shown on the tab"
        },
        "path": {
          "type": "string",
          "description": "path in the project of the file shown in the tab, absent when the tab does not show a file"
        }
      },
      "description": "a tab of the IDE of a PROJECT question"
    },
    "playback_ide_tab_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "IDE_TAB_OPENED / IDE_TAB_CLOSED (verbose): the candidate opened / closed a tab. IDE_TAB_SHOWN / IDE_TAB_HIDDEN (verbose): a tab became visible / hidden. IDE_ACTIVE_TAB_CHANGED: the candidate switched to another tab, data is empty when no tab is active",
          "enum": [
            "IDE_TAB_OPENED",
            "IDE_TAB_CLOSED",
            "IDE_TAB_SHOWN",
            "IDE_TAB_HIDDEN",
            "IDE_ACTIVE_TAB_CHANGED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_ide_tab"
        }
      },
      "description": "the candidate acted on a tab of the IDE of a PROJECT question"
    },
    "playback_mcq_answer_changed_data": {
      "type": "object",
      "properties": {
        "selected_choice_indexes": {
          "type": "array",
          "description": "zero based positions of the choices selected after the change, in mcq_details.choices of GET /tests/{id}",
          "items": {
            "type": "integer",
            "description": "zero based positions of the choices selected after the change, in mcq_details.choices of GET /tests/{id}",
            "format": "int32"
          }
        }
      }
    },
    "playback_mcq_answer_changed_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "MCQ_ANSWER_CHANGED: the candidate changed their selection on an MCQ question",
          "enum": [
            "MCQ_ANSWER_CHANGED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_mcq_answer_changed_data"
        }
      },
      "description": "the candidate changed their selection on an MCQ question"
    },
    "playback_project_answer_diagnostics_changed_data": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "path of the file in the project"
        },
        "diagnostics": {
          "type": "array",
          "description": "every diagnostic of the file after the change",
          "items": {
            "$ref": "#/$defs/playback_file_diagnostic"
          }
        }
      }
    },
    "playback_project_answer_diagnostics_changed_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "PROJECT_ANSWER_DIAGNOSTICS_CHANGED (verbose): the errors, warnings and hints reported on a file of a PROJECT question changed",
          "enum": [
            "PROJECT_ANSWER_DIAGNOSTICS_CHANGED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_project_answer_diagnostics_changed_data"
        }
      },
      "description": "the diagnostics of a file of a PROJECT question changed"
    },
    "playback_project_text_selection_changed_data": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "path of the file in the project"
        },
        "trigger": {
          "type": "string",
          "description": "what moved the selection, as reported by the IDE"
        },
        "selections": {
          "type": "array",
          "description": "the selections after the change, one per cursor",
          "items": {
            "$ref": "#/$defs/playback_selection"
          }
        }
      }
    },
    "playback_project_text_selection_changed_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "PROJECT_TEXT_SELECTION_CHANGED (verbose): the candidate moved the cursor or changed the selections in a file of a PROJECT question",
          "enum": [
            "PROJECT_TEXT_SELECTION_CHANGED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_project_text_selection_changed_data"
        }
      },
      "description": "the candidate moved the cursor or the selections in a file of a PROJECT question"
    },
    "playback_selection": {
      "type": "object",
      "properties": {
        "offset": {
          "type": "integer",
          "description": "zero based position, in characters, where the selection starts",
          "format": "int32"
        },
        "length": {
          "type": "integer",
          "description": "number of characters selected, 0 for a cursor move",
          "format": "int32"
        }
      },
      "description": "a selection, or the cursor position when its length is 0"
    },
    "playback_signal_data": {
      "type": "object"
    },
    "playback_signal_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "ANSWER_SUBMITTED: the candidate submitted the answer. WINDOW_FOCUS_LOST / WINDOW_FOCUS_GAINED: the test window lost / got the focus back. QUESTION_EXITED / QUESTION_ENTERED: the candidate left / opened the question. FULL_SCREEN_ENTERED / FULL_SCREEN_EXITED: the candidate entered / left full screen mode. PROJECT_TESTS_RUN_REQUESTED: the candidate clicked the button running the tests of a PROJECT question",
          "enum": [
            "ANSWER_SUBMITTED",
            "WINDOW_FOCUS_LOST",
            "WINDOW_FOCUS_GAINED",
            "QUESTION_EXITED",
            "QUESTION_ENTERED",
            "FULL_SCREEN_ENTERED",
            "FULL_SCREEN_EXITED",
            "PROJECT_TESTS_RUN_REQUESTED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_signal_data"
        }
      },
      "description": "an event whose data is always empty"
    },
    "playback_statement_text_copied_data": {
      "type": "object",
      "properties": {
        "copied_text": {
          "type": "string",
          "description": "the copied text"
        }
      }
    },
    "playback_statement_text_copied_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "STATEMENT_TEXT_COPIED: the candidate copied text from the question statement",
          "enum": [
            "STATEMENT_TEXT_COPIED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_statement_text_copied_data"
        }
      },
      "description": "the candidate copied text from the question statement"
    },
    "playback_task_execution_ended_data": {
      "type": "object",
      "properties": {
        "task_id": {
          "type": "string",
          "description": "id of the execution, shared with its TASK_EXECUTION_STARTED event"
        },
        "name": {
          "type": "string",
          "description": "name of the task"
        }
      }
    },
    "playback_task_execution_ended_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "TASK_EXECUTION_ENDED: a task of the IDE ended",
          "enum": [
            "TASK_EXECUTION_ENDED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_task_execution_ended_data"
        }
      },
      "description": "a task ended in the IDE of a PROJECT question"
    },
    "playback_task_execution_started_data": {
      "type": "object",
      "properties": {
        "task_id": {
          "type": "string",
          "description": "id of the execution, shared with its TASK_EXECUTION_ENDED event"
        },
        "name": {
          "type": "string",
          "description": "name of the task"
        },
        "reason": {
          "type": "string",
          "description": "what started the task, as reported by the IDE"
        }
      }
    },
    "playback_task_execution_started_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "TASK_EXECUTION_STARTED: a task of the IDE started",
          "enum": [
            "TASK_EXECUTION_STARTED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_task_execution_started_data"
        }
      },
      "description": "a task started in the IDE of a PROJECT question"
    },
    "playback_terminal_command_ended_data": {
      "type": "object",
      "properties": {
        "command_id": {
          "type": "string",
          "description": "id of the command, shared with its TERMINAL_COMMAND_STARTED event"
        },
        "command": {
          "type": "string",
          "description": "the command"
        },
        "exit_code": {
          "type": "integer",
          "description": "exit code of the command, absent when the terminal did not report it",
          "format": "int32"
        }
      }
    },
    "playback_terminal_command_ended_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "TERMINAL_COMMAND_ENDED: a command ended in the terminal of a PROJECT question",
          "enum": [
            "TERMINAL_COMMAND_ENDED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_terminal_command_ended_data"
        }
      },
      "description": "a command ended in the terminal of a PROJECT question"
    },
    "playback_terminal_command_output_emitted_data": {
      "type": "object",
      "properties": {
        "command_id": {
          "type": "string",
          "description": "id of the command, shared with its TERMINAL_COMMAND_STARTED event"
        },
        "output": {
          "type": "string",
          "description": "the chunk of output printed"
        }
      }
    },
    "playback_terminal_command_output_emitted_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "TERMINAL_COMMAND_OUTPUT_EMITTED (verbose): a command printed a chunk of output in the terminal",
          "enum": [
            "TERMINAL_COMMAND_OUTPUT_EMITTED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_terminal_command_output_emitted_data"
        }
      },
      "description": "a command of the terminal of a PROJECT question printed output"
    },
    "playback_terminal_command_started_data": {
      "type": "object",
      "properties": {
        "command_id": {
          "type": "string",
          "description": "id of the command, shared with its TERMINAL_COMMAND_ENDED event"
        },
        "command": {
          "type": "string",
          "description": "the command"
        }
      }
    },
    "playback_terminal_command_started_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "TERMINAL_COMMAND_STARTED: a command started in the terminal of a PROJECT question",
          "enum": [
            "TERMINAL_COMMAND_STARTED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_terminal_command_started_data"
        }
      },
      "description": "a command started in the terminal of a PROJECT question"
    },
    "playback_test_case_result": {
      "type": "object",
      "properties": {
        "name": {
          "type": "string",
          "description": "name of the test case"
        },
        "path": {
          "type": "string",
          "description": "path of the file declaring the test case"
        },
        "state": {
          "type": "string",
          "description": "state of the test case, as reported by the test framework, so its values depend on the framework"
        }
      },
      "description": "the test cases of the test explorer, with their state after the change"
    },
    "playback_test_results_changed_data": {
      "type": "object",
      "properties": {
        "test_cases": {
          "type": "array",
          "description": "the test cases of the test explorer, with their state after the change",
          "items": {
            "$ref": "#/$defs/playback_test_case_result"
          }
        }
      }
    },
    "playback_test_results_changed_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "TEST_RESULTS_CHANGED: the results shown in the test explorer of a PROJECT question changed",
          "enum": [
            "TEST_RESULTS_CHANGED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_test_results_changed_data"
        }
      },
      "description": "the test results of a PROJECT question changed"
    },
    "playback_test_run_ended_data": {
      "type": "object",
      "properties": {
        "test_case_index": {
          "type": "integer",
          "description": "zero based index of the test case, absent when the run was not tied to a single test case",
          "format": "int32"
        },
        "outcome": {
          "type": "string",
          "description": "outcome of the test case run, absent when it was not recorded",
          "enum": [
            "PASSED",
            "FAILED"
          ]
        }
      }
    },
    "playback_test_run_ended_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "TEST_RUN_ENDED: a test case run of the candidate is over",
          "enum": [
            "TEST_RUN_ENDED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_test_run_ended_data"
        }
      },
      "description": "a test case run of the candidate is over"
    },
    "playback_test_run_started_data": {
      "type": "object",
      "properties": {
        "test_case_index": {
          "type": "integer",
          "description": "zero based index of the test case the candidate ran, absent when the run was not tied to a single test case",
          "format": "int32"
        }
      }
    },
    "playback_test_run_started_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "TEST_RUN_STARTED: the candidate started running their code on a test case",
          "enum": [
            "TEST_RUN_STARTED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_test_run_started_data"
        }
      },
      "description": "the candidate started running their code on a test case"
    },
    "playback_text_copied_data": {
      "type": "object",
      "properties": {
        "path": {
          "type": "string",
          "description": "path of the file the text was copied from, on a PROJECT question only"
        },
        "offset": {
          "type": "integer",
          "description": "zero based position, in characters, where the copied text starts",
          "format": "int32"
        },
        "length": {
          "type": "integer",
          "description": "number of characters copied",
          "format": "int32"
        },
        "source_file_length": {
          "type": "integer",
          "description": "number of characters in the file the text was copied from, absent on events recorded before it was captured",
          "format": "int32"
        }
      }
    },
    "playback_text_copied_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "TEXT_COPIED: the candidate copied text from the editor",
          "enum": [
            "TEXT_COPIED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_text_copied_data"
        }
      },
      "description": "the candidate copied text from the editor"
    },
    "playback_text_position": {
      "type": "object",
      "properties": {
        "line": {
          "type": "integer",
          "description": "1-based line",
          "format": "int32"
        },
        "column": {
          "type": "integer",
          "description": "1-based column",
          "format": "int32"
        }
      }
    },
    "playback_text_range": {
      "type": "object",
      "properties": {
        "start": {
          "$ref": "#/$defs/playback_text_position"
        },
        "end": {
          "$ref": "#/$defs/playback_text_position"
        }
      },
      "description": "a range of text, its positions are 1-based"
    },
    "playback_text_selection_changed_event": {
      "type": "object",
      "properties": {
        "relative_time_ms": {
          "type": "integer",
          "description": "moment of the event in the playback, in milliseconds. On a PROJECT question, the time elapsed since the first event. On any other question, the time the candidate spent on the question: each time they left it and came back counts as one second",
          "format": "int64"
        },
        "type": {
          "type": "string",
          "description": "TEXT_SELECTION_CHANGED (verbose): the candidate moved the cursor or changed the selection in the answer editor of a CODE or TEXT question",
          "enum": [
            "TEXT_SELECTION_CHANGED"
          ]
        },
        "data": {
          "$ref": "#/$defs/playback_selection"
        }
      },
      "description": "the candidate moved the cursor or the selection in the answer editor"
    }
  }
}