|
@@ -14,6 +14,20 @@
|
|
|
</style>
|
|
</style>
|
|
|
</head>
|
|
</head>
|
|
|
<body>
|
|
<body>
|
|
|
|
|
+<script>
|
|
|
|
|
+function quizApp() {
|
|
|
|
|
+ return {
|
|
|
|
|
+ zacalqiz: false,
|
|
|
|
|
+ otazky: [],
|
|
|
|
|
+
|
|
|
|
|
+ async startQuiz() {
|
|
|
|
|
+ this.zacalqiz = ! this.zacalqiz
|
|
|
|
|
+ const res = await fetch('/api/questions?count=5');
|
|
|
|
|
+ this.otazky = await res.json();
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+</script>
|
|
|
|
|
|
|
|
<template x-if="!zacalqiz">
|
|
<template x-if="!zacalqiz">
|
|
|
<div>
|
|
<div>
|
|
@@ -249,8 +263,10 @@
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
- <button @click="zacalqiz = ! zacalqiz">Toggle Content</button>
|
|
|
|
|
|
|
+ <button @click="startQuiz()">Toggle Content</button>
|
|
|
|
|
|
|
|
</body>
|
|
</body>
|
|
|
|
|
|
|
|
-</html>
|
|
|
|
|
|
|
+</html>
|
|
|
|
|
+
|
|
|
|
|
+
|