Saltearse al contenido

Drag and Drop

El usuario arrastra elementos a zonas de destino. Requiere el campo content.

Schema de content

{
"items": [
{ "id": "1", "text": "Apple", "correctZoneId": "fruit" },
{ "id": "2", "text": "Carrot", "correctZoneId": "vegetable" }
],
"zones": [
{ "id": "fruit", "label": "Fruits" },
{ "id": "vegetable", "label": "Vegetables" }
]
}

Formato de answer

answer = JSON.stringify({ item_id: zone_id })

Items no incluidos en answer cuentan como incorrectos.

Request

{
"exerciseId": "ex_004",
"area": "vocabulary",
"type": "drag_and_drop",
"answer": "{\"1\":\"fruit\",\"2\":\"vegetable\"}",
"content": {
"items": [
{ "id": "1", "text": "Apple", "correctZoneId": "fruit" },
{ "id": "2", "text": "Carrot", "correctZoneId": "vegetable" }
],
"zones": [
{ "id": "fruit", "label": "Fruits" },
{ "id": "vegetable", "label": "Vegetables" }
]
}
}

Respuestas

// Todo correcto
{ "correct": true, "score": 10, "feedback": "All items placed correctly!", "metadata": { "area": "vocabulary", "type": "drag_and_drop" } }
// Parcialmente correcto (1 de 2)
{ "correct": false, "score": 5, "feedback": "You placed 1 out of 2 items correctly.", "metadata": { "area": "vocabulary", "type": "drag_and_drop" } }

Score = Math.round((items_correctos / total) * 10)