- Notifications
You must be signed in to change notification settings - Fork 4
Add css quiz fixtures #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits Select commit Hold shift + click to select a range
6f65d4c #60 Add CSS quiz questions
metinbaris b3ef18b #60 Add CSS array-unit tests
metinbaris 56f7fd4 #60 Add typescript css questions
metinbaris 130bc83 #60 Add css quiz and question import
metinbaris b383b9f #60 Update numbers
metinbaris File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,148 @@ | ||
| import {QuestionJsonldQuestionRead} from "../../generated/openapi" | ||
| | ||
| const CSSQuestions: QuestionJsonldQuestionRead[] = [ | ||
| { | ||
| '@context': "/api/v1/contexts/Question", | ||
| '@id': "/api/v1/question/15", | ||
| '@type': "Question", | ||
| content: "How many padding properties are there in CSS?", | ||
| answers: [ | ||
| { | ||
| '@id': "/api/v1/answers/1", | ||
| '@type': "Answer", | ||
| content: "3", | ||
| is_correct: false, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/2", | ||
| '@type': "Answer", | ||
| content: "4", | ||
| is_correct: false, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/3", | ||
| '@type': "Answer", | ||
| content: "5", | ||
| is_correct: true, | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| '@context': "/api/v1/contexts/Question", | ||
| '@id': "/api/v1/question/16", | ||
| '@type': "Question", | ||
| content: "In CSS which rule overrides a previous style?", | ||
| answers: [ | ||
| { | ||
| '@id': "/api/v1/answers/4", | ||
| '@type': "Answer", | ||
| content: "important", | ||
| is_correct: false, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/5", | ||
| '@type': "Answer", | ||
| content: "!important", | ||
| is_correct: true, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/6", | ||
| '@type': "Answer", | ||
| content: "important!", | ||
| is_correct: false, | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| '@context': "/api/v1/contexts/Question", | ||
| '@id': "/api/v1/question/17", | ||
| '@type': "Question", | ||
| content: "In CSS which property controls the text font?", | ||
| answers: [ | ||
| { | ||
| '@id': "/api/v1/answers/7", | ||
| '@type': "Answer", | ||
| content: "font-face", | ||
| is_correct: false, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/8", | ||
| '@type': "Answer", | ||
| content: "font", | ||
| is_correct: false, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/9", | ||
| '@type': "Answer", | ||
| content: "font-family", | ||
| is_correct: true, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/10", | ||
| '@type': "Answer", | ||
| content: "font-style", | ||
| is_correct: false, | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| '@context': "/api/v1/contexts/Question", | ||
| '@id': "/api/v1/question/18", | ||
| '@type': "Question", | ||
| content: "What controls a repeating background in CSS?", | ||
| answers: [ | ||
| { | ||
| '@id': "/api/v1/answers/11", | ||
| '@type': "Answer", | ||
| content: "background: repeat", | ||
| is_correct: false, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/12", | ||
| '@type': "Answer", | ||
| content: "image-repeat: repeat", | ||
| is_correct: false, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/13", | ||
| '@type': "Answer", | ||
| content: "repeat-background: repeat", | ||
| is_correct: true, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/14", | ||
| '@type': "Answer", | ||
| content: "background-repeat: repeat", | ||
| is_correct: false, | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| '@context': "/api/v1/contexts/Question", | ||
| '@id': "/api/v1/question/19", | ||
| '@type': "Question", | ||
| content: "In #css how would you remove an underline from a hyperlink?", | ||
| answers: [ | ||
| { | ||
| '@id': "/api/v1/answers/15", | ||
| '@type': "Answer", | ||
| content: "underline: none", | ||
| is_correct: false, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/16", | ||
| '@type': "Answer", | ||
| content: "text-underline: none", | ||
| is_correct: false, | ||
| }, | ||
| { | ||
| '@id': "/api/v1/answers/17", | ||
| '@type': "Answer", | ||
| content: "text-decoration: none", | ||
| is_correct: true, | ||
| }, | ||
| ], | ||
| }, | ||
| ] | ||
| | ||
| export default CSSQuestions | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| import {QuizJsonldRead} from "../../generated/openapi" | ||
| | ||
| const CSSQuiz: QuizJsonldRead = | ||
| { | ||
| '@context': "/api/v1/contexts/Quiz", | ||
| '@id': "/api/v1/quiz/4", | ||
metinbaris marked this conversation as resolved. Show resolved Hide resolved | ||
| '@type': "Quiz", | ||
| title: "CSS Quiz", | ||
| slug: 'css-quiz', | ||
| questions: [ | ||
| "/api/v1/question/15", | ||
| "/api/v1/question/16", | ||
| "/api/v1/question/17", | ||
| "/api/v1/question/18", | ||
| "/api/v1/question/19", | ||
metinbaris marked this conversation as resolved. Show resolved Hide resolved | ||
| ] | ||
| } | ||
| | ||
| | ||
| export default CSSQuiz | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions 31 api/config/fixtures/quizzes/css-quiz/questions/question_1.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <?php | ||
| | ||
| /** | ||
| * @var array{array{content:string, quiz: string, answers: array{array{content: string, is_correct: boolean, display_order: integer}} }} $question | ||
| */ | ||
| $question = [ | ||
| [ | ||
| 'content' => 'How many padding properties are there in CSS?', | ||
| 'quiz' => 'quiz-slug-css-quiz', | ||
| 'answers' => [ | ||
| [ | ||
| 'content' => '3', | ||
| 'is_correct' => false, | ||
| 'display_order' => 1 | ||
| ], | ||
| [ | ||
| 'content' => '4', | ||
| 'is_correct' => false, | ||
| 'display_order' => 2 | ||
| ], | ||
| [ | ||
| 'content' => '5', | ||
| 'is_correct' => true, | ||
| 'display_order' => 3 | ||
| ], | ||
| ] | ||
| ] | ||
| ]; | ||
| | ||
| | ||
| return $question; |
31 changes: 31 additions & 0 deletions 31 api/config/fixtures/quizzes/css-quiz/questions/question_2.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <?php | ||
| | ||
| /** | ||
| * @var array{array{content:string, quiz: string, answers: array{array{content: string, is_correct: boolean, display_order: integer}} }} $question | ||
| */ | ||
| $question = [ | ||
| [ | ||
| 'content' => 'In CSS which rule overrides a previous style?', | ||
| 'quiz' => 'quiz-slug-css-quiz', | ||
| 'answers' => [ | ||
| [ | ||
| 'content' => 'important', | ||
| 'is_correct' => false, | ||
| 'display_order' => 1 | ||
| ], | ||
| [ | ||
| 'content' => '!important', | ||
| 'is_correct' => true, | ||
| 'display_order' => 2 | ||
| ], | ||
| [ | ||
| 'content' => 'important!', | ||
| 'is_correct' => false, | ||
| 'display_order' => 3 | ||
| ], | ||
| ] | ||
| ] | ||
| ]; | ||
| | ||
| | ||
| return $question; |
36 changes: 36 additions & 0 deletions 36 api/config/fixtures/quizzes/css-quiz/questions/question_3.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| <?php | ||
| | ||
| /** | ||
| * @var array{array{content:string, quiz: string, answers: array{array{content: string, is_correct: boolean, display_order: integer}} }} $question | ||
| */ | ||
| $question = [ | ||
| [ | ||
| 'content' => 'In CSS which property controls the text font?', | ||
| 'quiz' => 'quiz-slug-css-quiz', | ||
| 'answers' => [ | ||
| [ | ||
| 'content' => 'font-face', | ||
| 'is_correct' => false, | ||
| 'display_order' => 1 | ||
| ], | ||
| [ | ||
| 'content' => 'font', | ||
| 'is_correct' => false, | ||
| 'display_order' => 2 | ||
| ], | ||
| [ | ||
| 'content' => 'font-family', | ||
| 'is_correct' => true, | ||
| 'display_order' => 3 | ||
| ], | ||
| [ | ||
| 'content' => 'font-style', | ||
| 'is_correct' => false, | ||
| 'display_order' => 4 | ||
| ], | ||
| ] | ||
| ] | ||
| ]; | ||
| | ||
| | ||
| return $question; |
36 changes: 36 additions & 0 deletions 36 api/config/fixtures/quizzes/css-quiz/questions/question_4.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,36 @@ | ||
| <?php | ||
| | ||
| /** | ||
| * @var array{array{content:string, quiz: string, answers: array{array{content: string, is_correct: boolean, display_order: integer}} }} $question | ||
| */ | ||
| $question = [ | ||
| [ | ||
| 'content' => 'What controls a repeating background in CSS?', | ||
| 'quiz' => 'quiz-slug-css-quiz', | ||
| 'answers' => [ | ||
| [ | ||
| 'content' => 'background: repeat', | ||
| 'is_correct' => false, | ||
| 'display_order' => 1 | ||
| ], | ||
| [ | ||
| 'content' => 'image-repeat: repeat', | ||
| 'is_correct' => false, | ||
| 'display_order' => 2 | ||
| ], | ||
| [ | ||
| 'content' => 'repeat-background: repeat', | ||
| 'is_correct' => false, | ||
| 'display_order' => 3 | ||
| ], | ||
| [ | ||
| 'content' => 'background-repeat: repeat', | ||
| 'is_correct' => true, | ||
| 'display_order' => 4 | ||
| ], | ||
| ] | ||
| ] | ||
| ]; | ||
| | ||
| | ||
| return $question; |
31 changes: 31 additions & 0 deletions 31 api/config/fixtures/quizzes/css-quiz/questions/question_5.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <?php | ||
| | ||
| /** | ||
| * @var array{array{content:string, quiz: string, answers: array{array{content: string, is_correct: boolean, display_order: integer}} }} $question | ||
| */ | ||
| $question = [ | ||
| [ | ||
| 'content' => 'In #css how would you remove an underline from a hyperlink?', | ||
| 'quiz' => 'quiz-slug-css-quiz', | ||
| 'answers' => [ | ||
| [ | ||
| 'content' => 'underline: none', | ||
| 'is_correct' => false, | ||
| 'display_order' => 1 | ||
| ], | ||
| [ | ||
| 'content' => 'text-underline: none', | ||
| 'is_correct' => false, | ||
| 'display_order' => 2 | ||
| ], | ||
| [ | ||
| 'content' => 'text-decoration: none', | ||
| 'is_correct' => true, | ||
| 'display_order' => 3 | ||
| ], | ||
| ] | ||
| ] | ||
| ]; | ||
| | ||
| | ||
| return $question; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <?php | ||
| | ||
| $question1 = require 'questions/question_1.php'; | ||
| $question2 = require 'questions/question_2.php'; | ||
| $question3 = require 'questions/question_3.php'; | ||
| $question4 = require 'questions/question_4.php'; | ||
| $question5 = require 'questions/question_5.php'; | ||
| | ||
| /** | ||
| * @var array{title:string, slug: string, questions: array{array{content:string, quiz: string, answers: array{array{content: string, is_correct: boolean, display_order: integer}} }}} $quiz | ||
| */ | ||
| $quiz = [ | ||
| 'title' => 'CSS Quiz', | ||
| 'slug' => 'css-quiz', | ||
| 'questions' => [ | ||
| $question1[0], | ||
| $question2[0], | ||
| $question3[0], | ||
| $question4[0], | ||
| $question5[0], | ||
| ] | ||
| ]; | ||
| | ||
| return $quiz; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.