# Computes feedback for the provided task and answer This operation provides access to our formative feedback. The task included in the request is essential for context and must be provided with every request. This ensures synchronization and prevents issues where feedback might be based on an outdated version of the task. The field in the task object is crucial for identifying answers associated with the same task. This field represents the task's identifier as defined in the client’s system. If the id remains the same across requests but other task fields change, the system updates the fields for the existing task 𝑡. Feedback is then generated based on previously submitted answers and feedback related to task 𝑡 (). If the system has not seen the value of the field before, a new task 𝑡′ is created. In this case, there are no existing answers or feedback linked to task 𝑡′. To avoid unintended behavior, only change the id field when creating a completely new task. () This applies only if the task types remain the same. If a request specifies a task type for t that differs from the type already associated with it from previous requests, an error will be returned. --- : Whenever a task is updated in the client's system, it should be assumed that these changes affect the feedback. Therefore, we recommend the following actions to align with the changes: test the feedback after making changes; create new answers to reflect the updated task; and consider reassigning existing feedback for previous answers. Without these measures, the generated feedback may no longer be accurate. Endpoint: POST /feedback/compute Version: 0.9.0 Security: BearerAuthentication ## Request fields (application/json): - `userId` (string, required) By setting this field, you will link the answer to the provided learner identifier. Alternatively, you can use an anonymous identifier if preferred. Example: "some_anonymous_id" - `tenantId` (string) The identifier of the tenant where the target task, specified in the taskDefinition, will be stored or searched for. If not provided the domain's default tenant will be used. Ensure that the API user has the necessary permissions on the target tenant to create or update a task. If not, an [error-response](http://localhost:60000/documentation#tag/error_response_model) of type will be returned. Example: "product_123" - `metaData` (object) The object containing metadata related to the learner interaction. - `metaData.timeOnTask` (integer) The time in seconds it takes the user to answer the task. While this field is not mandatory, it may eventually impact the learner's task recommendations. Hence, it is recommended to set and track this field. Example: 64 - `metaData.tryCount` (integer) The number of attempts the learner has made, including the current request. This can be useful if the userId is not unique for privacy reasons or if not every attempt is sent via the API. Otherwise, the attempt count can be inferred from the number of API calls and is typically left empty. Example: 3 - `metaData.sessionId` (string) An optional identifier to group multiple interactions into one session. Useful for statistical purposes. - `taskType` (string, required) Defines the type of the task. Can be used by deserialization tools to instantiate the correct sub-type. Enum: "FREEFORM_TEXT", "IN_TEXT_FILL_IN_BLANKS", "IN_TEXT_CHOICES", "MULTIPLE_CHOICE", "MULTIPLE_RESPONSES" ## Response 200 fields (application/json): - `userId` (string, required) The user ID this feedback is meant for. Example: "some_anonymous_id" - `taskId` (string, required) The task ID this feedback is meant for. Example: "0Ihkl0CyzoWSjDm5F" - `taskType` (string, required) Defines the type of the task. Can be used by deserialization tools to instantiate the correct sub-type. Enum: "FREEFORM_TEXT", "IN_TEXT_FILL_IN_BLANKS", "IN_TEXT_CHOICES", "MULTIPLE_CHOICE", "MULTIPLE_RESPONSES" - `metaData` (object, required) The object containing metadata about the performed operation, along with helpful debugging information. Designed to simplify the integration process and does not include any production-related details that should be visible to the end user. - `metaData.taskAction` (string, required) The action that was performed on the task. Enum: "CREATED", "UPDATED", "UNCHANGED" - `metaData.tenantId` (string, required) - `metaData.taskLink` (string, required) Deeplink to task in the Taskbase Cockpit. ## Response 400 fields (application/json): - `message` (string, required) Contains more detailed information about the root cause of the problem. Example: "The user associated with the provided bearer token is not authorized." - `type` (string, required) Possible errors the API may return. For more details, refer to the [error table](#section/Error-Types). Enum: "REQUEST_SCHEMA_MALFORMED", "INVALID_TOKEN", "MISSING_PERMISSIONS", "INVALID_PARAMETER", "WRONG_TASK_TYPE_FOR_UPSERT", "INTERNAL" ## Response 500 fields (application/json): - `message` (string, required) Contains more detailed information about the root cause of the problem. Example: "An error occurred while processing your request. It has been logged with the ID 2b6b2818cc22fc4b." - `type` (string, required) Possible errors the API may return. For more details, refer to the [error table](#section/Error-Types). Enum: "REQUEST_SCHEMA_MALFORMED", "INVALID_TOKEN", "MISSING_PERMISSIONS", "INVALID_PARAMETER", "WRONG_TASK_TYPE_FOR_UPSERT", "INTERNAL"