Compute feedback for our task in two steps:
- Send task to the Taskbase platform.
- Request feedback for a learner's answer to the task.
You will need
- a valid API token
- a specific task
- some learners' answers
Save your task to the Taskbase platform by using the upsert endpoint. The taskDefinition.id is the identifier used in subsequent requests to target this task. The identifier is provided by your system and needs to be unique.
The response will confirm whether the task was created or updated, and will include the internal task ID that Taskbase assigned.
For API reference see Upsert a task.
API Call Example:
- https://api.taskbase.com/tenants/{tenantId}/tasks
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://api.taskbase.com/tenants/{tenantId}/tasks' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"id": "string",
"type": "FreeformTextTask",
"problemStatement": "When was the Battle of Waterloo?"
}'API Call Response Example:
{
"action": "CREATED",
"clientTaskId": "your-task-id-123",
"internalTaskId": "0Ihkl0CyzoWSjDm5F",
"taskType": "FREEFORM_TEXT"
}You now have a task in the Taskbase platform. You can request feedback by providing the learner's answer. To target that task, use the same taskDefinition.id that you provided when creating the task in Step 1.
For API reference see Compute feedback for an existing task.
API Call Example:
- https://api.taskbase.com/tasks/{taskId}/feedback/compute
- curl
- JavaScript
- Node.js
- Python
- Java
- C#
- PHP
- Go
- Ruby
- R
- Payload
curl -i -X POST \
'https://api.taskbase.com/tasks/{taskId}/feedback/compute' \
-H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
-H 'Content-Type: application/json' \
-d '{
"userId": "student123",
"taskType": "FREEFORM_TEXT",
"answer": {
"content": "The Battle of Waterloo was in 1815."
}
}'API Call Response Example Excerpt:
{
...
"result": {
"sampleSolution": {
"content": "The Battle of Waterloo was in 1815."
},
"feedback": [
{
"correctness": "correct",
"aspects": [
{
"name": "Present 3rd person singular of regular verbs",
"description": "A student can correctly form the present 3rd person singular of regular verbs.",
"type": "CONCEPT",
"aspectGroup": {
"name": "Grammar",
"description": "Grammatical concepts such as conjugation, tenses and conditionals"
}
}
],
"message": "Indeed, the Battle of Waterloo was on Saturday, the 15th of June 1815",
"context": [
{
"content": "was in 1815",
"offset": 23,
"length": 11
}
]
}
],
"answer": {
"content": "The Battle of Waterloo was in 1815."
},
...
}
}You sent a task and then requested feedback on a learner's answer to it.