Merge remote-tracking branch 'origin/master'

dev_forum
杨树明 5 years ago
commit ffd5495dab

@ -13,6 +13,9 @@ import CheckCodeModal from '../coursesPublic/modal/CheckCodeModal'
import '../css/Courses.css' import '../css/Courses.css'
import WorkDetailPageHeader from './common/WorkDetailPageHeader' import WorkDetailPageHeader from './common/WorkDetailPageHeader'
import CommonWorkAppraiseReply from './reply/CommonWorkAppraiseReply' import CommonWorkAppraiseReply from './reply/CommonWorkAppraiseReply'
import Example from './TestHooks'
import CommonWorkAppraiseReviseAttachments from './CommonWorkAppraiseReviseAttachments'
const { Option} = Select; const { Option} = Select;
const CheckboxGroup = Checkbox.Group; const CheckboxGroup = Checkbox.Group;
const confirm = Modal.confirm; const confirm = Modal.confirm;
@ -174,12 +177,12 @@ class CommonWorkAppraise extends Component{
modalSave={ModalSave} modalSave={ModalSave}
loadtype={loadtype} loadtype={loadtype}
/> />
{/* 内容区 */} {/* 内容区 */}
{/* <div className="padding40 memoContent new_li"> {/* <div className="padding40 memoContent new_li">
</div> */} </div> */}
<div className={"appraise imageLayerParent "} style={{}}> <div className={"appraise imageLayerParent "} style={{}}>
<style>{` <style>{`
.workAppraise>div:last-child { .workAppraise>div:last-child {
border-bottom: none !important; border-bottom: none !important;
@ -234,42 +237,7 @@ class CommonWorkAppraise extends Component{
</div> } </div> }
{revise_attachments.length===0?"":<div className={"stud-class-set bor-top-greyE padding20-30 edu-back-white"}> <CommonWorkAppraiseReviseAttachments {...this.state}></CommonWorkAppraiseReviseAttachments>
<style>{`
.color-grey:hover i {
display: inline !important;
}
`}</style>
<div className={"color-grey-6 mb10 font-16"}>
补交附件
</div>
<div className={"ml20"}>
{revise_reason}
</div>
{revise_attachments.map((item,key)=>{
return(
<div className="color-grey" key={key}>
<a className="color-grey ml20">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<a href={item.url}
className="mr12 color9B9B imageTarget" length="58">
{item.title}
</a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
{item.delete===true?<i className="font-14 iconfont icon-guanbi " style={{display: 'none'}} id={item.id} aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.id)}></i>:""}
</div>
)
})}
<div className={"color-grey-6 clearfix lineh-25 ml20"}>
<span className={"color9B9B fr"}>更新</span>
<span className={"fr font-13 mr10 ml10"}>{atta_update_user}</span>
<span className={"color9B9B fr"}>
{moment(atta_update_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(atta_update_time).format('YYYY-MM-DD HH:mm')}
</span>
</div>
</div>}
{is_evaluation != true && project_info && project_info.name && <div className={"stud-class-set bor-top-greyE edu-back-white padding20-30"}> {is_evaluation != true && project_info && project_info.name && <div className={"stud-class-set bor-top-greyE edu-back-white padding20-30"}>
<div className={"color-grey-6 mb10"}> <div className={"color-grey-6 mb10"}>

@ -0,0 +1,52 @@
import React, { useState } from 'react'
import moment from 'moment'
// import Example from './TestHooks'
function CommonWorkAppraiseReviseAttachments(props) {
const { revise_attachments, revise_reason, atta_update_time, atta_update_user} = props
if (!revise_attachments) return ''
return (
<React.Fragment>
{/* {Example()} */}
{revise_attachments.length===0?"":<div className={"stud-class-set bor-top-greyE padding20-30 edu-back-white"}>
<style>{`
.color-grey:hover i {
display: inline !important;
}
`}</style>
<div className={"color-grey-6 mb10 font-16"}>
补交附件
</div>
{/* {age} */}
<div className={"ml20"}>
{revise_reason}
</div>
{revise_attachments.map((item,key)=>{
return(
<div className="color-grey" key={key}>
<a className="color-grey ml20">
<i className="font-14 color-green iconfont icon-fujian mr8" aria-hidden="true"></i>
</a>
<a href={item.url}
className="mr12 color9B9B imageTarget" length="58">
{item.title}
</a>
<span className="color656565 mt2 color-grey-6 font-12 mr8">{item.filesize}</span>
{item.delete===true?<i className="font-14 iconfont icon-guanbi " style={{display: 'none'}} id={item.id} aria-hidden="true" onClick={()=>this.onAttachmentRemove(item.id)}></i>:""}
</div>
)
})}
<div className={"color-grey-6 clearfix lineh-25 ml20"}>
<span className={"color9B9B fr"}>更新</span>
<span className={"fr font-13 mr10 ml10"}>{atta_update_user}</span>
<span className={"color9B9B fr"}>
{moment(atta_update_time).format('YYYY-MM-DD HH:mm')==="Invalid date"?"":moment(atta_update_time).format('YYYY-MM-DD HH:mm')}
</span>
</div>
</div>}
</React.Fragment>
)
}
export default CommonWorkAppraiseReviseAttachments;

@ -0,0 +1,26 @@
// import React, { useState, useEffect } from 'react'
// function Example() {
// const [state, setState] = useState({counter: 0})
// useEffect(() => {
// console.log(' cdm')
// return () => {
// console.log(' cwum')
// };
// })
// const add1ToCounter = () => {
// const newCounterValue = state.counter + 1
// setState({ counter: newCounterValue })
// }
// return (
// <div>
// <p>{state.counter}</p>
// <button onClick={add1ToCounter}>
// Click me
// </button>
// </div>
// )
// }
// export default Example

@ -1907,7 +1907,7 @@ class Studentshavecompletedthelist extends Component {
}) })
} }
} else { } else {
console.log("2699包含主观题包含分班"); // console.log("2699包含主观题包含分班");
if (response.data.exercise_types.groups_count > 0) { if (response.data.exercise_types.groups_count > 0) {
this.setState({ this.setState({
data: datalist, data: datalist,

@ -113,19 +113,21 @@ class Testpapersettinghomepage extends Component{
experiment=(url)=>{ experiment=(url)=>{
axios.get(url).then((response) => { axios.get(url).then((response) => {
console.log(response);
debugger
if(response.data.status&&response.data.status===-1){ if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){ }else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){ if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议: // 已超出文件导出的上限数量100 ),建议:
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:100 DownloadMessageval:100
}) })
}else { }else {
//因附件资料超过500M //因附件资料超过500M
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:500 DownloadMessageval:500
}) })
} }

@ -1353,13 +1353,13 @@ class Listofworks extends Component {
// 已超出文件导出的上限数量100 ),建议: // 已超出文件导出的上限数量100 ),建议:
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:100 DownloadMessageval:100
}) })
}else { }else {
//因附件资料超过500M //因附件资料超过500M
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:500 DownloadMessageval:500
}) })
} }

@ -468,13 +468,13 @@ class ShixunStudentWork extends Component {
// 已超出文件导出的上限数量100 ),建议: // 已超出文件导出的上限数量100 ),建议:
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:100 DownloadMessageval:100
}) })
}else { }else {
//因附件资料超过500M //因附件资料超过500M
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:500 DownloadMessageval:500
}) })
} }

@ -41,13 +41,13 @@ class ShixunWorkReport extends Component {
// 已超出文件导出的上限数量100 ),建议: // 已超出文件导出的上限数量100 ),建议:
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:100 DownloadMessageval:100
}) })
}else { }else {
//因附件资料超过500M //因附件资料超过500M
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:500 DownloadMessageval:500
}) })
} }

@ -693,11 +693,11 @@ class Trainingjobsetting extends Component {
this.state.proportion=e.target.value this.state.proportion=e.target.value
if (e.target.value === "均分比例") { if (e.target.value === "均分比例") {
this.Equalproportion(); this.Equalproportion(this.state.latedeductiontwo);
} }
if (e.target.value === "经验值比例") { if (e.target.value === "经验值比例") {
this.Empiricalvalueratio(); this.Empiricalvalueratio(this.state.latedeductiontwo);
} }
if (e.target.value === "自定义分值") { if (e.target.value === "自定义分值") {
@ -717,11 +717,11 @@ class Trainingjobsetting extends Component {
} }
onChangeslevelproportiontwo=(value)=>{ onChangeslevelproportiontwo=(value)=>{
if (value === "均分比例") { if (value === "均分比例") {
this.Equalproportion(); this.Equalproportion(this.state.latedeductiontwo);
} }
if (value === "经验值比例") { if (value === "经验值比例") {
this.Empiricalvalueratio(); this.Empiricalvalueratio(this.state.latedeductiontwo);
} }
if (value=== "自定义分值") { if (value=== "自定义分值") {
@ -739,9 +739,9 @@ class Trainingjobsetting extends Component {
}) })
} }
//均分比例 //均分比例
Equalproportion = () => { Equalproportion = (latedeductiontwo) => {
var challenge_settingsdata=this.state.challenge_settings; var challenge_settingsdata=this.state.challenge_settings;
var latedeductiontwos=this.state.latedeductiontwo; var latedeductiontwos=latedeductiontwo;
if(latedeductiontwos === undefined || latedeductiontwos===null || latedeductiontwos===""){ if(latedeductiontwos === undefined || latedeductiontwos===null || latedeductiontwos===""){
latedeductiontwos=0; latedeductiontwos=0;
} }
@ -774,15 +774,22 @@ class Trainingjobsetting extends Component {
var intkks=0; var intkks=0;
if(srbool==true){ if(srbool==true){
// 奇数 // 奇数
var exams = Math.round(Proportion) var exams = parseFloat(Proportion.toFixed(1));
var intk = srorelength*exams; var intk = srorelength*exams;
intkk=oushution - intk; intkk=oushution - intk;
console.log("奇数");
console.log(srorelength);//3
console.log(oushution);//79
console.log(exams);//26.3
console.log(intk);//78.9
console.log(intkk);
}else { }else {
// 偶数 // 偶数
var examsy = Math.round(Proportion) var examsy =parseFloat(Proportion.toFixed(1));
intkks=oushution - (examsy*srorelength); intkks=oushution - (examsy*srorelength);
console.log("偶数");
console.log(oushution);
console.log((examsy*srorelength));
} }
var mact=0; var mact=0;
@ -790,20 +797,23 @@ class Trainingjobsetting extends Component {
for (var i=0;i<challenge_settingsdata.length;i++){ for (var i=0;i<challenge_settingsdata.length;i++){
if(challenge_settingsdata[i].checked === true) { if(challenge_settingsdata[i].checked === true) {
if(srbool===false){ if(srbool===false){
console.log(intkks);
mact=mact+1; mact=mact+1;
if(mact===srorelength){ if(mact===srorelength){
challenge_settingsdata[i].challenge_score = Math.round(Proportion)+intkks; challenge_settingsdata[i].challenge_score = (parseFloat(Proportion.toFixed(1))+parseFloat(intkks.toFixed(1))).toFixed(1);
console.log( challenge_settingsdata[i].challenge_score);
}else { }else {
challenge_settingsdata[i].challenge_score = Math.round(Proportion); challenge_settingsdata[i].challenge_score = Proportion.toFixed(1);
} }
}else{ }else{
console.log(intkk);
mact=mact+1; mact=mact+1;
if(mact===srorelength){ if(mact===srorelength){
challenge_settingsdata[i].challenge_score = Math.round(Proportion)+intkk; challenge_settingsdata[i].challenge_score = (parseFloat(Proportion.toFixed(1))+parseFloat( intkk.toFixed(1))).toFixed(1);
console.log( challenge_settingsdata[i].challenge_score);
}else { }else {
challenge_settingsdata[i].challenge_score = Math.round(Proportion); challenge_settingsdata[i].challenge_score = Proportion.toFixed(1);
} }
} }
@ -822,10 +832,10 @@ class Trainingjobsetting extends Component {
} }
//经验值比例 //经验值比例
Empiricalvalueratio=()=>{ Empiricalvalueratio=(latedeductiontwo)=>{
var shixun_exp = this.state.shixun_exp; var shixun_exp = this.state.shixun_exp;
var challenge_settingsdata=this.state.challenge_settings; var challenge_settingsdata=this.state.challenge_settings;
var latedeductiontwos=this.state.latedeductiontwo; var latedeductiontwos=latedeductiontwo;
if(latedeductiontwos === undefined || latedeductiontwos===null || latedeductiontwos===""){ if(latedeductiontwos === undefined || latedeductiontwos===null || latedeductiontwos===""){
latedeductiontwos=0; latedeductiontwos=0;
} }
@ -845,14 +855,45 @@ class Trainingjobsetting extends Component {
} }
} }
//开始循环赋值 //开始循环赋值
var expzs=0;
var mact=0;
for (var i=0;i<challenge_settingsdata.length;i++){ for (var i=0;i<challenge_settingsdata.length;i++){
if(challenge_settingsdata[i].checked===true) { if(challenge_settingsdata[i].checked===true) {
mact=mact+1;
var myint = (challenge_settingsdata[i].challenge_exp / Proportion) * ionsp; var myint = (challenge_settingsdata[i].challenge_exp / Proportion) * ionsp;
challenge_settingsdata[i].challenge_score = myint.toFixed(2); challenge_settingsdata[i].challenge_score = myint.toFixed(1);
expzs=parseFloat(myint.toFixed(1))+parseFloat(expzs);
}else{
challenge_settingsdata[i].challenge_score =0;
}
}
debugger
var expzsy=0;
var bool= true;
if(ionsp - expzs>0){
expzsy=ionsp - expzs;
bool=true;
}else{
expzsy=ionsp - expzs;
bool=false;
}
var macts=0;
for (var i=0;i<challenge_settingsdata.length;i++){
if(challenge_settingsdata[i].checked===true) {
macts= macts+1;
if(mact===macts){
if(bool===true){
challenge_settingsdata[i].challenge_score = challenge_settingsdata[i].challenge_score+expzsy;
}else {
challenge_settingsdata[i].challenge_score = challenge_settingsdata[i].challenge_score-parseInt(expzsy);
}
}
}else{ }else{
challenge_settingsdata[i].challenge_score =0; challenge_settingsdata[i].challenge_score =0;
} }
} }
} }
} }
} }
@ -873,10 +914,10 @@ class Trainingjobsetting extends Component {
}) })
//均分比例 //均分比例
if(this.state.proportion==="均分比例"){ if(this.state.proportion==="均分比例"){
this.Equalproportion(); this.Equalproportion(20);
}else if(this.state.proportion==="经验值比例"){ }else if(this.state.proportion==="经验值比例"){
this.Empiricalvalueratio(); this.Empiricalvalueratio(20);
} }
@ -889,10 +930,10 @@ class Trainingjobsetting extends Component {
}) })
//均分比例 //均分比例
if(this.state.proportion==="均分比例"){ if(this.state.proportion==="均分比例"){
this.Equalproportion(); this.Equalproportion(0);
}else if(this.state.proportion==="经验值比例"){ }else if(this.state.proportion==="经验值比例"){
this.Empiricalvalueratio(); this.Empiricalvalueratio(0);
} }
} }
@ -961,10 +1002,10 @@ class Trainingjobsetting extends Component {
}) })
//均分比例 //均分比例
if(this.state.proportion==="均分比例"){ if(this.state.proportion==="均分比例"){
this.Equalproportion(); this.Equalproportion(value);
}else if(this.state.proportion==="经验值比例"){ }else if(this.state.proportion==="经验值比例"){
this.Empiricalvalueratio(); this.Empiricalvalueratio(value);
} }
@ -1627,13 +1668,13 @@ class Trainingjobsetting extends Component {
if(response.data.messages === "100"){ if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议: // 已超出文件导出的上限数量100 ),建议:
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:100 DownloadMessageval:100
}) })
}else { }else {
//因附件资料超过500M //因附件资料超过500M
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:500 DownloadMessageval:500
}) })
} }

@ -322,13 +322,13 @@ class Workquestionandanswer extends Component {
if(response.data.messages === "100"){ if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议: // 已超出文件导出的上限数量100 ),建议:
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:100 DownloadMessageval:100
}) })
}else { }else {
//因附件资料超过500M //因附件资料超过500M
this.setState({ this.setState({
DownloadType:false, DownloadType:true,
DownloadMessageval:500 DownloadMessageval:500
}) })
} }

Loading…
Cancel
Save