Skip to content

<astl-drop>

A gap in running text that takes a word from a word bank (<astl-word-bank>) on the same page: answer (private) is the id of the correct word, bank the id of the bank (opaque in the view). One choice slot, answered with the opaque id of the word the student put there. Gaps of every kind share one reading-order numbering.

Generated from packages/components/src/drop/: the manifest, the message catalogs, the editor descriptor and the fixtures.

Property Value
Tag <astl-drop>
Display inline: sits inside text
Graded yes
Slot kinds choice (what they mean)
Element version (v) 1
Message namespace astl.drop
Editor label Word gap

The fixture drop-basic, played with the English UI and graded in the browser. Try it, then press "Check".

Fill the gaps with days of the week.

The school week starts on and ends on .

Monday Friday Sunday
<astl-doc lang="en">
<p>Fill the gaps with days of the week.</p>
<p>
The school week starts on <astl-drop id="start" bank="days" answer="monday"></astl-drop> and ends on
<astl-drop id="end" bank="days" answer="friday" points="2"></astl-drop>.
</p>
<astl-word-bank id="days">
<astl-word id="monday">Monday</astl-word>
<astl-word id="friday">Friday</astl-word>
<astl-word id="sunday" distractor>Sunday</astl-word>
</astl-word-bank>
</astl-doc>

Visibility: public attributes stay in the view, private ones exist only in the answer key (students never get them), derived ones are written by the compiler.

Attribute Meaning
id
public, required
id
Source id, unique in the document. Views carry an opaque id instead. Common to all components.
v
public
integer: >= 1
Element format version. Optional in sources (absent = 1); the compiler always writes the current one. Common to all components.
style-template
public
string
A look by name, from the style templates the host registers (the component scope); it wins over the document's. More: Looks. Common to all components.
scoring
private
scoring mode: all
default all
One of the manifest's scoring modes; absent = the manifest's default mode. Common to graded components.
points
private
number: 0.01 to 1000
default 1
Points of the element's scoring group. Inspector: "Points". Common to graded components.
answer
private, required
string
The id of the correct word in the bank. Inspector: "Correct word".
bank
public, required
string
The id of the word bank, on the same page, the gap takes its words from; the view carries its opaque id. Inspector: "Word bank".

No child elements.

One presentation: this component has no variants.

Pick a mode with the scoring attribute. Default: all. Rules: see Scoring.

Mode Rule
all (default) all-correct: full points only when every slot is correct; feedback shows the group verdict only

Slot kinds it produces: choice.

Reported in the namespace astl.drop, on top of the document issues. Errors block compiling; warnings do not.

Code Messages
DROP_BANK_UNKNOWN
error
params bank, id
English: Gap {id} takes its words from the bank “{bank}”, but this page has no word bank with that id.
Polish: Luka {id} bierze słowa z banku „{bank}”, ale na tej stronie nie ma banku słów o takim identyfikatorze.
DROP_ANSWER_UNKNOWN
error
params answer, bank, id
English: Gap {id} expects the word “{answer}”, but the word bank “{bank}” has no word with that id.
Polish: Luka {id} oczekuje słowa „{answer}”, ale bank słów „{bank}” nie ma słowa o takim identyfikatorze.
DROP_ANSWER_DISTRACTOR
warning
params bank, id, word
English: Gap {id} expects “{word}”, which the word bank “{bank}” marks as a distractor.
Polish: Luka {id} oczekuje słowa „{word}”, które bank słów „{bank}” oznacza jako dystraktor.

The insert menu lists <astl-drop> under "Components", where it inserts the default template. It has no named starters.

Entry English Polish
Components Word gap
The student puts a word from a word bank into the text.
Luka na słowo
Uczeń wstawia do tekstu słowo z banku słów.
Templates of astl-drop

As the descriptor writes them: {{id}} becomes a fresh id, {{t:key}} a message in the author's locale.

Default template:

<astl-drop id="{{id}}" answer="a" bank=""></astl-drop>
  • Pattern: button: Enter or Space puts the picked word here; with no word picked it takes its word out (back in the bank, picked to move it), or, empty, waits for a word: the arrow keys choose one and Enter puts it here; Escape cancels.
  • Keys: Tab, Enter, Space, ArrowUp, ArrowDown, ArrowLeft, ArrowRight, Home, End, Escape.

What every element must keep: Accessibility.

CSS parts: drop, word, verdict, solution. How to reach them: Looks.

Authors pick a look for one element with style-template; it wins over the document's. Built-in templates for <astl-drop>: playful, notebook.

Property Value
Label Word gap (editor.label)
Description The student puts a word from a word bank into the text. (editor.description)
Icon arrow-square-in
Id prefix drop: new elements get drop-1, drop-2, ...
Works with <astl-word-bank>: an insert fills an empty bank with the id of the first <astl-word-bank> (of the starter, else of the document) and adds one at the end of the document when it has none

Inspector fields, in order:

Field Edits Label Help
attribute attribute answer Correct word The word of its word bank that goes here. Without the bank: the id of the word, for example “a”.
attribute attribute bank Word bank The id of a word bank on the same page.
attribute attribute points Points

Every key of astl.drop: ui.* for students (messages/ui/<locale>.json, the only strings the element loads), issue codes, editor.* and template.* for authors (messages/<locale>.json).

15 keys in English and Polish
Key Messages
ui.name English: Gap {n}
Polish: Luka {n}
ui.namePlain English: Gap
Polish: Luka
ui.label English: {name}: {word}
Polish: {name}: {word}
ui.labelEmpty English: {name}, empty
Polish: {name}, pusta
ui.solution English: Correct answer: {answer}
Polish: Poprawna odpowiedź: {answer}
DROP_BANK_UNKNOWN English: Gap {id} takes its words from the bank “{bank}”, but this page has no word bank with that id.
Polish: Luka {id} bierze słowa z banku „{bank}”, ale na tej stronie nie ma banku słów o takim identyfikatorze.
DROP_ANSWER_UNKNOWN English: Gap {id} expects the word “{answer}”, but the word bank “{bank}” has no word with that id.
Polish: Luka {id} oczekuje słowa „{answer}”, ale bank słów „{bank}” nie ma słowa o takim identyfikatorze.
DROP_ANSWER_DISTRACTOR English: Gap {id} expects “{word}”, which the word bank “{bank}” marks as a distractor.
Polish: Luka {id} oczekuje słowa „{word}”, które bank słów „{bank}” oznacza jako dystraktor.
editor.label English: Word gap
Polish: Luka na słowo
editor.description English: The student puts a word from a word bank into the text.
Polish: Uczeń wstawia do tekstu słowo z banku słów.
editor.answer English: Correct word
Polish: Poprawne słowo
editor.answerHelp English: The word of its word bank that goes here. Without the bank: the id of the word, for example “a”.
Polish: Słowo z banku słów, które pasuje w to miejsce. Bez banku: identyfikator słowa, na przykład „a”.
editor.bank English: Word bank
Polish: Bank słów
editor.bankHelp English: The id of a word bank on the same page.
Polish: Identyfikator banku słów na tej samej stronie.
editor.points English: Points
Polish: Punkty