Lectful icon

Lectful

Interact with the VIPay Lectful API

Overview

This node interacts with the Lectful API to manage quiz choices within a quiz system. Specifically, the Quiz Choice - Create operation allows users to add new answer choices to a quiz question. This is useful in scenarios where you are building or updating quizzes programmatically and need to automate the creation of multiple choice options for questions.

Practical examples include:

  • Automatically generating quiz choices from an external data source.
  • Integrating quiz content creation into a larger course management workflow.
  • Dynamically adding correct/incorrect answers based on user input or other logic.

Properties

Name Meaning
Authentication Mode Choose how to authenticate with the Lectful API:
- Use Stored Credentials
- Manual Configuration (provide base URL and API key manually)
Credentials Note Informational note shown when using Manual Configuration mode about leaving credentials empty and using overrides instead.
Base URL Override Optional base URL to override the stored credential's base URL (without /api/v1).
API Key Override Optional API key to override the stored credential's API key.
Question ID The ID of the quiz question to which this choice belongs.
Content (Quill Delta JSON) The content of the choice formatted as Quill Delta JSON, representing rich text content.
Is Correct Boolean flag indicating whether this choice is the correct answer for the question.

Output

The node outputs an array of JSON objects corresponding to each input item processed. For the "Create Quiz Choice" operation, the output JSON contains the response from the Lectful API after creating the quiz choice. This typically includes details such as the newly created choice's ID, associated question ID, content, correctness flag, timestamps, and any other metadata returned by the API.

No binary data output is produced by this operation.

Dependencies

  • Requires access to the Lectful API.
  • Requires either stored credentials configured in n8n or manual entry of the base URL and API key.
  • The API key must have permissions to create quiz choices.
  • No additional external dependencies beyond HTTP access to the Lectful API.

Troubleshooting

  • Missing or invalid credentials: If neither stored credentials nor manual configuration parameters are provided correctly, the node will throw an error indicating missing or invalid credentials. Ensure that either valid credentials are configured in n8n or manual base URL and API key are supplied.
  • Base URL or API key missing in manual mode: When using manual authentication mode, both the Base URL Override and API Key Override must be provided; otherwise, an error is thrown.
  • Invalid Question ID: Providing an incorrect or non-existent question ID will likely result in an API error. Verify the question ID before running the node.
  • Malformed Quill Delta JSON: The choice content must be valid Quill Delta JSON. Invalid JSON or improperly formatted content may cause the API to reject the request.
  • API errors: Any HTTP errors returned by the Lectful API (e.g., 400 Bad Request, 401 Unauthorized) will be surfaced by the node. Check the API response message for details.

Links and References


This summary is based solely on static analysis of the provided source code and property definitions.

Discussion