dev_tj
cxt 5 years ago
commit 59b9930e2a

@ -42,7 +42,7 @@ if (isDev) {
// 老师 // 老师
//debugType="teacher"; //debugType="teacher";
// 学生 // 学生
debugType="student"; //debugType="student";
function railsgettimes(proxy) { function railsgettimes(proxy) {

@ -32,7 +32,7 @@ import _ from 'lodash'
import TPIContext from './TPIContext' import TPIContext from './TPIContext'
import { EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER import { EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC } from 'educoder' , EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC ,getRandomNumber} from 'educoder'
import { MuiThemeProvider, createMuiTheme, withStyles } from 'material-ui/styles'; import { MuiThemeProvider, createMuiTheme, withStyles } from 'material-ui/styles';
import MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil' import MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil'
@ -176,7 +176,7 @@ class TPIContextProvider extends Component {
testPath = 'http://test-newweb.educoder.net' testPath = 'http://test-newweb.educoder.net'
} }
// var url = `${testPath}/api/v1/games/${ game.identifier }/cost_time` // var url = `${testPath}/api/v1/games/${ game.identifier }/cost_time`
var url = `${testPath}/api/tasks/${ game.identifier }/cost_time` var url = `${testPath}/api/tasks/${ game.identifier }/cost_time${getRandomNumber()}`
window.$.ajax({ window.$.ajax({
type: 'get', type: 'get',
url: url, url: url,

@ -549,6 +549,10 @@ class Coursesleftnav extends Component{
window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`; window.location.href=`/courses/${coursesId}/boards/${result.data.category_id}`;
} }
if(positiontype!="course_groups"){
this.updasaveNavmoda()
}
if(positiontype==="course_groups"){ if(positiontype==="course_groups"){
window.location.href=`/courses/${coursesId}/course_groups/${result.data.group_id}`; window.location.href=`/courses/${coursesId}/course_groups/${result.data.group_id}`;
} }

@ -14,6 +14,7 @@ import passpartImg from '../../../images/tpi/passpart.png'
import empiricgreenImg from '../../../images/tpi/empiricgreen.png' import empiricgreenImg from '../../../images/tpi/empiricgreen.png'
import { trigger } from 'educoder'; import { trigger } from 'educoder';
import SecondTab from "../../paths/SchoolStatistics/SecondTab";
class TaskResultLayer extends Component { class TaskResultLayer extends Component {
@ -29,7 +30,7 @@ class TaskResultLayer extends Component {
} }
componentWillReceiveProps(newProps, newContext) { componentWillReceiveProps(newProps, newContext) {
if (newProps.currentGamePassed && (!this.props.currentGamePassed if (newProps.currentGamePassed && (!this.props.currentGamePassed
|| (newProps.currentGamePassed !== this.props.currentGamePassed ))) { || (newProps.currentGamePassed !== this.props.currentGamePassed ))) {
// this.fakeRanking = this._fakeRanking() // this.fakeRanking = this._fakeRanking()
const $ = window.$; const $ = window.$;
@ -51,10 +52,10 @@ class TaskResultLayer extends Component {
} }
} }
} }
onStarChange(challenge, index, value) { onStarChange(challenge, index, value) {
this.props.onStarChange(challenge, index, value); this.props.onStarChange(challenge, index, value);
this.setState({ this.setState({
stared: value ? true : false, stared: value ? true : false,
}) })
@ -87,11 +88,11 @@ class TaskResultLayer extends Component {
// this.context.router.push('/sample'); // this.context.router.push('/sample');
if (goNext === true) { if (goNext === true) {
if (next_game) { // https://www.trustie.net/issues/18573 if (next_game) { // https://www.trustie.net/issues/18573
this.goNext = true; this.goNext = true;
} }
// 隐藏掉效果查看页面 // 隐藏掉效果查看页面
window.$('#picture_display').hide() window.$('#picture_display').hide()
} }
this.props.onGamePassed(); this.props.onGamePassed();
this.setState({ this.setState({
stared: false stared: false
@ -110,9 +111,9 @@ class TaskResultLayer extends Component {
// return; // return;
// } // }
// const { showLanguagePictrue } = this.props.challenge; // const { showLanguagePictrue } = this.props.challenge;
// if ( prevProps.challenge.showLanguagePictrue != showLanguagePictrue && // if ( prevProps.challenge.showLanguagePictrue != showLanguagePictrue &&
// showLanguagePictrue == true ) { // showLanguagePictrue == true ) {
// } // }
// } // }
initEffectDisplayServerTimer = () => { initEffectDisplayServerTimer = () => {
@ -128,7 +129,7 @@ class TaskResultLayer extends Component {
this.setState({ timeRemain }) this.setState({ timeRemain })
}, 1000) }, 1000)
}) })
} }
componentWillUnmount() { componentWillUnmount() {
this.intervalHandler && clearInterval(this.intervalHandler); this.intervalHandler && clearInterval(this.intervalHandler);
@ -162,7 +163,7 @@ class TaskResultLayer extends Component {
// const fakeRanking = this.fakeRanking; // const fakeRanking = this.fakeRanking;
return ( return (
<div> <div>
{currentGamePassed ? {currentGamePassed ?
<div className="taskResultLayer"> <div className="taskResultLayer">
<div className="pr passTaskContent" style={{display:'none'}} > <div className="pr passTaskContent" style={{display:'none'}} >
<i className="far fa-times-circle closeIcon" onClick={closeTaskResultLayer} title="关闭"></i> <i className="far fa-times-circle closeIcon" onClick={closeTaskResultLayer} title="关闭"></i>
@ -174,52 +175,60 @@ class TaskResultLayer extends Component {
<p className="inline inlines exp"> <p className="inline inlines exp">
<img src={empiricgreenImg} className="mr8 mt5 fl"/> <img src={empiricgreenImg} className="mr8 mt5 fl"/>
{currentPassedGameGainExperience >= 0 ? `+${currentPassedGameGainExperience}` : '+0'} {currentPassedGameGainExperience >= 0 ? `+${currentPassedGameGainExperience}` : '+0'}
</p> </p>
</div> </div>
<div className="winPanel"> <div className="winPanel">
<style>
{
`
.page--body{
z-index: 0 !important;
}
`
}
</style>
<div className="cl"></div> <div className="cl"></div>
{ !game.star ? { !game.star ?
<React.Fragment> <React.Fragment>
<p className="rateLabel ">您的评价决定老师的江湖地位~</p> <p className="rateLabel ">您的评价决定老师的江湖地位~</p>
<Rate <Rate
defaultValue={0} defaultValue={0}
allowClear={false} allowClear={false}
onChange={(value) => this.onStarChange(this.props.game, this.props.challenge.position, value)} onChange={(value) => this.onStarChange(this.props.game, this.props.challenge.position, value)}
/> />
</React.Fragment> </React.Fragment>
: ''} : ''}
<p> <p>
{/*<a href="javascript:void(0)" className="passNext">下一关</a>*/} {/*<a href="javascript:void(0)" className="passNext">下一关</a>*/}
<a href="javascript:void(0)" className={`passed ${ stared || game.star ? 'stared' : '' }`} <a href="javascript:void(0)" className={`passed ${ stared || game.star ? 'stared' : '' }`}
{...titleObj} onClick={()=>this.onFinish(true)}>{ next_game ? '下一关' : '完成'}</a> {...titleObj} onClick={()=>this.onFinish(true)}>{ next_game ? '下一关' : '完成'}</a>
{ challenge.showLanguagePictrue && { challenge.showLanguagePictrue &&
<a href="javascript:void(0)" className={`passed ${ stared || game.star ? 'stared' : '' }`} <a href="javascript:void(0)" className={`passed ${ stared || game.star ? 'stared' : '' }`}
{...titleObj} onClick={()=>this.onFinish()}> {...titleObj} onClick={()=>this.onFinish()}>
{ `查看效果` } { `查看效果` }
{/* ${ moment(this.state.timeRemain * 1000).format('mm:ss') } */} {/* ${ moment(this.state.timeRemain * 1000).format('mm:ss') } */}
</a> </a>
} }
{/* {/*
(this.state.timeRemain ? (this.state.timeRemain ?
<Tooltip title={"注意效果查看服务只会保留5分钟"} disableFocusListener={true}> <Tooltip title={"注意效果查看服务只会保留5分钟"} disableFocusListener={true}>
</Tooltip> </Tooltip>
: :
<Tooltip title={"效果查看服务已被终止运行,需要重新评测后才能查看"} disableFocusListener={true}> <Tooltip title={"效果查看服务已被终止运行,需要重新评测后才能查看"} disableFocusListener={true}>
<a href="javascript:void(0)" className={`passed ${ stared || game.star ? 'stared' : '' }`} <a href="javascript:void(0)" className={`passed ${ stared || game.star ? 'stared' : '' }`}
{...titleObj} onClick={()=>{}} style={{ backgroundColor: 'gray'}}> {...titleObj} onClick={()=>{}} style={{ backgroundColor: 'gray'}}>
{ `查看效果` } { `查看效果` }
</a> </a>
</Tooltip> </Tooltip>
) )
*/} */}
{/* {/*
注意效果查看服务只会保留5分钟 注意效果查看服务只会保留5分钟
效果查看服务已被终止运行需要重新评测后才能查看 效果查看服务已被终止运行需要重新评测后才能查看
*/} */}

Loading…
Cancel
Save