dev_aliyun2
harry 5 years ago
parent 6b8724e6b0
commit 8e6e13264d

@ -1,7 +1,12 @@
import React, { Component } from "react";
import { markdownToHTML } from 'educoder';
import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn, SnackbarHOC, getImageUrl, markdownToHTML} from 'educoder';
import axios from 'axios';
import {
notification,
Spin,
Table,
Pagination,
Radio,
Tooltip,
Icon
@ -181,17 +186,17 @@ class Listjihe extends Component {
}
} else {
// 单选题和判断题
if (items.item_type === "MULTIPLE") {
if(items.item_type === "MULTIPLE"){
if (items.choices) {
if (items.choices.length > 0) {
var arr = items.choices;
for (var i = 0; i < arr.length; i++) {
if (arr[i].is_answer === true) {
if (MULTIPLEkey === null) {
if(MULTIPLEkey===null){
MULTIPLEkey = tagArrays[i];
} else {
MULTIPLEkey = MULTIPLEkey + tagArrays[i];
}else{
MULTIPLEkey =MULTIPLEkey+ tagArrays[i];
}
}
@ -199,7 +204,7 @@ class Listjihe extends Component {
}
}
} else {
}else{
if (items.choices) {
if (items.choices.length > 0) {
var arr = items.choices;
@ -217,31 +222,28 @@ class Listjihe extends Component {
}
}
var itemssname = "";
var itemssname="";
try {
itemssname = JSON.parse(items.name);
} catch (e) {
itemssname= JSON.parse(items.name);
}catch (e) {
}
if(itemssname===undefined){
itemssname=items.name+""
}
var itemsnamesy = "";
var itemsnamesy="";
try {
itemsnamesy = JSON.parse(items && items.program_attr && items.program_attr.description);
} catch (e) {
itemsnamesy = 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+"";
}
var analysisnames = "";
var analysisnames="";
try {
analysisnames = JSON.parse(items && items.analysis);
analysisnames= JSON.parse(items&&items.analysis);
}catch (e) {
analysisnames=items&&items.analysis+"";
@ -284,8 +286,6 @@ class Listjihe extends Component {
// console.log(Periofters);
// console.log(Perioftersbols);
}
const types = questionType.filter(item => item.type === items.item_type);
return (
<div key={keindex}
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 id={"itemsnamesyid"} className={"sortinxdirection mt15"}>
{
items && items.program_attr && items.program_attr.description ?
<p className="programquill" style={{ wordBreak: "break-word" }}
items&&items.program_attr&&items.program_attr.description?
<p className="programquill" style={{wordBreak: "break-word"}}
>
{
itemsnamesy===null || itemsnamesy===undefined?
@ -428,7 +428,7 @@ class Listjihe extends Component {
/>
}
</p>
: ""
:""
}
@ -439,28 +439,28 @@ class Listjihe extends Component {
<p className="w100s listjihetixingstitsp verticallayout ">
{
items === undefined || items === null ? "" : items.choices.map((object, index) => {
var string = ""
var string=""
try {
string = JSON.parse(object.choice_text);
} catch (e) {
string = object.choice_text;
string=JSON.parse(object.choice_text);
}catch (e) {
string=object.choice_text;
}
return (
<p className={index === 0 ? "sortinxdirection " : "sortinxdirection mt15 "}>
<p className="lh20s">{tagArray[index]}</p>
<p className="programquill" style={{ wordBreak: "break-word" }}>
<p className="programquill" style={{wordBreak: "break-word"}}>
{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
readOnly={true}
value={string}
showUploadImage={this.handleShowUploadImage}
/>
: ""
:""
:
@ -543,7 +543,7 @@ class Listjihe extends Component {
</p>
{
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`)}>
@ -694,21 +694,21 @@ class Listjihe extends Component {
{
items.item_type === "SINGLE" ?
<p className=" testfondex yldxtit"
style={{ wordBreak: "break-word" }}
dangerouslySetInnerHTML={{ __html: markdownToHTML("答案:" + tagArrays[rightkey]).replace(/▁/g, "▁▁▁") }}
style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + tagArrays[rightkey]).replace(/▁/g, "▁▁▁")}}
>
</p>
: items.item_type === "MULTIPLE" ?
: items.item_type === "MULTIPLE"?
<p className=" testfondex yldxtit"
style={{ wordBreak: "break-word" }}
dangerouslySetInnerHTML={{ __html: markdownToHTML("答案:" + MULTIPLEkey).replace(/▁/g, "▁▁▁") }}
style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + MULTIPLEkey).replace(/▁/g, "▁▁▁")}}
>
</p>
:
<p className=" testfondex yldxtit"
style={{ wordBreak: "break-word" }}
dangerouslySetInnerHTML={{ __html: markdownToHTML("答案:" + rightkey).replace(/▁/g, "▁▁▁") }}
style={{wordBreak: "break-word"}}
dangerouslySetInnerHTML={{__html: markdownToHTML("答案:" + rightkey).replace(/▁/g, "▁▁▁")}}
>
</p>
}
@ -724,7 +724,7 @@ class Listjihe extends Component {
style={{wordBreak: "break-word"}}
>
{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) {
}
const options = [
'bold', // 加粗
]
try {
if(itemsnamesy.constructor === Object){
// console.log("是对象");
// console.log(itemsnamesy);
}else {
// console.log("不是对象");
// console.log(itemsnamesy);
itemsnamesy=itemsnamesy+"";
}
}catch (e) {
}
return (

Loading…
Cancel
Save