Import Course Specification
This specification defines the structure of a course, including its steps and components, to ensure consistency and flexibility when building course content for the Telegram course constructor.
Course Fields
A course is defined by the following fields:
title (string): The title of the course, displayed to users.
description (string): A detailed description of the course. It can include information about the course purpose, content, and usage instructions.
is_publish (boolean): A flag indicating whether the course is published and available to users.
steps (array): A list of steps that make up the course. Each step represents a lesson, task, or activity.
Step Fields
Each step represents an individual unit of content or interaction in the course. Steps contain the following fields:
name (string): The title of the step, displayed to users.
text (string): A brief summary or description of the step’s content.
type (string): The type of content or activity for the step (e.g.,
image
,video
,quiz
).step_number (integer): A unique number identifying the step within the course.
is_publish (boolean): A flag indicating whether the step is published and accessible to users.
content_components (array): A list of components that make up the content of the step. Each component has a specific type and input data.
Component Fields
Components are building blocks for steps, defining specific types of content or interaction. Each component includes:
type (string): The type of the component (e.g.,
text
,mermaid
,code_executor
,image
).sort_index (integer): The order in which the component appears within the step.
input_data (object): Data specific to the component type, detailed below.
Supported Component Types
Text Component
Used for displaying formatted text.
type:
text
input_data:
html (string): The HTML content to render, which may include headings, paragraphs, lists, and other HTML tags.
Mermaid Component
Used for visualizing diagrams and charts with Mermaid.js.
type:
mermaid
input_data:
source (string): The Mermaid.js source code for the diagram.
Code Executor Component
Used for interactive code snippets that can be executed.
type:
code_executor
input_data:
template (string): The preloaded code snippet.
isReadOnly (boolean): Indicates whether the code is editable.
title (string): A title or description for the code snippet.
sourceLang (string): The programming language (e.g.,
golang
,javascript
).aceLang (string): The Ace editor language mode (e.g.,
ace/mode/golang
).langName (string): The display name of the programming language.
Image Component
Used to display images with optional captions.
type:
image
input_data:
url (string): The URL of the image.
alt (string): The alternative text for the image.
caption (string): A description or caption for the image (optional).
Single-Choose Question Component
Used for creating single-choice questions with explanations for each option.
type:
single_choose
input_data:
question (string): The question to be displayed.
options (array): A list of answer options, each with:
text (string): The text of the option.
isCorrect (boolean): Indicates if the option is correct.
explanation (string): Explanation for the option.
_settings (object): Additional settings for the component:
isIgnoreErrorAnswer (boolean): Determines if incorrect answers are ignored.
completedMessages (object): Messages displayed upon success or failure:
success (string): Message for a correct answer.
wrong (string): Message for an incorrect answer.
Multiple-Choose Question Component
Used for creating multiple-choice questions.
type:
multiple_choose
input_data:
question (string): The question to be displayed.
options (array): A list of answer options, each with:
text (string): The text of the option.
isCorrect (boolean): Indicates if the option is correct.
explanation (string, optional): Explanation for the option.
_settings (object): Additional settings for the component:
checkboxOptions (object): Settings for threshold and error handling:
isIgnoreErrorAnswer (boolean): Determines if incorrect answers are ignored.
lowerThreshold (integer): Minimum number of correct answers required.
threshold (boolean): Indicates if the threshold setting is active.
completedMessages (object): Messages displayed upon success or failure:
success (string): Message for correct answers.
wrong (string): Message for incorrect answers.
Component Code
type:
code
sort_index: An integer that specifies the order of the component within the step.
input_data: An object containing the following fields:
code (string): The actual code to display.
language (string): The programming language of the code (e.g.,
go
,python
,javascript
) for syntax highlighting._settings (object): Optional settings for the code display:
theme (string): The syntax highlighting theme for the code (e.g.,
atom
,monokai
,github
).
Example Course JSON
Last updated