diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 9d856d899..cb5f16055 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -82,8 +82,8 @@ export function initAxiosInterceptors(props) { // proxy = "https://testeduplus2.educoder.net" //proxy="http://47.96.87.25:48080" proxy="https://pre-newweb.educoder.net" - proxy="https://test-newweb.educoder.net" - // proxy="https://test-jupyterweb.educoder.net" + // proxy="https://test-newweb.educoder.net" + proxy="https://test-jupyterweb.educoder.net" //proxy="http://192.168.2.63:3001" // 在这里使用requestMap控制,避免用户通过双击等操作发出重复的请求; diff --git a/public/react/src/modules/paths/PathDetail/DetailCards.js b/public/react/src/modules/paths/PathDetail/DetailCards.js index 35efec643..604d8fefe 100644 --- a/public/react/src/modules/paths/PathDetail/DetailCards.js +++ b/public/react/src/modules/paths/PathDetail/DetailCards.js @@ -510,7 +510,7 @@ class DetailCards extends Component{ {this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true? item.shixuns_list && item.shixuns_list.map((line,index)=>{ return( -
this.showparagraph(key,index)} onMouseLeave={this.hideparagraph}> +
  • @@ -681,4 +681,4 @@ export default DetailCards; // // //
  • -// } \ No newline at end of file +// } diff --git a/public/react/src/modules/question/Paperreview_item.js b/public/react/src/modules/question/Paperreview_item.js index 7fb58cb67..9609b8a60 100644 --- a/public/react/src/modules/question/Paperreview_item.js +++ b/public/react/src/modules/question/Paperreview_item.js @@ -17,7 +17,7 @@ import NoneData from './component/NoneData'; import './questioncss/questioncom.css'; import '../tpm/newshixuns/css/Newshixuns.css'; import Paperreview_single from './Paperreview_single'; -import {DragDropContext,Draggable, Droppable} from 'react-beautiful-dnd'; +import {DragDropContext, Draggable, Droppable} from 'react-beautiful-dnd'; import PaperDeletModel from './component/PaperDeletModel'; import PaperDeletModels from './component/PaperDeletModels'; import Paperreview_itemModel from './component/Paperreview_itemModel'; @@ -36,14 +36,19 @@ class Paperreview_item extends Component { super(props); this.state = { - questions:0, - totalscore:0, - total:0, - modalsTypedel:false, - modalsTypey:false, - modalsTypedels:false, - titilesm:"", - titilesms:"", + questions: 0, + totalscore: 0, + total: 0, + modalsTypedel: false, + modalsTypey: false, + modalsTypedels: false, + titilesm: "", + titilesms: "", + singlebool: false, + multiplebool: false, + judgmentbool: false, + programbool: false, + paperreviewsingleindex: "无" } } @@ -52,8 +57,6 @@ class Paperreview_item extends Component { componentDidMount() { - - } @@ -64,8 +67,6 @@ class Paperreview_item extends Component { preservation = () => { - - } @@ -73,14 +74,14 @@ class Paperreview_item extends Component { } - onDragEnd=(result)=>{ + onDragEnd = (result) => { - const ids=this.props.single_questions.questions[result.source.index].id; - const positions=this.props.single_questions.questions[result.destination.index].position; + const ids = this.props.single_questions.questions[result.source.index].id; + const positions = this.props.single_questions.questions[result.destination.index].position; - const url=`/item_baskets/${ids}/adjust_position.json` - var data={ - position:positions + const url = `/item_baskets/${ids}/adjust_position.json` + var data = { + position: positions } axios.post(url, data) .then((result) => { @@ -93,13 +94,13 @@ class Paperreview_item extends Component { }) } - onDragEnds=(result)=>{ + onDragEnds = (result) => { - const ids=this.props.multiple_questions.questions[result.source.index].id; - const positions=this.props.multiple_questions.questions[result.destination.index].position; - const url=`/item_baskets/${ids}/adjust_position.json` - var data={ - position:positions + const ids = this.props.multiple_questions.questions[result.source.index].id; + const positions = this.props.multiple_questions.questions[result.destination.index].position; + const url = `/item_baskets/${ids}/adjust_position.json` + var data = { + position: positions } axios.post(url, data) .then((result) => { @@ -115,12 +116,12 @@ class Paperreview_item extends Component { } - onDragEndss=(result)=>{ - const ids=this.props.judgement_questions.questions[result.source.index].id; - const positions=this.props.judgement_questions.questions[result.destination.index].position; - const url=`/item_baskets/${ids}/adjust_position.json` - var data={ - position:positions + onDragEndss = (result) => { + const ids = this.props.judgement_questions.questions[result.source.index].id; + const positions = this.props.judgement_questions.questions[result.destination.index].position; + const url = `/item_baskets/${ids}/adjust_position.json` + var data = { + position: positions } axios.post(url, data) .then((result) => { @@ -134,13 +135,13 @@ class Paperreview_item extends Component { } - onDragEndsss=(result)=>{ + onDragEndsss = (result) => { - const ids=this.props.judgement_questions.questions[result.source.index].id; - const positions=this.props.judgement_questions.questions[result.destination.index].position; - const url=`/item_baskets/${ids}/adjust_position.json` - var data={ - position:positions + const ids = this.props.judgement_questions.questions[result.source.index].id; + const positions = this.props.judgement_questions.questions[result.destination.index].position; + const url = `/item_baskets/${ids}/adjust_position.json` + var data = { + position: positions } axios.post(url, data) .then((result) => { @@ -153,76 +154,78 @@ class Paperreview_item extends Component { }) } - Singlemagazine=(name,bool)=>{ - if(bool===true){ + Singlemagazine = (name, bool) => { + if (bool === true) { this.setState({ - modalsTypey:true, - titilesm:name + modalsTypey: true, + titilesm: name }) - }else { + } else { this.setState({ - modalsTypey:false, - titilesm:"" + modalsTypey: false, + titilesm: "" }) } } - setDownloady=(fenshu)=>{ - const url ="/item_baskets/batch_set_score.json"; - var data ={ - score:fenshu, - item_type:this.state.titilesm==="单选题"?"SINGLE":this.state.titilesm==="多选题"?"MULTIPLE":this.state.titilesm==="判断题"?"JUDGMENT":this.state.titilesm==="编程题"?"PROGRAM":'', + setDownloady = (fenshu) => { + const url = "/item_baskets/batch_set_score.json"; + var data = { + score: fenshu, + item_type: this.state.titilesm === "单选题" ? "SINGLE" : this.state.titilesm === "多选题" ? "MULTIPLE" : this.state.titilesm === "判断题" ? "JUDGMENT" : this.state.titilesm === "编程题" ? "PROGRAM" : '', - } + } axios.post(url, data) .then((result) => { if (result.data.status == 0) { this.props.showNotification(`调分成功`); this.props.getdata({}); - this.Singlemagazine("",false); + this.Singlemagazine("", false); } }).catch((error) => { console.log(error); }) } - setmodalsTypedel=(bool,type,names)=>{ - if(type===1){ + setmodalsTypedel = (bool, type, names) => { + if (type === 1) { this.setState({ - modalsTypedel:bool, - titilesms:names + modalsTypedel: bool, + titilesms: names }) - }else{ + } else { this.setState({ - modalsTypedel:bool, - modalsTypedels:true, - titilesms:names + modalsTypedel: bool, + modalsTypedels: true, + titilesms: names }) } } - setmodalsTypedels=(bool,type)=>{ - if(type===1){ + setmodalsTypedels = (bool, type) => { + if (type === 1) { this.setState({ - modalsTypedels:bool, - titilesms:"" + modalsTypedels: bool, + titilesms: "" }) - }else { + } else { //确定 - const url=`/item_baskets/delete_item_type.json`; - axios.delete((url), { data: { - item_type:this.state.titilesms - }}) + const url = `/item_baskets/delete_item_type.json`; + axios.delete((url), { + data: { + item_type: this.state.titilesms + } + }) .then((response) => { if (response.data.status == 0) { this.props.showNotification('删除成功'); this.props.getdata({}); this.setState({ - titilesms:"" - }) + titilesms: "" + }) } }) .catch(function (error) { @@ -230,298 +233,452 @@ class Paperreview_item extends Component { }); this.setState({ - modalsTypedels:bool, + modalsTypedels: bool, + }) + } + + } + + hideparagraph = (name) => { + console.log("hideparagraph"); + + } + + hideparagraphs = () => { + this.setState({ + singlebool: false, + multiplebool: false, + judgmentbool: false, + programbool: false, + }) + } + showparagraph = (name) => { + console.log("showparagraph"); + if (name === "SINGLE") { + this.setState({ + singlebool: true, + multiplebool: false, + judgmentbool: false, + programbool: false, + + }) + + } else if (name === "MULTIPLE") { + this.setState({ + singlebool: false, + multiplebool: true, + judgmentbool: false, + programbool: false, + + }) + } else if (name === "JUDGMENT") { + this.setState({ + singlebool: false, + multiplebool: false, + judgmentbool: true, + programbool: false, + + }) + } else if (name === "PROGRAM") { + this.setState({ + singlebool: false, + multiplebool: false, + judgmentbool: false, + programbool: true, }) + } + } + jixuxuantioncli = () => { + this.props.history.replace("/question"); } + showparagraphs = (e) => { + console.log("showparagraphs"); + console.log(e); + this.setState({ + paperreviewsingleindex: e, + }) + } render() { - let {questions,totalscore,total,modalsTypedel,modalsTypey,modalsTypedels} = this.state; - let {single_questions,multiple_questions,judgement_questions,program_questions,all_score}=this.props; + let { + questions, totalscore, total, modalsTypedel, modalsTypey, modalsTypedels, + singlebool, + multiplebool, + judgmentbool, + programbool, + paperreviewsingleindex + } = this.state; + let {single_questions, multiple_questions, judgement_questions, program_questions, all_score} = this.props; return (
    { - modalsTypedel===true? - this.setmodalsTypedel(bool,type,name)}> - :"" + modalsTypedel === true ? + this.setmodalsTypedel(bool, type, name)}> + : "" } { - modalsTypey===true? - this.setDownloady(fs)} Singlemagazine={(name,bool)=>this.Singlemagazine(name,bool)}> - :"" + modalsTypey === true ? + this.setDownloady(fs)} + Singlemagazine={(name, bool) => this.Singlemagazine(name, bool)}> + : "" } { - modalsTypedels===true? - this.setmodalsTypedels(bool,type)}> - :"" + modalsTypedels === true ? + this.setmodalsTypedels(bool, type)}> + : "" } -
    -
    -

    题数:{this.props.all_score}

    -

    总分:{this.props.all_questions_count}

    +
    +
    +
    +

    题数:{this.props.all_score}

    +

    总分:{this.props.all_questions_count}

    +
    +
    +
    this.jixuxuantioncli()}> + 继续选题 +
    +
    -
    -
    -
    拖动试题可调整排序
    -
    共{single_questions&&single_questions.questions_count}个试题
    - -
    - - {/*单选题*/} - { - single_questions&&single_questions? -
    - -
    -
    -

    一、单选题

    (共{single_questions&&single_questions.questions_count}题;共{single_questions&&single_questions.questions_score}分)

    -
    -
    -
    this.setmodalsTypedel(true,1,"SINGLE")}>删除
    -
    this.Singlemagazine("单选题",true)} >设置得分
    -
    - - - {(provided, snapshot) => ( -
    - { - single_questions&&single_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
    - -
    - )} -
    - ) - }) - - } -
    - )} -
    -
    - - -
    -
    - - :"" - } - - - { - multiple_questions&&multiple_questions? -
    -
    -
    -
    -

    {single_questions===null?"一":"二"}、多选题

    (共{multiple_questions&&multiple_questions.questions_count}题;共{multiple_questions&&multiple_questions.questions_score}分)

    -
    -
    -
    this.setmodalsTypedel(true,1,"MULTIPLE")}>删除
    -
    this.Singlemagazine("多选题",true)}>设置得分
    -
    - - - - {(provided, snapshot) => ( -
    - { - multiple_questions&&multiple_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
    - -
    - )} -
    - ) - }) - - } -
    - )} -
    -
    - - -
    -
    - : - "" - } - - { - judgement_questions&&judgement_questions? -
    - -
    -
    -

    {single_questions===null&&multiple_questions===null?"一":single_questions===null&&multiple_questions!==null?"二" - :single_questions!==null&&multiple_questions===null?"二" - :"三"}、判断题

    (共{judgement_questions&&judgement_questions.questions_count}题;共{judgement_questions&&judgement_questions.questions_score}分)

    -
    -
    -
    this.setmodalsTypedel(true,1,"JUDGMENT")}>删除
    -
    this.Singlemagazine("判断题",true)}>设置得分
    -
    - - - - {(provided, snapshot) => ( -
    - { - judgement_questions&&judgement_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
    - -
    - )} -
    - ) - }) - - } -
    - )} -
    -
    -
    -
    - :"" - } - - - { - program_questions&&program_questions? -
    - -
    -
    -

    - {single_questions===null&&multiple_questions===null&&program_questions===null?"一" - :single_questions===null&&multiple_questions===null&&program_questions!==null?"二" - :single_questions!==null&&multiple_questions===null&&program_questions===null?"二" - :single_questions===null&&multiple_questions!==null&&program_questions===null?"二" - :single_questions!==null&&multiple_questions!==null&&program_questions===null?"三" - :single_questions===null&&multiple_questions!==null&&program_questions!==null?"三" - :single_questions!==null&&multiple_questions==null&&program_questions!==null?"三": - "四"} - 、编程题

    (共{program_questions&&program_questions.questions_count}题;共{program_questions&&program_questions.questions_score}分)

    -
    -
    -
    this.setmodalsTypedel(true,1,"PROGRAM")}>删除
    -
    this.Singlemagazine("编程题",true)}>设置得分
    -
    - - - {(provided, snapshot) => ( -
    - { - program_questions&&program_questions.questions.map((object, index) => { - return ( - - {(provided, snapshot) => ( -
    - -
    - )} -
    - ) - }) - - } -
    - )} -
    -
    - - -
    -
    - : - "" - } - - -
    +
    +
    +
    拖动试题可调整排序
    +
    共{single_questions && single_questions.questions_count}个试题 +
    + +
    + + {/*单选题*/} + { + single_questions && single_questions ? +
    + +
    +
    this.showparagraph("SINGLE")} onMouseLeave={() => this.hideparagraph("SINGLE")}> +

    一、单选题

    (共{single_questions && single_questions.questions_count}题;共{single_questions && single_questions.questions_score}分)

    +
    + { + singlebool === true ? +
    +
    this.setmodalsTypedel(true, 1, "SINGLE")}>删除
    +
    this.Singlemagazine("单选题", true)}>批量设置得分
    +
    : "" + } + + + {(provided, snapshot) => ( +
    + { + single_questions && single_questions.questions.map((object, index) => { + return ( + + {(provided, snapshot) => ( +
    + + +
    +
    删除
    +
    设置得分
    +
    + + this.showparagraphs(e)} + objectsingle={object} key={index} indexx={index + 1} + indexxy={index} + hideparagraphs={() => this.hideparagraphs()}> +
    + )} +
    + ) + }) + + } +
    + )} +
    +
    + + +
    +
    + + : "" + } + + + { + multiple_questions && multiple_questions ? +
    +
    +
    +
    this.showparagraph("MULTIPLE")} + onMouseLeave={() => this.hideparagraph("MULTIPLE")}> +

    {single_questions === null ? "一" : "二"}、多选题

    +

    (共{multiple_questions && multiple_questions.questions_count}题;共{multiple_questions && multiple_questions.questions_score}分)

    +
    + { + multiplebool === true ? +
    +
    this.setmodalsTypedel(true, 1, "MULTIPLE")}>删除 +
    +
    this.Singlemagazine("多选题", true)}>批量设置得分
    +
    + + : "" + } + + + + + {(provided, snapshot) => ( +
    + { + multiple_questions && multiple_questions.questions.map((object, index) => { + return ( + + {(provided, snapshot) => ( +
    + +
    +
    删除
    +
    设置得分
    +
    + this.hideparagraphs()}> +
    + )} +
    + ) + }) + + } +
    + )} +
    +
    + + +
    +
    + : + "" + } + + { + judgement_questions && judgement_questions ? +
    +
    +
    +
    this.showparagraph("JUDGMENT")} + onMouseLeave={() => this.hideparagraph("JUDGMENT")}> +

    {single_questions === null && multiple_questions === null ? "一" : single_questions === null && multiple_questions !== null ? "二" + : single_questions !== null && multiple_questions === null ? "二" + : "三"}、判断题

    (共{judgement_questions && judgement_questions.questions_count}题;共{judgement_questions && judgement_questions.questions_score}分)

    +
    + { + judgmentbool === true ? +
    +
    this.setmodalsTypedel(true, 1, "JUDGMENT")}>删除 +
    +
    this.Singlemagazine("判断题", true)}>批量设置得分
    +
    + : ""} + + + + {(provided, snapshot) => ( +
    + { + judgement_questions && judgement_questions.questions.map((object, index) => { + return ( + + {(provided, snapshot) => ( +
    + +
    +
    删除
    +
    设置得分
    +
    + this.hideparagraphs()}> +
    + )} +
    + ) + }) + + } +
    + )} +
    +
    +
    +
    + : "" + } + + + { + program_questions && program_questions ? +
    + +
    +
    +
    this.showparagraph("PROGRAM")} + onMouseLeave={() => this.hideparagraph("PROGRAM")}> +

    + {single_questions === null && multiple_questions === null && program_questions === null ? "一" + : single_questions === null && multiple_questions === null && program_questions !== null ? "二" + : single_questions !== null && multiple_questions === null && program_questions === null ? "二" + : single_questions === null && multiple_questions !== null && program_questions === null ? "二" + : single_questions !== null && multiple_questions !== null && program_questions === null ? "三" + : single_questions === null && multiple_questions !== null && program_questions !== null ? "三" + : single_questions !== null && multiple_questions == null && program_questions !== null ? "三" : + "四"} + 、编程题

    (共{program_questions && program_questions.questions_count}题;共{program_questions && program_questions.questions_score}分)

    +
    + { + programbool === true ? +
    +
    this.setmodalsTypedel(true, 1, "PROGRAM")}>删除
    +
    this.Singlemagazine("编程题", true)}>批量设置得分
    +
    + : "" + } + + + + {(provided, snapshot) => ( +
    + { + program_questions && program_questions.questions.map((object, index) => { + return ( + + {(provided, snapshot) => ( +
    + +
    +
    删除
    +
    设置得分
    +
    + this.hideparagraphs()}> +
    + )} +
    + ) + }) + + } +
    + )} +
    +
    + + +
    +
    + : + "" + } + + +
    ) diff --git a/public/react/src/modules/question/Paperreview_single.js b/public/react/src/modules/question/Paperreview_single.js index 73928ed88..4b6a964fa 100644 --- a/public/react/src/modules/question/Paperreview_single.js +++ b/public/react/src/modules/question/Paperreview_single.js @@ -1,6 +1,6 @@ import React, {Component} from "react"; import {Link, NavLink} from 'react-router-dom'; -import {WordsBtn, ActionBtn, getImageUrl,markdownToHTML} from 'educoder'; +import {WordsBtn, ActionBtn, getImageUrl, markdownToHTML} from 'educoder'; import axios from 'axios'; import { notification, @@ -17,21 +17,22 @@ import Itembankstop from "./component/Itembankstop"; import NoneData from './component/NoneData'; import './questioncss/questioncom.css'; import '../tpm/newshixuns/css/Newshixuns.css'; + 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 Paperreview_single extends Component { constructor(props) { super(props); this.state = { - questions:0, - totalscore:0, - total:0, - + questions: 0, + totalscore: 0, + total: 0, } } @@ -40,8 +41,6 @@ class Paperreview_single extends Component { componentDidMount() { - - } @@ -52,37 +51,43 @@ class Paperreview_single extends Component { preservation = () => { + } + + + setitem_type = (item_type) => { } + showparagraph = (indexx) => { - setitem_type = (item_type) => { + } + setmodalsTypedels = () => { + } + + Singlemagaziness = () => { } render() { - let {questions,totalscore,total,items} = this.state; - let {objectsingle} =this.props; - // //console.log(params); - - const objectsingleid=objectsingle.id; - const objectsinglescore=`(${objectsingle.score}分)`; + let {questions, totalscore, total, items} = this.state; + let {objectsingle, indexx, paperreviewsingleindex, indexxy} = this.props; return ( -
    this.props.showparagraphs(indexxy)} style={{ minHeight: "114px", }}> - - {/*顶部*/} -
    - {/*
    */} - {/*

    {objectsingleid}

    ({objectsinglescore}分)

    */} - {/*
    */} - -
    -
    -
    - {/*内容*/} -
    - - - { - objectsingle.item_type==="JUDGMENT"? -

    - { - objectsingle === undefined ||objectsingle === null? "" : objectsingle.choices.map((object, index) => { - return ( -

    - - {object.choice_text} - -

    - ) - }) - } -

    - : - objectsingle.item_type==="PROGRAM"? -

    -

    -

    -

    + } + +
    +
    +
    + {/*内容*/} +
    + + + { + objectsingle.item_type === "JUDGMENT" ? +

    + { + objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { + return ( +

    + + {object.choice_text} + +

    + ) + }) + }

    : -

    - { - objectsingle === undefined ||objectsingle === null? "" : objectsingle.choices.map((object, index) => { - return ( -

    - {tagArray[index]} -

    -

    - ) - }) - } -

    - } - - -
    + objectsingle.item_type === "PROGRAM" ? +

    +

    +

    +

    +

    + : +

    + { + objectsingle === undefined || objectsingle === null ? "" : objectsingle.choices.map((object, index) => { + return ( +

    + {tagArray[index]} +

    +

    + ) + }) + } +

    + } +
    diff --git a/public/react/src/modules/question/questioncss/questioncom.css b/public/react/src/modules/question/questioncss/questioncom.css index cb8b922a5..eef7dcf12 100644 --- a/public/react/src/modules/question/questioncss/questioncom.css +++ b/public/react/src/modules/question/questioncss/questioncom.css @@ -688,26 +688,44 @@ right: 2px; top: 11px; } - +.postitonrelatiss{ + position: absolute; + right: 2px; + top: -41px; +} +.postitonrelatisss{ + position: absolute; + right: 2px; + top: -39px; +} +.postitonrelatisssy{ + position: absolute; + right: 1px; + top: 52px; +} +.mt50{ + margin-top: 50px; +} .szdfd{ - width:88px; - height:34px; + width:100px; + height:40px; background:rgba(51,189,140,1); border-radius:4px 4px 0px 0px; text-align: center; color: #ffffff; - line-height: 32px; + line-height: 40px; margin-right: 27px; + font-size:12px; } .scd{ - width:88px; - height:34px; + width:100px; + height:40px; background:#4CACFF; border-radius:4px 4px 0px 0px; text-align: center; color: #ffffff; - line-height: 32px; - + line-height: 40px; + font-size:12px; } @@ -757,3 +775,35 @@ .mt7{ margin-top: 7px; } +.ml18{ + margin-left: 18px; +} +.btques{ + width:1021px; + background:rgba(249,249,249,1); + border:1px solid rgba(221,221,221,1); +} + +.borderwdswuhques { + width: 1020px !important; + background: #F9F9F9; + border: 1px solid #DDDDDD; + min-height: 42px; +} + +.jixuxuanti{ + width:106px; + height:34px; + background:rgba(51,189,140,1); + border-radius:4px; + color:#ffffff ; + line-height: 34px; + text-align: center; +} +.lh34{ + line-height: 34px; +} + +.mr2{ + margin-right: 2px; +}