|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
import React, {Component} from "react";
|
|
|
|
|
import {WordsBtn, MarkdownToHtml} from 'educoder';
|
|
|
|
|
import {MarkdownToHtml,QuillForEditor} from 'educoder';
|
|
|
|
|
import {Table,Progress} from "antd";
|
|
|
|
|
import {Link,Switch,Route,Redirect} from 'react-router-dom';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const tagArray = [
|
|
|
|
|
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
|
|
|
|
@ -15,7 +15,6 @@ class Exercisetablesmubus extends Component {
|
|
|
|
|
super(props);
|
|
|
|
|
this.state = {
|
|
|
|
|
loadingstate:true,
|
|
|
|
|
datas:undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -23,13 +22,26 @@ class Exercisetablesmubus extends Component {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setdata=(value)=>{
|
|
|
|
|
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,21 +52,26 @@ 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 = <span style={{color:text.type===true? "#29BD8B":'#333333', width: '100%'}}>
|
|
|
|
|
{text.value!="有效填写量"&&text.value!="wrong" &&
|
|
|
|
|
<MarkdownToHtml content={text.value} selector={(tableNum+1) + '' + (index+1)}></MarkdownToHtml>
|
|
|
|
|
{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?<QuillForEditor
|
|
|
|
|
style={{ display: 'inline-block', width:'100%' , margin: '1px',padding:'0px'}}
|
|
|
|
|
readOnly={true}
|
|
|
|
|
value={this.setdata(text.value)}
|
|
|
|
|
// showUploadImage={this.handleShowUploadImage}
|
|
|
|
|
/>:text.value!="有效填写量"&&text.value!="wrong"&&<MarkdownToHtml content={text.value} selector={(tableNum+1) + '' + (index+1)}></MarkdownToHtml>
|
|
|
|
|
}
|
|
|
|
|
{text.value==="wrong" && "填写了错误答案" }
|
|
|
|
|
{text.value==="有效填写量" && "有效填写量" }
|
|
|
|
@ -122,13 +139,15 @@ class Exercisetablesmubus extends Component {
|
|
|
|
|
.Exermubu .ant-table-tbody> tr > td{
|
|
|
|
|
border-bottom: transparent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.ql-editor{
|
|
|
|
|
padding:0px !important;
|
|
|
|
|
}
|
|
|
|
|
`}
|
|
|
|
|
</style>
|
|
|
|
|
|
|
|
|
|
{datas===undefined?"":<Table
|
|
|
|
|
{list===undefined?"":<Table
|
|
|
|
|
className={"Exermubu"}
|
|
|
|
|
dataSource={datas}
|
|
|
|
|
dataSource={list}
|
|
|
|
|
columns={columns}
|
|
|
|
|
pagination={false}
|
|
|
|
|
// loading={loadingstate}
|
|
|
|
|