Add sample quiz JSON file

This commit is contained in:
luca0N! 2021-06-02 19:26:41 -03:00
parent 0abc865113
commit 4379bbd6e5
Signed by: luca0N
GPG Key ID: 2E7B4655CF16D7D6
2 changed files with 100 additions and 1 deletions

View File

@ -41,7 +41,8 @@ function setUpStrings(){
let warning = document.getElementById('warning'); let warning = document.getElementById('warning');
warning.style['display'] = 'unset'; warning.style['display'] = 'unset';
// Get JSON file which contains all of the challenges required. // Get JSON file which contains all of the challenges required.
sendGetRequest('privacy-quiz.en.json', function(text){ // FIXME: remove hardcoded quiz name.
sendGetRequest('sample.en.json', function(text){
quiz = JSON.parse(text); quiz = JSON.parse(text);
// Set up UI elements based on quiz metadata. // Set up UI elements based on quiz metadata.

98
sample.en.json Normal file
View File

@ -0,0 +1,98 @@
{
"title": "Sample Quiz",
"originalTimestamp": 1622672119,
"timestamp": -1,
"author": "luca0N!",
"contributors": [
"luca0N!"
],
"publisher": "luca0N!",
"license": "CC0",
"version": "v0.0-dev",
"revision": 1,
"format": "qrstd-1.0",
"globalSettings": {
"section.multiple.points.max": 10,
"section.multiple.points.min": -10
},
"threshold":{
"s.min": 10,
"a.min": 8,
"b.min": 4,
"c.min": 0,
"d.min": -3,
"e.min": -14,
"f.min": -24
},
"gradeMessages":{
"grade-s": "Congratulations! Your grade is Grade S.",
"grade-a": "Congratulations! Your grade is Grade A.",
"grade-b": "Congratulations! Your grade is Grade B.",
"grade-c": "Your grade is Grade C.",
"grade-d": "Your grade is Grade D.",
"grade-e": "Your grade is Grade E.",
"grade-f": "Your grade is Grade F."
},
"contents":[
{
"title": "This is a question with checkboxes.",
"type": "multiple",
"choices": [
"Choice 1 (Good)",
"Choice 2 (Warning)",
"Choice 3 (Bad)",
"Choice 4 (Critical)"
],
"ids": [
"choice-good", "choice-warning", "choice-bad", "choice-critical"
]
},
{
"title": "This is another question, but with radio buttons instead of checkboxes.",
"type": "single",
"choices": [
"Choice 1 (Good)",
"Choice 2 (Warning)",
"Choice 3 (Bad)",
"Choice 4 (Critical)"
],
"ids": [
"choice-good", "choice-warning", "choice-bad", "choice-critical"
]
}
],
"reports":{
"choice-good": {
"title": "You have picked a good choice",
"type": "good",
"points": 5,
"description": "This is the report description."
},
"choice-warning": {
"title": "You have picked a choice associated with a warning report",
"type": "warning",
"points": 0,
"description": "This is the report description.\nLine breaks will split paragraphs.",
"advisory": "This is the report advisory. Advisories are optional and can be used with all report types. Advisories are recommended for all report types, except good reports."
},
"choice-bad": {
"title": "You have picked a bad choice",
"type": "bad",
"points": -5,
"description": "This is the report description.",
"advisory": "This is the report advisory. Advisories are optional and can be used with all report types. Advisories are recommended for all report types, except good reports."
},
"choice-critical": {
"title": "You have picked a very bad choice",
"type": "critical",
"points": -8,
"description": "This is the report description.",
"advisory": "This is the report advisory. Advisories are optional and can be used with all report types. Advisories are recommended for all report types, except good reports."
}
}
}