|
|
|
@ -1,21 +1,10 @@
|
|
|
|
|
import React,{ Component } from "react";
|
|
|
|
|
import React, { Component } from "react";
|
|
|
|
|
|
|
|
|
|
import {
|
|
|
|
|
Form, Input, InputNumber, Switch, Radio,
|
|
|
|
|
Slider, Button, Upload, Icon, Rate, Checkbox, message,
|
|
|
|
|
Row, Col, Select, Modal, Tooltip
|
|
|
|
|
} from 'antd';
|
|
|
|
|
import { Tooltip } from 'antd';
|
|
|
|
|
import QuillForEditor from '../../../common/quillForEditor';
|
|
|
|
|
import TPMMDEditor from '../../../modules/tpm/challengesnew/TPMMDEditor';
|
|
|
|
|
import axios from 'axios'
|
|
|
|
|
import update from 'immutability-helper'
|
|
|
|
|
import './../questioncss/questioncom.css';
|
|
|
|
|
import {getUrl, ActionBtn, DMDEditor, ConditionToolTip} from 'educoder';
|
|
|
|
|
const { TextArea } = Input;
|
|
|
|
|
const confirm = Modal.confirm;
|
|
|
|
|
const $ = window.$
|
|
|
|
|
const { Option } = Select;
|
|
|
|
|
|
|
|
|
|
import { ConditionToolTip } from 'educoder';
|
|
|
|
|
const tagArray = [
|
|
|
|
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
|
|
|
|
|
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
|
|
|
|
@ -23,8 +12,8 @@ const tagArray = [
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
//题库的试卷 单选题 组件
|
|
|
|
|
class SingleEditor extends Component{
|
|
|
|
|
constructor(props){
|
|
|
|
|
class SingleEditor extends Component {
|
|
|
|
|
constructor(props) {
|
|
|
|
|
super(props);
|
|
|
|
|
/**
|
|
|
|
|
choice_id: 32076
|
|
|
|
@ -33,7 +22,7 @@ class SingleEditor extends Component{
|
|
|
|
|
standard_boolean: true
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
const {question_choices} = this.props;
|
|
|
|
|
const { question_choices } = this.props;
|
|
|
|
|
let _standard_answers = undefined;
|
|
|
|
|
let _question_choices = undefined;
|
|
|
|
|
if (question_choices) {
|
|
|
|
@ -46,17 +35,17 @@ class SingleEditor extends Component{
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const choicescomy=[];
|
|
|
|
|
const choicescomy = [];
|
|
|
|
|
try {
|
|
|
|
|
if(this.props.item_banksedit){
|
|
|
|
|
if(this.props.item_banksedit.choices){
|
|
|
|
|
if (this.props.item_banksedit) {
|
|
|
|
|
if (this.props.item_banksedit.choices) {
|
|
|
|
|
|
|
|
|
|
this.props.item_banksedit.choices.forEach((item, index) => {
|
|
|
|
|
////console.log("SingleEditor");
|
|
|
|
|
////console.log(item);
|
|
|
|
|
choicescomy.push({
|
|
|
|
|
choice_text:item.choice_text,
|
|
|
|
|
standard_boolean:item.is_answer,
|
|
|
|
|
choice_text: item.choice_text,
|
|
|
|
|
standard_boolean: item.is_answer,
|
|
|
|
|
})
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
@ -69,19 +58,19 @@ class SingleEditor extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}catch (e) {
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
this.state = {
|
|
|
|
|
question_choices: _question_choices || ['', '', '', ''],
|
|
|
|
|
standard_answers: _standard_answers || [false, false, false, false],
|
|
|
|
|
question_title: this.props.question_title!==undefined?JSON.parse(this.props.question_title):"",
|
|
|
|
|
question_title: this.props.question_title !== undefined ? JSON.parse(this.props.question_title) : "",
|
|
|
|
|
question_type: this.props.question_type || 0,
|
|
|
|
|
question_score: this.props.question_score || this.props.init_question_score,
|
|
|
|
|
question_titles: this.props.question_titles!==undefined?JSON.parse(this.props.question_titles):"",
|
|
|
|
|
question_titlesysl:this.props.question_titlesysl||'',
|
|
|
|
|
question_titleysl:this.props.question_title || '',
|
|
|
|
|
item_banksedit:[],
|
|
|
|
|
question_titles: this.props.question_titles !== undefined ? JSON.parse(this.props.question_titles) : "",
|
|
|
|
|
question_titlesysl: this.props.question_titlesysl || '',
|
|
|
|
|
question_titleysl: this.props.question_title || '',
|
|
|
|
|
item_banksedit: [],
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
addOption = () => {
|
|
|
|
@ -97,36 +86,36 @@ class SingleEditor extends Component{
|
|
|
|
|
this.setState({ question_choices, standard_answers })
|
|
|
|
|
}
|
|
|
|
|
deleteOption = (index) => {
|
|
|
|
|
let {question_choices}=this.state;
|
|
|
|
|
let { question_choices } = this.state;
|
|
|
|
|
|
|
|
|
|
// //////console.log("deleteOption");
|
|
|
|
|
// //////console.log(question_choices);
|
|
|
|
|
|
|
|
|
|
if(question_choices[index]===""){
|
|
|
|
|
if (question_choices[index] === "") {
|
|
|
|
|
// repeat code
|
|
|
|
|
this.toMDMode(null)
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
question_choices : update(prevState.question_choices, {$splice: [[index, 1]]}),
|
|
|
|
|
standard_answers : update(prevState.standard_answers, {$splice: [[index, 1]]})
|
|
|
|
|
question_choices: update(prevState.question_choices, { $splice: [[index, 1]] }),
|
|
|
|
|
standard_answers: update(prevState.standard_answers, { $splice: [[index, 1]] })
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
this.toMDMode(null)
|
|
|
|
|
this.setState(
|
|
|
|
|
(prevState) => ({
|
|
|
|
|
question_choices : update(prevState.question_choices, {$splice: [[index, 1]]}),
|
|
|
|
|
standard_answers : update(prevState.standard_answers, {$splice: [[index, 1]]})
|
|
|
|
|
question_choices: update(prevState.question_choices, { $splice: [[index, 1]] }),
|
|
|
|
|
standard_answers: update(prevState.standard_answers, { $splice: [[index, 1]] })
|
|
|
|
|
})
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onSave = () => {
|
|
|
|
|
var editordata=[];
|
|
|
|
|
const {question_title, question_titleysl,question_score, question_type,question_titles,question_titlesysl, question_choices, standard_answers } = this.state;
|
|
|
|
|
var editordata = [];
|
|
|
|
|
const { question_title, question_titleysl, question_score, question_type, question_titles, question_titlesysl, question_choices, standard_answers } = this.state;
|
|
|
|
|
const { question_id_to_insert_after, question_id } = this.props
|
|
|
|
|
// TODO check
|
|
|
|
|
const answerArray = standard_answers.map((item, index) => { return item == true ? index+1 : -1 }).filter(item => item != -1);
|
|
|
|
|
const answerArray = standard_answers.map((item, index) => { return item == true ? index + 1 : -1 }).filter(item => item != -1);
|
|
|
|
|
|
|
|
|
|
// const _text = quill.getText();
|
|
|
|
|
// const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
|
|
|
|
@ -136,12 +125,12 @@ class SingleEditor extends Component{
|
|
|
|
|
// // 提交到后台的内容需要处理一下;
|
|
|
|
|
// value = JSON.stringify(value)
|
|
|
|
|
// }
|
|
|
|
|
if(!question_titleysl) {
|
|
|
|
|
if (!question_titleysl) {
|
|
|
|
|
// this.refs['titleEditor'].showError()
|
|
|
|
|
this.props.showNotification('请您输入题干');
|
|
|
|
|
return editordata;
|
|
|
|
|
}
|
|
|
|
|
for(let i = 0; i < question_choices.length; i++) {
|
|
|
|
|
for (let i = 0; i < question_choices.length; i++) {
|
|
|
|
|
if (!question_choices[i]) {
|
|
|
|
|
// this.refs[`optionEditor${i}`].showError()
|
|
|
|
|
this.props.showNotification(`请先输入 ${tagArray[i]} 选项的内容`);
|
|
|
|
@ -149,7 +138,7 @@ class SingleEditor extends Component{
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(!answerArray || answerArray.length == 0) {
|
|
|
|
|
if (!answerArray || answerArray.length == 0) {
|
|
|
|
|
this.props.showNotification('请先点击选择本选择题的正确选项');
|
|
|
|
|
return editordata;
|
|
|
|
|
}
|
|
|
|
@ -169,7 +158,7 @@ class SingleEditor extends Component{
|
|
|
|
|
"question_choices":["a答案","b答案","c答案","d答案"],
|
|
|
|
|
"standard_answers":[1]
|
|
|
|
|
}*/
|
|
|
|
|
editordata=[question_titleysl,answerArray,question_choices,question_titlesysl];
|
|
|
|
|
editordata = [question_titleysl, answerArray, question_choices, question_titlesysl];
|
|
|
|
|
// question_title,
|
|
|
|
|
// question_type: answerArray.length > 1 ? 1 : 0,
|
|
|
|
|
// question_score,
|
|
|
|
@ -187,24 +176,24 @@ class SingleEditor extends Component{
|
|
|
|
|
componentDidMount = () => {
|
|
|
|
|
try {
|
|
|
|
|
this.props.getanswerMdRef(this);
|
|
|
|
|
}catch (e) {
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
this.setState({
|
|
|
|
|
item_banksedit:this.props.item_banksedit,
|
|
|
|
|
question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
|
|
|
|
|
question_titleysl:this.props.item_banksedit.name|| '',
|
|
|
|
|
question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
|
|
|
|
|
question_titlesysl:this.props.item_banksedit.analysis||'',
|
|
|
|
|
mychoicess:this.props.item_banksedit.choices,
|
|
|
|
|
item_banksedit: this.props.item_banksedit,
|
|
|
|
|
question_title: this.props.item_banksedit.name !== undefined ? JSON.parse(this.props.item_banksedit.name) : "",
|
|
|
|
|
question_titleysl: this.props.item_banksedit.name || '',
|
|
|
|
|
question_titles: this.props.item_banksedit.analysis !== undefined ? JSON.parse(this.props.item_banksedit.analysis) : "",
|
|
|
|
|
question_titlesysl: this.props.item_banksedit.analysis || '',
|
|
|
|
|
mychoicess: this.props.item_banksedit.choices,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}catch (e) {
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -213,13 +202,13 @@ class SingleEditor extends Component{
|
|
|
|
|
// ////console.log(prevProps);
|
|
|
|
|
// ////console.log(this.props.item_banksedit);
|
|
|
|
|
|
|
|
|
|
if(prevProps.item_banksedit !== this.props.item_banksedit) {
|
|
|
|
|
if (prevProps.item_banksedit !== this.props.item_banksedit) {
|
|
|
|
|
this.setState({
|
|
|
|
|
item_banksedit: this.props.item_banksedit,
|
|
|
|
|
question_title: this.props.item_banksedit.name!==undefined?JSON.parse(this.props.item_banksedit.name):"",
|
|
|
|
|
question_titleysl:this.props.item_banksedit.name|| '',
|
|
|
|
|
question_titles: this.props.item_banksedit.analysis!==undefined?JSON.parse(this.props.item_banksedit.analysis):"",
|
|
|
|
|
question_titlesysl:this.props.item_banksedit.analysis||'',
|
|
|
|
|
question_title: this.props.item_banksedit.name !== undefined ? JSON.parse(this.props.item_banksedit.name) : "",
|
|
|
|
|
question_titleysl: this.props.item_banksedit.name || '',
|
|
|
|
|
question_titles: this.props.item_banksedit.analysis !== undefined ? JSON.parse(this.props.item_banksedit.analysis) : "",
|
|
|
|
|
question_titlesysl: this.props.item_banksedit.analysis || '',
|
|
|
|
|
mychoicess: this.props.item_banksedit.choices,
|
|
|
|
|
|
|
|
|
|
})
|
|
|
|
@ -232,10 +221,10 @@ class SingleEditor extends Component{
|
|
|
|
|
// //////console.log(standard_answers);
|
|
|
|
|
// //////console.log(standard_answers[index]);
|
|
|
|
|
// //////console.log(!standard_answers[index]);
|
|
|
|
|
for (var i=0;i<standard_answers.length;i++){
|
|
|
|
|
if(index===i){
|
|
|
|
|
for (var i = 0; i < standard_answers.length; i++) {
|
|
|
|
|
if (index === i) {
|
|
|
|
|
standard_answers[index] = true;
|
|
|
|
|
}else{
|
|
|
|
|
} else {
|
|
|
|
|
standard_answers[i] = false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -243,7 +232,7 @@ class SingleEditor extends Component{
|
|
|
|
|
// standard_answers[index] = !standard_answers[index];
|
|
|
|
|
this.setState({ standard_answers })
|
|
|
|
|
}
|
|
|
|
|
onOptionContentChange = (value,quill,index) => {
|
|
|
|
|
onOptionContentChange = (value, quill, index) => {
|
|
|
|
|
if (index >= this.state.question_choices.length) {
|
|
|
|
|
// TODO 新建,然后删除CD选项,再输入题干,会调用到这里,且index是3
|
|
|
|
|
return;
|
|
|
|
@ -253,16 +242,16 @@ class SingleEditor extends Component{
|
|
|
|
|
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
|
|
|
|
|
if (!reg.test(_text)) {
|
|
|
|
|
// 处理编辑器内容为空
|
|
|
|
|
texts="";
|
|
|
|
|
texts = "";
|
|
|
|
|
} else {
|
|
|
|
|
if (_text.length >= 301) {
|
|
|
|
|
var result = _text.substring(0, 300);
|
|
|
|
|
texts = { "ops": [{ "insert": result }] };
|
|
|
|
|
texts = JSON.stringify(texts);
|
|
|
|
|
} else {
|
|
|
|
|
if(_text.length>=301){
|
|
|
|
|
var result = _text.substring(0,300);
|
|
|
|
|
texts={"ops":[{"insert":result}]};
|
|
|
|
|
texts=JSON.stringify(texts);
|
|
|
|
|
}else {
|
|
|
|
|
// 提交到后台的内容需要处理一下;
|
|
|
|
|
value = JSON.stringify(value)
|
|
|
|
|
texts=value;
|
|
|
|
|
texts = value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
let question_choices = this.state.question_choices.slice(0);
|
|
|
|
@ -285,58 +274,58 @@ class SingleEditor extends Component{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
onContentChange=(value,quill)=>{
|
|
|
|
|
onContentChange = (value, quill) => {
|
|
|
|
|
var _text = quill.getText();
|
|
|
|
|
|
|
|
|
|
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
|
|
|
|
|
if (!reg.test(_text)) {
|
|
|
|
|
// 处理编辑器内容为空
|
|
|
|
|
this.setState({
|
|
|
|
|
question_titleysl:""
|
|
|
|
|
question_titleysl: ""
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
// 提交到后台的内容需要处理一下;
|
|
|
|
|
|
|
|
|
|
var texts="";
|
|
|
|
|
if(_text.length>=1001){
|
|
|
|
|
var result = _text.substring(0,1000);
|
|
|
|
|
texts={"ops":[{"insert":result}]};
|
|
|
|
|
texts=JSON.stringify(texts);
|
|
|
|
|
}else {
|
|
|
|
|
var texts = "";
|
|
|
|
|
if (_text.length >= 1001) {
|
|
|
|
|
var result = _text.substring(0, 1000);
|
|
|
|
|
texts = { "ops": [{ "insert": result }] };
|
|
|
|
|
texts = JSON.stringify(texts);
|
|
|
|
|
} else {
|
|
|
|
|
value = JSON.stringify(value)
|
|
|
|
|
texts=value;
|
|
|
|
|
texts = value;
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
question_titleysl:texts
|
|
|
|
|
question_titleysl: texts
|
|
|
|
|
})
|
|
|
|
|
try {
|
|
|
|
|
//console.log("onContentChange");
|
|
|
|
|
//console.log(quill.getText().length);
|
|
|
|
|
}catch (e) {
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
onContentChanges=(value,quill)=>{
|
|
|
|
|
onContentChanges = (value, quill) => {
|
|
|
|
|
const _text = quill.getText();
|
|
|
|
|
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
|
|
|
|
|
if (!reg.test(_text)) {
|
|
|
|
|
// 处理编辑器内容为空
|
|
|
|
|
this.setState({
|
|
|
|
|
question_titlesysl:""
|
|
|
|
|
question_titlesysl: ""
|
|
|
|
|
})
|
|
|
|
|
} else {
|
|
|
|
|
var texts="";
|
|
|
|
|
if(_text.length>=1001){
|
|
|
|
|
var result = _text.substring(0,1000);
|
|
|
|
|
texts={"ops":[{"insert":result}]};
|
|
|
|
|
texts=JSON.stringify(texts);
|
|
|
|
|
}else {
|
|
|
|
|
var texts = "";
|
|
|
|
|
if (_text.length >= 1001) {
|
|
|
|
|
var result = _text.substring(0, 1000);
|
|
|
|
|
texts = { "ops": [{ "insert": result }] };
|
|
|
|
|
texts = JSON.stringify(texts);
|
|
|
|
|
} else {
|
|
|
|
|
value = JSON.stringify(value)
|
|
|
|
|
texts=value;
|
|
|
|
|
texts = value;
|
|
|
|
|
}
|
|
|
|
|
this.setState({
|
|
|
|
|
question_titlesysl:texts
|
|
|
|
|
question_titlesysl: texts
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -347,7 +336,7 @@ class SingleEditor extends Component{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
|
let { question_title, question_score, question_type, question_choices, standard_answers,question_titles,question_titlesysl} = this.state;
|
|
|
|
|
let { question_title, question_score, question_type, question_choices, standard_answers, question_titles, question_titlesysl } = this.state;
|
|
|
|
|
let { question_id, index, exerciseIsPublish,
|
|
|
|
|
// question_title,
|
|
|
|
|
// question_type,
|
|
|
|
@ -368,7 +357,7 @@ class SingleEditor extends Component{
|
|
|
|
|
// //////console.log("xuanzheshijuan");
|
|
|
|
|
// //////console.log(answerTagArray);
|
|
|
|
|
// //////console.log(!exerciseIsPublish);
|
|
|
|
|
return(
|
|
|
|
|
return (
|
|
|
|
|
<div className="padding20-30 signleEditor danxuano" id={qNumber}>
|
|
|
|
|
|
|
|
|
|
<style>{`
|
|
|
|
@ -398,8 +387,8 @@ class SingleEditor extends Component{
|
|
|
|
|
|
|
|
|
|
<QuillForEditor
|
|
|
|
|
autoFocus={true}
|
|
|
|
|
imgAttrs={{width: '146px', height: '136px'}}
|
|
|
|
|
style={{ height: '155px'}}
|
|
|
|
|
imgAttrs={{ width: '146px', height: '136px' }}
|
|
|
|
|
style={{ height: '155px' }}
|
|
|
|
|
placeholder="请您输入题干"
|
|
|
|
|
options={['code-block', 'image', 'formula']}
|
|
|
|
|
value={question_title}
|
|
|
|
@ -412,40 +401,40 @@ class SingleEditor extends Component{
|
|
|
|
|
<span className="xingtigans fl"><span className="xingtigan">答案选项:</span>点击选项可设置正确答案</span>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
{question_choices.map( (item, index) => {
|
|
|
|
|
{question_choices.map((item, index) => {
|
|
|
|
|
const bg = standard_answers[index] ? 'check-option-bg' : ''
|
|
|
|
|
return <div className={index>0?"df optionRow mt15": "df optionRow"} key={index} >
|
|
|
|
|
return <div className={index > 0 ? "df optionRow mt15" : "df optionRow"} key={index} >
|
|
|
|
|
{/* 点击设置答案 */}
|
|
|
|
|
{/* TODO 加了tooltip后,会丢失掉span的class */}
|
|
|
|
|
{/* <Tooltip title={standard_answers[index] ? '点击取消标准答案设置' : '点击设置为标准答案'}> */}
|
|
|
|
|
<span className={`option-item fr mr10 color-grey select-choice ${bg} `}
|
|
|
|
|
name="option_span" onClick={() => this.onOptionClick(index)} style={{flex: '0 0 38px'}}>
|
|
|
|
|
name="option_span" onClick={() => this.onOptionClick(index)} style={{ flex: '0 0 38px' }}>
|
|
|
|
|
<ConditionToolTip key={index} title={'点击设置为标准答案'} placement="left" condition={true}>
|
|
|
|
|
<div style={{width: '100%', height: '100%'}}>{tagArray[index]}</div>
|
|
|
|
|
<div style={{ width: '100%', height: '100%' }}>{tagArray[index]}</div>
|
|
|
|
|
</ConditionToolTip>
|
|
|
|
|
</span>
|
|
|
|
|
{/* </Tooltip> */}
|
|
|
|
|
<div style={{ flex: '0 0 1038px'}}>
|
|
|
|
|
<div style={{ flex: '0 0 1038px' }}>
|
|
|
|
|
{
|
|
|
|
|
item===undefined||item===null||item===""?
|
|
|
|
|
item === undefined || item === null || item === "" ?
|
|
|
|
|
<QuillForEditor
|
|
|
|
|
autoFocus={false}
|
|
|
|
|
imgAttrs={{width: '146px', height: '136px'}}
|
|
|
|
|
style={{ height: '166px'}}
|
|
|
|
|
imgAttrs={{ width: '146px', height: '136px' }}
|
|
|
|
|
style={{ height: '166px' }}
|
|
|
|
|
placeholder="请您输入题干"
|
|
|
|
|
options={['code-block', 'image', 'formula']}
|
|
|
|
|
value={item}
|
|
|
|
|
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
|
|
|
|
|
onContentChange={(value, quill) => this.onOptionContentChange(value, quill, index)}
|
|
|
|
|
/>
|
|
|
|
|
:
|
|
|
|
|
<QuillForEditor
|
|
|
|
|
autoFocus={false}
|
|
|
|
|
imgAttrs={{width: '146px', height: '136px'}}
|
|
|
|
|
style={{ height: '166px'}}
|
|
|
|
|
imgAttrs={{ width: '146px', height: '136px' }}
|
|
|
|
|
style={{ height: '166px' }}
|
|
|
|
|
placeholder="请您输入题干"
|
|
|
|
|
options={['code-block', 'image', 'formula']}
|
|
|
|
|
value={JSON.parse(item)}
|
|
|
|
|
onContentChange={(value,quill) => this.onOptionContentChange(value,quill,index)}
|
|
|
|
|
onContentChange={(value, quill) => this.onOptionContentChange(value, quill, index)}
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@ -455,20 +444,20 @@ class SingleEditor extends Component{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
{exerciseIsPublish || index<=1?
|
|
|
|
|
{exerciseIsPublish || index <= 1 ?
|
|
|
|
|
<i className=" font-18 ml15 mr20"></i>
|
|
|
|
|
:<Tooltip title="删除">
|
|
|
|
|
: <Tooltip title="删除">
|
|
|
|
|
<i className="iconfont icon-htmal5icon19 font-18 color-grey-c ml15" onClick={() => this.deleteOption(index)}></i>
|
|
|
|
|
</Tooltip> }
|
|
|
|
|
{ !exerciseIsPublish && index<7 && <Tooltip title={`新增参考答案`}>
|
|
|
|
|
</Tooltip>}
|
|
|
|
|
{!exerciseIsPublish && index < 7 && <Tooltip title={`新增参考答案`}>
|
|
|
|
|
<i className="color-green font-16 iconfont icon-roundaddfill ml6"
|
|
|
|
|
onClick={() => this.addOption()}
|
|
|
|
|
style={{float: 'right', visibility: index == question_choices.length - 1 ? '' : 'hidden', marginTop: '2px'}}
|
|
|
|
|
style={{ float: 'right', visibility: index == question_choices.length - 1 ? '' : 'hidden', marginTop: '2px' }}
|
|
|
|
|
></i>
|
|
|
|
|
</Tooltip>}
|
|
|
|
|
|
|
|
|
|
</div>
|
|
|
|
|
}) }
|
|
|
|
|
})}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -481,8 +470,8 @@ class SingleEditor extends Component{
|
|
|
|
|
<div className="mt10"></div>
|
|
|
|
|
<QuillForEditor
|
|
|
|
|
autoFocus={false}
|
|
|
|
|
imgAttrs={{width: '146px', height: '136px'}}
|
|
|
|
|
style={{height: '166px' }}
|
|
|
|
|
imgAttrs={{ width: '146px', height: '136px' }}
|
|
|
|
|
style={{ height: '166px' }}
|
|
|
|
|
placeholder="请您输入题目解析"
|
|
|
|
|
options={['code-block', 'image', 'formula']}
|
|
|
|
|
value={question_titles}
|
|
|
|
|