diff --git a/docs/labs/template.html b/docs/labs/template.html index d485128b..4e29bc90 100644 --- a/docs/labs/template.html +++ b/docs/labs/template.html @@ -7,35 +7,9 @@ + - - - - - - - - - - - -
// If you use a one-line input: +>// If you use a one-line input (answer "EXPECTED0"): -// If you use a textarea: +// If you use a textarea (answer "EXPECTED1"): initial text 1; diff --git a/docs/labs/template.js b/docs/labs/template.js new file mode 100644 index 00000000..b36ae4c8 --- /dev/null +++ b/docs/labs/template.js @@ -0,0 +1,46 @@ +info = +{ + hints: [ + { + present: "initial", + text: "The term 'initial' is not part of the answer." + }, + { + present: "unknown", + text: "Unknown is not part of the answer." + }, + { + absent: String.raw`EXPECTED`, + text: "The word 'EXPECTED' is expected." + }, + { + present: "initial", + index: 1, + text: "The term 'initial' is not part of the answer." + }, + { + absent: String.raw`EXPECTED`, + index: 1, + text: "The word 'EXPECTED' is expected." + }, + ], + expected: [ + "EXPECTED0", + "EXPECTED1" + ], + correct: [ + String.raw`\s* EXPECTED0 \s*`, + String.raw`\s* EXPECTED1 \s*` + ], + successes: [ + [ " EXPECTED0 ", " EXPECTED1 " ], + [ " EXPECTED0 ", " EXPECTED1 " ] + ], + failures: [ + [ "EXPECTED", "EXPECTED1" ], + [ "Unknown", "EXPECTED1" ], + [ "EXPECTED0", "EXPECTED" ], + [ "EXPECTED0", "EXPECTED11" ] + ], + // debug: true // to enable debug output +}