quiz: Add Quiz.introduction for an optional intro message
[quizzer.git] / quizzes / posix-shell.json
1 {
2         "version": "0.1",
3         "introduction": "Test your knowledge of the POSIX shell.",
4         "questions": [
5                 {
6                         "class": "ScriptQuestion",
7                         "interpreter": "sh",
8                         "id": "quoting spaces",
9                         "prompt": "Call `ls` and pass it two arguments: `a` and `b c`.",
10                         "answer": "ls a 'b c'",
11                         "help": "http://pubs.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#tag_02_02"
12                 },
13                 {
14                         "class": "ScriptQuestion",
15                         "interpreter": "sh",
16                         "id": "echo constant",
17                         "prompt": "Print the string `hello, world` to stdout.",
18                         "answer": "echo 'hello, world'",
19                         "help": "http://pubs.opengroup.org/onlinepubs/009696699/utilities/echo.html"
20                 },
21                 {
22                         "class": "ScriptQuestion",
23                         "interpreter": "sh",
24                         "id": "parameter expansion",
25                         "prompt": "Print the contents of the PATH variable to stdout.",
26                         "answer": "echo \"$PATH\"",
27                         "help": "http://pubs.opengroup.org/onlinepubs/009696699/utilities/xcu_chap02.html#tag_02_06_02",
28                         "dependencies": [
29                                 "echo constant"
30                                 ]
31                 },
32                 {
33                         "class": "ScriptQuestion",
34                         "interpreter": "sh",
35                         "id": "variable assign constant",
36                         "prompt": "Set the ABC variable to the string `xyz`.",
37                         "answer": "ABC='xyz'",
38                         "teardown": [
39                                 "echo \"ABC: '${ABC}'\""
40                                 ],
41                         "help": "http://tldp.org/LDP/abs/html/varassignment.html"
42                 },
43                 {
44                         "class": "ScriptQuestion",
45                         "interpreter": "sh",
46                         "prompt": "Prepend the string `/some/path:` to the PATH variable.",
47                         "answer": "PATH=\"/some/path:$PATH\"",
48                         "teardown": [
49                                 "echo \"PATH: '${PATH}'\""
50                                 ],
51                         "help": "",
52                         "dependencies": [
53                                 "variable assign constant"
54                                 ]
55                 }
56         ]
57 }