fix pr/forms bugs
This commit is contained in:
parent
a2a99cedda
commit
1642e2d211
|
@ -4,7 +4,7 @@
|
|||
import parseQuestion from '$lib/utils/parseQuestion'
|
||||
|
||||
export let gameData
|
||||
let answers = parseQuestion(gameData.question.answer, gameData.question.type)
|
||||
let answer = parseQuestion(gameData.question.answer, gameData.question.type)
|
||||
let myAnswer = ''
|
||||
|
||||
export let nextQuestion
|
||||
|
@ -18,7 +18,7 @@
|
|||
myAnswer = ''
|
||||
}}
|
||||
{control}
|
||||
on:submit={() => (control = myAnswer !== '' ? myAnswer === answers.answer : null)}
|
||||
on:submit={() => (control = myAnswer !== '' ? myAnswer == answer : null)}
|
||||
>
|
||||
<span slot="title">{gameData.name}</span>
|
||||
<span slot="about">{@html gameData.question.question}</span>
|
||||
|
|
|
@ -38,14 +38,13 @@
|
|||
export let gameData = {} //data
|
||||
|
||||
$: answers = parseQuestion(gameData.questions[clientAnswers.pos].answer, gameData.questions[clientAnswers.pos].type) //delete
|
||||
|
||||
let page
|
||||
$: page = components[gameData.questions[clientAnswers.pos].type]
|
||||
let clientAnswers = {
|
||||
pos: 0,
|
||||
end: gameData.questions.length, //kolik otázek
|
||||
points: 0, //body
|
||||
}
|
||||
let page
|
||||
$: page = components[gameData.questions[clientAnswers.pos].type]
|
||||
|
||||
/*jen pro tedkon, pozdeji vymazat az bude singlechoise a multichoise oddelene*/
|
||||
$: page = gameData.questions[clientAnswers.pos].type === 'CHOICE' ? components[vals()] : page
|
||||
|
|
|
@ -10,10 +10,11 @@
|
|||
export let control = null
|
||||
export let nextQuestion
|
||||
|
||||
const rightAnswer = () =>
|
||||
answers.map((item) => {
|
||||
const rightAnswer = () => {
|
||||
return answers.filter((item) => {
|
||||
if (item.value) return item.label
|
||||
})
|
||||
})[0].label
|
||||
}
|
||||
</script>
|
||||
|
||||
<Layout
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
import parseQuestion from '$lib/utils/parseQuestion'
|
||||
|
||||
export let gameData
|
||||
let answers = parseQuestion(gameData.question.answer, gameData.question.type)
|
||||
let answer = parseQuestion(gameData.question.answer, gameData.question.type)
|
||||
let myAnswer = ''
|
||||
|
||||
export let control = null
|
||||
|
@ -22,7 +22,7 @@
|
|||
nextQuestion()
|
||||
myAnswer = ''
|
||||
}}
|
||||
on:submit={() => (control = myAnswer !== '' ? compare(myAnswer, answers.answer) : null)}
|
||||
on:submit={() => (control = myAnswer !== '' ? compare(myAnswer, answer) : null)}
|
||||
>
|
||||
<span slot="title">{gameData.name}</span>
|
||||
<span slot="about">{@html gameData.question.question}</span>
|
||||
|
|
|
@ -2,14 +2,15 @@
|
|||
import { Marker } from '@beyonk/svelte-mapbox'
|
||||
import { createEventDispatcher, getContext } from 'svelte'
|
||||
|
||||
export let lat, lng
|
||||
export let width = 0.004
|
||||
export let lat = null
|
||||
export let lng = null
|
||||
export let round = (1 / 110.574 / 1000) * 12 * 5222525 //cca 12m nutno pozměnit!!!!!!!!!! tento komentář nemazat
|
||||
export let user = { lat: 0, lng: 0 }
|
||||
|
||||
const dispatch = createEventDispatcher()
|
||||
|
||||
let Mlat = [lat - width, lat + width]
|
||||
let Mlng = [lng - width, lng + width]
|
||||
let Mlat = [lat - round, lat + round]
|
||||
let Mlng = [lng - round, lng + round]
|
||||
|
||||
$: isIn = user ? user.lat > Mlat[0] && user.lat < Mlat[1] && user.lng > Mlng[0] && user.lng < Mlng[1] : null
|
||||
|
||||
|
|
Loading…
Reference in New Issue