Class UpdatePearsonContextTemplateQuestionCommand

Update a Pearson context template question.

Use a bare-bones client and the command you need to make an API call.

import { Apiv2Client, UpdatePearsonContextTemplateQuestionCommand } from "@codegrade/apiv2-client"; // ES Modules import
// const { Apiv2Client, UpdatePearsonContextTemplateQuestionCommand } = require("@codegrade/apiv2-client"); // CommonJS import
const client = new Apiv2Client(config);
const input = { // UpdatePearsonContextTemplateQuestionRequest
tenantId: "STRING_VALUE", // required
templateId: "STRING_VALUE", // required
contextId: "STRING_VALUE", // required
questionId: "STRING_VALUE", // required
enabled: true || false,
};
const command = new UpdatePearsonContextTemplateQuestionCommand(input);
const response = await client.send(command);
// { // UpdatePearsonContextTemplateQuestionResponse
// question: { // PearsonContextTemplateQuestion
// name: "STRING_VALUE", // required
// enabled: true || false, // required
// data: { // PearsonQuestionData Union: only one key present
// coding: { // PearsonCodingQuestionData
// filename: "STRING_VALUE", // required
// template: "STRING_VALUE", // required
// description: "STRING_VALUE", // required
// correctAnswer: "STRING_VALUE", // required
// autoTestSteps: "DOCUMENT_VALUE", // required
// },
// multipleChoice: { // PearsonMultipleChoiceQuestionData
// question: "STRING_VALUE", // required
// answers: [ // PearsonMultipleChoiceQuestionAnswers // required
// { // PearsonMultipleChoiceQuestionAnswer
// answer: "STRING_VALUE", // required
// isCorrect: true || false,
// hint: "STRING_VALUE",
// },
// ],
// answerOrder: "index-order" || "random-order",
// },
// selectAll: { // PearsonSelectAllQuestionData
// question: "STRING_VALUE", // required
// answers: [ // PearsonSelectAllQuestionAnswers // required
// { // PearsonSelectAllQuestionAnswer
// answer: "STRING_VALUE", // required
// isCorrect: true || false,
// hints: { // PearsonSelectAllQuestionAnswerHints
// correct: "STRING_VALUE",
// incorrect: "STRING_VALUE",
// },
// },
// ],
// answerOrder: "index-order" || "random-order",
// },
// },
// questionId: "STRING_VALUE", // required
// },
// };

UpdatePearsonContextTemplateQuestionCommandInput

InternalServerError (server fault) An internal failure at the fault of the server.

BadRequestError (client fault) An error at the fault of the client sending invalid input.

NotFoundError (client fault) An error due to the client attempting to access a missing resource.

NotAuthorizedError (client fault) An error due to the client not being authorized to access the resource.

NotAuthenticatedError (client fault) An error due to the client not being authenticated.

ValidationError (client fault) A standard error for input validation failures. This should be thrown by services when a member of the input structure falls outside of the modeled or documented constraints.

Apiv2ServiceException

Base exception class for all service exceptions from Apiv2 service.

Hierarchy

Constructors

  • Returns UpdatePearsonContextTemplateQuestionCommand

  • Parameters

    Returns UpdatePearsonContextTemplateQuestionCommand

Properties

schema?: OperationSchema

This should be OperationSchema from @smithy/types, but would create problems with the client transform type adaptors.

__types: {
    api: {
        input: UpdatePearsonContextTemplateQuestionRequest;
        output: UpdatePearsonContextTemplateQuestionResponse;
    };
    sdk: {
        input: UpdatePearsonContextTemplateQuestionCommandInput;
        output: UpdatePearsonContextTemplateQuestionCommandOutput;
    };
}

type navigation helper, not in runtime.

Methods

  • Internal

    Parameters

    • clientStack: MiddlewareStack<any, any>
    • configuration: { logger: Logger; requestHandler: RequestHandler<any, any, any> }
    • options: any
    • __namedParameters: ResolveMiddlewareContextArgs

    Returns InitializeHandler<any, UpdatePearsonContextTemplateQuestionCommandOutput>

  • Returns EndpointParameterInstructions