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
testCases = Base64.encode64(test_sets.to_json)
#codeFileContent = Base64.urlsafe_encode64(@my_hack.code)
Rails.logger.info("##########code_#{@my_hack.identifier}: #{@my_hack.code}")
debug_params = {execMode: exec_mode,
tpiID: @my_hack.identifier,
testCases: testCases,

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

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

@ -1,7 +1,7 @@
/*
* @Description: 自定义测试化用例
* @Author: tangjiang
* @Github:
* @Github:
* @Date: 2019-11-27 19:46:14
* @LastEditors : tangjiang
* @LastEditTime : 2019-12-26 20:07:35
@ -50,11 +50,8 @@ function InitTabCtx (props, ref) {
>
{
getFieldDecorator('input', {
rules: [
{ required: true, message: '输入值不能为空'}
],
initialValue: inputValue
})(<TextArea
})(<TextArea
className="input_textarea_style"
rows={8}
placeholder="请填写测试用例的输入值,点击“调试代码”"

@ -147,7 +147,7 @@ const AddTestDemo = (props) => {
return (
<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>
<FormItem
label={<span className={'label_text'}>输入</span>}

@ -85,6 +85,25 @@ class EditTab extends React.Component {
// this.props.getQuestion({
// 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) {
@ -171,7 +190,7 @@ class EditTab extends React.Component {
render () {
const { showAdd } = this.state;
const {
ojForm,
ojFormValidate,
@ -359,7 +378,7 @@ class EditTab extends React.Component {
const obj = Object.assign({}, values, {sub_discipline_id})
tagDisciplines(obj);
}
return (
<div className={'editor_area'} id="textCase">
<Form className={'editor_form'}>

@ -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_sub">{detail.pass_sets_count}</span>
<span className="pass_case_span"> / {detail.set_count}</span>
个通过测试用例
个通过测试用例
</span>
</div>
<div className="result_error_area">
@ -134,9 +134,9 @@ function RecordDetail (props) {
<MonacoEditor
height="100%"
width="100%"
className="code_area_Style"
language={(detail.language && detail.language.toLowerCase()) || ''}
value={detail.code || ''}
theme="dark"
readOnly={true}
/>
</div>

@ -1,5 +1,19 @@
@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{
background: #fff;
.record_detail_ctx{

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

@ -788,12 +788,37 @@ class Question extends Component {
}
//全选试题库
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){
this.props.showNotification(`本页全部试题未发布,不能选择`);
return
}
var item_idsdata=[];
var arr= this.state.Contentdata.items;
@ -1083,6 +1108,8 @@ class Question extends Component {
<Contentpart {...this.state} {...this.props}
pages={this.state.page}
Isitapopup={"false"}
Datacount={Datacount}
Datacountbool={true}
chakanjiexiboolindex={this.state.chakanjiexiboolindex}
chakanjiexibool={(e)=>this.chakanjiexibool(e)}
getitem_basketss={(id)=>this.getitem_basketss(id)}

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

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

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

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

Loading…
Cancel
Save