From 02651e5ce397570d5df3aa03c911611215374855 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=A8=E6=A0=91=E6=98=8E?= <775174143@qq.com> Date: Sat, 20 Jul 2019 12:28:01 +0800 Subject: [PATCH] =?UTF-8?q?=20=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/react/src/AppConfig.js | 20 +- .../components}/Notcompleted.js | 6 +- .../src/common/components/SetAppModel.js | 33 + public/react/src/common/educoder.js | 107 +-- .../src/modules/courses/busyWork/UseBank.js | 2 +- .../src/modules/page/main/CodeEvaluateView.js | 766 +++++++++--------- .../react/src/modules/page/main/LeftView.js | 2 +- public/react/src/modules/page/main/Webssh.js | 2 +- public/react/src/modules/tpm/TPMIndexHOC.js | 3 +- public/react/src/modules/user/Interestpage.js | 7 +- 10 files changed, 495 insertions(+), 453 deletions(-) rename public/react/src/{modules/user => common/components}/Notcompleted.js (87%) create mode 100644 public/react/src/common/components/SetAppModel.js diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 6cbf499ee..d5d002e52 100644 --- a/public/react/src/AppConfig.js +++ b/public/react/src/AppConfig.js @@ -2,7 +2,7 @@ import React from "react"; import axios from 'axios'; import { requestProxy } from "./indexEduplus2RequestProxy"; -import { broadcastChannelOnmessage } from 'educoder' +import { broadcastChannelOnmessage ,SetAppModel} from 'educoder'; import { notification } from 'antd'; import './index.css' broadcastChannelOnmessage('refreshPage', () => { @@ -10,11 +10,19 @@ broadcastChannelOnmessage('refreshPage', () => { }) function locationurl(list){ - if (window.location.port === "3007") { + if (window.location.port === "3007") { - } else { - window.location.replace(list) - } + } else { + + if(list===402){ + SetAppModel(402) + }else if(list===407){ + + }else{ + window.location.replace(list) + } + + } } // TODO 开发期多个身份切换 @@ -149,7 +157,7 @@ export function initAxiosInterceptors(props) { debugger console.log(response.data.status); console.log(response.data); - locationurl(response.data.message); + locationurl(402); } diff --git a/public/react/src/modules/user/Notcompleted.js b/public/react/src/common/components/Notcompleted.js similarity index 87% rename from public/react/src/modules/user/Notcompleted.js rename to public/react/src/common/components/Notcompleted.js index 848eded48..e974003de 100644 --- a/public/react/src/modules/user/Notcompleted.js +++ b/public/react/src/common/components/Notcompleted.js @@ -1,8 +1,8 @@ import React, { Component } from 'react'; -import {getImageUrl} from 'educoder'; +import {getImageUrl} from 'public/react/src/common/educoder'; import { Modal} from 'antd'; import axios from 'axios'; -import './common.css'; +import '../../modules/user/common.css'; //完善个人资料 class Notcompleted extends Component { @@ -21,7 +21,7 @@ class Notcompleted extends Component { render() { - + console.log(this.props) return( + {/**/} + + ) + } + } + } +} + diff --git a/public/react/src/common/educoder.js b/public/react/src/common/educoder.js index 749d2a1e5..128963c25 100644 --- a/public/react/src/common/educoder.js +++ b/public/react/src/common/educoder.js @@ -1,53 +1,56 @@ -import { from } from '_array-flatten@2.1.2@array-flatten'; - -// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil'; - -export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool'; -export { default as queryString } from './UrlTool2'; - -export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC'; - -export { trigger as trigger, on as on, off as off - , broadcastChannelPostMessage, broadcastChannelOnmessage } from './EventUtil'; - -export { updatePageParams as updatePageParams } from './RouterUtil'; - -export { bytesToSize as bytesToSize } from './UnitUtil'; - -export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension } from './TextUtil' -export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' - - -export { isDev as isDev } from './Env' - -export { toStore as toStore, fromStore as fromStore } from './Store' - -export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info_c, warn_c, error_c } from './LogUtil' - -export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER - , EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const' - -export { themes, ThemeContext } from './context/ThemeContext' - -export { ModalHOC } from './components/ModalHOC' -export { default as Cropper } from './components/Cropper' -export { default as ConditionToolTip } from './components/ConditionToolTip' -export { default as DragValidator } from './components/DragValidator' - -export { default as PopInstruction } from './components/instruction/PopInstruction' - -export { default as City } from './components/form/City' - - -// course -export { default as WordsBtn } from './course/WordsBtn' - -export { default as ActionBtn } from './course/ActionBtn' - -export { default as MarkdownToHtml } from './components/markdown/MarkdownToHtml' - -export { default as DMDEditor } from './components/markdown/DMDEditor' - - - +import { from } from '_array-flatten@2.1.2@array-flatten'; + +// export { default as OrderStateUtil } from '../routes/Order/components/OrderStateUtil'; + +export { getImageUrl as getImageUrl, getUrl as getUrl, getUrl2 as getUrl2, setImagesUrl as setImagesUrl, getUploadActionUrl as getUploadActionUrl } from './UrlTool'; +export { default as queryString } from './UrlTool2'; + +export { SnackbarHOC as SnackbarHOC } from './SnackbarHOC'; + +export { trigger as trigger, on as on, off as off + , broadcastChannelPostMessage, broadcastChannelOnmessage } from './EventUtil'; + +export { updatePageParams as updatePageParams } from './RouterUtil'; + +export { bytesToSize as bytesToSize } from './UnitUtil'; + +export { markdownToHTML, uploadNameSizeSeperator, appendFileSizeToUploadFile, appendFileSizeToUploadFileAll, isImageExtension } from './TextUtil' +export { handleDateString, getNextHalfHourOfMoment,formatDuring } from './DateUtil' + + +export { isDev as isDev } from './Env' + +export { toStore as toStore, fromStore as fromStore } from './Store' + +export { trace_collapse, trace, debug, info, warn, error, trace_c, debug_c, info_c, warn_c, error_c } from './LogUtil' + +export { EDU_ADMIN, EDU_BUSINESS, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER + , EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL} from './Const' + +export { themes, ThemeContext } from './context/ThemeContext' + +export { ModalHOC } from './components/ModalHOC' + +export { SetAppModel } from './components/SetAppModel' + +export { default as Cropper } from './components/Cropper' +export { default as ConditionToolTip } from './components/ConditionToolTip' +export { default as DragValidator } from './components/DragValidator' + +export { default as PopInstruction } from './components/instruction/PopInstruction' + +export { default as City } from './components/form/City' + + +// course +export { default as WordsBtn } from './course/WordsBtn' + +export { default as ActionBtn } from './course/ActionBtn' + +export { default as MarkdownToHtml } from './components/markdown/MarkdownToHtml' + +export { default as DMDEditor } from './components/markdown/DMDEditor' + + + export { default as ImageLayerHook } from './hooks/ImageLayerHook' \ No newline at end of file diff --git a/public/react/src/modules/courses/busyWork/UseBank.js b/public/react/src/modules/courses/busyWork/UseBank.js index 69e51da3d..4cd1b424e 100644 --- a/public/react/src/modules/courses/busyWork/UseBank.js +++ b/public/react/src/modules/courses/busyWork/UseBank.js @@ -252,7 +252,7 @@ class UseBank extends Component{

通过职业认证的教师才能访问公共题库

- 立即认证 + 立即认证
: diff --git a/public/react/src/modules/page/main/CodeEvaluateView.js b/public/react/src/modules/page/main/CodeEvaluateView.js index 8be0b8765..16932b818 100644 --- a/public/react/src/modules/page/main/CodeEvaluateView.js +++ b/public/react/src/modules/page/main/CodeEvaluateView.js @@ -1,383 +1,383 @@ -import React, { Component } from 'react'; - -import IconButton from 'material-ui/IconButton'; -import Tooltip from 'material-ui/Tooltip'; -import Button from 'material-ui/Button'; - -import './CodeEvaluateView.css' -import { CircularProgress } from 'material-ui/Progress'; -import { on, off } from 'educoder' -const testSetsExpandedArrayInitVal = [false, false, false, false, false, - false, false, false, false, false, - false, false, false, false, false, - false, false, false, false, false] - -const $ = window.$; -const TAB_INDEX_WEB_DISPLAY = 0; -const TAB_INDEX_EVALUATE_RESULT_INDEX = 1 - -class CodeEvaluateView extends Component { - - constructor(props) { - super(props) - - this.onEvaluateViewExpand = this.onEvaluateViewExpand.bind(this) - - this.state = { - // TODO 最多20个测试集? - testSetsInitedArray: testSetsExpandedArrayInitVal.slice(0), - - evaluateViewExpanded: false, - - tabIndex: 1, - } - } - - componentDidMount() { - const { challenge } = this.props; - - on('showWebDisplayEvent', () => { - if (challenge.isHtml) { - this.setState({ - tabIndex: TAB_INDEX_WEB_DISPLAY - }) - } - }) - - if (challenge.isHtml === true) { - this.tabIndexChange(TAB_INDEX_WEB_DISPLAY) - } - - } - componentWillUnmount() { - off('showWebDisplayEvent') - } - - componentWillReceiveProps(newProps, newContext) { - if (this.props.game && newProps.game && (newProps.game.id !== this.props.game.id - || newProps.gameBuilding !== this.props.gameBuilding )) { // 切换game时重置state - if (newProps.gameBuilding === false) { - // 清空codemirror的内容,TODO最好调用codemirror的销毁方法 - $('#evaluating_contents .result_different_show').html('') - this.setState({ - tabIndex: TAB_INDEX_EVALUATE_RESULT_INDEX - }) - } - this.setState({ - testSetsInitedArray: testSetsExpandedArrayInitVal.slice(0), - }) - if (newProps.game.id !== this.props.game.id) { - if (this.props.challenge.isHtml === true) { - this.tabIndexChange(TAB_INDEX_WEB_DISPLAY) - } - } - } - } - - componentDidUpdate(prevProps, prevState, snapshot) { - // 通关后重置为0 - if (!prevProps.currentGamePassed && this.props.currentGamePassed === true) { - this.tabIndexChange(TAB_INDEX_WEB_DISPLAY) - } - } - - - tabIndexChange(index) { - this.setState({tabIndex: index}); - } - - onTestSetHeaderClick(index) { - const { output_sets, power, game } = this.props; - const { test_sets_array } = output_sets; - - const { testSetsInitedArray } = this.state; - - // TODO 评测了以后,测试集会变化, - var current_test_set = test_sets_array[index]; - if (!current_test_set.output) { - current_test_set.output = '' - } - // 优化,但是会增加代码复杂度 - if (( game.test_sets_view === true || power == 1 || current_test_set.is_public == 1 ) && testSetsInitedArray[index] === false ) { // 如果测试集没有初始化过(如果重新评测了,都需要重新初始化) - const id = "result_different_show_" + index; - - var mv = window.CodeMirror.k_init(id, current_test_set.actual_output || "", current_test_set.output); - - - var height=0; - // 以前的代码用不了,2个pane的高度都是300 - // if($("#"+id).find(".CodeMirror-merge-pane").eq(0).height()>$("#"+id).find(".CodeMirror-merge-pane").eq(1).height()){ - // height = parseInt($("#"+id).find(".CodeMirror-merge-pane").eq(0).height()); - // }else{ - // height = parseInt($("#"+id).find(".CodeMirror-merge-pane").eq(1).height()); - // } - var lineNumber = Math.max( current_test_set.output.split('\n').length - , (current_test_set.actual_output ? current_test_set.actual_output.split('\n').length : 1 )) - - height = lineNumber * 19 + 25; - console.log('height ', height) - $("#"+id).find(".CodeMirror").height(height); - $(".CodeMirror-merge-gap").find("svg").css("height", height); - // 取真实高度 - $(".CodeMirror-merge-gap").css("height", $('.CodeMirror-merge-pane.CodeMirror-merge-editor').height()); - setTimeout(()=>{ // 解决第一次打开时高度不准的问题 - $('#game_test_set_results .CodeMirror-merge').css('display', 'flex') - }, 100) - // refresh一下,解决CM显示不全的问题 - mv.edit.refresh() - mv.right.orig.refresh() - testSetsInitedArray[index] = true; - } - - this.props.onTestSetHeaderClick(index) - this.setState({ - testSetsInitedArray, - }) - } - goToCertification() { - window.open('/account/professional_certification', '_blank'); - } - renderTestSets() { - const { output_sets, testSetsExpandedArray, power, allowed_unlock, testSetUnlock, showDialog, challenge, game, user } = this.props; - const { testSetsInitedArray } = this.state; - - const { test_sets_array, test_sets_count, had_test_count, test_sets_hidden_count, test_sets_public_count - , had_passed_testsests_error_count, had_passed_testsests_hidden_count, had_passed_testsests_public_count } = output_sets; - - const testSetsComponentArray = [] - - if (!test_sets_array) { - console.error('no test_sets_array error') - return '' - } - test_sets_array.forEach( (item, index) => { - // function toggle_test_case(open, output, actual_output, id, power){ - // onclick={toggle_test_case(1, output, actual_output, 0, true)} - - const isExpanded = testSetsExpandedArray[index] - - let headIconClass = ''; - let _headLockIconClass = ''; - - if (item.is_public == 0) { - if (game.test_sets_view === true || power === 1){ - _headLockIconClass = 'fas fa-unlock-alt' - } else { - _headLockIconClass = 'fa-lock' - } - } - - if (item.result == true) { - headIconClass = 'fa-check-circle color-light-green font-16' - } else if (item.result == false) { - headIconClass = 'fa-exclamation-circle -text-danger' - } - - testSetsComponentArray.push( -
-

- - 测试集 {index + 1} - - { headIconClass && } - { _headLockIconClass && } - - { item.ts_mem && 消耗内存{item.ts_mem}MB } - { item.ts_mem && item.ts_time && } - { item.ts_time && 代码执行时长:{item.ts_time}秒 } - -

-
- ) - - // - let contentText = (power === 0 && user.is_teacher) ? - -
{`已经过职业认证的教师可以免金币查看隐藏测试集。`}
-
{`解锁本关所有测试集需要扣除${challenge.score*5}金币,确定要解锁吗?`}
-
this.goToCertification()} style={{color: '#4CACFF', cursor: 'pointer', 'text-decoration': 'underline' - , 'margin-top': '12px'}}>立即认证
-
: - -
{`解锁本关所有测试集需要扣除${challenge.score*5}金币`}
-
{`确定要解锁吗?`}
-
- - const moreButtonsRender = () => { - return '' - // ${this.props.classes.button} - // return (power === 0 && user.is_teacher) ? ( - // - // ) : '' - } - testSetsComponentArray.push( -
-
- { - (game.test_sets_view === true || power == 1 || item.is_public == 1) ? - ( - - { item.input ? -
-
- 测试输入: - -
")}}>
- -
-
- : "" } -
-

- 预期输出 -

-

- 实际输出 -

-
-
- ) : -

- { !allowed_unlock ? '隐藏测试集,暂不支持解锁和查看。' : '此为隐藏测试项。'} - { (power === 0 && allowed_unlock == true) ? showDialog({ contentText, callback: testSetUnlock , moreButtonsRender})} - style={{"textDecoration": "underline"}}>解锁 : '' } -

- } - -
- - {/*测试集已解锁||管理员||公开的测试集||TODO应该是全通过时 已通过的测试集*/} - { - (game.test_sets_view == true || power == 1 || item.is_public == 1 || !!item.result === true) ? -
- : "" - } - -
- ) - }) - return testSetsComponentArray; - } - - onEvaluateViewExpand() { - window.valuation_extend_and_zoom(); - this.setState({ - evaluateViewExpanded: !this.state.evaluateViewExpanded - }) - } - - render() { - const { evaluateViewExpanded, tabIndex } = this.state; - const { output_sets, latest_output, record, challenge, gameBuilding, myshixun } = this.props; - - if (!output_sets) { - return ( -
loading
- ) - } - - const { test_sets, test_sets_count, had_test_count, test_sets_hidden_count, test_sets_public_count - , had_passed_testsests_error_count, had_passed_testsests_hidden_count, had_passed_testsests_public_count } = output_sets; - - - /* - - - - - -
  • - 评测信息 -
  • - - onclick="check_tab('blacktab_con','blacktab_hover',this);" - */ - return ( - -
      -
    • -
    • - { challenge.isHtml ? -
    • this.tabIndexChange(0)}> - 效果显示 -
    • : ''} -
    • this.tabIndexChange(1)}> - 测试结果 -
    • - - - {/*TODO 按钮大小改造,css*/} - - - - - - - -
      -
    - - - -
    - -
    - - -
    -
    - - - -
    - -
    -
    -
    -
    -
    -
    - {/* - record ? 本次评测耗时:{ record }秒 : "" - */} - { had_test_count === 0 || test_sets_count == null ?
    : - had_passed_testsests_error_count === test_sets_count ? -

    - - {test_sets_count}/{test_sets_count} 全部通过 -

    : -

    - - {had_passed_testsests_error_count}/{test_sets_count} - {/*.replace(/\\u/gi, '%u') unicode转码 */} - {latest_output ? - - : ""} -

    - } - {this.renderTestSets()} -
    -
    -
    -
    -
    -
    -
    - - ); - } -} - -export default CodeEvaluateView; +import React, { Component } from 'react'; + +import IconButton from 'material-ui/IconButton'; +import Tooltip from 'material-ui/Tooltip'; +import Button from 'material-ui/Button'; + +import './CodeEvaluateView.css' +import { CircularProgress } from 'material-ui/Progress'; +import { on, off } from 'educoder' +const testSetsExpandedArrayInitVal = [false, false, false, false, false, + false, false, false, false, false, + false, false, false, false, false, + false, false, false, false, false] + +const $ = window.$; +const TAB_INDEX_WEB_DISPLAY = 0; +const TAB_INDEX_EVALUATE_RESULT_INDEX = 1 + +class CodeEvaluateView extends Component { + + constructor(props) { + super(props) + + this.onEvaluateViewExpand = this.onEvaluateViewExpand.bind(this) + + this.state = { + // TODO 最多20个测试集? + testSetsInitedArray: testSetsExpandedArrayInitVal.slice(0), + + evaluateViewExpanded: false, + + tabIndex: 1, + } + } + + componentDidMount() { + const { challenge } = this.props; + + on('showWebDisplayEvent', () => { + if (challenge.isHtml) { + this.setState({ + tabIndex: TAB_INDEX_WEB_DISPLAY + }) + } + }) + + if (challenge.isHtml === true) { + this.tabIndexChange(TAB_INDEX_WEB_DISPLAY) + } + + } + componentWillUnmount() { + off('showWebDisplayEvent') + } + + componentWillReceiveProps(newProps, newContext) { + if (this.props.game && newProps.game && (newProps.game.id !== this.props.game.id + || newProps.gameBuilding !== this.props.gameBuilding )) { // 切换game时重置state + if (newProps.gameBuilding === false) { + // 清空codemirror的内容,TODO最好调用codemirror的销毁方法 + $('#evaluating_contents .result_different_show').html('') + this.setState({ + tabIndex: TAB_INDEX_EVALUATE_RESULT_INDEX + }) + } + this.setState({ + testSetsInitedArray: testSetsExpandedArrayInitVal.slice(0), + }) + if (newProps.game.id !== this.props.game.id) { + if (this.props.challenge.isHtml === true) { + this.tabIndexChange(TAB_INDEX_WEB_DISPLAY) + } + } + } + } + + componentDidUpdate(prevProps, prevState, snapshot) { + // 通关后重置为0 + if (!prevProps.currentGamePassed && this.props.currentGamePassed === true) { + this.tabIndexChange(TAB_INDEX_WEB_DISPLAY) + } + } + + + tabIndexChange(index) { + this.setState({tabIndex: index}); + } + + onTestSetHeaderClick(index) { + const { output_sets, power, game } = this.props; + const { test_sets_array } = output_sets; + + const { testSetsInitedArray } = this.state; + + // TODO 评测了以后,测试集会变化, + var current_test_set = test_sets_array[index]; + if (!current_test_set.output) { + current_test_set.output = '' + } + // 优化,但是会增加代码复杂度 + if (( game.test_sets_view === true || power == 1 || current_test_set.is_public == 1 ) && testSetsInitedArray[index] === false ) { // 如果测试集没有初始化过(如果重新评测了,都需要重新初始化) + const id = "result_different_show_" + index; + + var mv = window.CodeMirror.k_init(id, current_test_set.actual_output || "", current_test_set.output); + + + var height=0; + // 以前的代码用不了,2个pane的高度都是300 + // if($("#"+id).find(".CodeMirror-merge-pane").eq(0).height()>$("#"+id).find(".CodeMirror-merge-pane").eq(1).height()){ + // height = parseInt($("#"+id).find(".CodeMirror-merge-pane").eq(0).height()); + // }else{ + // height = parseInt($("#"+id).find(".CodeMirror-merge-pane").eq(1).height()); + // } + var lineNumber = Math.max( current_test_set.output.split('\n').length + , (current_test_set.actual_output ? current_test_set.actual_output.split('\n').length : 1 )) + + height = lineNumber * 19 + 25; + console.log('height ', height) + $("#"+id).find(".CodeMirror").height(height); + $(".CodeMirror-merge-gap").find("svg").css("height", height); + // 取真实高度 + $(".CodeMirror-merge-gap").css("height", $('.CodeMirror-merge-pane.CodeMirror-merge-editor').height()); + setTimeout(()=>{ // 解决第一次打开时高度不准的问题 + $('#game_test_set_results .CodeMirror-merge').css('display', 'flex') + }, 100) + // refresh一下,解决CM显示不全的问题 + mv.edit.refresh() + mv.right.orig.refresh() + testSetsInitedArray[index] = true; + } + + this.props.onTestSetHeaderClick(index) + this.setState({ + testSetsInitedArray, + }) + } + goToCertification() { + window.open('/account/certification', '_blank'); + } + renderTestSets() { + const { output_sets, testSetsExpandedArray, power, allowed_unlock, testSetUnlock, showDialog, challenge, game, user } = this.props; + const { testSetsInitedArray } = this.state; + + const { test_sets_array, test_sets_count, had_test_count, test_sets_hidden_count, test_sets_public_count + , had_passed_testsests_error_count, had_passed_testsests_hidden_count, had_passed_testsests_public_count } = output_sets; + + const testSetsComponentArray = [] + + if (!test_sets_array) { + console.error('no test_sets_array error') + return '' + } + test_sets_array.forEach( (item, index) => { + // function toggle_test_case(open, output, actual_output, id, power){ + // onclick={toggle_test_case(1, output, actual_output, 0, true)} + + const isExpanded = testSetsExpandedArray[index] + + let headIconClass = ''; + let _headLockIconClass = ''; + + if (item.is_public == 0) { + if (game.test_sets_view === true || power === 1){ + _headLockIconClass = 'fas fa-unlock-alt' + } else { + _headLockIconClass = 'fa-lock' + } + } + + if (item.result == true) { + headIconClass = 'fa-check-circle color-light-green font-16' + } else if (item.result == false) { + headIconClass = 'fa-exclamation-circle -text-danger' + } + + testSetsComponentArray.push( +
    +

    + + 测试集 {index + 1} + + { headIconClass && } + { _headLockIconClass && } + + { item.ts_mem && 消耗内存{item.ts_mem}MB } + { item.ts_mem && item.ts_time && } + { item.ts_time && 代码执行时长:{item.ts_time}秒 } + +

    +
    + ) + + // + let contentText = (power === 0 && user.is_teacher) ? + +
    {`已经过职业认证的教师可以免金币查看隐藏测试集。`}
    +
    {`解锁本关所有测试集需要扣除${challenge.score*5}金币,确定要解锁吗?`}
    +
    this.goToCertification()} style={{color: '#4CACFF', cursor: 'pointer', 'text-decoration': 'underline' + , 'margin-top': '12px'}}>立即认证
    +
    : + +
    {`解锁本关所有测试集需要扣除${challenge.score*5}金币`}
    +
    {`确定要解锁吗?`}
    +
    + + const moreButtonsRender = () => { + return '' + // ${this.props.classes.button} + // return (power === 0 && user.is_teacher) ? ( + // + // ) : '' + } + testSetsComponentArray.push( +
    +
    + { + (game.test_sets_view === true || power == 1 || item.is_public == 1) ? + ( + + { item.input ? +
    +
    + 测试输入: + +
    ")}}>
    + +
    +
    + : "" } +
    +

    - 预期输出 -

    +

    - 实际输出 -

    +
    +
    + ) : +

    + { !allowed_unlock ? '隐藏测试集,暂不支持解锁和查看。' : '此为隐藏测试项。'} + { (power === 0 && allowed_unlock == true) ? showDialog({ contentText, callback: testSetUnlock , moreButtonsRender})} + style={{"textDecoration": "underline"}}>解锁 : '' } +

    + } + +
    + + {/*测试集已解锁||管理员||公开的测试集||TODO应该是全通过时 已通过的测试集*/} + { + (game.test_sets_view == true || power == 1 || item.is_public == 1 || !!item.result === true) ? +
    + : "" + } + +
    + ) + }) + return testSetsComponentArray; + } + + onEvaluateViewExpand() { + window.valuation_extend_and_zoom(); + this.setState({ + evaluateViewExpanded: !this.state.evaluateViewExpanded + }) + } + + render() { + const { evaluateViewExpanded, tabIndex } = this.state; + const { output_sets, latest_output, record, challenge, gameBuilding, myshixun } = this.props; + + if (!output_sets) { + return ( +
    loading
    + ) + } + + const { test_sets, test_sets_count, had_test_count, test_sets_hidden_count, test_sets_public_count + , had_passed_testsests_error_count, had_passed_testsests_hidden_count, had_passed_testsests_public_count } = output_sets; + + + /* + + + + + +
  • + 评测信息 +
  • + + onclick="check_tab('blacktab_con','blacktab_hover',this);" + */ + return ( + +
      +
    • +
    • + { challenge.isHtml ? +
    • this.tabIndexChange(0)}> + 效果显示 +
    • : ''} +
    • this.tabIndexChange(1)}> + 测试结果 +
    • + + + {/*TODO 按钮大小改造,css*/} + + + + + + + +
      +
    + + + +
    + +
    + + +
    +
    + + + +
    + +
    +
    +
    +
    +
    +
    + {/* + record ? 本次评测耗时:{ record }秒 : "" + */} + { had_test_count === 0 || test_sets_count == null ?
    : + had_passed_testsests_error_count === test_sets_count ? +

    + + {test_sets_count}/{test_sets_count} 全部通过 +

    : +

    + + {had_passed_testsests_error_count}/{test_sets_count} + {/*.replace(/\\u/gi, '%u') unicode转码 */} + {latest_output ? + + : ""} +

    + } + {this.renderTestSets()} +
    +
    +
    +
    +
    +
    +
    + + ); + } +} + +export default CodeEvaluateView; diff --git a/public/react/src/modules/page/main/LeftView.js b/public/react/src/modules/page/main/LeftView.js index 9e39a5508..428d898cb 100644 --- a/public/react/src/modules/page/main/LeftView.js +++ b/public/react/src/modules/page/main/LeftView.js @@ -68,7 +68,7 @@ const styles = MUIDialogStyleUtil.getTwoButtonStyle( class LeftView extends Component { goToCertification() { - window.open('/account/professional_certification', '_blank'); + window.open('/account/certification', '_blank'); } // /shixuns/mnf6b7z3/shixun_discuss?challenge_id=88 render() { diff --git a/public/react/src/modules/page/main/Webssh.js b/public/react/src/modules/page/main/Webssh.js index b5924c2d4..a76210909 100644 --- a/public/react/src/modules/page/main/Webssh.js +++ b/public/react/src/modules/page/main/Webssh.js @@ -7,7 +7,7 @@ export function loadSshScript(callback) { prefix = '' } else { // _url_origin = `https://testeduplus2.educoder.net/`; - _url_origin = 'http://47.96.87.25:48080/'; + _url_origin = ''; } const $ = window.$; // 未加载过 diff --git a/public/react/src/modules/tpm/TPMIndexHOC.js b/public/react/src/modules/tpm/TPMIndexHOC.js index cc89f3003..2c38e602d 100644 --- a/public/react/src/modules/tpm/TPMIndexHOC.js +++ b/public/react/src/modules/tpm/TPMIndexHOC.js @@ -18,7 +18,8 @@ import Trialapplication from "../login/Trialapplication"; const $ = window.$; const versionNum = '0001'; // let _url_origin = getUrl() -let _url_origin=`http://47.96.87.25:48080`; +console.log(this.props) +let _url_origin=''; // let _url_origin=`https://www.educoder.net`; if (!window['indexHOCLoaded']) { diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js index 939e9d5f9..c7fd23443 100644 --- a/public/react/src/modules/user/Interestpage.js +++ b/public/react/src/modules/user/Interestpage.js @@ -2,7 +2,7 @@ import React, {Component} from 'react'; import {Button,notification} from 'antd'; import {broadcastChannelPostMessage} from 'educoder'; import MyEduCoderModal from './MyEduCoderModal'; -import Notcompleted from './Notcompleted'; +// import Notcompleted from '../../common/Notcompleted'; import axios from 'axios'; import './common.css'; import mytc from './img/mytc.png'; @@ -31,7 +31,7 @@ class InterestpageComponent extends Component { passmm:this.props.passmm, homedatalist:undefined, hometypepvisible: undefined, - + MyEduCoderModals:false } } openNotification = (messge) => { @@ -249,9 +249,6 @@ class InterestpageComponent extends Component { setNotcompleteds={()=>{this.setNotcompleteds()}} /> -
    请选择你的职业