Skip to content

Quiz Assembly

1. Overview

FieldTypeRequiredDescription
requestIDnumberYesStarting ID
tasktaskType[]YesArray of taskType question objects

2. taskType Definition

ts
interface taskType {
    "title": string,          // question title, required
    "comp": "dapei"|"fillDan"|"select"|"fillselect", // component type: select = multiple choice, fillselect = multi-select fill-in, fillDan = single fill-in, dapei = matching
    "daan": string[][]|string[], // answer(s)
    "subtitle": string,       // sub-question text
    "selectOption": string[], // answer options
    "isDuo": number,          // whether multi-select; 2 = multi-select
    "cls": "small",           // add this to shrink the component

    "requestId": number,      // usually filled by the program; can be left blank manually
    "id": number,             // usually filled by the program; can be left blank manually
}
interface taskType {
    "title": string,          // question title, required
    "comp": "dapei"|"fillDan"|"select"|"fillselect", // component type: select = multiple choice, fillselect = multi-select fill-in, fillDan = single fill-in, dapei = matching
    "daan": string[][]|string[], // answer(s)
    "subtitle": string,       // sub-question text
    "selectOption": string[], // answer options
    "isDuo": number,          // whether multi-select; 2 = multi-select
    "cls": "small",           // add this to shrink the component

    "requestId": number,      // usually filled by the program; can be left blank manually
    "id": number,             // usually filled by the program; can be left blank manually
}

3. Combined Data Example

json
{
    "requestID": 9000,
    "task": [
        { 
            "title": "Adjective-Preposition Collocations",
            "comp": "dapei",
            "daan": [
                ["interested", "in"],
                ["wrong", "with"],
                ["determined", "to"],
                ["worried", "about"],
                ["famous", "for"]
            ] 
        },
        {
            "title": "Write this sentence in English",
            "comp": "fillselect",
            "subtitle": "Learn knowledge",
            "selectOption": ["study", "learn", "lession", "book", "acquire", "knowledge"],
            "daan": ["acquire", "knowledge"],
            "isDuo": 2
        },
        { 
            "title": "Choose the correct answer", 
            "comp": "select",
            "subtitle": "China",
            "selectOption": ["China", "English", "Your"],
            "daan": ["China"]
        },
        { 
            "title": "Translate", 
            "comp": "fillDan",
            "subtitle": "What you want to point out is that there are many exceptions to the rules of \"the,\" so there is no point in remembering them.",
            "daan": [
                "What's the point of remembering the rules of \"the,\" if there are many exceptions to them?"
            ],
            "cls": "small"
        }
    ]
}
{
    "requestID": 9000,
    "task": [
        { 
            "title": "Adjective-Preposition Collocations",
            "comp": "dapei",
            "daan": [
                ["interested", "in"],
                ["wrong", "with"],
                ["determined", "to"],
                ["worried", "about"],
                ["famous", "for"]
            ] 
        },
        {
            "title": "Write this sentence in English",
            "comp": "fillselect",
            "subtitle": "Learn knowledge",
            "selectOption": ["study", "learn", "lession", "book", "acquire", "knowledge"],
            "daan": ["acquire", "knowledge"],
            "isDuo": 2
        },
        { 
            "title": "Choose the correct answer", 
            "comp": "select",
            "subtitle": "China",
            "selectOption": ["China", "English", "Your"],
            "daan": ["China"]
        },
        { 
            "title": "Translate", 
            "comp": "fillDan",
            "subtitle": "What you want to point out is that there are many exceptions to the rules of \"the,\" so there is no point in remembering them.",
            "daan": [
                "What's the point of remembering the rules of \"the,\" if there are many exceptions to them?"
            ],
            "cls": "small"
        }
    ]
}

4. Component Examples

dapei

json
{ 
    "title": "Adjective-Preposition Collocations",
    "comp": "dapei",
    "cls": "small",
    "daan": [
        ["interested", "in"],
        ["wrong", "with"],
        ["determined", "to"],
        ["worried", "about"],
        ["famous", "for"]
    ] 
}
{ 
    "title": "Adjective-Preposition Collocations",
    "comp": "dapei",
    "cls": "small",
    "daan": [
        ["interested", "in"],
        ["wrong", "with"],
        ["determined", "to"],
        ["worried", "about"],
        ["famous", "for"]
    ] 
}

fillselect

json
{
    "title": "Write this sentence in English",
    "comp": "fillselect",
    "subtitle": "Learn knowledge",
    "selectOption": ["study", "learn", "lession", "book", "acquire", "knowledge"],
    "daan": ["acquire", "knowledge"],
    "isDuo": 2
}
{
    "title": "Write this sentence in English",
    "comp": "fillselect",
    "subtitle": "Learn knowledge",
    "selectOption": ["study", "learn", "lession", "book", "acquire", "knowledge"],
    "daan": ["acquire", "knowledge"],
    "isDuo": 2
}

select

json
{ 
    "title": "Choose the correct answer", 
    "comp": "select",
    "subtitle": "China",
    "selectOption": ["China", "English", "Your"],
    "daan": ["China"]
}
{ 
    "title": "Choose the correct answer", 
    "comp": "select",
    "subtitle": "China",
    "selectOption": ["China", "English", "Your"],
    "daan": ["China"]
}

fillDan

json
{ 
    "title": "Translate", 
    "comp": "fillDan",
    "subtitle": "What you want to point out is that there are many exceptions to the rules of \"the,\" so there is no point in remembering them.",
    "daan": [
        "What's the point of remembering the rules of \"the,\" if there are many exceptions to them?"
    ],
    "cls": "small"
}
{ 
    "title": "Translate", 
    "comp": "fillDan",
    "subtitle": "What you want to point out is that there are many exceptions to the rules of \"the,\" so there is no point in remembering them.",
    "daan": [
        "What's the point of remembering the rules of \"the,\" if there are many exceptions to them?"
    ],
    "cls": "small"
}

fillDan — Multiple Blanks in One Question

Add ,"cls": "small" if the text is long.

json
{ 
    "title": "Multi-blank fill-in", 
    "comp": "fillDan",
    "subtitle": "Know: ____<br>Food: _____",
    "daan": ["know", "food"]
}
{ 
    "title": "Multi-blank fill-in", 
    "comp": "fillDan",
    "subtitle": "Know: ____<br>Food: _____",
    "daan": ["know", "food"]
}

5. Project Repository