Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

video_transcode
dinglink 5 years ago
commit 18f5d5525f

@ -134,6 +134,7 @@ class HackUserLastestCodesController < ApplicationController
end end
testCases = Base64.encode64(test_sets.to_json) testCases = Base64.encode64(test_sets.to_json)
#codeFileContent = Base64.urlsafe_encode64(@my_hack.code) #codeFileContent = Base64.urlsafe_encode64(@my_hack.code)
Rails.logger.info("##########code_#{@my_hack.identifier}: #{@my_hack.code}")
debug_params = {execMode: exec_mode, debug_params = {execMode: exec_mode,
tpiID: @my_hack.identifier, tpiID: @my_hack.identifier,
testCases: testCases, testCases: testCases,

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

@ -435,7 +435,7 @@ a.white-btn.use_scope-btn:hover{
.maxwidth190{max-width: 190px; color:#666666;font-size: 14px;} .maxwidth190{max-width: 190px; color:#666666;font-size: 14px;}
.color05101A{color:#05101A;} .color05101A{color:#05101A;}
.liactive{border-left: 1px solid #4CACFF;} .liactive{border-left: 1px solid #4CACFF;}
.ant-btn-lg{height: 39px;}
.bannername{ .bannername{
max-width: 907px; max-width: 907px;
overflow: hidden; overflow: hidden;

@ -50,9 +50,6 @@ function InitTabCtx (props, ref) {
> >
{ {
getFieldDecorator('input', { getFieldDecorator('input', {
rules: [
{ required: true, message: '输入值不能为空'}
],
initialValue: inputValue initialValue: inputValue
})(<TextArea })(<TextArea
className="input_textarea_style" className="input_textarea_style"

@ -147,7 +147,7 @@ const AddTestDemo = (props) => {
return ( return (
<Collapse className={'collapse_area'} activeKey={isOpen?'1':''} onChange={() => handleChangeCollapse()}> <Collapse className={'collapse_area'} activeKey={isOpen?'1':''} onChange={() => handleChangeCollapse()}>
<Panel header={`测试用例${props.index + 1}`} extra={genExtra()} key="1"> <Panel header={`测试用例${props.index + 1}`} extra={props.index===0?false:genExtra()} key="1">
<Form> <Form>
<FormItem <FormItem
label={<span className={'label_text'}>输入</span>} label={<span className={'label_text'}>输入</span>}

@ -85,6 +85,25 @@ class EditTab extends React.Component {
// this.props.getQuestion({ // this.props.getQuestion({
// source: 'question' // source: 'question'
// }); // });
const obj = { // 测试用例参数
input: '',
output: '',
position: 1,
isAdd: true // 新增的测试用例
}
const validateObj = { // 测试用例验证参数
input: {
validateStatus: '',
errMsg: ''
},
output: {
validateStatus: '',
errMsg: ''
}
}
// this.scrollRef.current.scrollTo(1000);
this.props.addTestCase({testCase: obj, tcValidate: validateObj});
} }
// componentDidUpdate (nextProp) { // componentDidUpdate (nextProp) {

@ -112,7 +112,7 @@ function RecordDetail (props) {
<span className="status_label pass_case" style={{ display: [-1, 0, 2, 5].includes(detail.status) ? 'inline-block' : 'none'}}> <span className="status_label pass_case" style={{ display: [-1, 0, 2, 5].includes(detail.status) ? 'inline-block' : 'none'}}>
<span className="status_label_sub">{detail.pass_sets_count}</span> <span className="status_label_sub">{detail.pass_sets_count}</span>
<span className="pass_case_span"> / {detail.set_count}</span> <span className="pass_case_span"> / {detail.set_count}</span>
个通过测试用例 个通过测试用例
</span> </span>
</div> </div>
<div className="result_error_area"> <div className="result_error_area">
@ -134,9 +134,9 @@ function RecordDetail (props) {
<MonacoEditor <MonacoEditor
height="100%" height="100%"
width="100%" width="100%"
className="code_area_Style"
language={(detail.language && detail.language.toLowerCase()) || ''} language={(detail.language && detail.language.toLowerCase()) || ''}
value={detail.code || ''} value={detail.code || ''}
theme="dark"
readOnly={true} readOnly={true}
/> />
</div> </div>

@ -1,5 +1,19 @@
@import '../split_pane_resizer.scss'; @import '../split_pane_resizer.scss';
.result_code_area .monaco-editor, .monaco-editor-background, .monaco-editor .inputarea.ime-input{
background-color: #f9f9f9!important;
}
.result_code_area .monaco-editor .line-numbers{
color: #999!important;
}
.result_code_area .monaco-editor .current-line ~ .line-numbers {
color: #0b216f!important;
}
.result_code_area .minimap-decorations-layer{
background: rgba(225,225,225,0.2)!important;
}
.result_code_area .monaco-editor .margin{
background-color: #eee!important;
}
.record_detail_area{ .record_detail_area{
background: #fff; background: #fff;
.record_detail_ctx{ .record_detail_ctx{

@ -21,6 +21,7 @@ import NoneData from './component/NoneData';
import './questioncss/questioncom.css'; import './questioncss/questioncom.css';
import Bottomsubmit from "../modals/Bottomsubmit"; import Bottomsubmit from "../modals/Bottomsubmit";
import QuestionModalys from "./component/QuestionModalys"; import QuestionModalys from "./component/QuestionModalys";
import Listjihe from "./component/Listjihe";
//exam_id 试卷的id //exam_id 试卷的id
var Undoclickable=true; var Undoclickable=true;
@ -264,12 +265,6 @@ class NewMyShixunModel extends Component {
} }
this.callback(defaultActiveKeys); this.callback(defaultActiveKeys);
} }
if(prevProps.Contentdata !== this.props.Contentdata){
this.setState({
Contentdata:this.props.Contentdata,
})
}
} }
//公共和我的 //公共和我的
@ -721,33 +716,33 @@ class NewMyShixunModel extends Component {
getbasket_listdata = () => { getbasket_listdata = () => {
// 获取试题篮展开的数据 // 获取试题篮展开的数据
// const url = "/item_baskets/basket_list.json"; const url = "/item_baskets/basket_list.json";
// axios.get(url) axios.get(url)
// .then((result) => { .then((result) => {
// // ////console.log("getbasket_listdata"); // ////console.log("getbasket_listdata");
// // ////console.log(result.data); // ////console.log(result.data);
// this.setState({ this.setState({
// completion_questions_count: result.data.completion_questions_count, completion_questions_count: result.data.completion_questions_count,
// judgement_questions_count: result.data.judgement_questions_count, judgement_questions_count: result.data.judgement_questions_count,
// multiple_questions_count: result.data.multiple_questions_count, multiple_questions_count: result.data.multiple_questions_count,
// practical_questions_count: result.data.practical_questions_count, practical_questions_count: result.data.practical_questions_count,
// program_questions_count: result.data.program_questions_count, program_questions_count: result.data.program_questions_count,
// single_questions_count: result.data.single_questions_count, single_questions_count: result.data.single_questions_count,
// subjective_questions_count: result.data.subjective_questions_count, subjective_questions_count: result.data.subjective_questions_count,
// }) })
//
// }).catch((error) => { }).catch((error) => {
// // ////console.log(error); // ////console.log(error);
// this.setState({ this.setState({
// completion_questions_count: 0, completion_questions_count: 0,
// judgement_questions_count: 0, judgement_questions_count: 0,
// multiple_questions_count: 0, multiple_questions_count: 0,
// practical_questions_count: 0, practical_questions_count: 0,
// program_questions_count: 0, program_questions_count: 0,
// single_questions_count: 0, single_questions_count: 0,
// subjective_questions_count: 0, subjective_questions_count: 0,
// }) })
// }) })
} }
@ -1030,7 +1025,9 @@ class NewMyShixunModel extends Component {
+ subjective_questions_count; + subjective_questions_count;
// console.log("弹出框"); // console.log("弹出框");
// console.log(Contentdata) // console.log(Datacount)
// console.log(Contentdata)
return ( return (
<div className="newMain clearfix " ref={this.saveContainer}> <div className="newMain clearfix " ref={this.saveContainer}>
@ -1103,6 +1100,8 @@ class NewMyShixunModel extends Component {
Contentdata={Contentdata} Contentdata={Contentdata}
exam_id={this.props.exam_id} exam_id={this.props.exam_id}
Isitapopup={"true"} Isitapopup={"true"}
Datacount={Datacount}
Datacountbool={true}
chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)} chakanjiexibool={(e)=>this.chakanjiexibool(e)}
getitem_basketss={(id)=>this.getitem_basketss(id)} getitem_basketss={(id)=>this.getitem_basketss(id)}

@ -788,12 +788,37 @@ class Question extends Component {
} }
//全选试题库 //全选试题库
selectallquestionsonthispage=(bool)=>{ selectallquestionsonthispage=(bool)=>{
if(bool===true){
//bool 是选中状态
let {
completion_questions_count, judgement_questions_count, multiple_questions_count, practical_questions_count,
program_questions_count, single_questions_count, subjective_questions_count,
} = this.state;
const Datacount = completion_questions_count + judgement_questions_count
+ multiple_questions_count + practical_questions_count
+ program_questions_count
+ single_questions_count
+ subjective_questions_count;
if(Datacount===100){
this.props.showNotification(`已选100个试题不能在选用更多试题`);
return;
}
}
if(myGrandtotal===true){ if(myGrandtotal===true){
this.props.showNotification(`本页全部试题未发布,不能选择`); this.props.showNotification(`本页全部试题未发布,不能选择`);
return return
} }
var item_idsdata=[]; var item_idsdata=[];
var arr= this.state.Contentdata.items; var arr= this.state.Contentdata.items;
@ -1083,6 +1108,8 @@ class Question extends Component {
<Contentpart {...this.state} {...this.props} <Contentpart {...this.state} {...this.props}
pages={this.state.page} pages={this.state.page}
Isitapopup={"false"} Isitapopup={"false"}
Datacount={Datacount}
Datacountbool={true}
chakanjiexiboolindex={this.state.chakanjiexiboolindex} chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)} chakanjiexibool={(e)=>this.chakanjiexibool(e)}
getitem_basketss={(id)=>this.getitem_basketss(id)} getitem_basketss={(id)=>this.getitem_basketss(id)}

@ -143,7 +143,7 @@ class ChoquesEditor extends Component{
} }
} }
if(!answerArray || answerArray.length == 0) { if(!answerArray || answerArray.length == 0) {
this.props.showNotification('请先点击选择本选择题的正确选项'); this.props.showNotification('请设置本题的正确答案点击选项A/B...即可完成设置');
return editordata; return editordata;
} }
if(!answerArray || answerArray.length < 2) { if(!answerArray || answerArray.length < 2) {

@ -369,18 +369,16 @@ class Contentpart extends Component {
</style> </style>
<div className="xaxisreverseorder"> <div className="xaxisreverseorder">
{ {
defaultActiveKey===0||defaultActiveKey==="0"? isysladmins===true||is_teacher===true?
isysladmins===true||is_teacher===true? this.props.Isitapopup&&this.props.Isitapopup==="true"?
this.props.Isitapopup&&this.props.Isitapopup==="true"? ""
"" :
: <a onClick={(e)=>this.xinzenw(e)}>
<a onClick={(e)=>this.xinzenw(e)}> <div className="newbutoon">
<div className="newbutoon"> <p className="newbutoontes" >新增</p>
<p className="newbutoontes" >新增</p> </div>
</div> </a>
</a> :""
:""
:""
} }
{item_type==="PROGRAM"? {item_type==="PROGRAM"?
@ -400,33 +398,24 @@ class Contentpart extends Component {
{ {
defaultActiveKey===0||defaultActiveKey==="0"? this.props.Isitapopup&&this.props.Isitapopup==="true"?
this.props.Isitapopup&&this.props.Isitapopup==="true"? <Search
<Search style={isysladmins===true||is_teacher===true?{ marginRight:"0px"}:{marginRight:"0px"}}
style={isysladmins===true||is_teacher===true?{ marginRight:"0px"}:{marginRight:"0px"}} className={"xaxisreverseorder searchwidth"}
className={"xaxisreverseorder searchwidth"} placeholder="请输入题目名称、内容"
placeholder="请输入题目名称、内容" enterButton
enterButton size="large"
size="large" onInput={(e)=>this.props.setdatafunsval(e)}
onInput={(e)=>this.props.setdatafunsval(e)} onSearch={ (value)=>this.props.setdatafuns(value)} />
onSearch={ (value)=>this.props.setdatafuns(value)} /> :
: <Search
<Search style={isysladmins===true||is_teacher===true?{ marginRight:"30px"}:{marginRight:"0px"}}
style={isysladmins===true||is_teacher===true?{ marginRight:"30px"}:{marginRight:"0px"}} className={"xaxisreverseorder searchwidth"}
className={"xaxisreverseorder searchwidth"} placeholder="请输入题目名称、内容"
placeholder="请输入题目名称、内容" enterButton
enterButton size="large"
size="large" onInput={(e)=>this.props.setdatafunsval(e)}
onInput={(e)=>this.props.setdatafunsval(e)} onSearch={ (value)=>this.props.setdatafuns(value)} />
onSearch={ (value)=>this.props.setdatafuns(value)} />
:
<Search
className={"xaxisreverseorder searchwidth"}
placeholder="请输入题目名称、内容"
enterButton
size="large"
onInput={(e)=>this.props.setdatafunsval(e)}
onSearch={ (value)=>this.props.setdatafuns(value)} />
} }
</div> </div>
@ -466,6 +455,8 @@ class Contentpart extends Component {
: this.props.Contentdata.items.map((object, index) => { : this.props.Contentdata.items.map((object, index) => {
return ( return (
<Listjihe {...this.state} {...this.props} <Listjihe {...this.state} {...this.props}
Datacountbool={this.props.Datacountbool}
Datacount={this.props.Datacount}
Isitapopup={this.props.Isitapopup} Isitapopup={this.props.Isitapopup}
chakanjiexiboolindex={this.props.chakanjiexiboolindex} chakanjiexiboolindex={this.props.chakanjiexiboolindex}
chakanjiexibool={(keindex)=>this.chakanjiexibool(keindex)} chakanjiexibool={(keindex)=>this.chakanjiexibool(keindex)}

@ -97,6 +97,19 @@ class Listjihe extends Component {
} }
//选用 //选用
Selectingpracticaltraining = (id) => { Selectingpracticaltraining = (id) => {
try {
if(this.props.Datacountbool){
if(this.props.Datacount===100){
this.props.showNotification(`已选100个试题不能在选用更多试题`);
return;
}
}
}catch (e) {
}
let data = {} let data = {}
if (this.props.exam_id === undefined) { if (this.props.exam_id === undefined) {
data = { data = {

@ -156,7 +156,7 @@ class SingleEditor extends Component{
} }
if(!answerArray || answerArray.length == 0) { if(!answerArray || answerArray.length == 0) {
this.props.showNotification('请先点击选择本选择题的正确选项'); this.props.showNotification('请设置本题的正确答案点击选项A/B...即可完成设置');
return editordata; return editordata;
} }

Loading…
Cancel
Save