Skip to content

Commit 4987da0

Browse files
Edwin ChanEdwin Chan
authored andcommitted
added custom problem id and endless mode
1 parent f96999c commit 4987da0

2 files changed

Lines changed: 10 additions & 5 deletions

File tree

docs/admin-guide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
2. Fill out the set title, slug, topic tags, and settings.
1212
- **Order ID:** If you leave the `order` as `0` or blank, the system automatically assigns the next available number.
1313
3. Add problems one-by-one, including statement, answer type, and answer key.
14+
- Each problem has an **ID** field (the short label shown to students, e.g. `1`, `2a`, `A1`). It accepts any text — letters, digits, or a mix. Problems are sorted by ASCII order of their ID.
15+
- If you leave it as-is, new problems default to sequential numbers (`1`, `2`, `3`, …).
1416
4. For each problem, use the **LaTeX / HTML** toggle next to the statement field.
1517
- Use **LaTeX** for `$...$`/`$$...$$` style input.
1618
- Use **HTML** for content that includes tags like `<math>...</math>`.

docs/import-format.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,23 @@ Practice mode only shows tags that belong to more than 10 published questions.
2424
"videoUrl": "https://example.com/video",
2525
"problems": [
2626
{
27-
"number": 1,
27+
"number": "1",
2828
"statement": "Solve for x: 2x = 4",
2929
"answerType": "integer",
3030
"answerKey": "2",
3131
"points": 1,
3232
"topicTags": ["algebra", "linear-equations"]
3333
},
3434
{
35-
"number": 2,
35+
"number": "2",
3636
"statement": "Give the exact value of sqrt(2).",
3737
"answerType": "expression",
3838
"answerKey": "sqrt(2)",
3939
"acceptedAnswers": ["2^0.5"],
4040
"topicTags": ["surds"]
4141
},
4242
{
43-
"number": 3,
43+
"number": "3",
4444
"statement": "State the parity of 17.",
4545
"answerType": "exact",
4646
"answerKey": "odd"
@@ -79,7 +79,7 @@ Each entry in `problems` defines one question.
7979

8080
| Field | Type | Required | Default | Notes |
8181
| :--- | :--- | :--- | :--- | :--- |
82-
| `number` | integer | No | array index + 1 | Question number. |
82+
| `number` | string | No | array index + 1 | Question identifier. Supports alphanumeric values like `"1"`, `"1a"`, `"A1"`, `"Q3b"`. Integer values are also accepted and coerced to strings. Ordered by ASCII value. |
8383
| `statement` | string | No | `""` | Problem statement. LaTeX is allowed. |
8484
| `statementFormat` | string | No | inherits top-level `statementFormat` | One of `"LATEX"` or `"HTML"`. Use `"HTML"` for content containing tags like `<math>...</math>`. |
8585
| `answerKey` | string | Yes* | - | Primary correct answer. |
@@ -129,6 +129,9 @@ Per-problem `topicTags` drive Practice mode.
129129

130130
- File size limit: 5 MB
131131
- The uploaded file must be valid JSON.
132-
- Duplicate problem numbers are rejected.
132+
- Duplicate problem numbers (IDs) are rejected.
133+
- Problem IDs can be any non-empty string — letters, digits, or a mix (e.g. `"1a"`, `"A1"`, `"Q3b"`).
134+
- When problem IDs are omitted, they default to `"1"`, `"2"`, `"3"`, etc.
135+
- Problems are sorted by ASCII value of their ID string.
133136
- Each problem must include an answer.
134137
- Invalid answer types are rejected.

0 commit comments

Comments
 (0)