diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index df3ad315b..c630abf7e 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -46,7 +46,7 @@ debugType = "admin"; // 老师 // debugType="teacher"; // 学生 -debugType="student"; +//debugType="student"; diff --git a/public/react/src/common/TextUtil.js b/public/react/src/common/TextUtil.js index 8360881e9..ae04e3a1c 100644 --- a/public/react/src/common/TextUtil.js +++ b/public/react/src/common/TextUtil.js @@ -6,11 +6,8 @@ export function isImageExtension(fileName) { } export function markdownToHTML(oldContent, selector) { - console.log(oldContent) - console.log(selector) - if(oldContent){ + try { window.$('#md_div').html('') - // markdown to html if (selector && oldContent && oldContent.startsWith(' {data&&data.commit_results.map((item,key)=>{ @@ -299,9 +301,14 @@ class Exercisestatisticalresult extends Component {
{/*Q{item.ques_position}:*/} {/*
*/} - : + >} {/**/}
@@ -319,8 +326,9 @@ class Exercisestatisticalresult extends Component {
正确率 {ite.challenge_percent}%
{ + let newvalue; + try { + newvalue=JSON.parse(value); + }catch (e) { + newvalue={"ops":[{"insert":value}]}; + } + if(value===undefined){ + newvalue={"ops":[{"insert":""}]}; + } + return newvalue + } + render() { - let {data,type,effictive_counts,choicetype, tableNum}=this.props; - let datas=[]; + let {datass,type,effictive_counts,choicetype, tableNum}=this.props; + let list=[]; - data&&data.forEach((item,key)=>{ - datas.push({ + datass&&datass.forEach((item,key)=>{ + list.push({ commit_percent:{ num:item.choice_position, value:type===4||type===5?choicetype[item.choice_text-1]:item.choice_text, @@ -40,33 +52,38 @@ class Exercisetablesmubus extends Component { max_score:item.choice_percent, }) }) - datas.push({ + list.push({ commit_percent: {num:null,value:"有效填写量"}, min_score:{value:effictive_counts}, }) let columns=[] - if(datas.length!=0){ + if(list.length!=0){ columns=[{ title: '选项', dataIndex: 'commit_percent', key: 'commit_percent', render: (text, record, index) => { const _content = - {text.value!="有效填写量"&&text.value!="wrong" && - + {text.value>0&&text.value!="有效填写量"&&text.value!="wrong"||!text.value&&text.value!="有效填写量"&&text.value!="wrong"?text.value:text.value!="有效填写量"&&text.value!="wrong" && + this.props&&this.props.data.is_md===false?:text.value!="有效填写量"&&text.value!="wrong"&& } {text.value==="wrong" && "填写了错误答案" } - {text.value==="有效填写量" && "有效填写量" } + {text.value==="有效填写量" && "有效填写量" } return ( - + (text._type === 0 || text._type === 1) ?
{{tagArray[index]}.} {_content}
: {_content} ) - + }, }, { title: '小计', @@ -122,13 +139,15 @@ class Exercisetablesmubus extends Component { .Exermubu .ant-table-tbody> tr > td{ border-bottom: transparent; } - + .ql-editor{ + padding:0px !important; + } `} - - {datas===undefined?"":{ + let newvalue; + try { + newvalue=JSON.parse(value); + }catch (e) { + newvalue={"ops":[{"insert":value}]}; + } + if(value===undefined){ + newvalue={"ops":[{"insert":""}]}; + } + return newvalue + } render() { let { question_choices, question_id, index } = this.props; const qNumber = `question_${index}`; - + console.log(this.props) return(