hjm 6 years ago
commit 8ea08cd9fc

@ -21,7 +21,7 @@ function locationurl(list){
const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' :
window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin'
window._debugType = debugType;
// const debugType ="";
export function initAxiosInterceptors(props) {
// TODO 避免重复的请求 https://github.com/axios/axios#cancellation

@ -892,6 +892,7 @@ pop_box_new(htmlvalue, 480, 182);
<Dialog
id="tpi-dialog"
open={this.state.gDialogOpen}
disableEscapeKeyDown={true}
onClose={() => this.handleGdialogClose()}
>
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle>

@ -33,4 +33,8 @@ body {
}
.anticon anticon-paper-clip{
color: #29bd8b !important;
}
.MuiModal-root-15{
z-index: 1000 !important;
}

@ -505,6 +505,7 @@ class Comments extends Component {
</Modals> :
<Dialog
open={dialogOpen}
disableEscapeKeyDown={true}
onClose={this.handleDialogClose}
>
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle>
@ -531,6 +532,7 @@ class Comments extends Component {
<Dialog
open={goldRewardDialogOpen}
disableEscapeKeyDown={true}
onClose={this.handleGoldRewardDialogClose}
>
<DialogTitle id="alert-dialog-title">{"奖励设置"}</DialogTitle>

@ -1,88 +1,89 @@
import React, { Component } from 'react';
import Dialog, {
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
} from 'material-ui/Dialog';
import Button from 'material-ui/Button';
import { FormControl, FormHelperText } from 'material-ui/Form';
import Input, { InputLabel } from 'material-ui/Input';
class RewardDialog extends Component {
constructor(props) {
super(props)
this.handleGoldRewardDialogClose = this.handleGoldRewardDialogClose.bind(this)
this.state = {
// goldRewardDialogOpen: false,
goldRewardInput: '',
}
}
showGoldRewardDialog(comment, childComment) {
if (comment.admin === true) {
this.comment = comment;
this.childComment = childComment;
this.setState({goldRewardDialogOpen: true})
}
}
handleGoldRewardDialogClose() {
this.props.setRewardDialogVisible(false)
}
onGoldRewardDialogOkBtnClick() {
console.log('onGoldRewardDialogOkBtnClick')
const { goldRewardInput } = this.state;
if (!goldRewardInput || goldRewardInput === '0' || goldRewardInput.indexOf('-') !== -1) {
this.setState({ goldRewardInputError: true})
return;
} else {
this.props.setRewardDialogVisible( false )
this.props.rewardCode(goldRewardInput)
}
}
onGoldRewardInputChange(event) {
this.setState({ goldRewardInput: event.target.value, goldRewardInputError: false });
}
render() {
const { goldRewardDialogOpen } = this.props;
const { goldRewardInputError } = this.state;
const goldRewardInputErrorObj = goldRewardInputError ? {'error': 'error'} : {}
return (
<Dialog
open={goldRewardDialogOpen}
onClose={this.handleGoldRewardDialogClose}
>
<DialogTitle id="alert-dialog-title">{"奖励设置"}</DialogTitle>
<DialogContent>
<FormControl { ...goldRewardInputErrorObj } aria-describedby="name-error-text">
<InputLabel htmlFor="goldReward">请输入奖励的金币数量</InputLabel>
<Input id="goldReward" type="number" value={this.state.goldRewardInput} onChange={(e) => this.onGoldRewardInputChange(e)} />
{ goldRewardInputError ? <FormHelperText id="name-error-text">奖励金币不能为空或负数</FormHelperText> : ''}
</FormControl>
{/*<DialogContentText id="alert-dialog-description" style={{textAlign: 'center'}}> </DialogContentText>*/}
</DialogContent>
<DialogActions>
<Button onClick={this.handleGoldRewardDialogClose} color="primary">
取消
</Button>
<Button variant="raised"
onClick={() => this.onGoldRewardDialogOkBtnClick() } color="primary" autoFocus>
确定
</Button>
</DialogActions>
</Dialog>
);
}
}
export default RewardDialog;
import React, { Component } from 'react';
import Dialog, {
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
} from 'material-ui/Dialog';
import Button from 'material-ui/Button';
import { FormControl, FormHelperText } from 'material-ui/Form';
import Input, { InputLabel } from 'material-ui/Input';
class RewardDialog extends Component {
constructor(props) {
super(props)
this.handleGoldRewardDialogClose = this.handleGoldRewardDialogClose.bind(this)
this.state = {
// goldRewardDialogOpen: false,
goldRewardInput: '',
}
}
showGoldRewardDialog(comment, childComment) {
if (comment.admin === true) {
this.comment = comment;
this.childComment = childComment;
this.setState({goldRewardDialogOpen: true})
}
}
handleGoldRewardDialogClose() {
this.props.setRewardDialogVisible(false)
}
onGoldRewardDialogOkBtnClick() {
console.log('onGoldRewardDialogOkBtnClick')
const { goldRewardInput } = this.state;
if (!goldRewardInput || goldRewardInput === '0' || goldRewardInput.indexOf('-') !== -1) {
this.setState({ goldRewardInputError: true})
return;
} else {
this.props.setRewardDialogVisible( false )
this.props.rewardCode(goldRewardInput)
}
}
onGoldRewardInputChange(event) {
this.setState({ goldRewardInput: event.target.value, goldRewardInputError: false });
}
render() {
const { goldRewardDialogOpen } = this.props;
const { goldRewardInputError } = this.state;
const goldRewardInputErrorObj = goldRewardInputError ? {'error': 'error'} : {}
return (
<Dialog
open={goldRewardDialogOpen}
disableEscapeKeyDown={true}
onClose={this.handleGoldRewardDialogClose}
>
<DialogTitle id="alert-dialog-title">{"奖励设置"}</DialogTitle>
<DialogContent>
<FormControl { ...goldRewardInputErrorObj } aria-describedby="name-error-text">
<InputLabel htmlFor="goldReward">请输入奖励的金币数量</InputLabel>
<Input id="goldReward" type="number" value={this.state.goldRewardInput} onChange={(e) => this.onGoldRewardInputChange(e)} />
{ goldRewardInputError ? <FormHelperText id="name-error-text">奖励金币不能为空或负数</FormHelperText> : ''}
</FormControl>
{/*<DialogContentText id="alert-dialog-description" style={{textAlign: 'center'}}> </DialogContentText>*/}
</DialogContent>
<DialogActions>
<Button onClick={this.handleGoldRewardDialogClose} color="primary">
取消
</Button>
<Button variant="raised"
onClick={() => this.onGoldRewardDialogOkBtnClick() } color="primary" autoFocus>
确定
</Button>
</DialogActions>
</Dialog>
);
}
}
export default RewardDialog;

@ -5,7 +5,8 @@ import locale from 'antd/lib/date-picker/locale/zh_CN';
import { WordsBtn,getUrl ,handleDateString} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import DownloadMessage from '../../../modals/DownloadMessage';
import DownloadMessageysl from "../../../modals/DownloadMessageysl";
import CoursesListType from '../../coursesPublic/CoursesListType';
import HomeworkModal from "../../coursesPublic/HomeworkModal";
import moment from 'moment';
@ -70,7 +71,9 @@ class GraduationTaskssettingapp extends Component{
endtimetype:false,
flagPageEdit:false,
visible:false,
starttime:undefined
starttime:undefined,
DownloadType:false,
DownloadMessageval:undefined,
}
}
@ -891,34 +894,41 @@ class GraduationTaskssettingapp extends Component{
}
/// 确认是否下载
confirmysl(url){
axios.get(url).then((response) => {
if(response === undefined){
return
}
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
}
this.refs.DownloadMessage.confirmysl(url);
// axios.get(url).then((response) => {
// if(response.data.status&&response.data.status===-1){
// }else if(response.data.status&&response.data.status===-2){
// if(response.data.messages === "100"){
// // 已超出文件导出的上限数量100 ),建议:
// this.setState({
// DownloadType:true,
// DownloadMessageval:100
// })
// }else {
// //因附件资料超过500M
// this.setState({
// DownloadType:true,
// DownloadMessageval:500
// })
// }
// }else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
// }
// }).catch((error) => {
// console.log(error)
// });
Downloadcal=()=> {
this.setState({
DownloadType: false,
DownloadMessageval: undefined
})
}
render(){
const { getFieldDecorator } = this.props.form;
@ -994,11 +1004,15 @@ class GraduationTaskssettingapp extends Component{
{/*course_groups={course_groups}*/}
{/*skipTop={this.skipTop}*/}
{/*/>*/}
<DownloadMessage
{...this.props}
ref="DownloadMessage"
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<HomeworkModal
<HomeworkModal
starttimes={this.state.starttimes}
typs={this.state.typs}
modalname={modalname}

@ -6,9 +6,8 @@ import axios from 'axios';
import moment from 'moment';
import HomeworkModal from "../../coursesPublic/HomeworkModal";
import Modals from '../../../modals/Modals';
import DownloadMessage from '../../../modals/DownloadMessage';
import CoursesListType from '../../coursesPublic/CoursesListType';
import DownloadMessageysl from "../../../modals/DownloadMessageysl";
import ModulationModal from "../../coursesPublic/ModulationModal";
import AllocationModal from "../../coursesPublic/AllocationModal";
import Associationmodel from '../../coursesPublic/Associationmodel';
@ -48,7 +47,9 @@ class GraduationTaskssettinglist extends Component{
Allocationtype:false,
task_Id:"",
user_id:"",
visibles:false
visibles:false,
DownloadType:false,
DownloadMessageval:undefined,
}
}
@ -626,21 +627,57 @@ class GraduationTaskssettinglist extends Component{
this.seacthdata(teacher_comment,task_status,course_group,cross_comment,order,b_order,search,pageNumber);
}
/// 确认是否下载
confirmysl(url){
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state;
let params ={
teacher_comment:teacher_comment,
task_status:task_status,
course_group:course_group,
cross_comment:cross_comment,
order:order,
b_order:b_order,
search:search,
}
axios.get(url,{
params
}).then((response) => {
if(response === undefined){
return
}
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
}
let {teacher_comment, task_status, course_group, cross_comment, order, b_order, search,page} =this.state;
let params ={
teacher_comment:teacher_comment,
task_status:task_status,
course_group:course_group,
cross_comment:cross_comment,
order:order,
b_order:b_order,
search:search,
}
this.refs.DownloadMessage.confirmysl(url,params);
Downloadcal=()=> {
this.setState({
DownloadType: false,
DownloadMessageval: undefined
})
}
render(){
@ -1007,7 +1044,13 @@ class GraduationTaskssettinglist extends Component{
setupdate={this.setupdate}
/>:""}
<DownloadMessage ref="DownloadMessage" {...this.props} />
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
{taskslistdata&&taskslistdata?
// 教师列表

@ -4,7 +4,7 @@ import {Link} from 'react-router-dom';
import { WordsBtn,markdownToHTML} from 'educoder';
import axios from 'axios';
import Modals from '../../../modals/Modals';
import DownloadMessage from '../../../modals/DownloadMessage';
import DownloadMessageysl from "../../../modals/DownloadMessageysl";
import HomeworkModal from "../../coursesPublic/HomeworkModal";
import CoursesListType from '../../coursesPublic/CoursesListType';
import moment from 'moment';
@ -25,7 +25,9 @@ class GraduationTasksquestions extends Component{
fileList: [],
contents: [{val:"",id:1}],
type:true,
questionslist:undefined
questionslist:undefined,
DownloadType:false,
DownloadMessageval:undefined,
}
}
@ -192,37 +194,40 @@ class GraduationTasksquestions extends Component{
/// 确认是否下载
confirmysl(url){
this.refs.DownloadMessage.confirmysl(url);
// axios.get(url).then((response) => {
// if(response.data.status&&response.data.status===-1){
// }else if(response.data.status&&response.data.status===-2){
// if(response.data.messages === "100"){
// // 已超出文件导出的上限数量100 ),建议:
// this.setState({
// DownloadType:true,
// DownloadMessageval:100
// })
// }else {
// //因附件资料超过500M
// this.setState({
// DownloadType:true,
// DownloadMessageval:500
// })
// }
// }else {
// this.props.showNotification(`正在下载中`);
// window.open("/api"+url, '_blank');
// }
// }).catch((error) => {
// console.log(error)
// });
axios.get(url).then((response) => {
if(response === undefined){
return
}
if(response.data.status&&response.data.status===-1){
}else if(response.data.status&&response.data.status===-2){
if(response.data.messages === "100"){
// 已超出文件导出的上限数量100 ),建议:
this.setState({
DownloadType:true,
DownloadMessageval:100
})
}else {
//因附件资料超过500M
this.setState({
DownloadType:true,
DownloadMessageval:500
})
}
}else {
this.props.showNotification(`正在下载中`);
window.open("/api"+url, '_blank');
}
}).catch((error) => {
console.log(error)
});
}
Downloadcal=()=>{
Downloadcal=()=> {
this.setState({
DownloadType:false,
DownloadMessageval:undefined
DownloadType: false,
DownloadMessageval: undefined
})
}
render(){
@ -256,9 +261,12 @@ class GraduationTasksquestions extends Component{
{/*modalSave={ModalSave}*/}
{/*loadtype={Loadtype}*/}
{/*/>*/}
<DownloadMessage
<DownloadMessageysl
{...this.props}
ref="DownloadMessage"
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<HomeworkModal
starttimes={this.state.starttimes}

@ -911,8 +911,8 @@ class Listofworksstudentone extends Component {
}
}
student=()=>{
console.log("914");
debugger
// console.log("914");
// debugger
this.props.triggerRef(this);
var homeworkid = this.props.match.params.homeworkid;
this.Getalistofworks(homeworkid);
@ -932,8 +932,8 @@ class Listofworksstudentone extends Component {
// 获取作品列表
Getalistofworks = (homeworkid) => {
// console.log("获取作品列表");
console.log("935");
debugger
// console.log("935");
// debugger
let urll = `/homework_commons/${homeworkid}/works_list.json`;
var data = {
search: "",
@ -948,9 +948,9 @@ class Listofworksstudentone extends Component {
if(result === undefined){
return
}
console.log("951");
console.log(result);
debugger
// console.log("951");
// console.log(result);
// debugger
if (result.status === 200) {
this.setState({
teacherdata: result.data,
@ -1109,11 +1109,11 @@ class Listofworksstudentone extends Component {
})
// }
var teacherlist = { //分页
total: teacherdata.student_works.length, //数据总数量
pageSize: teacherdata.student_works.length, //一页显示几条
current: this.state.page,
}
// var teacherlist = { //分页
// total: teacherdata.student_works.length, //数据总数量
// pageSize: teacherdata.student_works.length, //一页显示几条
// current: this.state.page,
// }
styletable = {"display": "block",}
} else {
// console.log("seacthdata设置数据2")
@ -1231,11 +1231,11 @@ class Listofworksstudentone extends Component {
})
// }
var teacherlist = { //分页
total: teacherdata.student_works.length, //数据总数量
pageSize: teacherdata.student_works.length, //一页显示几条
current: this.state.page,
}
// var teacherlist = { //分页
// total: teacherdata.student_works.length, //数据总数量
// pageSize: teacherdata.student_works.length, //一页显示几条
// current: this.state.page,
// }
} else {
// console.log("seacthdata设置数据2")
var teacherlist = undefined;
@ -1404,11 +1404,11 @@ class Listofworksstudentone extends Component {
TablePagination = (e) => {
// console.log(e.current);
var teacherlists = { //分页
total: this.state.student_works.length, //数据总数量
pageSize: 10, //一页显示几条
current: e.current,
}
// var teacherlists = { //分页
// total: this.state.student_works.length, //数据总数量
// pageSize: 10, //一页显示几条
// current: e.current,
// }
this.setState({
page: e.current,
teacherlists: teacherlists
@ -1468,7 +1468,7 @@ class Listofworksstudentone extends Component {
// 获取作品列表
Getalistofworkst = (homeworkid) => {
// console.log("获取作品列表");7009
debugger
// debugger
let urll = `/homework_commons/${homeworkid}/works_list.json`;
// console.log(homeworkid);
@ -1488,7 +1488,7 @@ class Listofworksstudentone extends Component {
limit:20,
}
axios.post(urll, data).then((result) => {
debugger
// debugger
if (result !== undefined) {
// console.log(url)
// console.log("作品列表6789077")
@ -1583,7 +1583,7 @@ class Listofworksstudentone extends Component {
// 设置数据
seacthdatat = (teacherdata,student_works,work_efficiency,course_group_info) => {
debugger
// debugger
let {page, limit} = this.state;
let datalist = [];
let columns = this.state.columns;
@ -1615,11 +1615,11 @@ class Listofworksstudentone extends Component {
}
var teacherlist = { //分页
total: student_works.length, //数据总数量
pageSize: 20, //一页显示几条
current: page,
}
// var teacherlist = { //分页
// total: student_works.length, //数据总数量
// pageSize: 20, //一页显示几条
// current: page,
// }
if (work_efficiency === false) {
if(JSON.stringify(course_group_info) === "[]"|| course_group_info === undefined||course_group_info === null){
//这里没有分班 没有 关卡得分 没有效率分
@ -2198,9 +2198,12 @@ class Listofworksstudentone extends Component {
// console.log(this.state.data);
// console.log("841");
// console.log(this.state.columns);
// console.log(data);
// console.log("2202");
// console.log(this.props.isAdmin());
return (
this.props.isAdmin === true ?
(
this.props.isAdmin() === true ?
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
{visible === true ? <ModulationModal
visible={visible}
@ -2488,7 +2491,7 @@ class Listofworksstudentone extends Component {
</div>
{
teacherdata && teacherdata.work_count && teacherdata.work_count > limit ?
<div className="edu-txt-center edu-back-white mt30 mb20">
<div className="edu-txt-center mt30 ">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
total={teacherdata.work_count}></Pagination>
@ -2498,13 +2501,14 @@ class Listofworksstudentone extends Component {
</div>
</div>
) :(
teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ?
// 学生不能查看别人的
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
<style>
{`
:
<div>
{
teacherdata === undefined || teacherdata.student_works === undefined || teacherdata.student_works === null || JSON.stringify(teacherdata.student_works) === "[]" ?
// 学生不能查看别人的
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
<style>
{`
.startbox{
height: 48px;
background: rgba(255,104,0,0.1);
@ -2544,65 +2548,65 @@ class Listofworksstudentone extends Component {
cursor: pointer;
}
`}
</style>
{visibles === true ?
<div>
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<style>
{
`
</style>
{visibles === true ?
<div>
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
<style>
{
`
body {
overflow: hidden !important;
}
`
}
</style>
<TraineetraininginformationModal
homeworkid={this.props.match.params.homeworkid}
coursesId={this.props.match.params.coursesId}
userids={this.state.userids}
viewtrainingdata={viewtrainingdata}
game_list={game_list}
visible={visibles}
experience={experience}
boolgalist={boolgalist}
Cancel={() => this.cancelModulationModels()}
/>
</div>
: ""
}
</style>
<TraineetraininginformationModal
homeworkid={this.props.match.params.homeworkid}
coursesId={this.props.match.params.coursesId}
userids={this.state.userids}
viewtrainingdata={viewtrainingdata}
game_list={game_list}
visible={visibles}
experience={experience}
boolgalist={boolgalist}
Cancel={() => this.cancelModulationModels()}
/>
</div>
: ""
}
<div className={"educontent "}>
<div className="edu-back-white" style={{width: "1200"}}>
<div className={"educontent "}>
<div className="edu-back-white" style={{width: "1200"}}>
{computeTimetype===false?<li className="clearfix startbox mb20">
{computeTimetype===false?<li className="clearfix startbox mb20">
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
</span>
</li>:""}
</li>:""}
{JSON.stringify(data) !== "[]" ?
<div>
<div id="graduation_work_list"
style={{
"padding": '20px 20px 10px 20px',
"margin-bottom": "10px"
}}>
{JSON.stringify(data) !== "[]" ?
<div>
<div id="graduation_work_list"
style={{
"padding": '20px 20px 10px 20px',
"margin-bottom": "10px"
}}>
<div className="clearfix">
<div className="clearfix">
<span className="fl color-grey-6 font-12">
<span
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}</span><span
className="color-orange-tip">{teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}</span><span
className="ml10">{teacherdata === undefined ? "" : teacherdata.uncommit_count}</span><span></span>
{teacherdata === undefined ? "" : teacherdata.left_time === undefined ? "" : teacherdata.left_time === null ? "" :
<span className="ml20">{teacherdata.left_time.status}</span>
@ -2613,16 +2617,16 @@ class Listofworksstudentone extends Component {
}
</span>
<div className="fr">
<div className="fr">
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{teacherdata&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true?
(this.props.isNotMember()===false?
<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
</div>
:"")
<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
</div>
:"")
:
(teacherdata&&teacherdata.homework_status[0]=== "未发布"? "":
this.props.isNotMember()===false?
@ -2633,100 +2637,100 @@ class Listofworksstudentone extends Component {
}
</span>}
</div>
</div>
</div>
</div>
</div>
<div className={"justify break_full_word new_li edu-back-white"}
style={{minHeight: "480px"}}>
<style>{`
</div>
<div className={"justify break_full_word new_li edu-back-white"}
style={{minHeight: "480px"}}>
<style>{`
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;}
}
`}</style>
<div className="edu-table edu-back-white ">
{data === undefined ? "222222" : <Table
dataSource={data}
columns={columnsstu}
pagination={false}
loading={false}
/>}
</div>
</div>
</div>
<div className="edu-table edu-back-white ">
{data === undefined ? "222222" : <Table
dataSource={data}
columns={columnsstu}
pagination={false}
loading={false}
/>}
</div>
</div>
</div>
:
<div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">没有数据可以显示</p>
</div>
</div>
</div>
}
:
<div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">没有数据可以显示</p>
</div>
</div>
</div>
}
</div>
</div>
</div>
:
// 学生能查看别人的
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
</div>
:
// 学生能查看别人的
<div className=" clearfix " style={{margin: "auto" , minWidth:"1200px"}}>
<DownloadMessageysl
{...this.props}
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
{visibles === true ?
<TraineetraininginformationModal
homeworkid={this.props.match.params.homeworkid}
coursesId={this.props.match.params.coursesId}
userids={this.state.userids}
viewtrainingdata={viewtrainingdata}
game_list={game_list}
visible={visibles}
experience={experience}
boolgalist={boolgalist}
Cancel={() => this.cancelModulationModels()}
/> : ""
}
<div className={"educontent mb20"}>
{visibles === true ?
<TraineetraininginformationModal
homeworkid={this.props.match.params.homeworkid}
coursesId={this.props.match.params.coursesId}
userids={this.state.userids}
viewtrainingdata={viewtrainingdata}
game_list={game_list}
visible={visibles}
experience={experience}
boolgalist={boolgalist}
Cancel={() => this.cancelModulationModels()}
/> : ""
}
<div className={"educontent mb20"}>
<div className="edu-back-white">
<div className="edu-back-white">
{computeTimetype===false?<li className="clearfix startbox mb20">
{computeTimetype===false?<li className="clearfix startbox mb20">
<span className={"startfont"}>
正在执行成绩计算请稍后刷新页面查看结果
温馨提示执行时间因作品数量而异
</span>
</li>:""}
<div className="edu-table edu-back-white ">
{data === undefined ? "" : <Table
style={styletable}
dataSource={data}
columns={columnsstu}
pagination={false}
loading={false}
showHeader={false}
/>}
</div>
{JSON.stringify(datas) !== "[]" ?
<div>
<div id="graduation_work_list" style={{
"padding": '20px 20px 10px 20px',
"margin-bottom": "10px"
}}>
<div className="clearfix">
</li>:""}
<div className="edu-table edu-back-white ">
{data === undefined ? "" : <Table
style={styletable}
dataSource={data}
columns={columnsstu}
pagination={false}
loading={false}
showHeader={false}
/>}
</div>
{JSON.stringify(datas) !== "[]" ?
<div>
<div id="graduation_work_list" style={{
"padding": '20px 20px 10px 20px',
"margin-bottom": "10px"
}}>
<div className="clearfix">
<span className="fl color-grey-6 font-12">
<span className="color-orange-tip">
{teacherdata === undefined ? "" : teacherdata.commit_count === undefined ? "" : teacherdata.commit_count}
@ -2739,8 +2743,8 @@ class Listofworksstudentone extends Component {
style={{"color": '#FF6800'}}>{teacherdata.left_time.time}</span>}
</span>
<style>
{`
<style>
{`
.startbox{
height: 48px;
background: rgba(255,104,0,0.1);
@ -2780,95 +2784,96 @@ class Listofworksstudentone extends Component {
cursor: pointer;
}
`}
</style>
<div className="fr">
</style>
<div className="fr">
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
<span className="fl mr10 color-grey-6 ">计算成绩时间{teacherdata&&teacherdata.calculation_time==null?"--": moment(teacherdata&&teacherdata.calculation_time).format('YYYY-MM-DD HH:mm')}</span>
{teacherdata&&teacherdata.task_operation&&teacherdata.task_operation[0]==="开启挑战"?"":<span>
{computeTimetype===true?
(this.props.isNotMember()===false?<div className={"computeTime font-13"} onClick={this.setComputeTime}>
计算成绩
</div>:""):
teacherdata&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-13"}>
计算成绩
</div>:"")
计算成绩
</div>:""):
teacherdata&&teacherdata.homework_status[0]=== "未发布"? "":
(this.props.isNotMember()===false?<div className={"computeTimes font-13"}>
计算成绩
</div>:"")
}
</span>}
</div>
{/*因为计算按钮占了和这个位置,和设计沟通学生视角取消这个按钮*/}
{/*<div className="fr edu-menu-panel">*/}
{/*<ul>*/}
{/*<li className="edu-position edu-position-hidebox">*/}
</div>
{/*因为计算按钮占了和这个位置,和设计沟通学生视角取消这个按钮*/}
{/*<div className="fr edu-menu-panel">*/}
{/*<ul>*/}
{/*<li className="edu-position edu-position-hidebox">*/}
{/*<a className="font-12 ">*/}
{/*{order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>*/}
{/*{order === "updated_at" ? "时间" : order === "work_score" ? "成绩" : order === "student_id" ? "学号" : ""}排序</a>*/}
{/*<i className="iconfont icon-xiajiantou ml5 font-12 "></i>*/}
{/*<ul className="edu-position-hide undis mt10">*/}
{/*<li><a onClick={(e) => this.funorder("updated_at")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li>*/}
{/*<li><a onClick={(e) => this.funorder("work_score")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>最终成绩</a></li>*/}
{/*<li><a onClick={(e) => this.funorder("student_id")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>学生学号</a></li>*/}
{/*<li><a onClick={(e) => this.funorder("updated_at")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>更新时间</a></li>*/}
{/*<li><a onClick={(e) => this.funorder("work_score")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>最终成绩</a></li>*/}
{/*<li><a onClick={(e) => this.funorder("student_id")} data-remote="true"*/}
{/*className="color-grey-6 font-12" style={{"text-align": "center "}}>学生学号</a></li>*/}
{/*</ul>*/}
{/*</li>*/}
{/*</ul>*/}
{/*</li>*/}
{/*</ul>*/}
{/*</div>*/}
{/*</div>*/}
</div>
</div>
</div>
</div>
<div className={"justify break_full_word new_li edu-back-white"}
style={{minHeight: "480px"}}>
<style>{`
<div className={"justify break_full_word new_li edu-back-white"}
style={{minHeight: "480px"}}>
<style>{`
.ant-spin-nested-loading > div > .ant-spin .ant-spin-dot {
top: 72%;}
}
`}</style>
<div className="edu-table edu-back-white ">
{datas === undefined ? "" : <Table
dataSource={datas}
columns={columnsstu}
pagination={false}
loading={loadingstate}
/>}
</div>
{
teacherdata && teacherdata.work_count && teacherdata.work_count > limit ?
<div className="edu-txt-center edu-back-white mt30 mb20">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
total={teacherdata.work_count}></Pagination>
<div className="edu-table edu-back-white ">
{datas === undefined ? "" : <Table
dataSource={datas}
columns={columnsstu}
pagination={false}
loading={loadingstate}
/>}
</div>
{
teacherdata && teacherdata.work_count && teacherdata.work_count > limit ?
<div className="edu-txt-center mt30">
<Pagination showQuickJumper current={page}
onChange={this.paginationonChanges} pageSize={limit}
total={teacherdata.work_count}></Pagination>
</div>
: ""
}
</div>
</div>
:
<div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">没有数据可以显示</p>
</div>
</div>
: ""
}
</div>
</div>
:
<div id="forum_list" className="forum_table">
<div className="mh650 edu-back-white">
<div className="edu-tab-con-box clearfix edu-txt-center">
<img className="edu-nodata-img mb20"
src={getImageUrl("images/educoder/nodata.png")}/>
<p className="edu-nodata-p mb30">没有数据可以显示</p>
</div>
</div>
</div>
}
</div>
}
{/*///*/}
{/*///*/}
</div>
</div>
</div>
</div>
</div>
}
</div>
)
)
}

@ -276,6 +276,7 @@ class ShixunHomeworkPage extends Component {
value={this.state.DownloadMessageval}
modalCancel={this.Downloadcal}
modalsType={this.state.DownloadType}
/>
{parseInt(tab) === 0 &&<Listofworksstudentone triggerRef={this.bindRef} {...this.props} {...this.state} Getdataback={(jobsettingsdata, teacherdata) => this.Getdataback(jobsettingsdata, teacherdata)}></Listofworksstudentone>}

@ -381,6 +381,7 @@ class LoginDialog extends Component {
return (
<Dialog open={true} id="DialogID"
style={{ display: isRender==false? 'none' : ''}}
disableEscapeKeyDown={true}
onClose={() => this.handleDialogClose()}
>
<div className={dialogBox}>

@ -538,6 +538,7 @@ class Trialapplication extends Component {
style={{height: '0', width: '0', border: 'none', display: "none"}}/>
<Dialog open={true} id="DialogIDysl"
disableEscapeKeyDown={true}
style={{display: isRenders == false ? 'none' : '', "border-radius": "10px"}}
>
<div id="closeIcon" onClick={() => {
@ -604,7 +605,7 @@ class Trialapplication extends Component {
{
Phonenumberisnotco && Phonenumberisnotco != "" ?
<p className="color-red mt5 mb5" style={{width: " 100%", height: "20px"}}>
<span>{Phonenumberisnotco}</span>
<span style={{textAlign:"left"}}>{Phonenumberisnotco}</span>
</p>
: <div style={{height: "20px"}}></div>
}
@ -661,7 +662,7 @@ class Trialapplication extends Component {
{
Phonenumberisnotcocodes && Phonenumberisnotcocodes != "" ?
<p className="color-red " style={{width: " 100%", height: "20px"}}>
<span>{Phonenumberisnotcocodes}</span>
<span style={{textAlign:"left"}}>{Phonenumberisnotcocodes}</span>
</p>
: <div style={{height: "20px"}}></div>
}
@ -676,7 +677,7 @@ class Trialapplication extends Component {
{
Phonenumberisnotcoreason && Phonenumberisnotcoreason != "" ?
<p className="color-red" style={{width: " 100%", height: "20px"}}>
<span>{Phonenumberisnotcoreason}</span>
<span style={{textAlign:"left"}}>{Phonenumberisnotcoreason}</span>
</p>
: <div style={{height: "20px"}}></div>
}

File diff suppressed because it is too large Load Diff

@ -1,359 +1,360 @@
import React, { Component } from 'react';
import ContentLoader from 'react-content-loader'
import Tooltip from 'material-ui/Tooltip';
import Dialog, {
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
} from 'material-ui/Dialog';
import { CircularProgress } from 'material-ui/Progress';
import Button from 'material-ui/Button';
import IconButton from 'material-ui/IconButton';
import CommentContainer from '../../comment/CommentContainer'
import CommentInput from '../../comment/CommentInput'
import ChooseAnswerView from '../component/ChooseAnswerView'
import { withStyles } from 'material-ui/styles';
import { markdownToHTML } from 'educoder'
import AnswerListContainer from './answer/AnswerListContainer'
import './leftView.css'
import CodeEvaluateMultiLevelAnswerUnlock from './CodeEvaluateMultiLevelAnswerUnlock'
import MUIDialogStyleUtil from '../component/MUIDialogStyleUtil'
// http://danilowoz.com/create-react-content-loader/
const MyLoader = () => (
<ContentLoader
height={600}
width={400}
speed={2}
primaryColor={"#000000"}
secondaryColor={"#ecebeb"}
>
<rect x="0" y="10" rx="3" ry="3" width="320" height="6.4" />
<rect x="0" y="35" rx="3" ry="3" width="85" height="10" />
<rect x="0" y="60" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="80" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="100" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="120" rx="3" ry="3" width="101" height="6.4" />
<rect x="0" y="145" rx="3" ry="3" width="65" height="10" />
<rect x="0" y="170" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="190" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="210" rx="3" ry="3" width="201" height="6.4" />
</ContentLoader>
)
const styles = MUIDialogStyleUtil.getTwoButtonStyle(
(theme) => { return {
iconButton: {
margin: theme.spacing.unit,
// background: '#05101A',
color: '#4CACFF',
top: '-7px',
width: '36px',
height: '36px',
}
}
}
)
// const styles = theme => ();
class LeftView extends Component {
goToCertification() {
window.open('/account/professional_certification', '_blank');
}
// /shixuns/mnf6b7z3/shixun_discuss?challenge_id=88
render() {
let { challenge, shixun, tabIndex, tabIndexChange, loading, discusses_count
, dialogOpen, handleDialogClose, handleDialogReadAnswer, gameAnswer, loadingComments, st, user,
classes, onDrawerButtonClick, lockedAnswers, unlockedAnswers, isMultiLevelAnswer } = this.props
let propaedeutics = shixun ? shixun.propaedeutics : null;
let _hasAnswer = challenge.hasAnswer // st === 1 ||
// const actions = [
// <Button
// label="取消"
// primary={true}
// onClick={handleDialogClose}
// style={{marginRight: '6px'}}
// />,
// <Button
// variant="raised"
// label="确定"
// primary={true}
// onClick={handleDialogReadAnswer}
// />,
// ];
// TODO TEST
// isMultiLevelAnswer = true
const is_teacher = user.is_teacher
let contentText = is_teacher ?
<React.Fragment>
<p>{`已经过职业认证的教师可以免金币查看答案哟~`}</p>
<p>{`将扣除${challenge.score}点金币,是否确认查看答案`}</p>
<p><a onClick={()=>this.goToCertification()} style={{textDecoration: 'underline'}}>立即认证</a></p>
</React.Fragment>
:
<React.Fragment>
<p>{`先查看参考答案,再通过评测的学生,实训作业有可能是零分哦~`}</p>
<p>{`将扣除${challenge.score}点金币,是否确认查看答案`}</p>
</React.Fragment>;
// 多级别解锁
if (isMultiLevelAnswer) {
// power === 0 &&
contentText = ( is_teacher ) ?
            <React.Fragment>
             <p>{`已经过职业认证的教师可以免金币查看答案哟~`}</p>
<p><a style={{textDecoration: 'underline'}} onClick={()=>this.goToCertification()}
style={{ color: '#1890ff', 'margin-top': '6px', display: 'inline-block'}}>立即认证</a></p>
<CodeEvaluateMultiLevelAnswerUnlock
ref="answerUnlock" lockedAnswers={lockedAnswers} unlockedAnswers={unlockedAnswers}
challenge={challenge}
>
</CodeEvaluateMultiLevelAnswerUnlock>
            </React.Fragment>
              :
            <React.Fragment>
<p>{`先查看参考答案,再通过评测的学生,实训作业将被扣分`}</p>
{/* { MultiLevelUnlockTable } */}
<CodeEvaluateMultiLevelAnswerUnlock
ref="answerUnlock" lockedAnswers={lockedAnswers} unlockedAnswers={unlockedAnswers}
challenge={challenge}
>
</CodeEvaluateMultiLevelAnswerUnlock>
            </React.Fragment>;
}
/**
{ is_teacher ? <Button size="small" variant="raised" style={{ marginRight: '20px'}}
onClick={()=>this.goToCertification()} color="primary">
{ '立即认证' }
</Button> : ''}
*/
return (
<React.Fragment>
<Dialog
open={dialogOpen}
onClose={handleDialogClose}
>
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle>
<DialogContent id="dialog-content" >
<DialogContentText id="alert-dialog-description" style={{textAlign: 'center'}}>
{ contentText }
</DialogContentText>
</DialogContent>
{/* http://localhost:3000/account/professional_certification */}
<DialogActions id="dialog-actions">
<Button onClick={handleDialogClose} color="primary" className={`${classes.button} ${classes.buttonGray}`}>
取消
</Button>
{/* variant={ is_teacher ? "flat" : "raised"} */}
<Button size="medium" variant={"raised"}
className={`${classes.button} `}
onClick={() => handleDialogReadAnswer(this.refs.answerUnlock ? this.refs.answerUnlock.getSelectedId() : '')}
color="primary" autoFocus>
{ is_teacher ? '继续查看' : '确定'}
</Button>
</DialogActions>
</Dialog>
<div className="-fit -layout-v">
<div className="-layout-v -flex -bg-white -task-ml80">
{/*新界面关卡名称显示、关卡金币显示*/}
<div id="task_name_section" className="task_name_section">
{ loading ? "" :
<React.Fragment>
<Tooltip title={ "点击查看全部任务" } disableFocusListener={true}>
<IconButton color="default" mini={''} aria-label="edit" className={classes.iconButton}
onClick={onDrawerButtonClick}>
<i className={ "fa font-18 fa-list-ul" }></i>
</IconButton>
</Tooltip>
<h3 className="subject">{challenge.position}{challenge.subject}</h3>
<span className="btn-cir-big fr mt8 mr15">{challenge.score}</span>
</React.Fragment>
}
</div>
<ul id="tab_nav" className="-tab-nav">
<li id="tab_nav_1" className={ tabIndex === 0 ? `tab_hover` : ''} onClick={() => tabIndexChange(0)}>
<a href="javascript:void(0);" className="tab_type" style={{fontSize: '16px'}}>过关任务</a>
</li>
{/**/}
{ propaedeutics && <li id="tab_nav_2" className={ tabIndex === 1 ? `tab_hover` : ''} onClick={() => tabIndexChange(1)}>
<a href="javascript:void(0);" className="tab_type">背景知识</a>
</li> }
{ _hasAnswer && <li id="tab_nav_3" className={ tabIndex === 2 ? `tab_hover` : ''} onClick={() => tabIndexChange(2)}>
<a href="javascript:void(0);" className="tab_type" style={{fontSize: '16px'}}>参考答案</a>
</li> }
<li id="tab_nav_5" className={ tabIndex === 4 ? `tab_hover` : ''} onClick={() => tabIndexChange(4)}
style={{display: 'none'}}>
<a href="javascript:void(0);" className="tab_type" style={{fontSize: '16px'}}>TA人解答</a>
</li>
<li id="tab_nav_4" className={ tabIndex === 3 ? `tab_hover` : ''} onClick={() => tabIndexChange(3)}>
<a href="javascript:void(0)" className="tab_type" style={{fontSize: '16px'}} data-remote="true">
评论<span id="discusses_count" className="edu-cir-grey1" style={{lineHeight: '18px!important'}}>{discusses_count||""}</span>
</a>
</li>
{/*<span className="btn-cir-big fr mt8 mr15">经验值:{challenge.score}</span>*/}
</ul>
<div className="cl"></div>
<div className="-flex -relative greytab-inner">
{/*过关任务*/}
<div id="tab_con_1" className="tab-info" style={ tabIndex === 0 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll">
<div className="-layout-v -fit">
{ loading ?
<div className="-flex -scroll task-padding16 panel-box-sizing new_li break_word markdown-body editormd-html-preview"
unselectable="on">
<CircularProgress size={40} thickness={3} className="circularProgress"
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40% !important', display: 'block' }}/>
</div> : ""
}
<div className="-flex -scroll task-padding16 panel-box-sizing new_li break_word markdown-body editormd-html-preview"
unselectable="on" id="game_task_pass" style={loading ? {display:'none'} : {}}>
</div>
</div>
</div>
</div>
{/*背景知识*/}
<div id="tab_con_2" className="tab-info" style={ tabIndex === 1 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll">
<div className="-layout-v -fit">
<div className="-flex -scroll task-padding16 panel-box-sizing new_li markdown-body editormd-html-preview" unselectable="on" id="game_ready_knowledge">
</div>
</div>
</div>
</div>
{/* 参考答案*/}
<div id="tab_con_3" className="tab-info" style={ tabIndex === 2 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll">
<div className="-layout-v -fit" style={{ overflowY: 'scroll' }}>
{/* markdown markdownToHTML markdownsetMarkdown
<textarea style={{display:'none'}} id="editorMd_contents" value={gameAnswer}></textarea>*/}
{ (!unlockedAnswers || unlockedAnswers.length === 0) && (!lockedAnswers || lockedAnswers.length === 0) &&
<div className="-flex -scroll task-padding16 panel-box-sizing new_li" id="game_answer_show"
style={{ display: st === 0 ? 'block' : 'none' }}>
</div>
}
<style>{`
.multiLevelAnswer {
margin: 0px 12px;
}
.multiLevelAnswer .anwserSection {
padding: 20px;
border-bottom: 1px solid #EAEAEA;
}
.multiLevelAnswer .df {
display: flex;
font-size: 15px;
}
.multiLevelAnswer .level {
color: #9A9A9A;
flex: 0 0 55px;
}
.multiLevelAnswer .name{
color: #4C4C4C;
flex: 1;
}
.multiLevelAnswer .status{
color: #CDCDCD;
flex: 0 0 45px;
}
.markdown-body ol, .markdown-body ul {
padding-left: 2.5em;
}
`}</style>
<div className="multiLevelAnswer">
{ unlockedAnswers && unlockedAnswers.map((item, index) => {
return <div className="anwserSection">
<div className="df">
<div className="level">级别{index + 1}</div>
<div className="name">{item.name}</div>
<div className="status">已解锁</div>
</div>
<div className="contents markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(item.contents)}}>
</div>
</div>
})}
{ lockedAnswers && lockedAnswers.map((item, index) => {
return <div class="anwserSection">
<div className="df">
<div className="level">级别{index + 1 + (unlockedAnswers ? unlockedAnswers.length : 0)}</div>
<div className="name">{item.name}</div>
<div
className="status" onClick={ () => { this.props.showUnlockAnswerDialog(item) } }
style={{ color: '#4CACFF', cursor: 'pointer' }}
>解锁</div>
</div>
</div>
})}
</div>
{ st === 1 ?
<div className="-flex -scroll task-padding16 panel-box-sizing new_li" id="game_answer_show_choose"
>
<ChooseAnswerView gameAnswer={gameAnswer}></ChooseAnswerView>
</div>
: ''
}
</div>
</div>
</div>
{/* TA人解答*/}
<div id="tab_con_5" className="tab-info" style={ tabIndex === 4 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll">
<div className="-layout-v -fit">
<AnswerListContainer {...this.props}></AnswerListContainer>
</div>
</div>
</div>
<div id="tab_con_4" className="tab-info commentsDelegateParent" style={ tabIndex === 3 ? {display: 'block'} : {display: 'none'} }>
{ loadingComments ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> :
<CommentContainer {...this.props}></CommentContainer>
}
</div>
</div>
<div id="mini_comment_section">
{/*说点什么 */}
<CommentInput challenge={challenge} {...this.props}></CommentInput>
</div>
</div>
</div>
</React.Fragment>
);
}
}
// <textarea style={{display:'none'}} value={challenge.task_pass ? `${challenge.task_pass}` : ''}></textarea>
// {/*<textarea style={{display:'none'}} value={propaedeutics ? `${propaedeutics}` : ''}></textarea>*/}
export default withStyles(styles)( LeftView );
import React, { Component } from 'react';
import ContentLoader from 'react-content-loader'
import Tooltip from 'material-ui/Tooltip';
import Dialog, {
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
} from 'material-ui/Dialog';
import { CircularProgress } from 'material-ui/Progress';
import Button from 'material-ui/Button';
import IconButton from 'material-ui/IconButton';
import CommentContainer from '../../comment/CommentContainer'
import CommentInput from '../../comment/CommentInput'
import ChooseAnswerView from '../component/ChooseAnswerView'
import { withStyles } from 'material-ui/styles';
import { markdownToHTML } from 'educoder'
import AnswerListContainer from './answer/AnswerListContainer'
import './leftView.css'
import CodeEvaluateMultiLevelAnswerUnlock from './CodeEvaluateMultiLevelAnswerUnlock'
import MUIDialogStyleUtil from '../component/MUIDialogStyleUtil'
// http://danilowoz.com/create-react-content-loader/
const MyLoader = () => (
<ContentLoader
height={600}
width={400}
speed={2}
primaryColor={"#000000"}
secondaryColor={"#ecebeb"}
>
<rect x="0" y="10" rx="3" ry="3" width="320" height="6.4" />
<rect x="0" y="35" rx="3" ry="3" width="85" height="10" />
<rect x="0" y="60" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="80" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="100" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="120" rx="3" ry="3" width="101" height="6.4" />
<rect x="0" y="145" rx="3" ry="3" width="65" height="10" />
<rect x="0" y="170" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="190" rx="3" ry="3" width="350" height="6.4" />
<rect x="0" y="210" rx="3" ry="3" width="201" height="6.4" />
</ContentLoader>
)
const styles = MUIDialogStyleUtil.getTwoButtonStyle(
(theme) => { return {
iconButton: {
margin: theme.spacing.unit,
// background: '#05101A',
color: '#4CACFF',
top: '-7px',
width: '36px',
height: '36px',
}
}
}
)
// const styles = theme => ();
class LeftView extends Component {
goToCertification() {
window.open('/account/professional_certification', '_blank');
}
// /shixuns/mnf6b7z3/shixun_discuss?challenge_id=88
render() {
let { challenge, shixun, tabIndex, tabIndexChange, loading, discusses_count
, dialogOpen, handleDialogClose, handleDialogReadAnswer, gameAnswer, loadingComments, st, user,
classes, onDrawerButtonClick, lockedAnswers, unlockedAnswers, isMultiLevelAnswer } = this.props
let propaedeutics = shixun ? shixun.propaedeutics : null;
let _hasAnswer = challenge.hasAnswer // st === 1 ||
// const actions = [
// <Button
// label="取消"
// primary={true}
// onClick={handleDialogClose}
// style={{marginRight: '6px'}}
// />,
// <Button
// variant="raised"
// label="确定"
// primary={true}
// onClick={handleDialogReadAnswer}
// />,
// ];
// TODO TEST
// isMultiLevelAnswer = true
const is_teacher = user.is_teacher
let contentText = is_teacher ?
<React.Fragment>
<p>{`已经过职业认证的教师可以免金币查看答案哟~`}</p>
<p>{`将扣除${challenge.score}点金币,是否确认查看答案`}</p>
<p><a onClick={()=>this.goToCertification()} style={{textDecoration: 'underline'}}>立即认证</a></p>
</React.Fragment>
:
<React.Fragment>
<p>{`先查看参考答案,再通过评测的学生,实训作业有可能是零分哦~`}</p>
<p>{`将扣除${challenge.score}点金币,是否确认查看答案`}</p>
</React.Fragment>;
// 多级别解锁
if (isMultiLevelAnswer) {
// power === 0 &&
contentText = ( is_teacher ) ?
            <React.Fragment>
             <p>{`已经过职业认证的教师可以免金币查看答案哟~`}</p>
<p><a style={{textDecoration: 'underline'}} onClick={()=>this.goToCertification()}
style={{ color: '#1890ff', 'margin-top': '6px', display: 'inline-block'}}>立即认证</a></p>
<CodeEvaluateMultiLevelAnswerUnlock
ref="answerUnlock" lockedAnswers={lockedAnswers} unlockedAnswers={unlockedAnswers}
challenge={challenge}
>
</CodeEvaluateMultiLevelAnswerUnlock>
            </React.Fragment>
              :
            <React.Fragment>
<p>{`先查看参考答案,再通过评测的学生,实训作业将被扣分`}</p>
{/* { MultiLevelUnlockTable } */}
<CodeEvaluateMultiLevelAnswerUnlock
ref="answerUnlock" lockedAnswers={lockedAnswers} unlockedAnswers={unlockedAnswers}
challenge={challenge}
>
</CodeEvaluateMultiLevelAnswerUnlock>
            </React.Fragment>;
}
/**
{ is_teacher ? <Button size="small" variant="raised" style={{ marginRight: '20px'}}
onClick={()=>this.goToCertification()} color="primary">
{ '立即认证' }
</Button> : ''}
*/
return (
<React.Fragment>
<Dialog
open={dialogOpen}
disableEscapeKeyDown={true}
onClose={handleDialogClose}
>
<DialogTitle id="alert-dialog-title">{"提示"}</DialogTitle>
<DialogContent id="dialog-content" >
<DialogContentText id="alert-dialog-description" style={{textAlign: 'center'}}>
{ contentText }
</DialogContentText>
</DialogContent>
{/* http://localhost:3000/account/professional_certification */}
<DialogActions id="dialog-actions">
<Button onClick={handleDialogClose} color="primary" className={`${classes.button} ${classes.buttonGray}`}>
取消
</Button>
{/* variant={ is_teacher ? "flat" : "raised"} */}
<Button size="medium" variant={"raised"}
className={`${classes.button} `}
onClick={() => handleDialogReadAnswer(this.refs.answerUnlock ? this.refs.answerUnlock.getSelectedId() : '')}
color="primary" autoFocus>
{ is_teacher ? '继续查看' : '确定'}
</Button>
</DialogActions>
</Dialog>
<div className="-fit -layout-v">
<div className="-layout-v -flex -bg-white -task-ml80">
{/*新界面关卡名称显示、关卡金币显示*/}
<div id="task_name_section" className="task_name_section">
{ loading ? "" :
<React.Fragment>
<Tooltip title={ "点击查看全部任务" } disableFocusListener={true}>
<IconButton color="default" mini={''} aria-label="edit" className={classes.iconButton}
onClick={onDrawerButtonClick}>
<i className={ "fa font-18 fa-list-ul" }></i>
</IconButton>
</Tooltip>
<h3 className="subject">{challenge.position}{challenge.subject}</h3>
<span className="btn-cir-big fr mt8 mr15">{challenge.score}</span>
</React.Fragment>
}
</div>
<ul id="tab_nav" className="-tab-nav">
<li id="tab_nav_1" className={ tabIndex === 0 ? `tab_hover` : ''} onClick={() => tabIndexChange(0)}>
<a href="javascript:void(0);" className="tab_type" style={{fontSize: '16px'}}>过关任务</a>
</li>
{/**/}
{ propaedeutics && <li id="tab_nav_2" className={ tabIndex === 1 ? `tab_hover` : ''} onClick={() => tabIndexChange(1)}>
<a href="javascript:void(0);" className="tab_type">背景知识</a>
</li> }
{ _hasAnswer && <li id="tab_nav_3" className={ tabIndex === 2 ? `tab_hover` : ''} onClick={() => tabIndexChange(2)}>
<a href="javascript:void(0);" className="tab_type" style={{fontSize: '16px'}}>参考答案</a>
</li> }
<li id="tab_nav_5" className={ tabIndex === 4 ? `tab_hover` : ''} onClick={() => tabIndexChange(4)}
style={{display: 'none'}}>
<a href="javascript:void(0);" className="tab_type" style={{fontSize: '16px'}}>TA人解答</a>
</li>
<li id="tab_nav_4" className={ tabIndex === 3 ? `tab_hover` : ''} onClick={() => tabIndexChange(3)}>
<a href="javascript:void(0)" className="tab_type" style={{fontSize: '16px'}} data-remote="true">
评论<span id="discusses_count" className="edu-cir-grey1" style={{lineHeight: '18px!important'}}>{discusses_count||""}</span>
</a>
</li>
{/*<span className="btn-cir-big fr mt8 mr15">经验值:{challenge.score}</span>*/}
</ul>
<div className="cl"></div>
<div className="-flex -relative greytab-inner">
{/*过关任务*/}
<div id="tab_con_1" className="tab-info" style={ tabIndex === 0 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll">
<div className="-layout-v -fit">
{ loading ?
<div className="-flex -scroll task-padding16 panel-box-sizing new_li break_word markdown-body editormd-html-preview"
unselectable="on">
<CircularProgress size={40} thickness={3} className="circularProgress"
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40% !important', display: 'block' }}/>
</div> : ""
}
<div className="-flex -scroll task-padding16 panel-box-sizing new_li break_word markdown-body editormd-html-preview"
unselectable="on" id="game_task_pass" style={loading ? {display:'none'} : {}}>
</div>
</div>
</div>
</div>
{/*背景知识*/}
<div id="tab_con_2" className="tab-info" style={ tabIndex === 1 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll">
<div className="-layout-v -fit">
<div className="-flex -scroll task-padding16 panel-box-sizing new_li markdown-body editormd-html-preview" unselectable="on" id="game_ready_knowledge">
</div>
</div>
</div>
</div>
{/* 参考答案*/}
<div id="tab_con_3" className="tab-info" style={ tabIndex === 2 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll">
<div className="-layout-v -fit" style={{ overflowY: 'scroll' }}>
{/* markdown markdownToHTML markdownsetMarkdown
<textarea style={{display:'none'}} id="editorMd_contents" value={gameAnswer}></textarea>*/}
{ (!unlockedAnswers || unlockedAnswers.length === 0) && (!lockedAnswers || lockedAnswers.length === 0) &&
<div className="-flex -scroll task-padding16 panel-box-sizing new_li" id="game_answer_show"
style={{ display: st === 0 ? 'block' : 'none' }}>
</div>
}
<style>{`
.multiLevelAnswer {
margin: 0px 12px;
}
.multiLevelAnswer .anwserSection {
padding: 20px;
border-bottom: 1px solid #EAEAEA;
}
.multiLevelAnswer .df {
display: flex;
font-size: 15px;
}
.multiLevelAnswer .level {
color: #9A9A9A;
flex: 0 0 55px;
}
.multiLevelAnswer .name{
color: #4C4C4C;
flex: 1;
}
.multiLevelAnswer .status{
color: #CDCDCD;
flex: 0 0 45px;
}
.markdown-body ol, .markdown-body ul {
padding-left: 2.5em;
}
`}</style>
<div className="multiLevelAnswer">
{ unlockedAnswers && unlockedAnswers.map((item, index) => {
return <div className="anwserSection">
<div className="df">
<div className="level">级别{index + 1}</div>
<div className="name">{item.name}</div>
<div className="status">已解锁</div>
</div>
<div className="contents markdown-body" dangerouslySetInnerHTML={{__html: markdownToHTML(item.contents)}}>
</div>
</div>
})}
{ lockedAnswers && lockedAnswers.map((item, index) => {
return <div class="anwserSection">
<div className="df">
<div className="level">级别{index + 1 + (unlockedAnswers ? unlockedAnswers.length : 0)}</div>
<div className="name">{item.name}</div>
<div
className="status" onClick={ () => { this.props.showUnlockAnswerDialog(item) } }
style={{ color: '#4CACFF', cursor: 'pointer' }}
>解锁</div>
</div>
</div>
})}
</div>
{ st === 1 ?
<div className="-flex -scroll task-padding16 panel-box-sizing new_li" id="game_answer_show_choose"
>
<ChooseAnswerView gameAnswer={gameAnswer}></ChooseAnswerView>
</div>
: ''
}
</div>
</div>
</div>
{/* TA人解答*/}
<div id="tab_con_5" className="tab-info" style={ tabIndex === 4 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll">
<div className="-layout-v -fit">
<AnswerListContainer {...this.props}></AnswerListContainer>
</div>
</div>
</div>
<div id="tab_con_4" className="tab-info commentsDelegateParent" style={ tabIndex === 3 ? {display: 'block'} : {display: 'none'} }>
{ loadingComments ?
<CircularProgress size={40} thickness={3} style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '40%', display: 'block' }}/> :
<CommentContainer {...this.props}></CommentContainer>
}
</div>
</div>
<div id="mini_comment_section">
{/*说点什么 */}
<CommentInput challenge={challenge} {...this.props}></CommentInput>
</div>
</div>
</div>
</React.Fragment>
);
}
}
// <textarea style={{display:'none'}} value={challenge.task_pass ? `${challenge.task_pass}` : ''}></textarea>
// {/*<textarea style={{display:'none'}} value={propaedeutics ? `${propaedeutics}` : ''}></textarea>*/}
export default withStyles(styles)( LeftView );

@ -547,13 +547,13 @@ submittojoinclass=(value)=>{
}
}
// trialapplications =()=>{
// console.log("点击了")
// this.setState({
// isRenders: true,
// showTrial:true,
// })
// }
trialapplications =()=>{
console.log("点击了")
this.setState({
isRenders: true,
showTrial:true,
})
}
// 关闭
cancelModulationModels = () => {
@ -618,14 +618,13 @@ submittojoinclass=(value)=>{
{/* :""*/}
{/*}*/}
{/*{*/}
{/* isRenders&&isRenders===true?*/}
{/* <Trialapplication*/}
{/* {...this.state}*/}
{/* Cancel={() => this.cancelModulationModels()}*/}
{/* />*/}
{/* :""*/}
{/*}*/}
isRenders&&isRenders===true?
<Trialapplication
{...this.state}
Cancel={() => this.cancelModulationModels()}
/>
:""
}
<Trialapplication {...this.state} Cancel={() => this.cancelModulationModels()} ></Trialapplication>
<div className="educontent clearfix">
{/*<%= link_to image_tag("/images/educoder/logo.png", alt:"高校智能化教学与实训平台", className:"logoimg"), home_path %>*/}
@ -757,7 +756,7 @@ submittojoinclass=(value)=>{
<li><Link to={`/users/${this.props.current_user===undefined?"":this.props.current_user.login}/projects`}>我的项目</Link></li>
<li><a href={`/account/profile`}>账号管理</a></li>
{/*<li><a onClick={()=>this.educoderlogin()} >登入测试接口</a></li>*/}
{/*<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>*/}
<li><a onClick={()=>this.trialapplications()} >试用申请</a> </li>
{/*<li><Link to={`/interest`}>兴趣页</Link></li>*/}
<li className="bor-top-greyE">

@ -0,0 +1,51 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import 'common.css'
//立即申请试用
class MyEduCoderModal extends Component {
constructor(props) {
super(props);
this.state={
}
}
modalCancel=()=>{
//取消
}
setDownload=()=>{
//立即联系
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.modalsType===undefined?false:this.props.modalsType}
width="530px"
>
<div className="educouddiv">
<div><p>欢迎使用EduCoder您可以试用1天</p></div>
<div><p>超过期限需要经过管理员的授权审核</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={this.modalCancel()}>先试试看</a>
<a className="task-btn task-btn-orange" onClick={this.setDownload()}>立即申请授权</a>
</div>
</div>
</Modal>
)
}
}
export default MyEduCoderModal;

@ -0,0 +1,49 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import 'common.css'
//完善个人资料
class Notcompleted extends Component {
constructor(props) {
super(props);
}
modalCancel=()=>{
//取消
}
setDownload=()=>{
//立即联系
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.modalsType===undefined?false:this.props.modalsType}
width="530px"
>
<div className="educouddiv">
<div><p>您尚未完善个人资料</p></div>
<div><p>请在完成资料后提交试用申请</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={this.setDownload()}>立即完善资料</a>
</div>
</div>
</Modal>
)
}
}
export default Notcompleted;

@ -0,0 +1,42 @@
import React, { Component } from 'react';
import {getImageUrl} from 'educoder';
import { Modal} from 'antd';
import axios from 'axios';
import 'common.css'
//密码已重置,请重新登录
class ReadPassword extends Component {
constructor(props) {
super(props);
}
setDownload=()=>{
//立即联系
}
render() {
return(
<Modal
keyboard={false}
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
centered={true}
visible={this.props.modalsType===undefined?false:this.props.modalsType}
width="530px"
>
<div className="educouddiv">
<div><p>密码已重置请重新登录</p></div>
<a className="task-btn task-btn-orange" onClick={this.setDownload()}>知道啦</a>
</div>
</Modal>
)
}
}
export default ReadPassword;

@ -32,6 +32,10 @@
height: 45px;
}
.educouddiv {
display: flex;
justify-content: center;
}
.left_right {

Loading…
Cancel
Save