diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index c630abf7e..df3ad315b 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -46,7 +46,7 @@ debugType = "admin"; // 老师 // debugType="teacher"; // 学生 -//debugType="student"; +debugType="student"; diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index 337a9b7e9..9f60b3481 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -10,12 +10,13 @@ import moment from 'moment'; import { WordsBtn,markdownToHTML,ActionBtn,getImageUrl, MarkdownToHtml } from 'educoder'; import Modals from '../../modals/Modals'; import CoursesListType from '../coursesPublic/CoursesListType'; - +import QuillForEditor from "../../../common/quillForEditor"; import Multiple from './question/multiple'; import Single from './question/single'; import FillEmpty from './question/fillEmpty'; import SimpleAnswer from './question/simpleAnswer'; import ShixunAnswer from './question/shixunAnswer'; +import QuestionModalPicture from '../../question/component/QuestionModalPicture' import update from 'immutability-helper'; @@ -37,7 +38,7 @@ const tagArray = [ const $ = window.$; const statudmap={1:"未发布",2:"已发布",3:"已截止"} -const type=["单选题","多选题","判断题","填空题","简答题","实训题"] +const type=["单选题","多选题","判断题","填空题","简答题","实训题","编程题"] const format="YYYY-MM-DD HH:mm" class ExerciseReviewAndAnswer extends Component{ @@ -86,8 +87,12 @@ class ExerciseReviewAndAnswer extends Component{ // 加载效果 isSpin:false, // 调分数组 - ajustSore:undefined - } + ajustSore:undefined, + //是否是md编辑器 + is_md:false, + url: "", + + } } componentDidUpdate (prevProps) { // 需要等get_user_info执行完才能getInfo @@ -102,6 +107,18 @@ class ExerciseReviewAndAnswer extends Component{ //window.addEventListener('scroll', this.handleScroll); } + handleShowUploadImage = (url) => { + // console.log('==============>>>>>>>>>>>>',url); + // setUrl(url); + this.setState({ + url:url + }) + } + handleClose=()=>{ + this.setState({ + url:'', + }) + } remainTime=(time)=>{ // let { time } = this.state; @@ -206,6 +223,7 @@ class ExerciseReviewAndAnswer extends Component{ data:result.data, e_ReviewInfo:result.data, exercise:result.data.exercise, + is_md:result.data.exercise.is_md, exercise_types:result.data.exercise_scores.exercise_types, exercise_scores:result.data.exercise_scores, exercise_start_at:result.data.exercise_answer_user.start_at, @@ -633,7 +651,9 @@ class ExerciseReviewAndAnswer extends Component{ Loadtype, exerciseTotalScore, isSpin, - ajustSore + ajustSore, + is_md, + url }=this.state let isAdmin = this.props.isAdmin(); let isStudent =this.props.isStudent(); @@ -670,8 +690,15 @@ class ExerciseReviewAndAnswer extends Component{ .standardAnswer.editormd-html-preview,.answerStyle.editormd-html-preview{ width:100%!important } + .ql-editor{ + padding:0px !important + } `} - {/*
*/} + {url? +@@ -869,9 +922,19 @@ class ExerciseReviewAndAnswer extends Component{
-
参考答案: {questionType.standard_answer.map((i,k)=>{ return( @@ -78,4 +120,4 @@ class Multiple extends Component{ ) } } -export default Multiple \ No newline at end of file +export default Multiple diff --git a/public/react/src/modules/courses/exercise/question/single.js b/public/react/src/modules/courses/exercise/question/single.js index e739b8f1c..e33aa9e4b 100644 --- a/public/react/src/modules/courses/exercise/question/single.js +++ b/public/react/src/modules/courses/exercise/question/single.js @@ -1,5 +1,6 @@ import React,{ Component } from "react"; import {Checkbox,Radio, Input} from "antd"; +import QuillForEditor from "../../../../common/quillForEditor"; import {markdownToHTML, MarkdownToHtml} from 'educoder' import axios from 'axios' @@ -30,36 +31,80 @@ class single extends Component{ }) } render(){ - let { - questionType , + let { + questionType , exercise, - user_exercise_status + user_exercise_status, + is_md }=this.props - + let isStudent =this.props.isStudent(); let isJudge = questionType.question_type == 2 return(
-
参考答案: {questionType.standard_answer.map((i,k)=>{ return( @@ -73,4 +118,4 @@ class single extends Component{ ) } } -export default single \ No newline at end of file +export default single diff --git a/public/react/src/modules/question/component/Contentpart.js b/public/react/src/modules/question/component/Contentpart.js index 5cafe5937..06d563a55 100644 --- a/public/react/src/modules/question/component/Contentpart.js +++ b/public/react/src/modules/question/component/Contentpart.js @@ -18,7 +18,7 @@ import LoadingSpin from '../../../common/LoadingSpin'; import Contentquestionbank from "./Contentquestionbank"; import Listjihe from "./Listjihe"; import Certifiedprofessional from "../../modals/Certifiedprofessional"; -import QuestionModalPicture from '../component/QuestionModalPicture.js' +import QuestionModalPicture from '../component/QuestionModalPicture' const { TabPane } = Tabs; const Search = Input.Search; class Contentpart extends Component {