diff --git a/public/react/src/modules/tpm/challengesnew/TPManswer2.js b/public/react/src/modules/tpm/challengesnew/TPManswer2.js index c6c7ad795..596dcc910 100644 --- a/public/react/src/modules/tpm/challengesnew/TPManswer2.js +++ b/public/react/src/modules/tpm/challengesnew/TPManswer2.js @@ -1,48 +1,21 @@ import React, {Component} from 'react'; -import {Input, InputNumber, Select, Radio, Checkbox, Popconfirm, message, Modal, Tooltip} from 'antd'; +import {Input, InputNumber, Button, Tooltip} from 'antd'; import {BrowserRouter as Router, Route, Link, Switch} from "react-router-dom"; -// import "antd/dist/antd.css"; - -import { getImageUrl, toPath, getUrl } from 'educoder'; - import axios from 'axios'; -import './css/TPMchallengesnew.css'; - import TPMMDEditor from './TPMMDEditor'; +import Bottomsubmit from "../../modals/Bottomsubmit"; -let origin = getUrl(); - -let path = getUrl("/editormd/lib/") +import './css/TPMchallengesnew.css'; const $ = window.$; -let timeout; - -let currentValue; -const Option = Select.Option; -const RadioGroup = Radio.Group; - -// const testAnswers = [{ -// "id": 4337, -// "name": "解题思路1", -// "contents": "答案的解题思路1", -// "level": 1, -// "score": 25 -// }, -// { -// "id": 4338, -// "name": "解题思路2", -// "contents": "答案的解题思路2", -// "level": 2, -// "score": 25 -// }] export default class TPManswer extends Component { constructor(props) { super(props) @@ -94,7 +67,7 @@ export default class TPManswer extends Component { } } this.setState({ - answer:response.data.answer, + answer:response.data.answer, power: response.data.power, choice_url: newchoice_url, // 导航中的新建选择题url practice_url: newpractice_url, //string 导航中新建实践题url @@ -102,10 +75,11 @@ export default class TPManswer extends Component { position: response.data.position, //int 关卡位置,导航栏中的第几关 prev_challenge: newprev_challenge, next_challenge: next_challenge, + responsedata:response.data, }) if(response.data.power===false){ - this.props.showSnackbar("没有权限修改"); + this.props.showNotification("没有权限修改"); } // if(response.data.answer===undefined||response.data.answer===null){ // this.answerMD("", "answerMD"); @@ -133,7 +107,7 @@ export default class TPManswer extends Component { // this.refs.md0 const { answers } = this.state; const answersParams = answers.slice(0) - console.log(answersParams) + // console.log(answersParams) let isValidate = true; let totalScore = 0; answersParams.forEach( (item, index) => { @@ -147,10 +121,10 @@ export default class TPManswer extends Component { totalScore += item.score; delete item.id; if (!item.name) { - this.props.showSnackbar("请先填写参考答案名称"); + this.props.showNotification("请先填写参考答案名称"); isValidate = false; } else if (!mdContnet) { - this.props.showSnackbar("请先填写参考答案内容"); + this.props.showNotification("请先填写参考答案内容"); isValidate = false; } if (!isValidate) { @@ -161,7 +135,7 @@ export default class TPManswer extends Component { return; } if (answersParams.length != 0 && totalScore != 100) { - this.props.showSnackbar("请先保证占比和为100%"); + this.props.showNotification("请先保证占比和为100%"); return; } let id = this.props.match.params.shixunId; @@ -174,7 +148,7 @@ export default class TPManswer extends Component { ).then((response) => { if (response.data) { if (response.data.message) { - this.props.showSnackbar(response.data.message); + this.props.showNotification(response.data.message); } if (response.data.status == 1) { window.location.href=`/shixuns/${id}/challenges`; @@ -233,12 +207,16 @@ export default class TPManswer extends Component { } }) } + + gotocheckpoint=(url)=>{ + this.props.history.replace(url); + } render() { let { choice_url, practice_url, - go_back_url, + responsedata, position, task_pass_default, submit_url, @@ -256,60 +234,51 @@ export default class TPManswer extends Component { return (
-
- - - - 第{position}关 - 返回 - - {prev_challenge === undefined ? "" : - 上一关 - } - - {next_challenge === undefined ? "" : - 下一关 - } - - + 实践类型 - + 选择题类型 - +
+ 第{position}关:{responsedata&&responsedata.st === 0 ?"实践题":responsedata&&responsedata.st === 1?"选择题":""} + {this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"": + } + {this.props.identity>4||this.props.identity===undefined||this.props.status===2||this.props.status===1?"": + } + {next_challenge===undefined?"": + } + {prev_challenge===undefined?"": + }
-
  • - 本关任务 + 1、本关任务
  • - + {tab2url === "" ? "":
  • >
  • }
  • - 评测设置 + 2、评测设置
  • - + {tab3url === "" ? "":
  • >
  • }
  • - 参考答案 + 3、参考答案
  • -

    - 可以将参考答案分级设置,让学员自行选择级别,每级查看后按照比例扣分值(学员已完成任务再查看,则不影响原因已获得的成绩) +

    + 可以将参考答案分级设置,让学员自行选择级别,每级查看后按照比例扣分值(学员已完成任务再查看,则不影响学员已获得的成绩)

    -

    - 示例:级别1,扣减分值占比25%;级别2,扣减分值占比35%;级别3,扣减分值占比40%;则学员选择查看级别1的答案,将被扣减25%的分值; - 选择查看级别2的答案,将被扣减60%的分值;选择查看级别3的答案,将被扣减100%的分值。 +

    +

    示例:级别1,扣减分值占比25%;级别2,扣减分值占比35%;级别3,扣减分值占比40%;
    +
    若学员选择查看级别1的答案,将被扣减25%的分值;选择查看级别2的答案,将被扣减60%的分值;选择查看级别3的答案,将被扣减100%的分值。