Merge branch 'develop' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_item_bank

dev_jupyter
杨树林 5 years ago
commit 6241c0658e

@ -23,23 +23,23 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名
def check_sign
unless Rails.env.development?
Rails.logger.info("66666 #{params}")
suffix = request.url.split(".").last.split("?").first
suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释
unless suffix_arr.include?(suffix)
if params[:client_key].present?
randomcode = params[:randomcode]
# tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
Rails.logger.info("2222 #{sign}")
tip_exception(501, "请求不合理") if sign != params[:client_key]
else
tip_exception(501, "请求不合理")
end
end
end
# unless Rails.env.development?
# Rails.logger.info("66666 #{params}")
# suffix = request.url.split(".").last.split("?").first
# suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释
# unless suffix_arr.include?(suffix)
# if params[:client_key].present?
# randomcode = params[:randomcode]
# # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
#
# sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
# Rails.logger.info("2222 #{sign}")
# tip_exception(501, "请求不合理") if sign != params[:client_key]
# else
# tip_exception(501, "请求不合理")
# end
# end
# end
end
# 全局配置参数

@ -30,7 +30,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
devtool: "cheap-module-eval-source-map",
//devtool: "cheap-module-eval-source-map",
// 开启调试
//devtool: "source-map", // 开启调试
// These are the "entry points" to our application.

@ -326,8 +326,8 @@ module.exports = {
comments: false
},
compress: {
drop_debugger: false,
drop_console: false
drop_debugger: true,
drop_console: true
}
}
}),

@ -21,8 +21,16 @@ import './tpiPageForMobile.css';
import actions from '../../redux/actions';
const $ = window.$;
class MainContent extends Component {
constructor(props) {
super(props)
this.chooseQ = React.createRef();
}
chooseQfun = (Ref) => {
this.chooseQ = Ref;
}
componentDidMount() {
// ios下图标位置有问题
this.props.mainContentfun(this)
setTimeout(()=>{
if (window.$('.b-label>.resize-helper').position().top < 100) {
window.$('.b-label>.resize-helper').css('top', '200px')
@ -162,7 +170,7 @@ class MainContent extends Component {
<CodeRepositoryViewContainer { ...this.props } ></CodeRepositoryViewContainer>
</div>
</React.Fragment>
: <ChooseRepositoryView ref="chooseQ" { ...this.props }></ChooseRepositoryView>
: <ChooseRepositoryView ref="chooseQ" chooseQfun={(ref)=>this.chooseQfun(ref)}{ ...this.props }></ChooseRepositoryView>
}
{/* */}

@ -158,7 +158,7 @@ class MainContentContainer extends Component {
this.showResetCodeDialog = this.showResetCodeDialog.bind(this)
this.showResetPassedCodeDialog = this.showResetPassedCodeDialog.bind(this)
this.mainContent = React.createRef();
this.oldRepositoryCode = '';
@ -177,7 +177,9 @@ class MainContentContainer extends Component {
isEditablePath: true
}
}
mainContentfun = (Ref) => {
this.mainContent = Ref;
}
// ------------------------------------------------
// static childContextTypes = {
// muiTheme: PropTypes.object
@ -589,7 +591,9 @@ class MainContentContainer extends Component {
onRunChooseTest() {
const { st, game, onRunChooseTestFinish, showSnackbar } = this.props;
// 获取form表单值
var value = this.refs.mainContent.refs.chooseQ.getForm().getFieldsValue();
// console.log(this.mainContent.chooseQ.props.form.getFieldsValue())
var value = this.mainContent.chooseQ.props.form.getFieldsValue();
// this.refs.mainContent.refs.chooseQ.getForm().getFieldsValue();
var valueArray = []; // map转array
var unSelectOptionIndexArray = [] // 自己做未选提示
@ -984,7 +988,7 @@ class MainContentContainer extends Component {
</Dialog>
<UpdateDrawer {...this.props} fetchRepositoryCode={this.fetchRepositoryCode}></UpdateDrawer>
<MainContent ref="mainContent" {...this.props} output_sets={output_sets} {...this.state}
<MainContent ref="mainContent" mainContentfun={(ref)=>this.mainContentfun(ref)} {...this.props} output_sets={output_sets} {...this.state}
onRepositoryCodeUpdate={this.onRepositoryCodeUpdate} onRunCodeTest={this.onRunCodeTest}
codemirrorDidMount={this.codemirrorDidMount} fetchRepositoryCode={this.fetchRepositoryCode}
showResetCodeDialog={this.showResetCodeDialog} showResetPassedCodeDialog={this.showResetPassedCodeDialog}

@ -70,6 +70,9 @@ subject:"计算机中的应用软件是指:"
option_name:"所有计算机上都应使用的软件"
positon:0
*/
componentDidMount() {
this.props.chooseQfun(this)
}
renderChooseQuestions() {
const { getFieldDecorator } = this.props.form;
const { choose, choose_test_cases } = this.props;

@ -318,6 +318,7 @@ class CodeEvaluateView extends Component {
*/
const _arrowClasses = isCollapse ? 'iconfont icon-xiajiantou btn-arrow' : 'iconfont icon-shangjiantou btn-arrow';
return (
<React.Fragment>
<ul id="blacktab_nav">
@ -330,11 +331,11 @@ class CodeEvaluateView extends Component {
<li className={`blacktab_con ${ tabIndex === 1 ? 'tab_hover' : ''}`} onClick={() => this.tabIndexChange(1)}>
<a href="javascript:void(0);" className="tab_type tab_color">测试结果</a>
</li>
<li className="blacktab_con_abs">
{this.props&&this.props.vnc_url?<li className="blacktab_con_abs">
<span className="code_evalute_icon" onClick={() => this.handleShowTestCase()}>
<span className={_arrowClasses}></span>
</span>
</li>
</li>:""}
{this.props.inDrawer ? <Tooltip id="tooltip-icon-expand" title={ showOrHide ? "收起" : "展开"}>
{/*TODO 按钮大小改造css*/}

@ -510,9 +510,10 @@ class DetailCards extends Component{
{this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?
item.shixuns_list && item.shixuns_list.map((line,index)=>{
return(
<div className="clearfix paragraph lineh-30" onMouseEnter>
<div className="clearfix paragraph lineh-30" onMouseEnter={()=>this.showparagraph(key,index)} onMouseLeave={this.hideparagraph}>
<li className="fl li-width63">
<li className="fl li-width63">
<span className="progressRing mr10">
{
@ -531,7 +532,8 @@ class DetailCards extends Component{
{
showparagraphkey===key&&showparagraphindex===index?<div>
<Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link>
</div>:""
{line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战</a>}
</div>:""
}
</li>

Loading…
Cancel
Save