This article provides a step-by-step guide for adding questions to the YouTestMe platform via API, ensuring an organized question structure for efficient management. It includes steps to create question pools, add individual questions, and link them to the pool.
Adding a Question Pool #
To create a new question pool, follow these steps:
-
- Access the Pools Section: Navigate to the Pools section and click on it.
- Initiate a New Pool: Select the POST /pools option.
- Enable Request Fields: Click Try it out to open the request fields.
- Enter Pool Details:
-
- parentPoolId: If this is a top-level pool, set to
null
. Otherwise, provide the ID of an existing pool. - name: Specify a descriptive name (e.g., “AI Notes”).
- description: Briefly describe the purpose of this pool (e.g., “Pool for AI-related questions”).
- type: Indicate the type of pool, such as “TEST”.
- parentPoolId: If this is a top-level pool, set to
-
- Execute the Request: Click Execute to create the pool. A 200 status code indicates success.
Example Request Body:
Save the poolId for later use.
Adding Questions to the Pool #
After creating the pool, add questions as follows:
- Access the Questions Section: Navigate to Questions in the API documentation.
- Initiate a New Question: Select the POST /questions option.
- Enable Request Fields: Click Try it out.
- Enter Question Details:
- questionText: Write the question text.
- answers: List potential answers with their properties:
- answerText: Answer text.
- ordinalNumber: Display order of the answer.
- answerWeight: Weight for point calculation.
- answerCorrect: “Y” for correct, “N” for incorrect.
- questionType: Indicate type (e.g., “TFC” for True/False or “SNC” for single-choice).
- points, penalty, and duration: Set point value, penalty, and time limit.
- Execute the Request: Click Execute. A 201 status code confirms success.
Example Request Body:
Save the questionId from the response.
Adding Questions to a Question Pool #
To associate questions with the created pool:
- Access Pool Questions Section: Navigate to Pool Questions in the API documentation.
- Initiate Linking: Select the POST /poolquestions option.
- Enable Request Fields: Click Try it out.
- Enter Link Details:
- poolId: ID of the question pool.
- questionId: ID of the question.
- Execute the Request: Click Execute. A 201 status code confirms successful linking.
If the request is successful, you will see a 201 status code in the response, indicating the question was added successfully.
Example Request Body:
Demo Script #
A demonstration script illustrates the process of logging in, creating pools, adding questions, and linking them.