|
|
|
@ -247,24 +247,26 @@ class SingleEditor extends Component {
|
|
|
|
|
texts="";
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if(_text.length>=500){
|
|
|
|
|
var result = _text.substring(0,450);
|
|
|
|
|
texts={"ops":[{"insert":result}]};
|
|
|
|
|
texts=JSON.stringify(texts);
|
|
|
|
|
}else {
|
|
|
|
|
// 提交到后台的内容需要处理一下;
|
|
|
|
|
value = JSON.stringify(value);
|
|
|
|
|
if(value.length>=500){
|
|
|
|
|
let a=value.length-500;
|
|
|
|
|
let b=_text.length-a;
|
|
|
|
|
var result = _text.substring(0,b);
|
|
|
|
|
texts={"ops":[{"insert":result}]};
|
|
|
|
|
texts=JSON.stringify(texts);
|
|
|
|
|
}else{
|
|
|
|
|
texts=value;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// if(_text.length>=500){
|
|
|
|
|
// var result = _text.substring(0,450);
|
|
|
|
|
// texts={"ops":[{"insert":result}]};
|
|
|
|
|
// texts=JSON.stringify(texts);
|
|
|
|
|
// }else {
|
|
|
|
|
// // 提交到后台的内容需要处理一下;
|
|
|
|
|
//
|
|
|
|
|
// if(value.length>=500){
|
|
|
|
|
// let a=value.length-500;
|
|
|
|
|
// let b=_text.length-a;
|
|
|
|
|
// var result = _text.substring(0,b);
|
|
|
|
|
// texts={"ops":[{"insert":result}]};
|
|
|
|
|
// texts=JSON.stringify(texts);
|
|
|
|
|
// }else{
|
|
|
|
|
// texts=value;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
texts = JSON.stringify(value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
let question_choices = this.state.question_choices.slice(0);
|
|
|
|
|
question_choices[index] = texts;
|
|
|
|
|
this.setState({ question_choices });
|
|
|
|
@ -285,16 +287,7 @@ class SingleEditor extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
onContentChange = (value, quill) => {
|
|
|
|
|
=======
|
|
|
|
|
onContentChange=(value,quill)=>{
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
console.log("stringmysl");
|
|
|
|
|
console.log(stringmysl.length);
|
|
|
|
|
>>>>>>> 91722ce... 题库字数优化
|
|
|
|
|
=======
|
|
|
|
|
>>>>>>> 91dfb46... 多选题题库字数优化
|
|
|
|
|
var _text = quill.getText();
|
|
|
|
|
|
|
|
|
|
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
|
|
|
|
@ -310,18 +303,6 @@ class SingleEditor extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
// 提交到后台的内容需要处理一下;
|
|
|
|
|
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
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;
|
|
|
|
|
=======
|
|
|
|
|
var texts="";
|
|
|
|
|
if(_text.length>=979){
|
|
|
|
|
var result = _text.substring(0,975);
|
|
|
|
@ -332,11 +313,6 @@ class SingleEditor extends Component {
|
|
|
|
|
// console.log("2222");
|
|
|
|
|
// console.log(texts.length);
|
|
|
|
|
}else {
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
value = JSON.stringify(value)
|
|
|
|
|
texts=value;
|
|
|
|
|
>>>>>>> 91722ce... 题库字数优化
|
|
|
|
|
=======
|
|
|
|
|
value = JSON.stringify(value);
|
|
|
|
|
if(value.length>=1000){
|
|
|
|
|
let a=value.length-1000;
|
|
|
|
@ -347,29 +323,15 @@ class SingleEditor extends Component {
|
|
|
|
|
}else{
|
|
|
|
|
texts=value;
|
|
|
|
|
}
|
|
|
|
|
>>>>>>> 3610b7e... 多选题题库字数优化
|
|
|
|
|
}
|
|
|
|
|
let texts = JSON.stringify(value);
|
|
|
|
|
this.setState({
|
|
|
|
|
question_titleysl: texts
|
|
|
|
|
})
|
|
|
|
|
try {
|
|
|
|
|
//console.log("onContentChange");
|
|
|
|
|
//console.log(quill.getText().length);
|
|
|
|
|
} catch (e) {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
onContentChanges = (value, quill) => {
|
|
|
|
|
=======
|
|
|
|
|
onContentChanges=(value,quill)=>{
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
console.log("srruhsldssd");
|
|
|
|
|
console.log(srruhsldssd.length);
|
|
|
|
|
>>>>>>> 91722ce... 题库字数优化
|
|
|
|
|
=======
|
|
|
|
|
>>>>>>> 91dfb46... 多选题题库字数优化
|
|
|
|
|
const _text = quill.getText();
|
|
|
|
|
const reg = /^[\s\S]*.*[^\s][\s\S]*$/;
|
|
|
|
|
if (!reg.test(_text)) {
|
|
|
|
@ -384,16 +346,6 @@ class SingleEditor extends Component {
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
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;
|
|
|
|
|
=======
|
|
|
|
|
var texts="";
|
|
|
|
|
if(_text.length>=979){
|
|
|
|
|
var result = _text.substring(0,975);
|
|
|
|
@ -404,11 +356,6 @@ class SingleEditor extends Component {
|
|
|
|
|
// ; console.log("44444444");
|
|
|
|
|
// console.log(texts.length)
|
|
|
|
|
}else {
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
value = JSON.stringify(value)
|
|
|
|
|
texts=value;
|
|
|
|
|
>>>>>>> 91722ce... 题库字数优化
|
|
|
|
|
=======
|
|
|
|
|
value = JSON.stringify(value);
|
|
|
|
|
if(value.length>=1000){
|
|
|
|
|
let a=value.length-1000;
|
|
|
|
@ -419,8 +366,8 @@ class SingleEditor extends Component {
|
|
|
|
|
}else{
|
|
|
|
|
texts=value;
|
|
|
|
|
}
|
|
|
|
|
>>>>>>> 3610b7e... 多选题题库字数优化
|
|
|
|
|
}
|
|
|
|
|
let texts = JSON.stringify(value);
|
|
|
|
|
this.setState({
|
|
|
|
|
question_titlesysl: texts
|
|
|
|
|
})
|
|
|
|
@ -454,15 +401,11 @@ class SingleEditor extends Component {
|
|
|
|
|
// //////console.log("xuanzheshijuan");
|
|
|
|
|
// //////console.log(answerTagArray);
|
|
|
|
|
// //////console.log(!exerciseIsPublish);
|
|
|
|
|
<<<<<<< HEAD
|
|
|
|
|
return (
|
|
|
|
|
=======
|
|
|
|
|
const options=['code-block', 'image', 'formula',{size: ['14px', '16px', '18px', '20px']},
|
|
|
|
|
{ 'color': ['#333333','#e60000','#ff9900','#ffff00','#ffffff']},
|
|
|
|
|
{ 'font': ['Microsoft-YaHei','SimSun', 'SimHei','KaiTi','FangSong','Arial','Times-New-Roman','sans-serif']}
|
|
|
|
|
]
|
|
|
|
|
return(
|
|
|
|
|
>>>>>>> 2d54481... 调整输入的大小
|
|
|
|
|
<div className="padding20-30 signleEditor danxuano" id={qNumber}>
|
|
|
|
|
|
|
|
|
|
<style>{`
|
|
|
|
|