Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions packages/preview/exercise-bank/0.7.0/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2025 Nathan

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
1,469 changes: 1,469 additions & 0 deletions packages/preview/exercise-bank/0.7.0/README.md

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 31 additions & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/badge-position.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Badge position - exercise-bank
// badge-position: "above" frees the width the left badge column costs on every
// line, which matters most in a narrow measure and with enumerations

#import "@preview/exercise-bank:0.7.0": *

#set page(width: 9cm, height: auto, margin: 1cm)
#set text(font: "New Computer Modern", size: 10pt)
#set par(justify: true)

#let statement = [
Lors d'une élection, il y avait 41751 inscrits, 22159 votants et M. X a
obtenu 12826 voix.
+ Donner le résultat de M. X en pourcentage des votants, puis en pourcentage
des inscrits.
+ Donner le pourcentage d'abstention.
]

#exo-setup(badge-style: "filled-circle", badge-color: rgb("#1a4f8a"))

*badge-position: "margin"* (défaut)

#exo(exercise: statement)

#v(0.5em)

*badge-position: "above"*

#exo-setup(badge-position: "above")

#exo(exercise: statement)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/badge-size.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Badge size - exercise-bank
// badge-scale multiplies the paddings of any badge shape; badge-pad-x,
// badge-pad-y and badge-radius replace them outright

#import "@preview/exercise-bank:0.7.0": *

#set page(width: 11cm, height: auto, margin: 1cm)
#set text(font: "New Computer Modern", size: 10pt)

#exo-setup(
exercise-label: "Exercice",
badge-position: "above",
badge-color: rgb("#1a5276"),
label-font-size: 10pt,
)

#for style in ("filled-rect", "pill") {
for scale in (0.5, 1.0, 1.6) {
exo-setup(badge-style: style, badge-scale: scale)
exo(exercise: [`badge-style: "#style"`, `badge-scale: #scale`])
}
}

#exo-setup(badge-style: "pill", badge-scale: 1.0,
badge-pad-x: 6pt, badge-pad-y: 2pt, badge-radius: 7pt)
#exo(exercise: [`badge-pad-x: 6pt`, `badge-pad-y: 2pt`, `badge-radius: 7pt`])
1 change: 1 addition & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/bank.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 33 additions & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/bank.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#import "@preview/exercise-bank:0.7.0": exo-define, exo-show, exo-show-many, exo-setup

#set page(width: 14cm, height: auto, margin: 1cm)

= Exercise Bank

// Define exercises (not displayed yet)
#exo-define(
id: "quad-1",
exercise: [Solve $x^2 - 5x + 6 = 0$.],
topic: "quadratics",
solution: [$x = 2$ or $x = 3$],
)

#exo-define(
id: "quad-2",
exercise: [State the quadratic formula.],
topic: "quadratics",
solution: [$x = frac(-b plus.minus sqrt(b^2 - 4 a c), 2 a)$],
)

#exo-define(
id: "geom-1",
exercise: [Find the area of a circle with radius 5.],
topic: "geometry",
solution: [$A = pi r^2 = 25pi$],
)

== Selected Exercises

// Show specific exercises by ID
#exo-show("quad-1")
#exo-show("geom-1")
1 change: 1 addition & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/basic.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/basic.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#import "@preview/exercise-bank:0.7.0": exo

#set page(width: 14cm, height: auto, margin: 1cm)

= Basic Exercises

#exo(exercise: [
Solve the equation $2x + 5 = 13$.
])

#exo(exercise: [
Calculate the area of a rectangle with length 8 cm and width 5 cm.
])

#exo(exercise: [
Factor the expression $x^2 - 9$.
])
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/competencies.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#import "@preview/exercise-bank:0.7.0": exo-define, exo-show, exo-setup

#set page(width: 14cm, height: auto, margin: 1cm)

#exo-setup(
show-competencies: true,
)

= Exercises with Competencies

#exo-define(
id: "comp-1",
exercise: [Solve $2x + 5 = 13$ and explain your method.],
competencies: ("C1.1", "C2.3"),
solution: [$x = 4$],
)

#exo-define(
id: "comp-2",
exercise: [Determine the nature of the roots of $x^2 - 3x + 2 = 0$.],
competencies: ("C1.2", "C3.1", "C4.1"),
solution: [The discriminant is $b^2 - 4 a c = 1 > 0$, so there are two real solutions.],
)

#exo-show("comp-1")
#exo-show("comp-2")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 49 additions & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/corrections-only.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#import "@preview/exercise-bank:0.7.0": exo, exo-setup

#set page(width: 14cm, height: auto, margin: 1cm)

#exo-setup(
display: "sol", // Only show solutions/corrections (hide exercises)
corr-display: "correction", // Show corrections
)

= Teacher's Answer Key

This document shows only corrections/solutions (exercises are hidden).
Perfect for creating teacher answer keys.

#exo(
exercise: [Calculate $3 + 4 times 2$. (This exercise text is hidden)],
correction: [
$3 + 4 times 2 = 3 + 8 = 11$
],
)

#exo(
exercise: [Solve $x^2 = 9$. (This exercise text is hidden)],
correction: [
*Correction:*\
$x^2 = 9$\
$x = plus.minus 3$\
\
Common mistake: Students forget the negative root.
],
)

#exo(
exercise: [Factor $x^2 - 4$. (Hidden)],
correction: [
$x^2 - 4 = (x + 2)(x - 2)$
],
)

#exo(
exercise: [Simplify $2(x + 3) - 4x$. (Hidden)],
correction: [
$2(x + 3) - 4x$\
$= 2x + 6 - 4x$\
$= -2x + 6$\
\
Teaching tip: Emphasize distribution before combining like terms.
],
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/corrections.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#import "@preview/exercise-bank:0.7.0": exo, exo-setup

#set page(width: 14cm, height: auto, margin: 1cm)

#exo-setup(
corr-display: "correction", // Show corrections instead of solutions
)

= Correction Display Demo

== Exercise with correction only
#exo(
exercise: [
Calculate $3 + 4 times 2$.
],
correction: [
$3 + 4 times 2 = 3 + 8 = 11$
],
)

== Exercise with detailed correction
#exo(
exercise: [
Solve $x^2 = 9$.
],
correction: [
*Teacher's correction:*\
This is a basic quadratic equation.\
$x^2 = 9$\
$x = plus.minus 3$\
\
Students often forget the negative root. Make sure to emphasize both solutions.
],
)

== Exercise with both (correction shown)
#exo(
exercise: [
Factor $x^2 - 4$.
],
solution: [
$x^2 - 4 = (x + 2)(x - 2)$
],
correction: [
*Detailed correction:*\
This is a difference of squares: $a^2 - b^2 = (a+b)(a-b)$\
With $a = x$ and $b = 2$:\
$x^2 - 4 = (x + 2)(x - 2)$
],
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 54 additions & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/difficulty.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
// Difficulty encoding - exercise-bank
// Up to 5 levels, shown as badge colors, stars, or symbols

#import "@preview/exercise-bank:0.7.0": *

#set page(width: 14cm, height: auto, margin: 1cm)
#set text(font: "New Computer Modern", size: 11pt)

= Difficulty Levels

== Colors (default)

The exercise badge takes the color of the difficulty level:

#exo(exercise: [Level 1 -- introductory. Compute $2 + 2$.], difficulty: 1)
#exo(exercise: [Level 2 -- standard. Solve $3x = 12$.], difficulty: 2)
#exo(exercise: [Level 3 -- exam-type. Solve $x^2 - 4x + 3 = 0$.], difficulty: 3)
#exo(exercise: [Level 4 -- advanced. Show that $sqrt(2)$ is irrational.], difficulty: 4)
#exo(exercise: [Level 5 -- expert. Prove there are infinitely many primes.], difficulty: 5)

== Stars

#exo-setup(difficulty-display: "stars")

#exo(exercise: [One star. Compute $5 dot 6$.], difficulty: 1)
#exo(exercise: [Three stars. Factor $x^2 - 9$.], difficulty: 3)
#exo(exercise: [Five stars. A real challenge.], difficulty: 5)

== Symbols

Seedling, pencil, target, mountain, star:

#exo-setup(difficulty-display: "symbols")

#exo(exercise: [Seedling -- introductory.], difficulty: 1)
#exo(exercise: [Pencil -- standard.], difficulty: 2)
#exo(exercise: [Target -- exam-type.], difficulty: 3)
#exo(exercise: [Mountain -- advanced.], difficulty: 4)
#exo(exercise: [Star -- expert.], difficulty: 5)

== Custom scale

Define your own levels, colors, and symbols:

#exo-setup(
difficulty-display: "color",
difficulty-scale: (
"easy": (color: rgb("#00897b")),
"hard": (color: rgb("#e65100")),
),
)

#exo(exercise: [An "easy" one.], difficulty: "easy")
#exo(exercise: [A "hard" one.], difficulty: "hard")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
80 changes: 80 additions & 0 deletions packages/preview/exercise-bank/0.7.0/gallery/draft-mode.typ
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
#import "@preview/exercise-bank:0.7.0": *

#set page(width: 16cm, height: auto, margin: 1cm)

= Draft Mode Demo

== Part 1: Draft Mode OFF (Student Version)

Empty corrections/solutions maintain counter but show no placeholder.

#exo-setup(
draft-mode: false, // Student version - no placeholders visible
)

#exo(
exercise: [Solve $x + 5 = 12$],
solution: [], // Empty - shows space but no placeholder
)

#exo(
exercise: [Calculate $3 times 4$],
solution: [$3 times 4 = 12$], // Normal solution
)

#exo(
exercise: [Simplify $2x + 3x$],
solution: [], // Empty - counter continues
)

#pagebreak()

== Part 2: Draft Mode ON (Teacher Version)

Empty corrections/solutions show placeholders for completion.

#exo-setup(
draft-mode: true, // Teacher draft - shows placeholders
correction-placeholder: [_[To be completed]_],
solution-placeholder: [_[Answer to be written]_],
)

#exo(
exercise: [Solve $x + 5 = 12$],
solution: [], // Shows placeholder: "To be completed"
)

#exo(
exercise: [Calculate $3 times 4$],
solution: [$3 times 4 = 12$], // Normal solution
)

#exo(
exercise: [Simplify $2x + 3x$],
solution: [], // Shows placeholder
)

#pagebreak()

== Part 3: With Correction Mode

#exo-setup(
draft-mode: true,
corr-display: "correction", // Show corrections
correction-placeholder: [_[Explanation to be written]_],
)

#exo(
exercise: [Factor $x^2 - 4$],
correction: [], // Empty correction - shows placeholder
)

#exo(
exercise: [What is $5 + 7$?],
correction: [Add the two numbers to get 12.], // Real correction
)

#exo(
exercise: [Expand $(x+3)^2$],
correction: [], // Empty - shows placeholder
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading