杨树林 5 years ago
commit 92d6f36ee3

@ -29,7 +29,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "source-map", // 开启调试
devtool: "source-map", // 开启调试
// These are the "entry points" to our application.
// This means they will be the "root" imports that are included in JS bundle.
// The first two entry points enable "hot" CSS and auto-refreshes for JS.

@ -248,11 +248,11 @@ class ShixunModal extends Component{
</style>
}
<ul className="clearfix greybackHead edu-txt-center">
<li className="fl with40 paddingleft22" >实训名称</li>
<li className="fl with30 edu-txt-left">使用院校</li>
<li className="fl with10">使用人数</li>
<li className="fl with10">评价等级</li>
<li className="fl with10"></li>
<li className="fl with40 paddingleft22" >实训名称</li>
<li className="fl with25 edu-txt-left">院校</li>
<li className="fl with11">学习人数</li>
<li className="fl with11">难度</li>
<li className="fl with11"></li>
</ul>
@ -271,6 +271,10 @@ class ShixunModal extends Component{
margin-top:0px !important;
height: 40px;
}
.with11{
width: 11%;
box-sizing: border-box;
}
`
}
</style>
@ -279,24 +283,24 @@ class ShixunModal extends Component{
{
newshixunmodallist === undefined ? "": newshixunmodallist.map((item,key)=>{
return(
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl with40 edu-txt-left task-hide paddingl5 newtaskhide">
<Checkbox
id={"shixun_input_"+item.shixun_id} value={item.shixun_id}
className=" task-hide edu-txt-left newtaskhide"
style={{"width":"280px"}}
name="shixun_homework[]"
>
<span style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name">{item.shixun_name}</span>
</Checkbox>
</li>
<li className="fl with30 edu-txt-left task-hide paddingl5">{item.school_users}</li>
<li className="fl with10 paddingl10">{item.myshixuns_count}</li>
<li className="fl with10 color-orange-tip paddingl10">{item.preference}</li>
<Tooltip title="新窗口查看详情">
<li className="fl with10"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
</Tooltip>
</div>
<div className="clearfix edu-txt-center lineh-40 bor-bottom-greyE" key={key}>
<li className="fl with40 edu-txt-left task-hide paddingl5 newtaskhide">
<Checkbox
id={"shixun_input_"+item.shixun_id} value={item.shixun_id}
className=" task-hide edu-txt-left newtaskhide"
style={{"width":"280px"}}
name="shixun_homework[]"
>
<span style={{"textAlign":"left","color":"#05101A"}} className="task-hide color-grey-name">{item.shixun_name}</span>
</Checkbox>
</li>
<li className="fl with25 edu-txt-left task-hide paddingl5">{item.school}</li>
<li className="fl with11 paddingl10">{item.myshixuns_count}</li>
<li className="fl with11 color-orange-tip paddingl10">{item.level}</li>
<Tooltip title="新窗口查看详情">
<li className="fl with11"><a className="color-blue" href={"/shixuns/"+item.identifier+"/challenges"} target="_blank">详情</a></li>
</Tooltip>
</div>
)
})
}

@ -172,7 +172,9 @@ class Exercisestatisticalresult extends Component {
.bor-greyE{
border: 1px solid #EEEEEE!important;
}
.padtop24{
padding-top: 24px;
}
`}
</style>
@ -191,7 +193,7 @@ class Exercisestatisticalresult extends Component {
{/*<span className="markdown-body" dangerouslySetInnerHTML={createMarkup(item.ques_title)}></span>*/}
</div>
</div>
<div className="fr shixunreporttitles">正确率<span style={{color:'#FF6800'}}> {item.right_percent}%</span></div>
<div className="fr shixunreporttitles mt3">正确率<span style={{color:'#FF6800'}}> {item.right_percent}%</span></div>
</div>
{item.ques_type===5?
@ -199,9 +201,10 @@ class Exercisestatisticalresult extends Component {
return(
<div className={"mt20"}>
<div className="clearfix edu-back-white poll_list" style={{padding: '0px 20px'}}>
<div className="font-16 shixunreporttitle fl" >
<span> {ite.challenge_position}{ite.challenge_name}</span>
<div className="font-16 shixunreporttitle fl padding20">
<span>{ite.challenge_position}{ite.challenge_name}</span>
</div>
<div className="fr shixunreporttitles padtop24">正确率<span style={{color:'#FF6800'}}>{ite.challenge_percent}%</span></div>
</div>
<Exercisetablesmubu
data={ite.challenge_details}
@ -227,7 +230,7 @@ class Exercisestatisticalresult extends Component {
<div className="mb40 edu-txt-center padding20-30"
style={
{
display: data&&data===undefined?1:data&&data.commit_results.length< 10 ? 'none' : 'block'
display: data&&data===undefined?1:data&&data.questions_count.length< 10 ? 'none' : 'block'
}
}>

@ -1369,7 +1369,7 @@ class Listofworks extends Component {
let {columns,computeTimetype, page, boolgalist,limit,experience,course_groupysls, course_groupyslstwo, unlimited, unlimitedtwo, loadingstate, viewtrainingdata, game_list, data, course_group_info, order, teacherdata, task_status, checkedValuesine, searchtext, teacherlist, visible, visibles, jobsettingsdata} = this.state;
//
// console.log(teacherdata&&teacherdata.shixun_identifier)
// console.log(course_group_info)
// console.log(this.props.teacherdata&&this.props.teacherdata.publish_immediately)
// console.log(JSON.stringify(this.props));
return (
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
@ -1505,7 +1505,7 @@ class Listofworks extends Component {
<li className="clearfix ">
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
<span>
{computeTimetype===true?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
{this.props.teacherdata&&this.props.teacherdata.publish_immediately===false&&computeTimetype===true?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
</div>:<div className={"computeTimes font-13"} onClick={this.setComputeTime}>
计算成绩

@ -2,19 +2,24 @@ import React, {Component} from "react";
import {Link, NavLink} from 'react-router-dom';
import {WordsBtn, ActionBtn} from 'educoder';
import axios from 'axios';
import {
notification
} from "antd";
import '../css/members.css';
import "../common/formCommon.css";
import '../css/Courses.css';
import './style.css';
import '../css/busyWork.css'
import '../poll/pollStyle.css'
import '../css/busyWork.css';
import '../poll/pollStyle.css';
import Listofworks from "./Listofworks";
import Listofworksstudentone from './Listofworksstudentone'
import Trainingjobsetting from './Trainingjobsetting'
import Workquestionandanswer from './Workquestionandanswer'
import Listofworksstudentone from './Listofworksstudentone';
import Trainingjobsetting from './Trainingjobsetting';
import Workquestionandanswer from './Workquestionandanswer';
import CoursesListType from '../coursesPublic/CoursesListType';
import ShixunStudentWork from "./ShixunStudentWork";
import Startshixuntask from "../coursesPublic/Startshixuntask";
import HomeworkModal from "../coursesPublic/HomeworkModal";
import moment from 'moment';
class ShixunHomeworkPage extends Component {
constructor(props) {
@ -71,12 +76,190 @@ class ShixunHomeworkPage extends Component {
shixuntypes: types[3]
})
}
//立即发布
homeworkstart = () => {
debugger
let homeworkid = this.props.match.params.homeworkid;
let url = "/homework_commons/" + homeworkid + "/publish_groups.json";
axios.get(url).then((response) => {
if (response.status === 200) {
let starttime = this.props.getNowFormatDates(1);
let endtime = this.props.getNowFormatDates(2);
this.setState({
modalname: "立即发布",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
svisible: true,
Topval:"学生将立即收到作业",
// Botvalleft:"暂不发布",
Botval:`本操作只对"未发布"的分班有效`,
starttime: "发布时间:" + moment(moment(new Date())).format("YYYY-MM-DD HH:mm"),
endtime: "截止时间:" + endtime,
starttimes:starttime,
typs:"start",
Cancelname: "暂不发布",
Savesname: "立即发布",
Cancel: this.homeworkhide,
Saves: this.homeworkstartend,
course_groups: response.data.course_groups,
})
}
}).catch((error) => {
console.log(error)
});
}
getcourse_groupslist = (id) => {
this.setState({
course_groupslist: id
})
}
isupdatas = () => {
// var homeworkid = this.props.match.params.homeworkid;
// // this.Gettitleinformation(homeworkid);
// this.Getalistofworks(homeworkid);
}
homeworkhide = () => {
this.isupdatas()
this.setState({
modalname: undefined,
modaltype: undefined,
svisible: false,
Topval: undefined,
Topvalright: undefined,
Botvalleft: undefined,
Botval: undefined,
starttime: undefined,
endtime: undefined,
Cancelname: undefined,
Savesname: undefined,
Cancel: undefined,
Saves: undefined,
StudentList_value: undefined,
addname: undefined,
addnametype: false,
addnametab: undefined,
course_groupyslstwo: undefined,
typs:undefined,
starttimes:undefined,
})
}
// 立即发布
homeworkstartend = (ds,endtime) => {
var homeworkid = this.props.match.params.homeworkid;
let {course_groupslist} = this.state;
let coursesId = this.props.match.params.coursesId;
let url = "/courses/" + coursesId + "/homework_commons/publish_homework.json";
axios.post(url, {
homework_ids: [homeworkid],
group_ids: course_groupslist,
end_time:endtime,
}).then((result) => {
if (result.status === 200) {
if (result.data.status === 0) {
notification.open({
message: "提示",
description: result.data.message
});
this.homeworkhide()
}
}
}).catch((error) => {
console.log(error);
})
}
//立即截止
homeworkends = () => {
let homeworkid = this.props.match.params.homeworkid;
let url = "/homework_commons/" + homeworkid + "/end_groups.json";
axios.get(url).then((response) => {
if (response.status === 200) {
this.setState({})
this.setState({
modalname: "立即截止",
modaltype: response.data.course_groups === null || response.data.course_groups.length === 0 ? 2 : 1,
svisible: true,
Topval:"学生将不能再提交作业",
// Botvalleft:"暂不截止",
Botval:`本操作只对"提交中"的分班有效`,
Cancelname: "暂不截止",
Savesname: "立即截止",
Cancel: this.homeworkhide,
Saves: this.coursetaskend,
starttime: undefined,
endtime: undefined,
course_groups: response.data.course_groups,
typs:"end",
})
}
}).catch((error) => {
console.log(error)
});
}
//立即截止确定按钮
coursetaskend = () => {
var homeworkid = this.props.match.params.homeworkid;
let {course_groupslist} = this.state;
const cid = this.props.match.params.coursesId;
let url = "/courses/" + cid + "/homework_commons/end_homework.json";
axios.post(url, {
group_ids: course_groupslist,
homework_ids: [homeworkid],
})
.then((response) => {
if (response.data.status == 0) {
notification.open({
message: "提示",
description: response.data.message
});
this.homeworkhide()
}
})
.catch(function (error) {
console.log(error);
});
}
render() {
let {tab, jobsettingsdata, teacherdata} = this.state;
const isAdmin = this.props.isAdmin();
return (
<div className="newMain clearfix ">
{/*立即发布*/}
<HomeworkModal
modaltype={this.state.modaltype}
modalname={this.state.modalname}
visible={this.state.svisible}
Topval={this.state.Topval}
Topvalright={this.state.Topvalright}
Botvalleft={this.state.Botvalleft}
Botval={this.state.Botval}
starttime={this.state.starttime}
endtime={this.state.endtime}
Cancelname={this.state.Cancelname}
Savesname={this.state.Savesname}
Cancel={this.state.Cancel}
Saves={this.state.Saves}
course_groups={this.state.course_groups}
getcourse_groupslist={(id) => this.getcourse_groupslist(id)}
starttimes={this.state.starttimes}
typs={this.state.typs}
/>
<div className={"educontent mb20"} style={{width: "1200px"}}>
<div className="educontent mb20">

@ -58,7 +58,8 @@ export default class TPMchallengesnew extends Component {
marktype:false,
editPracticesendtype:false,
CreatePracticesendtype:false,
exec_time:20
exec_time:20,
shixunExec_timeType:false
}
}
@ -212,6 +213,13 @@ export default class TPMchallengesnew extends Component {
this.props.showSnackbar("技能标签为空")
return
}
if(exec_time===null||exec_time===undefined||exec_time===""){
this.setState({
shixunExec_timeType:false
})
return
}
const exercise_editormdvalue = this.exercisememoMDRef.current.getValue().trim();
let id = this.props.match.params.shixunId;
@ -329,6 +337,14 @@ export default class TPMchallengesnew extends Component {
})
return
}
if(exec_time===null||exec_time===undefined||exec_time===""){
debugger
this.setState({
shixunExec_timeType:false
})
return
}
axios.put(url, {
tab:0,
identifier:id,
@ -394,6 +410,8 @@ export default class TPMchallengesnew extends Component {
)
})
console.log(this.state.shixunExec_timeType )
return (
<React.Fragment>
<div className="educontent mt30 mb30">
@ -459,7 +477,7 @@ export default class TPMchallengesnew extends Component {
placeholder="请输入任务名称(此信息将提前展示给学员),例:计算学生的课程成绩绩点"/>
</div>
<div style={{width: '57px'}}>
<span
<span
className={shixunCreatePracticetype === true ? "color-orange mt8 fl block" : "color-orange mt8 fl none"}
id="new_shixun_name"><i
className="fa fa-exclamation-circle mr3"></i></span>
@ -572,11 +590,14 @@ export default class TPMchallengesnew extends Component {
<div className="edu-back-white padding40-20 mb20">
<p className="color-grey-6 font-16 mb30">服务配置</p>
<div className="clearfix mb5">
<span className="mr30 color-orange pt10">*</span>
<span className="color-orange pt10 fl">*</span>
<label className="panel-form-label fl">评测时限(S)</label>
<div className="pr fl with80 status_con">
<input value={this.state.exec_time} className="panel-box-sizing task-form-100 task-height-40" placeholder="请输入类别名称" onInput={this.setexec_time}/>
</div>
<span
className={this.state.shixunExec_timeType === true ? "color-orange mt8 fl block ml20" : "color-orange mt8 fl none"}
id="new_shixun_name"><i className="fa fa-exclamation-circle mr3"></i></span>
<div className="cl"></div>
</div>
</div>

@ -34,7 +34,7 @@ class AccountPage extends Component {
constructor (props) {
super(props)
this.state = {
basicInfo:undefined
basicInfo: {}
}
}
@ -57,8 +57,12 @@ class AccountPage extends Component {
if(result.data && result.data.base_info_completed == false){
this.props.history.push(`/account/profile/edit`);
}
// "authentication": "uncertified", // "uncertified" | "applying" | "certified"
this.setState({
basicInfo: Object.assign({}, {...result.data}, { avatar_url: `${result.data.avatar_url}?t=${new Date().getTime()}`})
basicInfo: Object.assign({}, {...result.data}, {
avatar_url: `${result.data.avatar_url}?t=${new Date().getTime()}`,
gender: result.data.gender == null || result.data.gender == undefined ? 0 : result.data.gender
})
})
}
}).catch((error)=>{

@ -44,25 +44,31 @@ class AccountBasic extends Component {
setValue=(basicInfo)=>{
if(basicInfo){
//if(basicInfo.nickname){
this.setState({
nameLength:basicInfo.nickname?basicInfo.nickname.length:0,
showRealName:basicInfo.show_realname,
identity:basicInfo.identity
})
//}
this.props.form.setFieldsValue({
nickname:basicInfo.nickname,
name:!basicInfo.show_realname ? this.hideRealName(basicInfo.name) : basicInfo.name,
student_No:basicInfo.student_id,
sex:String(basicInfo.gender),
job:map[basicInfo.identity],
job:basicInfo.identity,
org:basicInfo.school_name,
org2:basicInfo.department_name,
job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授",
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
city:[basicInfo.location,basicInfo.location_city]
})
setTimeout(() => {
// 等显示后再set
this.props.form.setFieldsValue({
student_No:basicInfo.student_id,
job1:basicInfo && basicInfo.identity=="teacher" ? basicInfo.technical_title:"教授",
job2:basicInfo && basicInfo.identity=="professional" ? basicInfo.technical_title:"企业管理者",
})
}, 100)
//if(basicInfo.nickname){
this.setState({
nameLength:basicInfo.nickname?basicInfo.nickname.length:0,
showRealName:basicInfo.show_realname,
identity:basicInfo.identity
})
//}
}
}
@ -109,14 +115,15 @@ class AccountBasic extends Component {
let url=`/users/accounts/${basicInfo.id}.json`
axios.put((url),{
nickname:values.nickname,
name:values.name,
// 认证中的不能修改
name: basicInfo.authentication == 'uncertified' ? values.name : basicInfo.name,
show_realname:this.state.showRealName,
gender:parseInt(values.sex),
location:values.city[0],
location_city:values.city[1],
identity:values.job=="教师"?"teacher":values.job=="学生"?"student":"professional",
identity: this.state.identity || (values.job=="teacher"?"teacher":values.job=="student"?"student":"professional"),
technical_title:values.job1 || values.job2,
student_id:values.job=="学生" ? values.student_No : null,
student_id:values.job=="student" ? values.student_No : null,
school_id:this.state.school_id,
department_id:this.state.department_id
}).then((result)=>{
@ -146,16 +153,21 @@ class AccountBasic extends Component {
}
}
// 将名字隐藏起来
hideRealName=(name)=>{
getHiddenName(name) {
if (!name) return ''
let len=parseInt(name.length)-1;
let str="";
for(var i = 0; i < len; i++){ str += "*"; }
const newName = name.substr(0,1)+str;
return newName
}
name = name.substr(0,1)+str;
// 将名字隐藏起来
hideRealName=(name)=>{
const newName = this.getHiddenName(name)
this.props.form.setFieldsValue({
name
name: newName
})
}
@ -365,19 +377,28 @@ class AccountBasic extends Component {
label="姓名"
className="formItemInline"
>
{getFieldDecorator('name', {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
message: '请输入您的姓名',
}],
})(
<Input placeholder="请输入您的姓名" suffix={
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"} onClick={()=>this.showOrHide(showRealName,basicInfo.name)}></i>
}></Input>
)}
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
</Form.Item>
{ basicInfo.authentication == 'uncertified' ? <React.Fragment>{getFieldDecorator('name', {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
message: '请输入您的姓名',
}],
})(
<Input placeholder="请输入您的姓名" suffix={
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
onClick={()=>this.showOrHide(showRealName,basicInfo.name)}></i>
}></Input>
)}
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
</React.Fragment> :
<div className="df" style={{ 'justify-content': 'center' }}>
<span className="mr8" >{showRealName ? this.props.basicInfo.name : this.getHiddenName(this.props.basicInfo.name)}</span>
<i className={showRealName?"iconfont icon-xianshi font-18 color-blue":"iconfont icon-yincang font-18 color-blue"}
onClick={()=>this.showOrHide(showRealName,basicInfo.name)}></i>
<span>{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }</span>
</div>
}
</Form.Item>
<Form.Item
label="性别"

@ -37,13 +37,10 @@ class AccountNav extends Component {
<i className="iconfont icon-jibenxinxi color-grey-9 font-16"></i>
基本信息
{
(basicInfo.authentication == 'uncertified' || basicInfo.authentication == 'applying') &&
basicInfo.base_info_completed == true ?
<i className="status fr iconfont icon-wancheng color-green-light font-16"></i> :
<i className="status fr iconfont icon-tishi color-red font-16"></i>
}
{
basicInfo.authentication == 'certified' &&
<i className="status fr iconfont icon-wancheng color-green-light font-16"></i>
}
</li>
<li className={`navItem ${isCertification ? 'active' : ''}`} onClick={this.toCertification}>
<i className="iconfont icon-renzhengxinxi color-grey-9 font-16"></i>

@ -121,7 +121,7 @@ class ChangeHeaderPicModal extends Component{
render(){
const { course_lists } = this.state
const { moduleName, current_user } = this.props
const userHeaderImgUrl = `${getUrl()}/images/${current_user.image_url}`
const userHeaderImgUrl = current_user ? `${getUrl()}/images/${current_user.image_url}` : ''
return(
<ModalWrapper
ref="modalWrapper"

Loading…
Cancel
Save