Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
148 changes: 148 additions & 0 deletions api-client/src/mockData/cssQuiz/cssQuestions.ts
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
20 changes: 20 additions & 0 deletions api-client/src/mockData/cssQuiz/cssQuiz.ts
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",
'@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",
]
}


export default CSSQuiz
10 changes: 9 additions & 1 deletion api-client/src/mockData/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,23 @@ import pythonQuiz from "./pythonQuiz/pythonQuiz";
import pythonQuestions from "./pythonQuiz/pythonQuestions";
import JavaScriptQuiz from "./javaScriptQuiz/javaScriptQuiz";
import javaScriptQuestions from "./javaScriptQuiz/javaScriptQuestions";
import cssQuiz from "./cssQuiz/cssQuiz";
import cssQuestions from "./cssQuiz/cssQuestions";


const data = {
quiz: [
htmlQuiz,
JavaScriptQuiz,
pythonQuiz,
cssQuiz,
],
question: [...htmlQuestions, ...javaScriptQuestions, ...pythonQuestions]
question: [
...htmlQuestions,
...javaScriptQuestions,
...pythonQuestions,
...cssQuestions
]
}

export default data
31 changes: 31 additions & 0 deletions api/config/fixtures/quizzes/css-quiz/questions/question_1.php
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 api/config/fixtures/quizzes/css-quiz/questions/question_2.php
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 api/config/fixtures/quizzes/css-quiz/questions/question_3.php
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 api/config/fixtures/quizzes/css-quiz/questions/question_4.php
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 api/config/fixtures/quizzes/css-quiz/questions/question_5.php
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;
24 changes: 24 additions & 0 deletions api/config/fixtures/quizzes/css-quiz/quiz.php
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;
Loading