問題の絵
空白のある数列、穴あきの文、1か所欠けたコード。これらのテンプレートは、毎回同じ絵を描きます。
絵を依頼する
テンプレートとデータを送ります。同じ入力なら、いつも同じ絵になります。
POST /api/v1/quizzes/{quizId}/images/templates
Authorization: Bearer <quiz-scoped-key>
Content-Type: application/json
{
"templateId": "universal.tiles",
"data": {
"rows": [
[
"2",
"4",
"8",
"?"
]
]
}
}保存するか、プレビューだけか
絵をクイズに保存するか、デザインを調整しているあいだの一時プレビューを頼むか。
output: "image"通常はクイズに保存したWebPで、画像IDが返ります。
output: "png" | "svg"PNGとSVGはプレビュー用のバイトで返され、保存されません。
空白が見えるテンプレート
実際に穴が表示されるものだけです。
language.textCloud と code.syntaxBlock は背景を足しますが空白は描かないので、このギャラリーではなくAPIリファレンスにあります。

universal.tiles数字タイル
数列、足し算、方程式をわかりやすいタイルにします。
{
"templateId": "universal.tiles",
"data": {
"rows": [
[
"2",
"4",
"8",
"?"
]
]
}
}
universal.sortingBins分類ボックス
ラベルのついた箱に項目を入れます。
{
"templateId": "universal.sortingBins",
"data": {
"bins": [
"Round",
"Angular"
],
"binItems": [
[
{
"kind": "shape",
"name": "circle"
},
{
"kind": "shape",
"name": "triangle"
}
],
[
{
"kind": "shape",
"name": "circle"
},
"?"
]
]
}
}
universal.clockFace時計の文字盤
時刻の問題のためのアナログ時計。
{
"templateId": "universal.clockFace",
"data": {
"hour": 3,
"minute": 30
}
}
universal.numberLine数直線
空欄付きの数え上げと数列。
{
"templateId": "universal.numberLine",
"data": {
"start": 0,
"end": 10,
"step": 2,
"missing": 6
}
}
math.fractionBar分数バー
全体に対する分数を示す分割バー。
{
"templateId": "math.fractionBar",
"data": {
"shaded": 3,
"total": 4
}
}
language.sentenceTiles文のタイル
単語タイルで文をつくり、埋める空白があります。
{
"templateId": "language.sentenceTiles",
"data": {
"words": [
"The",
"cat",
"sat",
"on",
"the",
{
"kind": "gap",
"characters": 3
}
]
}
}
geometry.figure図形
角、三角形、四角形、円、平行線に問題に必要なラベルを付け、求める値を空欄にします。
{
"templateId": "geometry.figure",
"data": {
"kind": "triangle",
"angles": [
90,
35,
55
],
"angleLabels": [
"90°",
"35°",
"?"
],
"sideLabels": [
"12 cm",
null,
"5 cm"
],
"vertices": [
"A",
"B",
"C"
]
}
}
data.barChart棒グラフ
目盛線から値を読み取る、項目を比べる、合計を求める問題に。
{
"templateId": "data.barChart",
"data": {
"title": "Costumes worn at the party",
"categories": [
"Witch",
"Ghost",
"Vampire",
"Zombie"
],
"values": [
12,
7,
9,
4
],
"unit": "pupils"
}
}
data.tableデータ表
1つのセルを隠した小さな表で「ここに入るのは?」を問います。
{
"templateId": "data.table",
"data": {
"headers": [
"Shop",
"Price (£)",
"Sold"
],
"rows": [
[
"Boo",
3.5,
12
],
[
"Fang",
4,
null
],
[
"Grim",
2.75,
20
]
]
}
}
math.coordinateGrid座標平面
座標・中点・傾きのための点と線分をプロットします。
{
"templateId": "math.coordinateGrid",
"data": {
"xMin": -5,
"xMax": 5,
"yMin": -5,
"yMax": 5,
"points": [
{
"x": 2,
"y": 3,
"label": "A"
},
{
"x": -4,
"y": 1,
"label": "B"
}
],
"segments": [
[
0,
1
]
]
}
}
science.circuit回路図
電池・豆電球・抵抗・スイッチ・計器の標準記号で描いた直列回路。
{
"templateId": "science.circuit",
"data": {
"components": [
{
"kind": "battery",
"label": "6 V"
},
{
"kind": "switch",
"open": true
},
{
"kind": "bulb",
"label": "L1"
},
{
"kind": "resistor",
"label": "10 Ω"
},
{
"kind": "ammeter"
}
]
}
}
science.rayDiagram光線図
鏡とレンズの主要光線。像のできる位置を問う、または像を表示します。
{
"templateId": "science.rayDiagram",
"data": {
"device": "concaveMirror",
"focalLength": 2,
"objectDistance": 5,
"objectHeight": 2,
"showImage": false
}
}
code.fillBlank穴埋め
欠けた部分がはっきり印のついたコード。
{
"templateId": "code.fillBlank",
"data": {
"code": "function average(scores) {\n const total = scores.reduce(\n (sum, score) => sum + score,\n 0\n )\n return total ___{1} scores.length\n}",
"language": "javascript"
}
}コードの例をもっと
code.fillBlank は30行、最大2,000文字まで。___ だけなら標準の幅。___{N} は空白をN文字分にし、Nは1〜24。JavaScript、Python、HTML、SQLが使えます。
JavaScript

{
"templateId": "code.fillBlank",
"data": {
"code": "async function loadQuiz(id) {\n const response = await fetch(`/api/quizzes/${id}`)\n if (!response.ok) {\n throw new Error(\"Could not load quiz\")\n }\n return ___{15}\n}",
"language": "javascript"
}
}Python

{
"templateId": "code.fillBlank",
"data": {
"code": "def average(scores):\n if not scores:\n return 0\n\n total = sum(scores)\n return total ___{1} len(scores)",
"language": "python"
}
}HTML

{
"templateId": "code.fillBlank",
"data": {
"code": "<figure class=\"quiz-image\">\n <img\n src=\"aurora.webp\"\n ___{3}=\"Northern lights over Tromsø\"\n />\n <figcaption>Norway at night</figcaption>\n</figure>",
"language": "html"
}
}SQL

{
"templateId": "code.fillBlank",
"data": {
"code": "SELECT subject, COUNT(*) AS question_count\nFROM questions\nWHERE status = 'published'\nGROUP BY ___{7}\nORDER BY question_count DESC;",
"language": "sql"
}
}タイルに入れられるもの
文字、数字、空白で絵を組み立てます。絵文字、重ね絵文字、旗、図形、装飾テキスト、LaTeXも使えます。{"kind":"gap","characters":N} は文字またはタイルの空白をN文字分にし、Nは1〜24。古い書き方は標準幅のままです。
textnumber?{"kind":"gap","characters":3}emojiemojiStackflagshapelatex