lia-timer for LiaScript: Countdown Timers for Quizzes and Exercises

lia-timer for LiaScript: Countdown Timers for Quizzes and Exercises

Timed quizzes and exercises motivate focused work and simulate exam conditions. The lia-timer community plugin by MINT-the-GAP adds a countdown timer to any LiaScript quiz with a single HTML comment — no JavaScript required. Three trigger modes let you start the clock automatically, on the first check attempt, or only when the student explicitly clicks a start button.


Quick Start

<!--
import: https://raw.githubusercontent.com/MINT-the-GAP/lia-timer/main/README.md
-->

No macros. Add data-solution-timer attributes as a comment directly above the quiz block.


Attributes

AttributeValuesDescription
data-solution-timer10s, 2min, 1:30, 90, 500msDuration of the countdown
data-solution-timer-startimmediate, oncheck, onclickWhen to start the timer
data-solution-timer-badgeon, offShow/hide the countdown badge on the quiz
data-solution-timer-start-labelany textLabel for the start button (onclick mode)

Time formats

  • 10s — 10 seconds
  • 2min — 2 minutes
  • 1:30 — 1 minute 30 seconds
  • 90 — 90 seconds (plain number = seconds)
  • 500ms — 500 milliseconds

Trigger modes

immediate — Countdown starts on page load

<!-- data-solution-timer="30s" data-solution-timer-start="immediate" -->
What is the capital of France?

[( )] Berlin
[(X)] Paris
[( )] Madrid
[( )] Rome

The timer starts as soon as the student reaches this quiz slide.


oncheck — Countdown starts on first check

<!-- data-solution-timer="60s" data-solution-timer-start="oncheck" -->
$2^8 = $ [[256]]

No timer is visible until the student clicks Check for the first time. After that, the remaining time counts down.


onclick — Student starts the timer manually

<!-- data-solution-timer="45s" data-solution-timer-start="onclick" data-solution-timer-start-label="Start 45-second timer" -->
Translate into German: "The weather is beautiful today."

[[Das Wetter ist heute schön.]]

A button with the given label is shown. The countdown only begins when the student clicks it.


Example: Timed Test

<!--
import: https://raw.githubusercontent.com/MINT-the-GAP/lia-timer/main/README.md
-->

# Speed Math Quiz

## Round 1 — Mental arithmetic (10 s each)

<!-- data-solution-timer="10s" data-solution-timer-start="immediate" -->
$7 \times 8 =$ [[56]]

---

<!-- data-solution-timer="10s" data-solution-timer-start="immediate" -->
$144 \div 12 =$ [[12]]

---

<!-- data-solution-timer="10s" data-solution-timer-start="immediate" -->
$\sqrt{81} =$ [[9]]

---

## Round 2 — Longer calculation (allow 90 s, start when ready)

<!-- data-solution-timer="1:30" data-solution-timer-start="onclick" data-solution-timer-start-label="Begin 90-second task" -->
A train travels at 120 km/h for 45 minutes.
How many kilometres does it travel?

[[90]]

---

## Round 3 — Language fill-in (timer starts on first check)

<!-- data-solution-timer="30s" data-solution-timer-start="oncheck" -->
The opposite of "shallow" is:

[[deep]]

Try it live — each question has a countdown timer; race the clock to answer in time:


Combining with lia-freeze-v2

<!--
import: https://raw.githubusercontent.com/MINT-the-GAP/lia-timer/main/README.md
import: https://raw.githubusercontent.com/MINT-the-GAP/lia-freeze-v2/main/README.md
-->

# Timed Vocabulary Quiz

@freeze

<!-- data-solution-timer="20s" data-solution-timer-start="immediate" -->
"Der Schmetterling" means:

[( )] The butterfly
[(X)] The butterfly
[( )] The dragonfly

@endfreeze

@submit(mailto:teacher@school.edu)

Full Template Demo


Use Cases

Exam simulation — Give each question a strict time budget; the timer locks answers when it expires.

Speed drills — Short 5–10 second timers for mental math, vocabulary recall, or reading-speed exercises.

Pressure-free practice — Use onclick mode so students start the timer only when they feel ready, removing anxiety from timed practice.

Classroom pacing — Immediate timers ensure all students move on at the same pace during synchronous sessions.


Technical Facts

Runs in browserYes — script plugin
Server requiredNo
SyntaxHTML comment above quiz block
Trigger modesimmediate, oncheck, onclick
Time formatss, min, mm:ss, plain seconds, ms
BadgeOn-screen countdown badge (optional)
Start button labelCustomizable
Community templateYes (MINT-the-GAP)
LicenseMIT
MaintainedVersion 0.0.1

Try It

Try in LiaScript Open in LiveEditor View on GitHub

Related Posts

lia-freeze-v2 for LiaScript: Quiz Submission and Teacher Review Links

Let students freeze their LiaScript quiz answers into a shareable URL with lia-freeze-v2 — the teacher opens the link, sees exactly what the student answered, and the page is locked for review.

Read More

lia-kachel for LiaScript: Drag-and-Drop Tile Quizzes

Enhance LiaScript's built-in tile quizzes with lia-kachel — rounded drag-and-drop cards with full touch support, order-independent grading, and sequential reveal modes for classroom exercises.

Read More

lia-marker for LiaScript: Color-Coded Text Highlighting Quizzes

Add interactive text highlighting to LiaScript courses with lia-marker — students color-code words in six colors, while quiz macros verify that the right terms are highlighted in the right color.

Read More