Skip to content
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

refactor: rename quiz keys, use unique namespace #14148

Merged
merged 6 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/Quiz/stories/QuizButtonGroup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export const NoSelectedAnswer: Story = {}

export const SelectedAnswer: Story = {
args: {
currentQuestionAnswerChoice: { answerId: "g001-a", isCorrect: true },
currentQuestionAnswerChoice: { answerId: "rollups-1-a", isCorrect: true },
},
}

Expand Down
6 changes: 3 additions & 3 deletions src/components/Quiz/stories/QuizRadioGroup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ export const StartQuestion: Story = {
}

const clickAnswer = async (
selectedId: `g001-${string}`,
selectedId: `rollups-1-${string}`,
answers: HTMLElement[]
) => {
const selectedAnswer = answers.find((answer) => answer.id === selectedId)
Expand All @@ -50,7 +50,7 @@ export const SelectedAnswer: Story = {
const answers = canvas.getAllByTestId("quiz-question-answer")

// Click the first answer ("which is the correct answer")
await clickAnswer("g001-a", answers)
await clickAnswer("rollups-1-a", answers)
},
}

Expand All @@ -73,6 +73,6 @@ export const SelectedIncorrectAnswer: Story = {
const answers = canvas.getAllByTestId("quiz-question-answer")

// Click the second answer ("which is the incorrect answer")
await clickAnswer("g001-b", answers)
await clickAnswer("rollups-1-b", answers)
},
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
},
"/content/translations/fa/energy-consumption/energy_consumption_pre_post_merge.png": {
"hash": "db7c5eb2",
"base64": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAA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s3Jo2Ud0tmEWq1WmAHT6WSsVjOUVCorUegJ5vbXAbRBLwhujKtkuaR9G/q5hhibYEN0h8qBMB6PH4uiGIQPnAfThlMpFyt3t3q23byuYpBsVQCiG0hiMVs7cQ+YOF3XBWxF11UBLbJH6gc1TYsqirLn5j2ukV/Nf+duuMjn8gAAAABJRU5ErkJggg=="
},
"/content/translations/fr/energy-consumption/energy_consumption_pre_post_merge.png": {
"hash": "9bc283e5",
Expand Down
61 changes: 47 additions & 14 deletions src/data/quizzes/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,59 +6,92 @@ import { addNextQuiz } from "@/components/Quiz/utils"
const quizzes = {
"what-is-ethereum": {
title: "what-is-ethereum",
questions: ["a001", "a002", "a003", "a004", "a005"],
questions: [
"ethereum-1",
"ethereum-2",
"ethereum-3",
"ethereum-4",
"ethereum-5",
],
},
"what-is-ether": {
title: "what-is-ether",
questions: ["b001", "b002", "b003", "b004"],
questions: ["ether-1", "ether-2", "ether-3", "ether-4"],
},
web3: {
title: "web3",
questions: ["c001", "c002", "c003", "c004", "c005"],
questions: ["web3-1", "web3-2", "web3-3", "web3-4", "web3-5"],
},
wallets: {
title: "wallets",
questions: ["d001", "d002", "d003", "d004"],
questions: ["wallets-1", "wallets-2", "wallets-3", "wallets-4"],
},
security: {
title: "ethereum-security",
questions: ["e001", "e002", "e003", "e004", "d003"],
questions: [
"security-1",
"security-2",
"security-3",
"security-4",
"wallets-3",
],
},
nfts: {
title: "nft-page",
questions: ["f001", "f002", "f003", "f004", "f005"],
questions: ["nfts-1", "nfts-2", "nfts-3", "nfts-4", "nfts-5"],
},
"layer-2": {
title: "layer-2",
questions: ["g001", "g002", "g003", "g004"],
questions: ["rollups-1", "rollups-2", "rollups-3", "rollups-4"],
},
merge: {
title: "learn-quizzes:page-assets-merge",
questions: ["h001", "h002", "h003", "h004", "h005"],
questions: ["merge-1", "merge-2", "merge-3", "merge-4", "merge-5"],
},
daos: {
title: "DAOs",
questions: ["i001", "i002", "i003", "i004", "i005"],
questions: ["daos-1", "daos-2", "daos-3", "daos-4", "daos-5"],
},
"solo-staking": {
title: "solo",
questions: ["j001", "j002", "j004", "j005", "j006", "j007", "j008"],
questions: [
"staking-1",
"staking-2",
"staking-4",
"staking-5",
"staking-6",
"staking-7",
"staking-8",
],
},
scaling: {
title: "scaling",
questions: ["k001", "k002", "k003", "k004"],
questions: ["scaling-1", "scaling-2", "scaling-3", "scaling-4"],
},
"run-a-node": {
title: "run-a-node",
questions: ["l001", "l002", "l003", "l004", "l005", "l006"],
questions: [
"run-a-node-1",
"run-a-node-2",
"run-a-node-3",
"run-a-node-4",
"run-a-node-5",
"run-a-node-6",
],
},
stablecoins: {
title: "stablecoins",
questions: ["m001", "m002", "m003", "m004", "m005"],
questions: [
"stablecoins-1",
"stablecoins-2",
"stablecoins-3",
"stablecoins-4",
"stablecoins-5",
],
},
defi: {
title: "DeFi",
questions: ["n001", "n002", "n003", "n004", "n005"],
questions: ["defi-1", "defi-2", "defi-3", "defi-4", "defi-5"],
},
} satisfies RawQuizzes

Expand Down
Loading
Loading