Skip to content

Commit b1926a6

Browse files
committed
Add documentation of gap-filler UI and update documentation.
1 parent 74af02f commit b1926a6

File tree

1 file changed

+48
-2
lines changed

1 file changed

+48
-2
lines changed

Readme.md

Lines changed: 48 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# CODE RUNNER
22

3-
Version: 3.7.0 August 2019
3+
Version: 3.7.1 October 2019
44

55
Authors: Richard Lobb, University of Canterbury, New Zealand.
66
Tim Hunt, The Open University, UK
@@ -1927,8 +1927,54 @@ itself the empty string.
19271927
An example of the use of this UI type can be seen in the
19281928
*python3_program_testing* prototype in the *samples* folder.
19291929
1930+
### The Gap Filler UI (new, experimental)
19301931
1931-
### The Html UI
1932+
This plugin replaces the usual textarea answer box with a div
1933+
consisting of pre-formatted text supplied by the question author in either the
1934+
"globalextra" field or the testcode field of the first test case, according
1935+
to the template parameter gapfiller_ui_source (default: globalextra). HTML
1936+
entry or textarea elements are then inserted at
1937+
specified points. It is intended primarily for use with coding questions
1938+
where the answerbox presents the students with code that has smallish bits
1939+
missing.
1940+
1941+
The locations within the globalextra text at which the input elements are
1942+
to be inserted are denoted by "tags" of the form
1943+
1944+
{[ size ]}
1945+
1946+
for an HTML input element
1947+
1948+
or
1949+
1950+
{[ rows, columns ]}
1951+
1952+
for a textarea element
1953+
1954+
where size, rows and column are integer literals. These respectively
1955+
inject an HTML input element or a textarea element of the
1956+
specified size.
1957+
1958+
The serialisation of the answer box contents, i.e. the text that
1959+
copied back into the textarea for submissions
1960+
as the answer, is simply a list of all the field values (strings), in order.
1961+
1962+
As a special case of the serialisation, if the value list is empty, the
1963+
serialisation itself is the empty string.
1964+
1965+
The delimiters for the input element insertion tags are by default '{[' and
1966+
']}', but can be changed by an optional template parameter gap_filler_delimiters,
1967+
which must be a 2-element array of strings. For example:
1968+
1969+
{"gap_filler_delimiters": ["{{", "}}"]}
1970+
1971+
Note that the double-brace delimiters in that example are the same as those
1972+
used by Twig, so using them instead of the default would prevent you from
1973+
ever adding Twig expansion (e.g. for randomisation) to the question. This is
1974+
not recommended.
1975+
1976+
1977+
### The Html UI (unsupported and experimental)
19321978
19331979
The HTML UI plug-in replaces the answer box with custom HTML provided by the
19341980
question author. The HTML will usually include data entry fields such as

0 commit comments

Comments
 (0)