Possible answers is object fix

This commit is contained in:
mrfry 2021-03-29 15:17:21 +02:00
parent 33e8b3a49e
commit 5cabf0766f
4 changed files with 8 additions and 7 deletions

View file

@ -64,6 +64,8 @@ export default function Question({ question, onChange, index }) {
<div className={styles.text}>Lehetséges válaszok:</div>
<div className={styles.possibleAnswers}>
{possibleAnswers.map((possibleAnswer, i) => {
// {"text":"a. Kétismeretlenes egyenletrendszert használunk.",
// "selectedByUser":true}
return (
<div key={i}>
<div>
@ -71,15 +73,15 @@ export default function Question({ question, onChange, index }) {
onChange={() => {
onChange({
...question,
A: possibleAnswer,
A: possibleAnswer.text,
})
}}
checked={possibleAnswer === question.A}
value={possibleAnswer}
checked={possibleAnswer.text === question.A}
value={possibleAnswer.text}
type="radio"
name={`possiblea${index ? index : ''}`}
/>
<span>{possibleAnswer}</span>
<span>{possibleAnswer.text}</span>
</div>
<span
onClick={() => {

View file

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

View file

@ -167,5 +167,4 @@ select {
}
select:hover {
border: 1px solid #99f;
}

View file

@ -70,7 +70,7 @@ const Infos = ({ onClick, renderOKButton }) => {
const fetchDbs = () => {
return new Promise((resolve) => {
fetch(`${constants.apiUrl}getdbs`, {
fetch(`${constants.apiUrl}getDbs`, {
credentials: 'include',
})
.then((resp) => {