Adding ccna4 preview questions.

This commit is contained in:
Fabian Stamm 2020-01-06 16:23:08 +01:00
parent b124d55273
commit 2accd04546
4 changed files with 2029 additions and 8 deletions

2007
ccna4.json Normal file

File diff suppressed because it is too large Load Diff

View File

@ -19,13 +19,12 @@ export const pageStore = readable<ActiveRoute>(undefined, (set) => {
router.resolve(); router.resolve();
}); });
import VaultsMobile from "./views/Overview.svelte"; import Overview from "./views/Overview.svelte";
import VaultsDesktop from "./views/Overview.svelte";
router.on("/", (params) => { router.on("/", (params) => {
setComponent({ setComponent({
desktop: VaultsDesktop as typeof SvelteComponent, desktop: Overview as typeof SvelteComponent,
mobile: VaultsMobile as typeof SvelteComponent, mobile: Overview as typeof SvelteComponent,
params params
}) })
}) })

View File

@ -3,16 +3,20 @@ import { Question, Exam } from "./data";
import CCNA2 from "../ccna2.json"; import CCNA2 from "../ccna2.json";
import CCNA3 from "../ccna3.json"; import CCNA3 from "../ccna3.json";
import CCNA4 from "../ccna4.json";
import TestData from "../data-test.json"; import TestData from "../data-test.json";
const tests = new Map<string, Exam>(); const tests = new Map<string, Exam>();
tests.set("ccna4", CCNA4);
tests.set("ccna3", CCNA3); tests.set("ccna3", CCNA3);
tests.set("ccna2", CCNA2); tests.set("ccna2", CCNA2);
tests.set("test", TestData) tests.set("test", TestData)
let test = new URL(window.location.href).searchParams.get("exam"); const DEFAULT = "ccna4";
const dataVersion = tests.has(test) ? test : "ccna3"; let test = new URL(window.location.href).searchParams.get("exam") || DEFAULT;
const dataVersion = tests.has(test) ? test : DEFAULT;
const Data = tests.get(dataVersion); const Data = tests.get(dataVersion);
console.log("Running exam:", dataVersion); console.log("Running exam:", dataVersion);
@ -20,6 +24,8 @@ console.log("Running exam:", dataVersion);
const runsShould = 3; const runsShould = 3;
class QuestionManager { class QuestionManager {
version: string = dataVersion;
activeQuestion = writable<{ activeQuestion = writable<{
correct: () => void; correct: () => void;
wrong: () => void; wrong: () => void;

View File

@ -1,7 +1,8 @@
<script> <script>
import QuestionManager from "../stores"; import QuestionManager from "../stores";
const { const {
progress progress,
version
} = QuestionManager; } = QuestionManager;
import Question from "./Question.svelte" import Question from "./Question.svelte"
@ -19,11 +20,19 @@
footer>div { footer>div {
background-color: var(--primary); background-color: var(--primary);
} }
.version {
position: fixed;
bottom :1.5rem;
left: .5rem;
}
</style> </style>
<div class="container" style="overflow-x: hidden"> <div class="container" style="overflow-x: hidden">
<Question /> <Question />
</div> </div>
<div class="version">{version}</div>
<footer class="elv-24"> <footer class="elv-24">
<div style={"width:" + $progress + "%;" }>{$progress}%</div> <div style={"width:" + $progress + "%;" }>{($progress).toFixed(2)}%</div>
</footer> </footer>