dev_forum
hjm 5 years ago
parent 9ffa8803b3
commit 4568e0c0c0

@ -20,7 +20,7 @@ import ShixunAnswer from './question/shixunAnswer'
import update from 'immutability-helper' import update from 'immutability-helper'
import axios from 'axios'; import axios from 'axios';
import './new/common.css'
const Textarea =Input.TextArea const Textarea =Input.TextArea
const tagArray = [ const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',

@ -222,6 +222,7 @@ class Exercisestatisticalresult extends Component {
) )
}): }):
<Exercisetablesmubu <Exercisetablesmubu
tableNum={key}
data={item.ques_details} data={item.ques_details}
type={item.ques_type} type={item.ques_type}
effictive_counts={item.effictive_counts} effictive_counts={item.effictive_counts}

@ -1,8 +1,14 @@
import React, {Component} from "react"; import React, {Component} from "react";
import {WordsBtn} from 'educoder'; import {WordsBtn, MarkdownToHtml} from 'educoder';
import {Table,Progress} from "antd"; import {Table,Progress} from "antd";
import {Link,Switch,Route,Redirect} from 'react-router-dom'; import {Link,Switch,Route,Redirect} from 'react-router-dom';
const tagArray = [
'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
]
class Exercisetablesmubus extends Component { class Exercisetablesmubus extends Component {
constructor(props) { constructor(props) {
@ -19,12 +25,17 @@ class Exercisetablesmubus extends Component {
render() { render() {
let {data,type,effictive_counts,choicetype}=this.props; let {data,type,effictive_counts,choicetype, tableNum}=this.props;
let datas=[]; let datas=[];
data&&data.forEach((item,key)=>{ data&&data.forEach((item,key)=>{
datas.push({ datas.push({
commit_percent:{num:item.choice_position,value:type===4||type===5?choicetype[item.choice_text-1]:item.choice_text,type:item.choice_right_boolean}, commit_percent:{
num:item.choice_position,
value:type===4||type===5?choicetype[item.choice_text-1]:item.choice_text,
type:item.choice_right_boolean,
_type: type
},
min_score:{value:item.choice_users_count,type:item.choice_right_boolean}, min_score:{value:item.choice_users_count,type:item.choice_right_boolean},
max_score:item.choice_percent, max_score:item.choice_percent,
}) })
@ -40,13 +51,23 @@ class Exercisetablesmubus extends Component {
title: '选项', title: '选项',
dataIndex: 'commit_percent', dataIndex: 'commit_percent',
key: 'commit_percent', key: 'commit_percent',
render: (text, record) => ( render: (text, record, index) => {
<span style={{color:text.type===true? "#29BD8B":'#333333'}}> const _content = <span style={{color:text.type===true? "#29BD8B":'#333333'}}>
{text.value!="有效填写量"&&text.value!="wrong"?text.value:false} {text.value!="有效填写量"&&text.value!="wrong" &&
{text.value==="wrong"?"填写了错误答案":false} <MarkdownToHtml content={text.value} selector={(tableNum+1) + '' + (index+1)}></MarkdownToHtml>
{text.value==="有效填写量"?"有效填写量":false} }
{text.value==="wrong" && "填写了错误答案" }
{text.value==="有效填写量" && "有效填写量" }
</span> </span>
), return (
(text._type === 0 || text._type === 1) ? <div style={{ display: 'flex'}}>
{<span style={{ 'margin-right': '4px', 'margin-top': '-2px'}}>{tagArray[index]}.</span>}
{_content}
</div> : <React.Fragment>{_content}</React.Fragment>
)
},
}, { }, {
title: '小计', title: '小计',
dataIndex: 'min_score', dataIndex: 'min_score',

@ -93,9 +93,9 @@ class SingleDisplay extends Component{
<div className="options"> <div className="options">
{ question_choices.map((item, optionIndex) => { { question_choices.map((item, optionIndex) => {
let prefix = undefined let prefix = undefined
if (!isPreviewPage) { // if (!isPreviewPage) {
prefix = `${tagArray[optionIndex]}.` prefix = `${tagArray[optionIndex]}.`
} // }
if (question_type == 0) { // 单选 if (question_type == 0) { // 单选
return ( return (
<div className="mb10 clearfix" key={optionIndex}> <div className="mb10 clearfix" key={optionIndex}>

@ -34,3 +34,7 @@
.singleDisplay .options .markdown-body { .singleDisplay .options .markdown-body {
max-width: 1116px; max-width: 1116px;
} }
.singleDisplay .ant-radio-wrapper span:last-child
, .singleDisplay .ant-checkbox-wrapper span:last-child {
padding-right: 0px;
}

@ -4,9 +4,9 @@ import {markdownToHTML} from 'educoder'
import axios from 'axios' import axios from 'axios'
const tagArray = [ const tagArray = [
// 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
// 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
// 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
] ]
class Multiple extends Component{ class Multiple extends Component{
constructor(props){ constructor(props){
@ -41,14 +41,17 @@ class Multiple extends Component{
let isStudent =this.props.isStudent(); let isStudent =this.props.isStudent();
console.log(questionType); console.log(questionType);
return( return(
<div className="pl30 pr30"> <div className="pl30 pr30 singleDisplay">
<Checkbox.Group disabled={ user_exercise_status == 1 ? true : false } onChange={this.saveId} defaultValue={questionType.user_answer}> <Checkbox.Group disabled={ user_exercise_status == 1 ? true : false } onChange={this.saveId} defaultValue={questionType.user_answer}>
{ {
questionType.question_choices && questionType.question_choices.map((item,key)=>{ questionType.question_choices && questionType.question_choices.map((item,key)=>{
let prefix = `${tagArray[key]}.`
return( return(
<p className="clearfix mb15 df"> <p className="clearfix mb15 df">
<Checkbox className="fl lineh-20 " value={item.choice_id}></Checkbox> <Checkbox className="fl lineh-20 " value={item.choice_id}>{prefix}</Checkbox>
<span class="fl lineh-20 mt1"></span><span style={{display:"inline-block"}} className="markdown-body mt1" dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span> {/* <span class="fl lineh-20 mt1"></span> */}
<span style={{display:"inline-block"}} className="markdown-body " dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
</p> </p>
) )
}) })

@ -4,9 +4,9 @@ import {Checkbox,Radio, Input} from "antd";
import {markdownToHTML} from 'educoder' import {markdownToHTML} from 'educoder'
import axios from 'axios' import axios from 'axios'
const tagArray = [ const tagArray = [
// 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I',
// 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
// 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'
] ]
class single extends Component{ class single extends Component{
constructor(props){ constructor(props){
@ -36,14 +36,16 @@ class single extends Component{
let isStudent =this.props.isStudent(); let isStudent =this.props.isStudent();
return( return(
<div className="pl30 pr30"> <div className="pl30 pr30 singleDisplay">
<Radio.Group disabled={ user_exercise_status == 1 ? true : false } defaultValue={questionType.user_answer[0]} onChange={this.changeItem}> <Radio.Group disabled={ user_exercise_status == 1 ? true : false } defaultValue={questionType.user_answer[0]} onChange={this.changeItem}>
{ {
questionType.question_choices && questionType.question_choices.map((item,key)=>{ questionType.question_choices && questionType.question_choices.map((item,key)=>{
let prefix = `${tagArray[key]}.`
return( return(
<p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15 df" : "fl mr40"}> <p className={parseInt(questionType.question_type) == 0 ? "clearfix mb15 df" : "fl mr40"}>
<Radio className="fl lineh-20" value={item.choice_id}></Radio> <Radio className="fl lineh-20" value={item.choice_id}>{prefix}</Radio>
<span className="fl lineh-20 mr3 mt1"></span><span style={{display:"inline-block"}} className="markdown-body fl mt1" dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span> {/* <span className="fl lineh-20 mr3 "></span> */}
<span style={{display:"inline-block", 'margin-top': '-1px'}} className="markdown-body fl " dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
</p> </p>
) )
}) })

Loading…
Cancel
Save