diff --git a/app/controllers/accounts_controller.rb b/app/controllers/accounts_controller.rb index 47349e219..324e5bde3 100644 --- a/app/controllers/accounts_controller.rb +++ b/app/controllers/accounts_controller.rb @@ -32,8 +32,11 @@ class AccountsController < ApplicationController end uid_logger("start register: verifi_code is #{verifi_code}, code is #{code}, time is #{Time.now.to_i - verifi_code.try(:created_at).to_i}") # check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60) - return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip - return normal_status(-2, "验证码已失效") if !verifi_code&.effective? + # todo 上线前请删除万能验证码"513231" + if code != "513231" + return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip + return normal_status(-2, "验证码已失效") if !verifi_code&.effective? + end code = generate_identifier User, 8 login = pre + code diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cae9d6413..28f35b94a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -325,6 +325,7 @@ class ApplicationController < ActionController::Base unless file_content.present? raise("获取文件代码异常") end + logger.info("#######game_id:#{game_id}, file_content:#{file_content}") game_code = GameCode.where(:game_id => game_id, :path => path).first if game_code.nil? GameCode.create!(:game_id => game_id, :new_code => file_content, :path => path) diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 7403cfc4d..649516a03 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -90,7 +90,6 @@ class MyshixunsController < ApplicationController # params[:pics] = "a.png,b.png,c.png" def training_task_status - logger.info("##################training_task_status_start#{params[:jsonTestDetails]['buildID']}") ActiveRecord::Base.transaction do begin t1 = Time.now diff --git a/public/react/src/AppConfig.js b/public/react/src/AppConfig.js index 0666aadc3..ddef777d6 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 ,SetAppModel} from 'educoder'; +import { broadcastChannelOnmessage ,SetAppModel, isDev, queryString } from 'educoder'; import { notification } from 'antd'; import './index.css' broadcastChannelOnmessage('refreshPage', () => { @@ -18,8 +18,17 @@ function locationurl(list){ } // TODO 开发期多个身份切换 -const debugType =window.location.search.indexOf('debug=t') != -1 ? 'teacher' : - window.location.search.indexOf('debug=s') != -1 ? 'student' : 'admin' +let debugType ="" +if (isDev) { + const _search = window.location.search; + let parsed = {}; + if (_search) { + parsed = queryString.parse(_search); + } + debugType = window.location.search.indexOf('debug=t') != -1 ? 'teacher' : + window.location.search.indexOf('debug=s') != -1 ? 'student' : + window.location.search.indexOf('debug=a') != -1 ? 'admin' : parsed.debug || '' +} window._debugType = debugType; export function initAxiosInterceptors(props) { diff --git a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js index b9f0f67f9..eb8143c03 100644 --- a/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js +++ b/public/react/src/modules/courses/exercise/ExerciseReviewAndAnswer.js @@ -20,7 +20,7 @@ import ShixunAnswer from './question/shixunAnswer' import update from 'immutability-helper' import axios from 'axios'; - +import './new/common.css' const Textarea =Input.TextArea const tagArray = [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', diff --git a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js index f6389613b..6e7b52715 100644 --- a/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js +++ b/public/react/src/modules/courses/exercise/Exercisestatisticalresult.js @@ -222,6 +222,7 @@ class Exercisestatisticalresult extends Component { ) }): { datas.push({ - commit_percent:{num:item.choice_position,value:type===4||type===5?choicetype[item.choice_text-1]:item.choice_text,type:item.choice_right_boolean}, + commit_percent:{ + num:item.choice_position, + value:type===4||type===5?choicetype[item.choice_text-1]:item.choice_text, + type:item.choice_right_boolean, + _type: type + }, min_score:{value:item.choice_users_count,type:item.choice_right_boolean}, max_score:item.choice_percent, }) @@ -40,13 +51,23 @@ class Exercisetablesmubus extends Component { title: '选项', dataIndex: 'commit_percent', key: 'commit_percent', - render: (text, record) => ( - - {text.value!="有效填写量"&&text.value!="wrong"?text.value:false} - {text.value==="wrong"?"填写了错误答案":false} - {text.value==="有效填写量"?"有效填写量":false} - - ), + render: (text, record, index) => { + const _content = + {text.value!="有效填写量"&&text.value!="wrong" && + + } + {text.value==="wrong" && "填写了错误答案" } + {text.value==="有效填写量" && "有效填写量" } + + return ( + + (text._type === 0 || text._type === 1) ?
+ {{tagArray[index]}.} + {_content} +
: {_content} + ) + + }, }, { title: '小计', dataIndex: 'min_score', diff --git a/public/react/src/modules/courses/exercise/new/SingleDisplay.js b/public/react/src/modules/courses/exercise/new/SingleDisplay.js index b7a1905fc..13d1e838c 100644 --- a/public/react/src/modules/courses/exercise/new/SingleDisplay.js +++ b/public/react/src/modules/courses/exercise/new/SingleDisplay.js @@ -93,9 +93,9 @@ class SingleDisplay extends Component{
{ question_choices.map((item, optionIndex) => { let prefix = undefined - if (!isPreviewPage) { + // if (!isPreviewPage) { prefix = `${tagArray[optionIndex]}.` - } + // } if (question_type == 0) { // 单选 return (
diff --git a/public/react/src/modules/courses/exercise/new/common.css b/public/react/src/modules/courses/exercise/new/common.css index 0fef369e3..7e1e2530f 100644 --- a/public/react/src/modules/courses/exercise/new/common.css +++ b/public/react/src/modules/courses/exercise/new/common.css @@ -33,4 +33,8 @@ .singleDisplay .options .markdown-body { max-width: 1116px; +} +.singleDisplay .ant-radio-wrapper span:last-child + , .singleDisplay .ant-checkbox-wrapper span:last-child { + padding-right: 0px; } \ No newline at end of file diff --git a/public/react/src/modules/courses/exercise/question/multiple.js b/public/react/src/modules/courses/exercise/question/multiple.js index 60dbc9ac9..3ef3d960f 100644 --- a/public/react/src/modules/courses/exercise/question/multiple.js +++ b/public/react/src/modules/courses/exercise/question/multiple.js @@ -4,9 +4,9 @@ import {markdownToHTML} from 'educoder' import axios from 'axios' const tagArray = [ - // 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', - // 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', - // 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', + 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', + 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ] class Multiple extends Component{ constructor(props){ @@ -41,14 +41,17 @@ class Multiple extends Component{ let isStudent =this.props.isStudent(); console.log(questionType); return( -
+
{ questionType.question_choices && questionType.question_choices.map((item,key)=>{ + let prefix = `${tagArray[key]}.` + return(

- - + {prefix} + {/* */} +

) }) diff --git a/public/react/src/modules/courses/exercise/question/single.js b/public/react/src/modules/courses/exercise/question/single.js index 5f514581a..aa23aa3d9 100644 --- a/public/react/src/modules/courses/exercise/question/single.js +++ b/public/react/src/modules/courses/exercise/question/single.js @@ -4,9 +4,9 @@ import {Checkbox,Radio, Input} from "antd"; import {markdownToHTML} from 'educoder' import axios from 'axios' const tagArray = [ - // 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', - // 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', - // 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', + 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', + 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z' ] class single extends Component{ constructor(props){ @@ -36,14 +36,16 @@ class single extends Component{ let isStudent =this.props.isStudent(); return( -
+
{ questionType.question_choices && questionType.question_choices.map((item,key)=>{ + let prefix = `${tagArray[key]}.` return(

- - + {prefix} + {/* */} +

) }) diff --git a/public/react/src/modules/user/Interestpage.js b/public/react/src/modules/user/Interestpage.js index b3abfe1a4..4642707b2 100644 --- a/public/react/src/modules/user/Interestpage.js +++ b/public/react/src/modules/user/Interestpage.js @@ -188,11 +188,11 @@ class InterestpageComponent extends Component { if (response !== undefined) { // this.Jumptotheinterestpage(); // window.location.href = "/" - if(response.data.message!==undefined){ + if(response.data.status===0){ - return; + this.setMyEduCoderModals() } - this.setMyEduCoderModals() + } diff --git a/public/react/src/modules/user/InterestpageMax.js b/public/react/src/modules/user/InterestpageMax.js index a53c1bbe0..fb3f1544c 100644 --- a/public/react/src/modules/user/InterestpageMax.js +++ b/public/react/src/modules/user/InterestpageMax.js @@ -166,6 +166,10 @@ class InterestpageMax extends Component { //兴趣页面点击 Interestcompletionpage(){ + + this.setState({ + setpagecomplet:true + }) if(this.state.gouxuans.length === 0){ this.openNotification("请选择您的职业"); return @@ -189,12 +193,9 @@ class InterestpageMax extends Component { if (response !== undefined) { // this.Jumptotheinterestpage(); // window.location.href = "/" - - if(response.data.message!==undefined){ - - return; + if(response.data.status===0){ + this.setMyEduCoderModals() } - this.setMyEduCoderModals() } @@ -285,7 +286,7 @@ class InterestpageMax extends Component { ) })}
- +