import React,{ Component } from "react"; import {Checkbox,Radio, Input} from "antd"; import {markdownToHTML, MarkdownToHtml} from 'educoder' import TPMMDEditor from '../../../../modules/tpm/challengesnew/TPMMDEditor' import axios from 'axios' class simpleAnswer extends Component{ constructor(props){ super(props); this.mdRef = React.createRef(); this.state={ simpleValue:undefined } } onChange=(value)=>{ this.setState({ simpleValue:value }) } onSimpleBlur=()=>{ let {simpleValue}=this.state let question_id =this.props.questionType.question_id; let url=`/exercise_questions/${question_id}/exercise_answers.json`; axios.post((url),{ answer_text:simpleValue }).then((result)=>{ if(result.status==200){ // this.setState({ // simpleValue:undefined // }) let k= simpleAnswer == "" ? 0 :1; this.props.changeQuestionStatus && this.props.changeQuestionStatus(parseInt(this.props.questionType.q_position)-1,k); } }).catch((error)=>{ console.log(error); }) } showAndHide=(flag)=>{ this.props.changeA_flag && this.props.changeA_flag(this.props.index,flag); } render(){ let { questionType , exercise, user_exercise_status, }=this.props let isAdmin=this.props.isAdmin(); let isStudent =this.props.isStudent(); return(
参考答案:
{/* */}