import { h, render, Component } from 'preact'; // eslint-disable-line no-unused-vars // module02: Question Item // outputs the current question export default class QuestionItem extends Component { render () { const keyPrefix = `${this.props.currentGroup}_${this.props.currentQuestion}`; const hasQuestion = this.props.currentGroup < 2; return (
{this.props.question.text}
{ hasQuestion ?
{this.props.answers.map((antwort, index) => { const markerClass = index === this.props.currentAnswerIndex ? 'question__options__item--marked' : ''; const correctClass = antwort.korrekt && this.props.currentAnswerIndex !== null ? 'question__options__item--correct' : ''; return (

); })}
: []}
); } }