/*
 * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
 */
import { lessonsResetAttempt } from "../../funcs/lessonsResetAttempt.js";
import * as operations from "../../models/operations/index.js";
import { formatResult } from "../tools.js";
const args = {
    request: operations.ResetAttemptRequest$inboundSchema.optional(),
};
export const tool$lessonsResetAttempt = {
    name: "lessons-reset-attempt",
    description: `Reset attempt

Resets the attempt for the given PowerPath lesson of a student:
- Soft-deletes all previous question responses, resets the test score to 0, and updates its 'scoreStatus' to "not submitted".
- If the lesson is an external test, only resets the test score to 0.

For Assessment Bank lessons, this will keep the user state in the same bank test for the current attempt.

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 lessonsResetAttempt(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=lessonsResetAttempt.js.map