From 1be002c372c5074a59d35cc41f63c5a1170162a7 Mon Sep 17 00:00:00 2001 From: Mattia Mascarello Date: Tue, 23 Apr 2024 10:40:46 +0200 Subject: [PATCH] Added questions, yaml schema, deleted json --- .vscode/settings.json | 6 + data.json | 390 ------------------------------------------ data.yaml | 26 +++ schema.yaml | 31 ++++ 4 files changed, 63 insertions(+), 390 deletions(-) create mode 100644 .vscode/settings.json delete mode 100644 data.json create mode 100644 schema.yaml diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3749029 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,6 @@ +{ + "yaml.schemas": { + "http://json-schema.org/draft-07/schema#": ["schema.yaml"], + "schema.yaml": [ "data.yaml" ] + } +} \ No newline at end of file diff --git a/data.json b/data.json deleted file mode 100644 index 8ff12c0..0000000 --- a/data.json +++ /dev/null @@ -1,390 +0,0 @@ -{ - "initialScore": 10000, - "questions": [ - { - "title": "Who's the best (and sexiest) president ever:", - "answers": [ - { - "text": "", - "effect": 2000 - }, - { - "text": "", - "effect": -9999 - }, - { - "text": "", - "effect": -9999 - }, - { - "text": "", - "effect": -9999 - } - ] - }, - { - "title": "Is Taiwan a country", - "answers": [ - { - "text": "Yes", - "effect": -1001 - }, - { - "text": "No", - "effect": 700 - }, - { - "text": "What is Taiwan?", - "effect": 3000 - } - ] - }, - { - "title": "How many parties are allowed in China?", - "answers": [ - { - "text": "One", - "effect": 1200 - }, - { - "text": "Many", - "effect": -5000 - }, - { - "text": "Only the Communist party", - "effect": 7000 - } - ] - }, - { - "title": "What happened in Tienanmen square in 1989?", - "answers": [ - { - "text": "Nothing", - "effect": 1200 - }, - { - "text": "Something", - "effect": -5000 - }, - { - "text": "What is Tienanmen square?", - "effect": 1000 - } - ] - }, - { - "title": "Do you use western socia media?", - "answers": [ - { - "text": "No", - "effect": 1200 - }, - { - "text": "Yes", - "effect": -5000 - } - ] - }, - { - "title": "Do you keep any Uyghurs hidden at home?", - "answers": [ - { - "text": "No", - "effect": 1200 - }, - { - "text": "Yes", - "effect": -5000 - } - ] - }, - { - "title": "Have you recently travelled abroad", - "answers": [ - { - "text": "No", - "effect": 1200 - }, - { - "text": "Yes", - "effect": -5000 - }, - { - "text": "To expand China's influence", - "effect": 1400 - } - ] - }, - { - "title": "Do you think we should respect the environment", - "answers": [ - { - "text": "No", - "effect": 1200 - }, - { - "text": "Yes", - "effect": -5000 - }, - { - "text": "Just casually expanding China's influence again", - "effect": 600 - } - ] - }, - { - "title": "Do you support Hong-Kong's indipendence?", - "answers": [ - { - "text": "No", - "effect": 1200 - }, - { - "text": "Yes", - "effect": -5000 - } - ] - }, - { - "title": "Would you like a multi-party system?", - "answers": [ - { - "text": "Yes", - "effect": -7200 - }, - { - "text": "No", - "effect": 5000 - }, - { - "text": "Glory to the Chinese Communist Party", - "effect": 9000 - } - ] - }, - { - "title": "Your father is going to a re-education camp", - "answers": [ - { - "text": "No!", - "effect": -7200 - }, - { - "text": "Yes!", - "effect": 5000 - } - ] - }, - { - "title": "Which country is the best?", - "answers": [ - { - "text": "America", - "effect": -1000 - }, - { - "text": "Not China", - "effect": -6969 - }, - { - "text": "China", - "effect": 3000 - }, - { - "text": "Taiwan", - "effect": -5000 - } - ] - }, - { - "title": "How many hours of videogames do you play per day?", - "answers": [ - { - "text": "1", - "effect": 1000 - }, - { - "text": "What is gaming?", - "effect": 609 - }, - { - "text": "3", - "effect": 500 - }, - { - "text": "more than 3 hours", - "effect": -1000 - } - ] - }, - { - "title": "Thoughts about communism?", - "answers": [ - { - "text": "I hate it", - "effect": -2000 - }, - { - "text": "I love it", - "effect": -609 - }, - { - "text": "We love it", - "effect": 1500 - }, - { - "text": "What is communism?", - "effect": -10 - } - ] - }, - { - "title": "Do you like the internet in China?", - "answers": [ - { - "text": "I use VPNS", - "effect": -1000 - }, - { - "text": "Yes", - "effect": 2000 - }, - { - "text": "Maybe", - "effect": -1000 - }, - { - "text": "I don't use it", - "effect": 1 - } - ] - }, - { - "title": "What do you think about China's involvement in international affairs?", - "answers": [ - { - "text": "Positive change", - "effect": 2500 - }, - { - "text": "Self-interest and expansionism", - "effect": -3000 - }, - { - "text": "I don't know", - "effect": 1000 - }, - { - "text": "Yes", - "effect": 10 - } - ] - }, - { - "title": "How do you feel about China's cultural heritage and traditions?", - "answers": [ - { - "text": "Diversity must be preserved", - "effect": -2000 - }, - { - "text": "We should respect everyone", - "effect": -1000 - }, - { - "text": "I only want Han", - "effect": 1000 - }, - { - "text": "Traditions?", - "effect": 1000 - } - ] - }, - { - "title": "What was the effect of the one child policy", - "answers": [ - { - "text": "Good, the CCP is infallible", - "effect": 2000 - }, - { - "text": "Good", - "effect": 1000 - }, - { - "text": "I don't know", - "effect": -1000 - }, - { - "text": "Bad", - "effect": -2000 - } - ] - }, - { - "title": "What do you think of the \"Great Firewall\"?", - "answers": [ - { - "text": "I love it", - "effect": 2000 - }, - { - "text": "It is necessary", - "effect": 1000 - }, - { - "text": "I don't like it", - "effect": -1000 - }, - { - "text": "I hate it", - "effect": -2000 - } - ] - }, - { - "title": "What is censorship?", - "answers": [ - { - "text": "Censorship? All lies", - "effect": 2000 - }, - { - "text": "We need unity", - "effect": 1000 - }, - { - "text": "I believe in human rights", - "effect": -1000 - }, - { - "text": "What?", - "effect": 2000 - } - ] - }, - { - "title": "Which of the following is your favourite?", - "answers": [ - { - "text": "Chairman Mao", - "effect": 2000 - }, - { - "text": "Deng Xiaoping", - "effect": 1000 - }, - { - "text": "Ronald Regan", - "effect": -2000 - }, - { - "text": "Zhao Ziyang", - "effect": -2000 - } - ] - } - ] -} diff --git a/data.yaml b/data.yaml index 8de8e81..17bfd76 100644 --- a/data.yaml +++ b/data.yaml @@ -182,3 +182,29 @@ questions: effect: -2000 - text: Zhao Ziyang effect: -2000 + - title: Who is the founder of the CCP + answers: + - text: Deng Xiaoping + effect: -500 + - text: Chiang Kai-shek + effect: -1000 + - text: Mao Zedong + effect: 2000 + - text: Xi Jinping + effect: -300 + - title: Have you ever heard of "Winnie The Pooh" + answers: + - text: "No" + effect: 1000 + - text: I hate that western cartoon + effect: 2000 + - text: Xi Jinping + effect: -2000 + - title: Is June 4th an important day to you? + answers: + - text: "No" + effect: 2000 + - text: Yes! + effect: -1000 + - text: "Wait a minute..." + effect: -2000 \ No newline at end of file diff --git a/schema.yaml b/schema.yaml new file mode 100644 index 0000000..a1081d4 --- /dev/null +++ b/schema.yaml @@ -0,0 +1,31 @@ +type: object +properties: + initialScore: + type: integer + description: Initial score for the quiz taker. + questions: + type: array + items: + type: object + properties: + title: + type: string + description: The question title. + answers: + type: array + items: + type: object + properties: + text: + type: string + description: The answer text. + effect: + type: integer + description: The effect of the answer on the quiz taker's score. + required: + - title + - answers + minItems: 1 +required: + - initialScore + - questions