diff --git a/public/react/src/common/quillForEditor/index.js b/public/react/src/common/quillForEditor/index.js index 46b02b94e..7f0e56e86 100644 --- a/public/react/src/common/quillForEditor/index.js +++ b/public/react/src/common/quillForEditor/index.js @@ -209,12 +209,16 @@ function QuillForEditor({ if (value && value.hasOwnProperty('ops')) { // console.log(value.ops); - const ops = value.ops || []; - ops.forEach((item, i) => { - if (item.insert['image']) { - item.insert['image'] = Object.assign({}, item.insert['image'], { style: { cursor: 'pointer' }, onclick: (url) => showUploadImage(url) }); - } - }); + try { + const ops = value.ops || []; + ops.forEach((item, i) => { + if (item.insert['image']) { + item.insert['image'] = Object.assign({}, item.insert['image'], { style: { cursor: 'pointer' }, onclick: (url) => showUploadImage(url) }); + } + }); + }catch (e) { + + } } const current = value diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index 9f60b3481..483769f62 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -13,6 +13,7 @@ import CoursesListType from '../coursesPublic/CoursesListType'; import QuillForEditor from "../../../common/quillForEditor"; import Multiple from './question/multiple'; import Single from './question/single'; +import Progques from './question/Progques'; import FillEmpty from './question/fillEmpty'; import SimpleAnswer from './question/simpleAnswer'; import ShixunAnswer from './question/shixunAnswer'; @@ -1014,6 +1015,22 @@ class ExerciseReviewAndAnswer extends Component{ handleShowUploadImage={(u)=>this.handleShowUploadImage(u)} > } + { + //编程题 + item.question_type == 6 && + this.handleShowUploadImage(u)} + > + + } { //调分理由部分 diff --git a/public/react/src/modules/courses/exercise/question/Progques.js b/public/react/src/modules/courses/exercise/question/Progques.js new file mode 100644 index 000000000..7a0c7660b --- /dev/null +++ b/public/react/src/modules/courses/exercise/question/Progques.js @@ -0,0 +1,103 @@ +import React,{ Component } from "react"; +import {Checkbox,Radio, Input} from "antd"; +import {DMDEditor,markdownToHTML, MarkdownToHtml } from 'educoder' +import QuillForEditor from "../../../../common/quillForEditor"; + +import axios from 'axios' + +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 Progques extends Component{ + constructor(props){ + super(props); + + } + + + toMDMode = (that) => { + + + } + + onOptionContentChange = (value, index) => { + + } + + onBlurEmpty=(index,number)=>{ + + } + + render(){ + let { + questionType , + exercise , + user_exercise_status, + is_md + }=this.props + let isAdmin = this.props.isAdmin(); + let isStudent = this.props.isStudent(); + let item=questionType; + let titename=""; + if(item){ + if(is_md===true){ + titename=item.description; + }else{ + try { + titename = JSON.parse(item.description); + }catch (e) { + titename={"ops":[{"insert":item.description}]}; + } + // JSON.parse 有些异常数据是undefined + if(titename===undefined){ + titename={"ops":[{"insert":item.description}]}; + } + try { + // JSON.parse 转换的时候如果是数字字符串就转成整数了 + if(titename>=0){ + titename={"ops":[{"insert":item.description}]}; + } + }catch (e) { + + } + } + } + + return( +
+ +
  • + +
  • +
    + ) + } +} +export default Progques