/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { lessonsUpdateStudentResponse } from "../../funcs/lessonsUpdateStudentResponse.js";
import * as components from "../../models/components/index.js";
import { formatResult } from "../tools.js";
const args = {
    request: components.UpdateStudentQuestionResponseInput$inboundSchema
        .optional(),
};
export const tool$lessonsUpdateStudentResponse = {
    name: "lessons-update-student-response",
    description: `Update student question response

Updates the student's response to a question and returns the updated PowerPath score:
- Checks the correctness of the response using the QTI question \`<qti-response-declaration>\` element and update the score accordingly.
- Creates/updates the AssessmentLineItem and AssessmentResult objects for the student/question pair if it doesn't exist yet.

A 'Lesson' in this context is a ComponentResource object which has a Resource object associated with it.
`,
    args,
    tool: async (client, args, ctx) => {
        const [result, apiCall] = await lessonsUpdateStudentResponse(client, args.request, { fetchOptions: { signal: ctx.signal } }).$inspect();
        if (!result.ok) {
            return {
                content: [{ type: "text", text: result.error.message }],
                isError: true,
            };
        }
        const value = result.value;
        return formatResult(value, apiCall);
    },
};
//# sourceMappingURL=lessonsUpdateStudentResponse.js.map