187 lines
5.5 KiB
YAML
187 lines
5.5 KiB
YAML
# Draft Patch — OpenAPI Interaktif Extension (Tidak Langsung Mengubah File Utama)
|
|
# Tujuan: Menyediakan perubahan skema untuk ditinjau dan kemudian di-merge ke `openapi.yaml`.
|
|
# Status: x-draft: true
|
|
|
|
openapi: 3.0.3
|
|
info:
|
|
title: LMS-BGN Interactive Extension (Draft)
|
|
version: 0.0.1
|
|
x-draft: true
|
|
|
|
components:
|
|
schemas:
|
|
ExamSessionCreateRequest:
|
|
type: object
|
|
properties:
|
|
examId: { type: string }
|
|
userId: { type: string }
|
|
isInteractive: { type: boolean, description: "Optional, overrides exam metadata" }
|
|
idempotencyKey: { type: string }
|
|
clientContext:
|
|
type: object
|
|
properties:
|
|
device: { type: string }
|
|
appVersion: { type: string }
|
|
locale: { type: string }
|
|
|
|
# Union item untuk answers[]
|
|
EnhancedMcqAnswer:
|
|
type: object
|
|
required: [questionId, type, choiceIndex]
|
|
properties:
|
|
questionId: { type: string }
|
|
type: { type: string, enum: [enhanced_mcq] }
|
|
choiceIndex: { type: integer }
|
|
confidence: { type: integer, minimum: 0, maximum: 5 }
|
|
|
|
VideoScenarioAnswer:
|
|
type: object
|
|
required: [questionId, type, scenarioAnswers]
|
|
properties:
|
|
questionId: { type: string }
|
|
type: { type: string, enum: [video_scenario] }
|
|
scenarioAnswers:
|
|
type: array
|
|
items:
|
|
type: object
|
|
required: [stepId, selectedOptionId]
|
|
properties:
|
|
stepId: { type: string }
|
|
selectedOptionId: { type: string }
|
|
|
|
ImageHotspotAnswer:
|
|
type: object
|
|
required: [questionId, type, selectedHotspots]
|
|
properties:
|
|
questionId: { type: string }
|
|
type: { type: string, enum: [image_hotspot] }
|
|
selectedHotspots:
|
|
type: array
|
|
items: { type: string }
|
|
|
|
MediaGalleryAnswer:
|
|
type: object
|
|
required: [questionId, type, viewedItems]
|
|
properties:
|
|
questionId: { type: string }
|
|
type: { type: string, enum: [media_gallery] }
|
|
viewedItems:
|
|
type: array
|
|
items: { type: string }
|
|
|
|
PuzzleAnswer:
|
|
type: object
|
|
required: [questionId, type, matches]
|
|
properties:
|
|
questionId: { type: string }
|
|
type: { type: string, enum: [puzzle] }
|
|
matches:
|
|
type: array
|
|
items:
|
|
type: object
|
|
required: [pieceId, targetId]
|
|
properties:
|
|
pieceId: { type: string }
|
|
targetId: { type: string }
|
|
|
|
ScenarioAnswer:
|
|
type: object
|
|
required: [questionId, type, selectedOptionId]
|
|
properties:
|
|
questionId: { type: string }
|
|
type: { type: string, enum: [scenario] }
|
|
selectedOptionId: { type: string }
|
|
|
|
ExamScoreRequest:
|
|
type: object
|
|
properties:
|
|
mode: { type: string, enum: [batch, stream] }
|
|
idempotencyKey: { type: string }
|
|
answers:
|
|
type: array
|
|
items:
|
|
oneOf:
|
|
- $ref: '#/components/schemas/EnhancedMcqAnswer'
|
|
- $ref: '#/components/schemas/VideoScenarioAnswer'
|
|
- $ref: '#/components/schemas/ImageHotspotAnswer'
|
|
- $ref: '#/components/schemas/MediaGalleryAnswer'
|
|
- $ref: '#/components/schemas/PuzzleAnswer'
|
|
- $ref: '#/components/schemas/ScenarioAnswer'
|
|
|
|
# Detail union untuk Summary
|
|
EnhancedMcqDetails:
|
|
type: object
|
|
properties:
|
|
choiceIndex: { type: integer }
|
|
confidence: { type: integer, minimum: 0, maximum: 5 }
|
|
|
|
VideoScenarioDetails:
|
|
type: object
|
|
properties:
|
|
steps:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
stepId: { type: string }
|
|
selectedOptionId: { type: string }
|
|
isCorrect: { type: boolean }
|
|
earnedPoints: { type: number }
|
|
|
|
ImageHotspotDetails:
|
|
type: object
|
|
properties:
|
|
selectedHotspots:
|
|
type: array
|
|
items: { type: string }
|
|
correctHotspots:
|
|
type: array
|
|
items: { type: string }
|
|
|
|
MediaGalleryDetails:
|
|
type: object
|
|
properties:
|
|
viewedItems:
|
|
type: array
|
|
items: { type: string }
|
|
requiredItems:
|
|
type: array
|
|
items: { type: string }
|
|
completionRate: { type: number }
|
|
|
|
PuzzleDetails:
|
|
type: object
|
|
properties:
|
|
matches:
|
|
type: array
|
|
items:
|
|
type: object
|
|
properties:
|
|
pieceId: { type: string }
|
|
targetId: { type: string }
|
|
correctPairs: { type: integer }
|
|
earnedPoints: { type: number }
|
|
|
|
ScenarioDetails:
|
|
type: object
|
|
properties:
|
|
selectedOptionId: { type: string }
|
|
isCorrect: { type: boolean }
|
|
|
|
ExamSummaryResponseAnswer:
|
|
type: object
|
|
properties:
|
|
questionId: { type: string }
|
|
question: { type: string }
|
|
userAnswer: { type: string }
|
|
correctAnswer: { type: string }
|
|
isCorrect: { type: boolean }
|
|
type: { type: string, enum: [enhanced_mcq, video_scenario, image_hotspot, media_gallery, puzzle, scenario] }
|
|
details:
|
|
oneOf:
|
|
- $ref: '#/components/schemas/EnhancedMcqDetails'
|
|
- $ref: '#/components/schemas/VideoScenarioDetails'
|
|
- $ref: '#/components/schemas/ImageHotspotDetails'
|
|
- $ref: '#/components/schemas/MediaGalleryDetails'
|
|
- $ref: '#/components/schemas/PuzzleDetails'
|
|
- $ref: '#/components/schemas/ScenarioDetails' |