dev_aliyun2
harry 5 years ago
parent 6b8724e6b0
commit 8e6e13264d

@ -1,7 +1,12 @@
import React, {Component} from "react";
import React, { Component } from "react"; import {Link, NavLink} from 'react-router-dom';
import { markdownToHTML } from 'educoder'; import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl, markdownToHTML} from 'educoder';
import axios from 'axios';
import { import {
notification,
Spin,
Table,
Pagination,
Radio, Radio,
Tooltip, Tooltip,
Icon Icon
@ -167,7 +172,7 @@ class Listjihe extends Component {
} else { } else {
if (items.item_type === "JUDGMENT") { if (items.item_type === "JUDGMENT") {
//多选题 //多选题
if (items.choices) { if (items.choices) {
if (items.choices.length > 0) { if (items.choices.length > 0) {
var arr = items.choices; var arr = items.choices;
@ -181,17 +186,17 @@ class Listjihe extends Component {
} }
} else { } else {
// 单选题和判断题 // 单选题和判断题
if (items.item_type === "MULTIPLE") { if(items.item_type === "MULTIPLE"){
if (items.choices) { if (items.choices) {
if (items.choices.length > 0) { if (items.choices.length > 0) {
var arr = items.choices; var arr = items.choices;
for (var i = 0; i < arr.length; i++) { for (var i = 0; i < arr.length; i++) {
if (arr[i].is_answer === true) { if (arr[i].is_answer === true) {
if (MULTIPLEkey === null) { if(MULTIPLEkey===null){
MULTIPLEkey = tagArrays[i]; MULTIPLEkey = tagArrays[i];
} else { }else{
MULTIPLEkey = MULTIPLEkey + tagArrays[i]; MULTIPLEkey =MULTIPLEkey+ tagArrays[i];
} }
} }
@ -199,7 +204,7 @@ class Listjihe extends Component {
} }
} }
} else { }else{
if (items.choices) { if (items.choices) {
if (items.choices.length > 0) { if (items.choices.length > 0) {
var arr = items.choices; var arr = items.choices;
@ -217,31 +222,28 @@ class Listjihe extends Component {
} }
} }
var itemssname = ""; var itemssname="";
try { try {
itemssname = JSON.parse(items.name); itemssname= JSON.parse(items.name);
} catch (e) { }catch (e) {
} }
if(itemssname===undefined){ if(itemssname===undefined){
itemssname=items.name+"" itemssname=items.name+""
} }
var itemsnamesy = ""; var itemsnamesy="";
try { try {
itemsnamesy = JSON.parse(items && items.program_attr && items.program_attr.description); itemsnamesy= JSON.parse(items&&items.program_attr&&items.program_attr.description);
} catch (e) {
itemsnamesy = items && items.program_attr && items.program_attr.description + "";
}catch (e) { }catch (e) {
itemsnamesy=items&&items.program_attr&&items.program_attr.description+""; itemsnamesy=items&&items.program_attr&&items.program_attr.description+"";
} }
var analysisnames = ""; var analysisnames="";
try { try {
analysisnames = JSON.parse(items && items.analysis); analysisnames= JSON.parse(items&&items.analysis);
}catch (e) { }catch (e) {
analysisnames=items&&items.analysis+""; analysisnames=items&&items.analysis+"";
@ -284,8 +286,6 @@ class Listjihe extends Component {
// console.log(Periofters); // console.log(Periofters);
// console.log(Perioftersbols); // console.log(Perioftersbols);
}
const types = questionType.filter(item => item.type === items.item_type);
return ( return (
<div key={keindex} <div key={keindex}
className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "borderwds pd20 mb20 listjihecolors"}> className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "borderwds pd20 mb20 listjihecolors"}>
@ -414,8 +414,8 @@ class Listjihe extends Component {
<p className="w100s listjihetixingstitssy sortinxdirection "> <p className="w100s listjihetixingstitssy sortinxdirection ">
<p id={"itemsnamesyid"} className={"sortinxdirection mt15"}> <p id={"itemsnamesyid"} className={"sortinxdirection mt15"}>
{ {
items && items.program_attr && items.program_attr.description ? items&&items.program_attr&&items.program_attr.description?
<p className="programquill" style={{ wordBreak: "break-word" }} <p className="programquill" style={{wordBreak: "break-word"}}
> >
{ {
itemsnamesy===null || itemsnamesy===undefined? itemsnamesy===null || itemsnamesy===undefined?
@ -428,7 +428,7 @@ class Listjihe extends Component {
/> />
} }
</p> </p>
: "" :""
} }
@ -439,28 +439,28 @@ class Listjihe extends Component {
<p className="w100s listjihetixingstitsp verticallayout "> <p className="w100s listjihetixingstitsp verticallayout ">
{ {
items === undefined || items === null ? "" : items.choices.map((object, index) => { items === undefined || items === null ? "" : items.choices.map((object, index) => {
var string = "" var string=""
try { try {
string = JSON.parse(object.choice_text); string=JSON.parse(object.choice_text);
} catch (e) { }catch (e) {
string = object.choice_text; string=object.choice_text;
} }
return ( return (
<p className={index === 0 ? "sortinxdirection " : "sortinxdirection mt15 "}> <p className={index === 0 ? "sortinxdirection " : "sortinxdirection mt15 "}>
<p className="lh20s">{tagArray[index]}</p> <p className="lh20s">{tagArray[index]}</p>
<p className="programquill" style={{ wordBreak: "break-word" }}> <p className="programquill" style={{wordBreak: "break-word"}}>
{object ? {object ?
object.choice_text === undefined || object.choice_text === null || object.choice_text === "" ? object.choice_text === undefined || object.choice_text=== null || object.choice_text === "" ?
"" ""
: :
object.choice_text.length > 0 ? object.choice_text.length>0?
<QuillForEditor <QuillForEditor
readOnly={true} readOnly={true}
value={string} value={string}
showUploadImage={this.handleShowUploadImage} showUploadImage={this.handleShowUploadImage}
/> />
: "" :""
: :
@ -543,7 +543,7 @@ class Listjihe extends Component {
</p> </p>
{ {
items.item_type === "PROGRAM" ? items.item_type === "PROGRAM" ?
this.props.Isitapopup && this.props.Isitapopup === "true" ? this.props.Isitapopup&&this.props.Isitapopup==="true"?
"" ""
: :
<a onClick={()=>this.seturls(`/problems/${items.program_attr.identifier}/edit`)}> <a onClick={()=>this.seturls(`/problems/${items.program_attr.identifier}/edit`)}>
@ -692,25 +692,25 @@ class Listjihe extends Component {
<div className=" sortinxdirection mt15 yldxtit"> <div className=" sortinxdirection mt15 yldxtit">
{ {
items.item_type === "SINGLE" ? items.item_type === "SINGLE" ?
<p className=" testfondex yldxtit" <p className=" testfondex yldxtit"
style={{ wordBreak: "break-word" }} style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{ __html: markdownToHTML("答案:" + tagArrays[rightkey]).replace(/▁/g, "▁▁▁") }} dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + tagArrays[rightkey]).replace(/▁/g, "▁▁▁")}}
> >
</p> </p>
: items.item_type === "MULTIPLE" ? : items.item_type === "MULTIPLE"?
<p className=" testfondex yldxtit" <p className=" testfondex yldxtit"
style={{ wordBreak: "break-word" }} style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{ __html: markdownToHTML("答案:" + MULTIPLEkey).replace(/▁/g, "▁▁▁") }} dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + MULTIPLEkey).replace(/▁/g, "▁▁▁")}}
> >
</p> </p>
: :
<p className=" testfondex yldxtit" <p className=" testfondex yldxtit"
style={{ wordBreak: "break-word" }} style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{ __html: markdownToHTML("答案:" + rightkey).replace(/▁/g, "▁▁▁") }} dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + rightkey).replace(/▁/g, "▁▁▁")}}
> >
</p> </p>
} }
</div> </div>
@ -724,7 +724,7 @@ class Listjihe extends Component {
style={{wordBreak: "break-word"}} style={{wordBreak: "break-word"}}
> >
{items ? {items ?
items.analysis === undefined || items.analysis === null || items.analysis === "" ? items.analysis=== undefined || items.analysis=== null || items.analysis === "" ?
"暂无解析" "暂无解析"
: :

@ -104,21 +104,6 @@ class Paperlibraryseeid_items extends Component {
} }
}catch (e) { }catch (e) {
}
const options = [
'bold', // 加粗
]
try {
if(itemsnamesy.constructor === Object){
// console.log("是对象");
// console.log(itemsnamesy);
}else {
// console.log("不是对象");
// console.log(itemsnamesy);
itemsnamesy=itemsnamesy+"";
}
}catch (e) {
} }
return ( return (

Loading…
Cancel
Save