import { Check, default as Octicon, X } from "@primer/octicons-react"; import * as React from "react"; import { Button, Container } from "reactstrap"; import { InternalExplanation } from "./InternalExplanation"; import { InternalPrompt } from "./Prompt"; import { QuestionData } from "./QuizData"; export interface IInternalAnswerQuestionProps { question: QuestionData; input: any[]; correct?: boolean; explained?: boolean; explainationStep: number; update(fn: (state: any[]) => any[]): void; onExplain(): void; onSubmit(score: number): void; onNext(): void; onNextStep(): void; } export class InternalAnswerQuestion extends React.Component< IInternalAnswerQuestionProps > { onSubmit = () => { this.props.onSubmit(this.props.question.prompt.getScore(this.props.input)); }; render() { return (
{this.props.correct === true && ( )} {this.props.correct === false && ( )} {this.props.explained === true && (

Explained

)} {(this.props.correct != null || this.props.explained != null) && ( )}
{this.props.explained && this.props.question.explaination ? (

) : null}
); } }