Possible answers fix

This commit is contained in:
mrfry 2021-03-29 16:25:13 +02:00
parent 5cabf0766f
commit 09b2e1a0d0
2 changed files with 12 additions and 5 deletions

View file

@ -66,6 +66,13 @@ export default function Question({ question, onChange, index }) {
{possibleAnswers.map((possibleAnswer, i) => {
// {"text":"a. Kétismeretlenes egyenletrendszert használunk.",
// "selectedByUser":true}
console.log(possibleAnswer)
const pa =
typeof possibleAnswer === 'string'
? possibleAnswer
: possibleAnswer.text
return (
<div key={i}>
<div>
@ -73,15 +80,15 @@ export default function Question({ question, onChange, index }) {
onChange={() => {
onChange({
...question,
A: possibleAnswer.text,
A: pa,
})
}}
checked={possibleAnswer.text === question.A}
value={possibleAnswer.text}
checked={pa === question.A}
value={pa}
type="radio"
name={`possiblea${index ? index : ''}`}
/>
<span>{possibleAnswer.text}</span>
<span>{pa}</span>
</div>
<span
onClick={() => {

View file

@ -1,5 +1,5 @@
{
"siteUrl": "https://qmining.frylabs.net/",
"apiUrl": "http://localhost:8080/",
"apiUrl": "https://api.frylabs.net/",
"maxQuestionsToRender": 250
}