From c000d1ddb1019896eb99ac5f6919b665bfab22b7 Mon Sep 17 00:00:00 2001 From: tunny17 Date: Sat, 7 Oct 2023 02:14:51 +0000 Subject: [PATCH] CLASSROOMIO-T-194: 20 Exercise Templates for CSS Co-authored-by: Tunji Adeyemi Merge-request: CLASSROOMIO-MR-91 Merged-by: Best Admin --- src/lib/mocks/css/001_css_syntax.ts | 118 +++++++++++++++++++ src/lib/mocks/css/002_css_selectors.ts | 118 +++++++++++++++++++ src/lib/mocks/css/003_css_howTo.ts | 118 +++++++++++++++++++ src/lib/mocks/css/004_css_comments.ts | 120 +++++++++++++++++++ src/lib/mocks/css/005_css_colors.ts | 126 ++++++++++++++++++++ src/lib/mocks/css/006_css_backgrounds.ts | 126 ++++++++++++++++++++ src/lib/mocks/css/007_css_borders.ts | 126 ++++++++++++++++++++ src/lib/mocks/css/008_css_margin.ts | 126 ++++++++++++++++++++ src/lib/mocks/css/009_css_padding.ts | 135 ++++++++++++++++++++++ src/lib/mocks/css/010_css_dimentions.ts | 134 ++++++++++++++++++++++ src/lib/mocks/css/011_css_boxModel.ts | 134 ++++++++++++++++++++++ src/lib/mocks/css/012_css_outline.ts | 132 +++++++++++++++++++++ src/lib/mocks/css/013_css_text.ts | 137 ++++++++++++++++++++++ src/lib/mocks/css/014_css_fonts.ts | 139 ++++++++++++++++++++++ src/lib/mocks/css/015_css_icons.ts | 139 ++++++++++++++++++++++ src/lib/mocks/css/016_css_links.ts | 139 ++++++++++++++++++++++ src/lib/mocks/css/017_css_lists.ts | 140 +++++++++++++++++++++++ src/lib/mocks/css/018_css_tables.ts | 140 +++++++++++++++++++++++ src/lib/mocks/css/019_css_display.ts | 129 +++++++++++++++++++++ src/lib/mocks/css/020_css_maxWidth.ts | 120 +++++++++++++++++++ src/lib/mocks/css/index.ts | 66 +++++++++++ src/lib/mocks/index.ts | 3 +- 22 files changed, 2664 insertions(+), 1 deletion(-) create mode 100644 src/lib/mocks/css/001_css_syntax.ts create mode 100644 src/lib/mocks/css/002_css_selectors.ts create mode 100644 src/lib/mocks/css/003_css_howTo.ts create mode 100644 src/lib/mocks/css/004_css_comments.ts create mode 100644 src/lib/mocks/css/005_css_colors.ts create mode 100644 src/lib/mocks/css/006_css_backgrounds.ts create mode 100644 src/lib/mocks/css/007_css_borders.ts create mode 100644 src/lib/mocks/css/008_css_margin.ts create mode 100644 src/lib/mocks/css/009_css_padding.ts create mode 100644 src/lib/mocks/css/010_css_dimentions.ts create mode 100644 src/lib/mocks/css/011_css_boxModel.ts create mode 100644 src/lib/mocks/css/012_css_outline.ts create mode 100644 src/lib/mocks/css/013_css_text.ts create mode 100644 src/lib/mocks/css/014_css_fonts.ts create mode 100644 src/lib/mocks/css/015_css_icons.ts create mode 100644 src/lib/mocks/css/016_css_links.ts create mode 100644 src/lib/mocks/css/017_css_lists.ts create mode 100644 src/lib/mocks/css/018_css_tables.ts create mode 100644 src/lib/mocks/css/019_css_display.ts create mode 100644 src/lib/mocks/css/020_css_maxWidth.ts create mode 100644 src/lib/mocks/css/index.ts diff --git a/src/lib/mocks/css/001_css_syntax.ts b/src/lib/mocks/css/001_css_syntax.ts new file mode 100644 index 00000000..fe5dc510 --- /dev/null +++ b/src/lib/mocks/css/001_css_syntax.ts @@ -0,0 +1,118 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'CSS Syntax Quiz', + description: 'Test your knowledge of CSS syntax', + questionnaire: { + questions: [ + { + title: 'What does CSS stand for?', + name: 'q1', + points: 1, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'Cascading Style Sheets', is_correct: true }, + { label: 'Computer Style Sheets', is_correct: false }, + { label: 'Creative Style Sheets', is_correct: false }, + ], + }, + { + title: 'How do you select an HTML element with id="demo" in CSS?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: '#demo', is_correct: true }, + { label: '.demo', is_correct: false }, + { label: 'element="demo"', is_correct: false }, + ], + }, + { + title: 'How do you select HTML elements with class="example" in CSS?', + name: 'q3', + points: 1, + order: 2, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: '.example', is_correct: true }, + { label: '#example', is_correct: false }, + { label: 'element="example"', is_correct: false }, + ], + }, + { + title: 'Which CSS property is used to change the text color of an element?', + name: 'q4', + points: 1, + order: 3, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'text-color', is_correct: false }, + { label: 'color', is_correct: true }, + { label: 'font-color', is_correct: false }, + ], + }, + { + title: 'How do you add a background color for all

elements?', + name: 'q5', + points: 1, + order: 4, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'h1 {background-color: yellow;}', is_correct: true }, + { label: 'h1.background-color: yellow;', is_correct: false }, + { label: 'all.h1 {bg-color: yellow;}', is_correct: false }, + ], + }, + { + title: 'What is the correct CSS syntax for making all the

elements bold?', + name: 'q6', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'p {text-style: bold;}', is_correct: false }, + { label: 'p {font-weight: bold;}', is_correct: true }, + { label: 'p.bold {text-weight: bold;}', is_correct: false }, + ], + }, + { + title: 'How do you add a comment in CSS?', + name: 'q7', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of the "float" property in CSS?', + name: 'q8', + points: 2, + order: 7, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'Explain the box model in CSS.', + name: 'q9', + points: 1, + order: 8, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What does CSS specificity refer to?', + name: 'q10', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/css/002_css_selectors.ts b/src/lib/mocks/css/002_css_selectors.ts new file mode 100644 index 00000000..e0f43b0d --- /dev/null +++ b/src/lib/mocks/css/002_css_selectors.ts @@ -0,0 +1,118 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'CSS Selectors Quiz', + description: 'Test your knowledge of CSS selectors', + questionnaire: { + questions: [ + { + title: 'What does the CSS selector "h1" target?', + name: 'q1', + points: 1, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: 'All

elements', is_correct: true }, + { label: 'The first

element', is_correct: false }, + { label: 'All elements with class "h1"', is_correct: false }, + ], + }, + { + title: 'Which CSS selector selects all elements with the class "example"?', + name: 'q2', + points: 1, + order: 1, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: '.example', is_correct: true }, + { label: '#example', is_correct: false }, + { label: 'element="example"', is_correct: false }, + ], + }, + { + title: 'How can you select all elements inside a
element?', + name: 'q3', + points: 1, + order: 2, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: '
{ }', is_correct: false }, + { label: 'div { }', is_correct: true }, + { label: '
* { }', is_correct: false }, + ], + }, + { + title: 'Which CSS selector selects elements with the "href" attribute?', + name: 'q4', + points: 1, + order: 3, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: '[href]', is_correct: true }, + { label: 'href', is_correct: false }, + { label: 'element="href"', is_correct: false }, + ], + }, + { + title: 'How do you select an element with the id "myID"?', + name: 'q5', + points: 1, + order: 4, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: '#myID', is_correct: true }, + { label: '.myID', is_correct: false }, + { label: 'id="myID"', is_correct: false }, + ], + }, + { + title: 'What does the CSS selector "p.intro" target?', + name: 'q6', + points: 2, + order: 5, + question_type: QuestionTypes[1], // CHECKBOX + options: [ + { label: 'All

elements with class "intro"', is_correct: true }, + { label: 'The first

element with class "intro"', is_correct: false }, + { label: 'All elements with the id "intro"', is_correct: false }, + ], + }, + { + title: 'Explain the usage of the universal selector "*" in CSS.', + name: 'q7', + points: 2, + order: 6, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'How can you select only the first child element of a parent element?', + name: 'q8', + points: 2, + order: 7, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the purpose of pseudo-classes in CSS?', + name: 'q9', + points: 1, + order: 8, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + { + title: 'What is the difference between the "descendant" selector and the "child" selector in CSS?', + name: 'q10', + points: 2, + order: 9, + question_type: QuestionTypes[2], // TEXTAREA + options: [], + }, + ], + }, +}; + +export default template; diff --git a/src/lib/mocks/css/003_css_howTo.ts b/src/lib/mocks/css/003_css_howTo.ts new file mode 100644 index 00000000..758edd89 --- /dev/null +++ b/src/lib/mocks/css/003_css_howTo.ts @@ -0,0 +1,118 @@ +import { QuestionTypes } from '../utils'; + +import type { ExerciseTemplate } from '$lib/utils/types'; + +const template: ExerciseTemplate = { + title: 'CSS How-To Quiz', + description: 'Test your knowledge of CSS with these how-to questions', + questionnaire: { + questions: [ + { + title: 'How do you include an external CSS file in an HTML document?', + name: 'q1', + points: 1, + order: 0, + question_type: QuestionTypes[0], // RADIO + options: [ + { label: '', is_correct: true }, + { label: '