Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_home
cxt 5 years ago
commit f46c93b468

@ -2,7 +2,7 @@ class Competitions::PrizeLeaderAccountsController < Competitions::BaseController
before_action :require_prize_team_leader! before_action :require_prize_team_leader!
def update def update
Competitions::SavePrizeTeamAccountService.call(current_competition, current_user, update_params) Competitions::SavePrizeTeamAccountService.call(current_competition, current_prize_user, update_params)
render_ok render_ok
rescue ApplicationService::Error => ex rescue ApplicationService::Error => ex
render_error(ex.message) render_error(ex.message)
@ -13,8 +13,8 @@ class Competitions::PrizeLeaderAccountsController < Competitions::BaseController
def require_prize_team_leader! def require_prize_team_leader!
prize_user = current_competition.competition_prize_users.joins(:competition_prize) prize_user = current_competition.competition_prize_users.joins(:competition_prize)
.where(competition_prizes: { category: :bonus }) .where(competition_prizes: { category: :bonus })
.find_by(leader: true, user_id: current_user.id) .find_by(leader: true, user_id: current_prize_user.id)
return if prize_user.present? return if prize_user.present? && (current_user.admin_or_business? || current_user.id == current_prize_user.id)
render_forbidden render_forbidden
end end
@ -22,4 +22,8 @@ class Competitions::PrizeLeaderAccountsController < Competitions::BaseController
def update_params def update_params
params.permit(:bank, :second_bank, :card_no) params.permit(:bank, :second_bank, :card_no)
end end
def current_prize_user
@_current_prize_user ||= User.find(params[:user_id])
end
end end

@ -245,6 +245,7 @@
height: 60px; height: 60px;
border-radius: 50% !important; border-radius: 50% !important;
box-shadow: 0px 0px 12px rgba(0,0,0,0.2); box-shadow: 0px 0px 12px rgba(0,0,0,0.2);
border: 2px solid #459BE5;
} }
.Competitioncenter{ .Competitioncenter{
@ -308,6 +309,7 @@
width: 64px; width: 64px;
height: 63px; height: 63px;
border-radius: 50%; border-radius: 50%;
border: 2px solid #459BE5;
} }
.CompetitionsListzhezhao{ .CompetitionsListzhezhao{
@ -419,3 +421,12 @@
max-width: 100px; max-width: 100px;
display: inherit; display: inherit;
} }
.competimgabsolute{
position: absolute;
left: 100px;
bottom: -10px;
}
.competimgabsolute .ant-badge-count{
box-shadow: none !important;
}

@ -1,5 +1,5 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table} from 'antd'; import {Button,Layout,Tabs,Icon, Card, Avatar, Row, Col ,Table,Badge} from 'antd';
import {markdownToHTML,getImageUrl} from 'educoder'; import {markdownToHTML,getImageUrl} from 'educoder';
import axios from 'axios'; import axios from 'axios';
@ -200,8 +200,11 @@ class CompetitionContents extends Component{
<li className="pr Competitioncenter"> <li className="pr Competitioncenter">
<img src={getImageUrl("images/educoder/huangguan-two.png")}/> <img src={getImageUrl("images/educoder/huangguan-two.png")}/>
<div className={"mt10"}> <div className={"mt10"}>
<a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark"> <a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark ">
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} /> <div className={"relativef"}>
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
<div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} /></div>
</div>
<p className="task-hide rankName mt5 jinshaifont">{personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}</p> <p className="task-hide rankName mt5 jinshaifont">{personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}</p>
</a> </a>
</div> </div>
@ -234,10 +237,13 @@ class CompetitionContents extends Component{
cover={ cover={
<div className={"Competitionfirstbox center"}> <div className={"Competitionfirstbox center"}>
<li className="pr Competitioncenter"> <li className="pr Competitioncenter">
<img src={getImageUrl("images/educoder/huangguan.png")}/> <img src={getImageUrl("images/educoder/huangguan.png")}/>
<div className={"mt10"}> <div className={"mt10"}>
<a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark"> <a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark">
<div className={"relativef"}>
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} /> <img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
<div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} /></div>
</div>
<p className="task-hide rankName mt5 jinshaifont">{personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}</p> <p className="task-hide rankName mt5 jinshaifont">{personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}</p>
</a> </a>
</div> </div>
@ -270,10 +276,13 @@ class CompetitionContents extends Component{
cover={ cover={
<div className={"Competitionsecondarybox center"}> <div className={"Competitionsecondarybox center"}>
<li className=" pr Competitioncenter "> <li className=" pr Competitioncenter ">
<img src={getImageUrl("images/educoder/huangguan-three.png")}/> <img src={getImageUrl("images/educoder/huangguan-three.png")}/>
<div className={"mt10"}> <div className={"mt10"}>
<a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark"> <a href={`/users/${item.user_login}`} target={"_blank"} className="color-dark">
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} /> <div className={"relativef"}>
<img className={"rankingimg"} src={getImageUrl(`images/${item.user_image===null?`avatars/User/0?1442652658`:item.user_image}`)} />
<div className={"competimgabsolute"}><Badge count={item.competition_prize} style={{ backgroundColor: '#459BE5' }} /></div>
</div>
<p className="task-hide rankName mt5 jinshaifont">{personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}</p> <p className="task-hide rankName mt5 jinshaifont">{personal===undefined||personal===null?item.record_user_name:personal===true?item.record_user_name:item.team_name}</p>
</a> </a>
</div> </div>

@ -40,12 +40,48 @@ class Bankcardnumberverification extends Component {
} }
} }
componentDidUpdate = (prevProps) => {
if (prevProps.bank_account != this.props.bank_account) {
console.log("componentDidUpdate");
console.log(this.props);
console.log(prevProps);
////console.log("Registration");
////console.log("componentDidUpdate");
////console.log(this.props.user.admin);
try {
if(this.props.bank_account){
this.props.form.setFieldsValue({
openingbank: this.props.bank_account.bank,
subbranch: this.props.bank_account.second_bank,
subbranchs: this.props.bank_account.card_no,
})
}
}catch (e) {
}
try {
if(prevProps.bank_account){
this.props.form.setFieldsValue({
openingbank:prevProps.bank_account.bank,
subbranch: prevProps.bank_account.second_bank,
subbranchs: prevProps.bank_account.card_no,
})
}
}catch (e) {
}
}
}
yhBankstrue = () => { yhBankstrue = () => {
this.props.form.validateFieldsAndScroll((err, values) => { this.props.form.validateFieldsAndScroll((err, values) => {
if (!err) { if (!err) {
let url = `/competitions/${this.props.match.params.identifier}/prize_leader_account.json`; let url = `/competitions/${this.props.match.params.identifier}/prize_leader_account.json`;
axios.patch(url, { axios.patch(url, {
user_id:this.props.userdata.id,
bank: values.openingbank, bank: values.openingbank,
second_bank: values.subbranchs, second_bank: values.subbranchs,
card_no: values.subbranch card_no: values.subbranch
@ -152,7 +188,7 @@ class Bankcardnumberverification extends Component {
> >
{getFieldDecorator('openingbank', { {getFieldDecorator('openingbank', {
rules: [{ rules: [{
// initialValue: this.state.cityDefaultValue, initialValue: this.state.openingbank&&this.state.openingbank,
required: true, required: true,
message: '请输入开户行', message: '请输入开户行',
}], }],
@ -167,7 +203,7 @@ class Bankcardnumberverification extends Component {
> >
{getFieldDecorator('subbranch', { {getFieldDecorator('subbranch', {
rules: [{ rules: [{
// initialValue: this.state.cityDefaultValue, initialValue: this.props.subbranch&&this.props.subbranch,
required: true, required: true,
message: '请输入支行', message: '请输入支行',
}], }],
@ -182,7 +218,7 @@ class Bankcardnumberverification extends Component {
> >
{getFieldDecorator('subbranchs', { {getFieldDecorator('subbranchs', {
rules: [{ rules: [{
// initialValue: this.state.cityDefaultValue, initialValue: this.props.subbranchs&&this.props.subbranchs,
required: true, required: true,
message: '请输入账号', message: '请输入账号',
}], }],

@ -288,6 +288,7 @@ class CompetitionContentspdfpeopledata extends Component {
if (!err) { if (!err) {
let url = `/competitions/${this.props.match.params.identifier}/prize_leader_account.json`; let url = `/competitions/${this.props.match.params.identifier}/prize_leader_account.json`;
axios.patch(url, { axios.patch(url, {
user_id:this.state.userdata.id,
bank: values.openingbank, bank: values.openingbank,
second_bank: values.subbranchs, second_bank: values.subbranchs,
card_no: values.subbranch card_no: values.subbranch
@ -296,7 +297,7 @@ class CompetitionContentspdfpeopledata extends Component {
try { try {
if (result.data.status == 0) { if (result.data.status == 0) {
// console.log(JSON.stringify(result)); // console.log(JSON.stringify(result));
this.props.showNotification(`提交成功成功`); this.props.showNotification(`提交成功`);
this.getdata(this.state.userdata.id); this.getdata(this.state.userdata.id);
this.GetawardinformationAPI(); this.GetawardinformationAPI();
} }
@ -321,11 +322,19 @@ class CompetitionContentspdfpeopledata extends Component {
//撤销认证 //撤销认证
Cancellationofapplication = (index) => { Cancellationofapplication = (index) => {
let userid;
let query=this.props.location&&this.props.location.search;
const types = query.split('user_id=')
if(types[1]===undefined){
userid=this.props.user&&this.props.user.user_id;
}else{
userid=types[1];
}
let url = "" let url = ""
if (index === 1) { if (index === 1) {
url = `/users/accounts/${this.props.user.user_id}/authentication_apply.json`; url = `/users/accounts/${userid}/authentication_apply.json`;
} else if (index === 2) { } else if (index === 2) {
url = `/users/accounts/${this.props.user.user_id}/professional_auth_apply.json`; url = `/users/accounts/${userid}/professional_auth_apply.json`;
} }
axios.delete(url) axios.delete(url)
.then((response) => { .then((response) => {
@ -336,7 +345,11 @@ class CompetitionContentspdfpeopledata extends Component {
} else if (index === 2) { } else if (index === 2) {
this.props.showNotification('撤销职业认证成功') this.props.showNotification('撤销职业认证成功')
} }
this.getdata(this.state.userdata.id); try {
this.getdata(this.state.userdata.id);
}catch (e) {
}
} }
} catch (e) { } catch (e) {
@ -515,6 +528,7 @@ class CompetitionContentspdfpeopledata extends Component {
<div> <div>
{ {
bank_account_editable === true ? bank_account_editable === true ?
<Bankcardnumberverifications {...this.props} {...this.state} basicInfo={userdata} <Bankcardnumberverifications {...this.props} {...this.state} basicInfo={userdata}
hideUpdating={(i) => this.hideUpdating(i)} hideUpdating={(i) => this.hideUpdating(i)}
getdata={(id) => this.getdata(id)} getdata={(id) => this.getdata(id)}

@ -47,7 +47,7 @@ class Phonenumberverification extends Component {
}).then((result) => { }).then((result) => {
if (result) { if (result) {
this.props.showNotification("手机号码绑定成功!"); this.props.showNotification("手机号码绑定成功!");
this.props.hideUpdating() this.props.hideUpdating(1)
this.props.getdata(id); this.props.getdata(id);
} }
}).catch((error) => { }).catch((error) => {

@ -46,6 +46,7 @@ function disabledDateFunc(current) {
return current && current < moment().endOf('day').subtract(1, 'days'); return current && current < moment().endOf('day').subtract(1, 'days');
} }
// 类似页面 http://localhost:3007/courses/1309/graduation/graduation_tasks/48/76/setting // 类似页面 http://localhost:3007/courses/1309/graduation/graduation_tasks/48/76/setting
//普通作业分组作业设置
class CommonWorkSetting extends Component{ class CommonWorkSetting extends Component{
constructor(props){ constructor(props){
@ -411,10 +412,11 @@ class CommonWorkSetting extends Component{
} }
// 补交设置 允许补交 // 补交设置 允许补交
allow_late_change=(e)=>{ allow_late_change=(e)=>{
// console.log(e.target.checked );
this.setState({ this.setState({
allow_late: e.target.value allow_late: e.target.checked
}) })
if (e.target.value) { if (e.target.checked) {
this.setState({ this.setState({
late_penalty: 5 late_penalty: 5
}) })
@ -1155,12 +1157,16 @@ class CommonWorkSetting extends Component{
<div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl36"> <div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl36">
<div className={" font-16 color-dark h20 mb20"}>补交设置 <div className={" font-16 color-dark h20 mb20"}>补交设置
<span className={"ml15 font-14 color-grey-9 "}>选中则允许学生延时提交作品</span> <span className={"ml15 font-14 color-grey-9 "}></span>
</div> </div>
<RadioGroup onChange={this.allow_late_change} value={allow_late}>
<Radio style={radioStyle} value={true} disabled={noAuth || moment(init_late_time) < this.fetchMoment}>允许补交</Radio>
<Checkbox style={radioStyle} value={"允许补交"} checked={allow_late} className="font-16 "
onChange={this.allow_late_change} disabled={noAuth || moment(init_late_time) < this.fetchMoment}>开启补交 <span
className={"font-14 ml10 color-grey-c"}
style={{textAlign: "left", fontSize: "14px"}}>选中则允许学生延时提交作品</span></Checkbox>
<div className={"h21 mb10 ml30 mt20"}> <div className={"h21 mb10 ml30 mt20"}>
<span>迟交扣分</span> <span>迟交扣分</span>
@ -1205,9 +1211,7 @@ class CommonWorkSetting extends Component{
</div> </div>
<Radio style={radioStyle} value={false} disabled={noAuth || moment(init_late_time) < this.fetchMoment}>禁止补交</Radio>
</RadioGroup>
</div> </div>
@ -1539,3 +1543,10 @@ class CommonWorkSetting extends Component{
const CommonWorkSettingForm = Form.create({ name: 'commonworkSettingForm' })(CommonWorkSetting); const CommonWorkSettingForm = Form.create({ name: 'commonworkSettingForm' })(CommonWorkSetting);
export default CommonWorkSettingForm; export default CommonWorkSettingForm;
// {/*<RadioGroup onChange={this.allow_late_change} value={allow_late}>*/}
//
// {/* <Radio style={radioStyle} value={true} disabled={noAuth || moment(init_late_time) < this.fetchMoment}>允许补交</Radio>*/}
// {/* <Radio style={radioStyle} value={false} disabled={noAuth || moment(init_late_time) < this.fetchMoment}>禁止补交</Radio>*/}
//
// {/*</RadioGroup>*/}

@ -11,21 +11,209 @@ class ModulationModal_exercise extends Component {
score: 0, score: 0,
subjective_questions: 0, subjective_questions: 0,
objective_questions: 0, objective_questions: 0,
subjective_score: 0,
objective_score: 0,
subool: false,
Inputsval: '',
Inputsvals: '',
Inputsvaltype: false,
Inputsvaltypes: false,
Inputsvaltest: "",
Inputsvaltests: "",
} }
//因为主观题加客观题的和是总分 //因为主观题加客观题的和是总分
} }
componentDidMount = () => { componentDidMount = () => {
console.log("ModulationModal_exercise");
console.log(this.props);
this.setState({
subjective_score: this.props.subjective_score,
objective_score: this.props.objective_score,
})
if (this.props.subjective_score > 0 && this.props.objective_score > 0) {
this.setState({
subool: false,
})
} else {
this.setState({
subool: true
})
}
} }
Saves = () => { Saves = () => {
let {textareaval, subjective_questions, objective_questions, score} = this.state; let {
textareaval,
subjective_questions,
objective_questions,
score,
subool,
Inputsval,
subjective_score,
objective_score,
Inputsvals
} = this.state;
let re = /^[0-9]+.?[0-9]*$/;//判断字符串是否为数字 //判断正整数 /^[1-9]+[0-9]*]*$/
if (subool === false) {
//不是总分模式
if (Inputsval === undefined || Inputsval === null || Inputsval === "") {
this.setState({
Inputsval: "",
Inputsvaltype: true,
Inputsvaltest: "请填写分数",
})
return
}
//判断主观题
var nubmer = Inputsval;
if (!re.test(nubmer)) {
this.setState({
Inputsval: Inputsval,
Inputsvaltype: true,
Inputsvaltest: "请输入0-100的分数",
})
return;
}
if (0 > parseFloat(Inputsval)) {
this.setState({
Inputsval: Inputsval,
Inputsvaltype: true,
Inputsvaltest: "成绩不能小于零",
})
return;
} else if (parseFloat(Inputsval) > this.props.subjective_score) {
this.setState({
Inputsval: Inputsval,
Inputsvaltype: true,
Inputsvaltest: `成绩不能大于${this.props.subjective_score}`,
})
return;
}
//判断客观题
if (Inputsvals === undefined || Inputsvals === null || Inputsvals === "") {
this.setState({
Inputsvals: "",
Inputsvaltypes: true,
Inputsvaltests: "请填写分数",
})
return
}
var nubmers = Inputsvals;
if (!re.test(nubmers)) {
this.setState({
Inputsvals: "",
Inputsvaltypes: true,
Inputsvaltests: "请输入0-100的分数",
})
return;
}
if (0 > parseFloat(Inputsvals)) {
this.setState({
Inputsvals: Inputsvals,
Inputsvaltypes: true,
Inputsvaltests: "请输入0-100的分数",
})
return;
} else if (parseFloat(Inputsval) > 100) {
this.setState({
Inputsvals: Inputsvals,
Inputsvaltypes: true,
Inputsvaltests: `成绩不能大于${this.props.objective_score}`,
})
return;
}
// this.props.Saves(textareaval, Inputsval)
} else {
//总分模式
if (subjective_score > 0) {
//主观题
if (Inputsval === undefined || Inputsval === null || Inputsval === "") {
this.setState({
Inputsval: "",
Inputsvaltype: true,
Inputsvaltest: "请填写分数",
})
return
}
//判断主观题
var nubmer = Inputsval;
if (!re.test(nubmer)) {
this.setState({
Inputsval: Inputsval,
Inputsvaltype: true,
Inputsvaltest: "请输入0-100的分数",
})
return;
}
if (0 > parseFloat(Inputsval)) {
this.setState({
Inputsval: Inputsval,
Inputsvaltype: true,
Inputsvaltest: "成绩不能小于零",
})
return;
} else if (parseFloat(Inputsval) > this.props.subjective_score) {
this.setState({
Inputsval: Inputsval,
Inputsvaltype: true,
Inputsvaltest: `成绩不能大于${this.props.subjective_score}`,
})
return;
}
} else if (objective_score > 0) {
//客观题
if (Inputsvals === undefined || Inputsvals === null || Inputsvals === "") {
this.setState({
Inputsvals: "",
Inputsvaltypes: true,
Inputsvaltests: "请填写分数",
})
return
}
var nubmers = Inputsvals;
if (!re.test(nubmers)) {
this.setState({
Inputsvals: "",
Inputsvaltypes: true,
Inputsvaltests: "请输入0-100的分数",
})
return;
}
if (0 > parseFloat(Inputsvals)) {
this.setState({
Inputsvals: Inputsvals,
Inputsvaltypes: true,
Inputsvaltests: "请输入0-100的分数",
})
return;
} else if (parseFloat(Inputsvals) > 100) {
this.setState({
Inputsvals: Inputsvals,
Inputsvaltypes: true,
Inputsvaltests: `成绩不能大于${this.props.objective_score}`,
})
return;
}
}
}
this.props.Saves(Inputsval, Inputsvals);
} }
@ -35,13 +223,57 @@ class ModulationModal_exercise extends Component {
}) })
} }
//主观题
setInputs = (e) => { setInputs = (e) => {
console.log("主");
console.log(e.target.value);
this.setState({
Inputsval: e.target.value,
Inputsvaltype: false,
})
}
//客观题
setInputss = (e) => {
console.log("客");
console.log(e.target.value);
this.setState({
Inputsvals: e.target.value,
Inputsvaltypes: false,
})
}
//最终成绩主观题
setInputsss = (e) => {
console.log("终主");
console.log(e.target.value);
this.setState({
Inputsval: e.target.value,
Inputsvaltype: false,
})
}
//最终成绩客观题
setInputssss = (e) => {
console.log("终客");
console.log(e.target.value);
this.setState({
Inputsvals: e.target.value,
Inputsvaltypes: false,
})
} }
render() { render() {
let {Inputsvaltype, subjective_questions, objective_questions, score} = this.state; let {
Inputsvaltype,
Inputsvaltypes,
Inputsvaltest,
Inputsvaltests,
subjective_score,
objective_score,
Inputsval,
Inputsvals,
} = this.state;
return ( return (
<div> <div>
<Modal <Modal
@ -58,66 +290,216 @@ class ModulationModal_exercise extends Component {
flexDirection: "column", flexDirection: "column",
alignItems: "center", alignItems: "center",
}}> }}>
{
subjective_score > 0 && objective_score > 0 ?
<div>
{Inputsvaltype === true ?
<style>
{
`
.ant-input:hover {
border: 1px solid #DD1717!important;
}
.ant-input:focus {
border: 1px solid #DD1717!important;
}
}
`
}
</style>
:
""
<div className="mexertwo"> }
<p className="mexeheigth2">主观题成绩:</p> <div className="mexertwo">
<Input <p className="mexeheigth2">主观题成绩:</p>
className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"} <Input
style={{ className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"}
width: "120px", style={{
height: "40px", width: "150px",
}} height: "40px",
placeholder="请填写主观题成绩" }}
onChange={(e) => this.setInputs(e)} placeholder="请填写主观题成绩"
value={subjective_questions === undefined || subjective_questions === null ? "" : subjective_questions}/> onInput={this.setInputs}
<p className="mexeheigth"> ,</p> value={Inputsval === undefined || Inputsval === null ? "" : Inputsval}/>
<p className="mexeheigth"><span>总分</span><span>45.0 </span><span></span></p> <p className="mexeheigth ml10"> ,</p>
</div> <p className="mexeheigth"><span>总分</span><span>{subjective_score}</span><span
className="ml10"></span></p>
<div className="mexertwo"> </div>
{
<p className="mexeheigth2">客观题成绩:</p> Inputsvaltype === true ?
<Input <p style={{
className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"} color: "#DD1717",
style={{ width: "77%",
width: "120px", marginLeft: "75px",
height: "40px", marginTop: "10px",
}} }}>{Inputsvaltest}</p>
placeholder="请填写客观题成绩" : ""
onChange={(e) => this.setInputs(e)} }
value={objective_questions === undefined || objective_questions === null ? "" : objective_questions}/> {Inputsvaltypes === true ?
<p className="mexeheigth"> ,</p> <style>
<p className="mexeheigth"><span>总分</span><span>45.0 </span><span></span></p> {
`
</div> .ant-input:hover {
border: 1px solid #DD1717!important;
<div className="mexertwo"> }
<p className="mexeheigth2">最终成绩:</p> .ant-input:focus {
<Input border: 1px solid #DD1717!important;
className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"} }
style={{ }
width: "120px", `
height: "40px", }
}} </style>
placeholder="请填写最终成绩" :
onChange={(e) => this.setInputs(e)} ""
value={score === undefined || score === null ? "" : score}/>
<p className="mexeheigth"> ,</p>
<p className="mexeheigth"><span>总分</span><span>45.0 </span><span></span></p>
</div>
<div className="minbuttionte">
<a className="task-btn color-white mr30" style={{width: "72px",}}
onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" style={{width: "72px",}}
onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
</div>
</div> }
<div className="mexertwo">
<p className="mexeheigth2">客观题成绩:</p>
<Input
className={Inputsvaltypes === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"}
style={{
width: "150px",
height: "40px",
}}
placeholder="请填写客观题成绩"
onInput={this.setInputss}
value={Inputsvals === undefined || Inputsvals === null ? "" : Inputsvals}/>
<p className="mexeheigth ml10"> ,</p>
<p className="mexeheigth"><span>总分</span><span>{objective_score} </span><span
className="ml10"></span></p>
</div>
{
Inputsvaltypes === true ?
<p style={{
color: "#DD1717",
width: "77%",
marginLeft: "75px",
marginTop: "10px",
}}>{Inputsvaltests}</p>
: ""
}
</div>
:
<div className="mt20">
{
subjective_score > 0 && objective_score === 0 ?
<div>
{Inputsvaltype === true ?
<style>
{
`
.ant-input:hover {
border: 1px solid #DD1717!important;
}
.ant-input:focus {
border: 1px solid #DD1717!important;
}
}
`
}
</style>
:
""
}
<div className="mexertwo">
<p className="mexeheigth2">最终成绩:</p>
<Input
className={Inputsvaltype === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"}
style={{
width: "150px",
height: "40px",
}}
placeholder="请填写最终成绩"
onInput={this.setInputsss}
value={Inputsval === undefined || Inputsval === null ? "" : Inputsval}/>
<p className="mexeheigth ml10"> ,</p>
<p className="mexeheigth">
<span>总分</span><span>{subjective_score > 0 && objective_score === 0 ? subjective_score : ""} {objective_score > 0 && subjective_score === 0 ? objective_score : ""}</span><span
className="ml10"></span></p>
</div>
{
Inputsvaltype === true ?
<p style={{
color: "#DD1717",
width: "77%",
marginLeft: "75px",
marginTop: "10px",
}}>{Inputsvaltest}</p>
: ""
}
</div>
:
""
}
{
objective_score > 0 && subjective_score === 0 ?
<div>
{Inputsvaltypes === true ?
<style>
{
`
.ant-input:hover {
border: 1px solid #DD1717!important;
}
.ant-input:focus {
border: 1px solid #DD1717!important;
}
}
`
}
</style>
:
""
}
<div className="mexertwo">
<p className="mexeheigth2">最终成绩:</p>
<Input
className={Inputsvaltypes === true ? "borerinput myinputnumbers bor-reds" : "myinputnumbers"}
style={{
width: "150px",
height: "40px",
}}
placeholder="请填写最终成绩"
onInput={this.setInputssss}
value={Inputsvals === undefined || Inputsvals === null ? "" : Inputsvals}/>
<p className="mexeheigth ml10"> ,</p>
<p className="mexeheigth">
<span>总分</span><span>{subjective_score > 0 && objective_score === 0 ? subjective_score : ""} {objective_score > 0 && subjective_score === 0 ? objective_score : ""}</span><span
className="ml10"></span></p>
</div>
{
Inputsvaltypes === true ?
<p style={{
color: "#DD1717",
width: "77%",
marginLeft: "75px",
marginTop: "10px",
}}>{Inputsvaltests}</p>
: ""
}
</div>
:
""
}
<div className="minbuttionte">
<a className="task-btn color-white mr30" style={{width: "72px",}}
onClick={this.props.Cancel}>{this.props.Cancelname || '取消'}</a>
<a className="task-btn task-btn-orange" style={{width: "72px",}}
onClick={this.Saves}>{this.props.Savesname || '保存'}</a>
</div>
</div>
}
</div>
</Modal> </Modal>
</div> </div>
) )

@ -361,7 +361,7 @@
.minbuttionte { .minbuttionte {
/* display: flex; */ /* display: flex; */
margin-top: 27px; margin-top: 20px;
width: 100%; width: 100%;
/* align-items: center; */ /* align-items: center; */
margin-bottom: 17px; margin-bottom: 17px;

@ -1031,10 +1031,8 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.finalscore==="--"? {record.finalscore==="--"?
<a style={{textAlign: "center"}} className="color-blue" target="_blank"
onClick={() => this.Adjustment(record.user_id)}>评阅</a>
<span style={{textAlign: "center", color: '#999999'}}
>--</span>
: :
<a style={{textAlign: "center"}} className="color-blue" <a style={{textAlign: "center"}} className="color-blue"
target="_blank" target="_blank"
@ -1229,8 +1227,8 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => ( render: (text, record) => (
<span> <span>
{record.finalscore==="--"? {record.finalscore==="--"?
<span style={{textAlign: "center", color: '#999999'}} <a style={{textAlign: "center"}} className="color-blue" target="_blank"
>--</span> onClick={() => this.Adjustment(record.user_id)}>评阅</a>
: :
<a style={{textAlign: "center"}} className="color-blue" <a style={{textAlign: "center"}} className="color-blue"
target="_blank" target="_blank"
@ -2608,9 +2606,11 @@ class Studentshavecompletedthelist extends Component {
} }
// 调分 // 调分
Adjustment = (e) => { Adjustment = (e) => {
console.log("Adjustment");
console.log(e);
this.setState({ this.setState({
testpapergradingboll: true, testpapergradingboll: true,
exeuserid: e.user_id, exeuserid: e,
}) })
} }
@ -2625,12 +2625,13 @@ class Studentshavecompletedthelist extends Component {
//试卷调分 //试卷调分
Testpapergrading = (v, n) => { Testpapergrading = (v, n) => {
// debugger
var exercise_id = this.props.match.params.Id; var exercise_id = this.props.match.params.Id;
let url = `/exercises/${exercise_id}/adjust_score.json`; let url = `/exercises/${exercise_id}/adjust_score.json`;
axios.post(url, { axios.post(url, {
user_id: this.state.exeuserid, user_id: this.state.exeuserid,
subjective_score: n, subjective_score: v,
objective_score: v, objective_score: n,
}) })
.then((response) => { .then((response) => {
if (response.data.status == '0') { if (response.data.status == '0') {
@ -2639,7 +2640,7 @@ class Studentshavecompletedthelist extends Component {
this.Teacherliststudentlist(); this.Teacherliststudentlist();
} }
}) })
.catch(function (error) { .catch((error) => {
console.log(error); console.log(error);
this.setState({testpapergradingboll: false}) this.setState({testpapergradingboll: false})
}); });
@ -2676,18 +2677,20 @@ class Studentshavecompletedthelist extends Component {
</div> </div>
: :
<div> <div>
{testpapergradingboll === true ? <ModulationModal {/*{testpapergradingboll === true ? <ModulationModal*/}
visible={testpapergradingboll} {/* visible={testpapergradingboll}*/}
Cancel={() => this.Adjustments()} {/* Cancel={() => this.Adjustments()}*/}
Saves={(value, num) => this.Testpapergrading(value, num)} {/* Saves={(value, num) => this.Testpapergrading(value, num)}*/}
/> : ""} {/*/> : ""}*/}
{/*{*/} {
{/* testpapergradingboll === true ? <ModulationModal_exercise*/} testpapergradingboll === true ? <ModulationModal_exercise
{/* visible={testpapergradingboll}*/} {...this.props}
{/* Cancel={() => this.Adjustments()}*/} {...this.state}
{/* Saves={(value, num) => this.Testpapergrading(value, num)}*/} visible={testpapergradingboll}
{/* /> : ""*/} Cancel={() => this.Adjustments()}
{/*}*/} Saves={(value, num) => this.Testpapergrading(value, num)}
/> : ""
}
<div className="edu-back-white" > <div className="edu-back-white" >
<ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}> <ul className="clearfix" style={{padding: '10px 30px 10px 30px'}}>

@ -31,7 +31,7 @@ function disabledDate(current) {
return current && current < moment().endOf('day').subtract(1, 'days'); return current && current < moment().endOf('day').subtract(1, 'days');
} }
//毕设任务设置
class GraduationTaskssettingapp extends Component{ class GraduationTaskssettingapp extends Component{
constructor(props){ constructor(props){
@ -315,17 +315,17 @@ class GraduationTaskssettingapp extends Component{
allowlatefun=(e)=>{ allowlatefun=(e)=>{
let {end_time}=this.state; let {end_time}=this.state;
if(e.target.value===true||e.target.value===1){ if(e.target.checked===true||e.target.checked===1){
this.setState({ this.setState({
latepenalty:5, latepenalty:5,
allowlate:e.target.value, allowlate:e.target.checked,
latetime:end_time===null||end_time === ""?"":moment(moment(handleDateString(end_time))).add(1, 'months').format("YYYY-MM-DD HH:mm"), latetime:end_time===null||end_time === ""?"":moment(moment(handleDateString(end_time))).add(1, 'months').format("YYYY-MM-DD HH:mm"),
}) })
}else{ }else{
this.setState({ this.setState({
latepenalty:0, latepenalty:0,
allowlate:e.target.value, allowlate:e.target.checked,
latetime:"" latetime:""
}) })
} }
@ -1120,10 +1120,10 @@ debugger
<div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl36"> <div className="stud-class-set bor-bottom-greyE pd20 edu-back-white pl36">
<div className={" font-16 color-dark h20 mb20"}>补交设置 </div> <div className={" font-16 color-dark h20 mb20"}>补交设置 </div>
<Checkbox style={radioStyle} value={"允许补交"} checked={allowlate} className="font-16 "
<RadioGroup onChange={this.allowlatefun} value={allowlate===true||allowlate===1?1:2} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}> onChange={this.allowlatefun} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}>开启补交 <span
className={"font-14 ml10 color-grey-c"}
<Radio style={radioStyle} value={1}>开启补交<span className={"font-14 color-grey-c "}>选中则允许学生延时提交作品</span></Radio> style={{textAlign: "left", fontSize: "14px"}}>选中则允许学生延时提交作品</span></Checkbox>
<div className={"h21 mb30 ml30 mt20"}> <div className={"h21 mb30 ml30 mt20"}>
<span>迟交扣分</span> <span>迟交扣分</span>
@ -1163,11 +1163,6 @@ debugger
{latetimetype===true?<div className={"color-red ml70"}>{this.state.latetimetypeval}</div>:""} {latetimetype===true?<div className={"color-red ml70"}>{this.state.latetimetypeval}</div>:""}
</div> </div>
<Radio style={radioStyle} value={2}>禁止补交</Radio>
</RadioGroup>
</div> </div>
@ -1308,3 +1303,9 @@ debugger
const GraduationTaskssetting = Form.create({ name: 'coursesNew' })(GraduationTaskssettingapp); const GraduationTaskssetting = Form.create({ name: 'coursesNew' })(GraduationTaskssettingapp);
export default GraduationTaskssetting; export default GraduationTaskssetting;
// {/*<RadioGroup onChange={this.allowlatefun} value={allowlate===true||allowlate===1?1:2} disabled={this.props.isAdmin()===true?flagPageEdit===true?false:true:true}>*/}
//
// {/* <Radio style={radioStyle} value={1}>开启补交<span className={"font-14 color-grey-c "}>(选中,则允许学生延时提交作品)</span></Radio>*/}
// {/* <Radio style={radioStyle} value={2}>禁止补交</Radio>*/}
//
// {/*</RadioGroup>*/}

@ -45,6 +45,7 @@ const {Option} = Select;
//作品列表(学生) //作品列表(学生)
let allow_lates=false; let allow_lates=false;
let answer_open_evaluation=false;
class Listofworksstudentone extends Component { class Listofworksstudentone extends Component {
//unifiedsetting 统一设置 //unifiedsetting 统一设置
//allowreplenishment 允许补交 //allowreplenishment 允许补交
@ -1173,7 +1174,7 @@ class Listofworksstudentone extends Component {
<div>{record.late_penalty === "--" ? <span>迟交扣分0</span> : <div>{record.late_penalty === "--" ? <span>迟交扣分0</span> :
<span>迟交扣分{record.late_penalty}</span>}</div> <span>迟交扣分{record.late_penalty}</span>}</div>
{record.view_answer_count===null?"":<div>查看参考答案{record.view_answer_count}</div>} {record.view_answer_count===null?"":answer_open_evaluation===true?<div>查看参考答案{record.view_answer_count}</div>:""}
<div>{record.finalscore === "--" ? <span>最终成绩0</span> : <div>{record.finalscore === "--" ? <span>最终成绩0</span> :
<span>最终成绩{record.finalscore}</span>}</div> <span>最终成绩{record.finalscore}</span>}</div>
@ -1510,7 +1511,7 @@ class Listofworksstudentone extends Component {
<div>{record.late_penalty === "--" ? <span>迟交扣分0</span> : <div>{record.late_penalty === "--" ? <span>迟交扣分0</span> :
<span>迟交扣分{record.late_penalty}</span>}</div> <span>迟交扣分{record.late_penalty}</span>}</div>
{record.view_answer_count===null?"":<div>查看参考答案{record.view_answer_count}</div>} {record.view_answer_count===null?"":answer_open_evaluation===true?<div>查看参考答案{record.view_answer_count}</div>:""}
<div>{record.finalscore === "--" ? <span>最终成绩0</span> : <div>{record.finalscore === "--" ? <span>最终成绩0</span> :
<span>最终成绩{record.finalscore}</span>}</div> <span>最终成绩{record.finalscore}</span>}</div>
@ -1749,9 +1750,11 @@ class Listofworksstudentone extends Component {
loadingstate: false, loadingstate: false,
computeTimetype: true, computeTimetype: true,
homework_status: result.data.homework_status, homework_status: result.data.homework_status,
update_score: result.data.update_score update_score: result.data.update_score,
}); });
allow_lates=result.data.allow_late; allow_lates=result.data.allow_late;
answer_open_evaluation=result.data.answer_open_evaluation;
//老师
this.seacthdatat(result.data, result.data.student_works, result.data.work_efficiency, result.data.course_group_info, 1); this.seacthdatat(result.data, result.data.student_works, result.data.work_efficiency, result.data.course_group_info, 1);
if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") { if (result.data.student_works === undefined || result.data.student_works === null || JSON.stringify(result.data.student_works) === "[]") {
@ -2491,8 +2494,11 @@ class Listofworksstudentone extends Component {
code_review: result.data.code_review, code_review: result.data.code_review,
challenges_count: result.data.challenges_count, challenges_count: result.data.challenges_count,
homework_status: result.data.homework_status, homework_status: result.data.homework_status,
answer_open_evaluation:result.data.answer_open_evaluation,
}); });
allow_lates=result.data.allow_late allow_lates=result.data.allow_late;
answer_open_evaluation=result.data.answer_open_evaluation;
//老师
this.seacthdatat(result.data, result.data.student_works, result.data.work_efficiency, result.data.course_group_info, page); this.seacthdatat(result.data, result.data.student_works, result.data.work_efficiency, result.data.course_group_info, page);
this.props.Getdataback(result, result.data); this.props.Getdataback(result, result.data);
// } // }

@ -132,3 +132,17 @@
font-size: 16px; font-size: 16px;
margin-left:15px; margin-left:15px;
} }
.maxnamewidth200 {
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}
.maxnamewidth180 {
max-width: 180px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
}

@ -201,15 +201,17 @@ class Statistics extends Component{
{ {
title: '姓名', title: '姓名',
dataIndex:'user_name', dataIndex:'user_name',
className: 'maxnamewidth180',
render: (text, record) => ( render: (text, record) => (
<span>{record.user_name}</span> <a title={record.user_name} className="maxnamewidth180">{record.user_name}</a>
) )
}, },
{ {
title: '分班', title: '分班',
dataIndex: 'course_group', dataIndex: 'course_group',
className: 'maxnamewidth200',
render: (text, record) => ( render: (text, record) => (
<span >{record.course_group}</span> <a title={record.course_group} className="maxnamewidth200">{record.course_group}</a>
) )
}, },
{ {

@ -1224,7 +1224,7 @@ submittojoinclass=(value)=>{
} }
{ {
this.props.Headertop && this.props.Headertop.laboratory_user && this.props.Headertop && this.props.Headertop.laboratory_user &&
<li><a href="/admins">后台管理</a></li> <li><a href="/cooperative">后台管理</a></li>
} }
<li><a href={`/account/profile`}>账号管理</a></li> <li><a href={`/account/profile`}>账号管理</a></li>

Loading…
Cancel
Save