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

issues25489
cxt 5 years ago
commit 5fc10548e7

@ -20,3 +20,44 @@ codemirror merge.js
修改过的地方: 修改过的地方:
Raphaël 2.1.3 Raphaël 2.1.3
Element= -> __Element= Element= 替换成了 __Element= Element= -> __Element= Element= 替换成了 __Element=
js_min_all的一些tpi的js
1、
code: TPI拖拽功能 begin
tpi的上下和左右的拖拽
2、
code: window.__tpiOnResize
onRepositoryViewExpand或window resize以后需要调用这个方法重新计算命令行区域大小
3、
code: window.refresh_editor_monaco
monaco重新layout计算高宽
4、
code: reply_to_dis、 $("#all_task_show").on("click", function(e){ 、 $("#all_task_index").on("click", function(e){ 、
$("#next_step").live("click", function(){ 、 $("#prev_step").live("click", function(){ 、
function open_answer(game, myshixun, choose){ 、 function choice_answer(st, nThis){
function check_tab(allClassName,addClassName,item){ 、 function toggle_test_case_choose(t_case, id){
function toggle_test_case(open, output, actual_output, id, power){ 、
CodeMirror_fromTextArea 、 function game_praise(obj_id, obj_type){ 、 function game_tread(obj_id){
function setupAjaxIndicatorBase() { 、 function match_specific_symbol(str){
function code_evaluation(test_sets 、 function pop_box_new(value, Width, Height){
貌似没用到基本上page目录或TPIContextProvider里搜索不到的代码都是没用到的可以优化去除掉。
code:
sure_box_redirect_btn 这些弹框的话,有的会有用到,有的没用到的可以尝试删除
5、
code function tpi_html_show(newCode){ 、 function is_cdn_link(contents){
html显示效果时用到的脚本
6、
code // 这里重新加一次事件监听,不在原有事件的基础上增加代码了
新加了一次拖拽事件
7、
code
function create_editorMD_4comment(id, width, high, placeholder, imageUrl, callback, otherOptions){
老的md编辑器初始化方法考虑用心的TPMMDEditor代替

@ -237,7 +237,7 @@ class OneSelfOrderModal extends Component{
}) })
return return
} }
arr.push(items.end_time) arr.push(handleDateString(items.end_time))
} }
} }
}) })
@ -273,7 +273,7 @@ class OneSelfOrderModal extends Component{
render(){ render(){
let {group_ids,endtime,course_groups}=this.state; let {group_ids,endtime,course_groups}=this.state;
console.log(this.props.modaltype) // console.log(this.props.modaltype)
let course_groupstype=course_groups===undefined||course_groups.length===0; let course_groupstype=course_groups===undefined||course_groups.length===0;
// TODO course_groups为空时的处理 // TODO course_groups为空时的处理
return( return(

@ -347,7 +347,7 @@ class Studentshavecompletedthelist extends Component {
render: (text, record) => ( render: (text, record) => (
<span> <span>
{ {
<span style={{color: '#999999', textAlign: "center",width:'100px'}}></span> <span style={{color: '#999999', textAlign: "center",width:'100px'}}></span>
} }
</span> </span>
) )
@ -1036,9 +1036,9 @@ class Studentshavecompletedthelist extends Component {
<span style={{textAlign: "center", color: '#999999'}} <span style={{textAlign: "center", color: '#999999'}}
>--</span> >--</span>
: :
<a style={{textAlign: "center"}} className="color-blue" <a style={{textAlign: "center"}} className="color-blue"
target="_blank" target="_blank"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a> href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
} }
</span> </span>
@ -1231,10 +1231,10 @@ class Studentshavecompletedthelist extends Component {
{record.finalscore==="--"? {record.finalscore==="--"?
<span style={{textAlign: "center", color: '#999999'}} <span style={{textAlign: "center", color: '#999999'}}
>--</span> >--</span>
: :
<a style={{textAlign: "center"}} className="color-blue" <a style={{textAlign: "center"}} className="color-blue"
target="_blank" target="_blank"
href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a> href={`/courses/${this.props.match.params.coursesId}/exercises/${this.props.match.params.Id}/users/${record.myid}`}>{record.finalscore}</a>
} }
</span> </span>
@ -2664,7 +2664,7 @@ class Studentshavecompletedthelist extends Component {
{ {
this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status===0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status===1 ? this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status===0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status===1 ?
<div className="edu-back-white"> <div className="edu-back-white">
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
: :
<div> <div>
@ -2883,7 +2883,7 @@ class Studentshavecompletedthelist extends Component {
{ {
this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 1 ? this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 1 ?
<div className="edu-back-white"> <div className="edu-back-white">
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
: :
<div className={"educontent mb20"}> <div className={"educontent mb20"}>
@ -2970,7 +2970,7 @@ class Studentshavecompletedthelist extends Component {
{ {
this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 1 ? this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 0 || this.props.Commonheadofthetestpaper&&this.props.Commonheadofthetestpaper.exercise_status === 1 ?
<div className="edu-back-white"> <div className="edu-back-white">
<NoneData></NoneData> <NoneData></NoneData>
</div> </div>
: :
<div> <div>

@ -1868,6 +1868,10 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} }
@ -1881,6 +1885,10 @@ class Listofworksstudentone extends Component {
} }
} else { } else {
if (work_efficiency === false) { if (work_efficiency === false) {
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} else if (item.title === "效率分") { } else if (item.title === "效率分") {
@ -1902,6 +1910,10 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} }
@ -1915,6 +1927,10 @@ class Listofworksstudentone extends Component {
} }
} else { } else {
if (work_efficiency === false) { if (work_efficiency === false) {
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} else if (item.title === "效率分") { } else if (item.title === "效率分") {
@ -2052,6 +2068,10 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} }
@ -2065,6 +2085,10 @@ class Listofworksstudentone extends Component {
} }
} else { } else {
if (this.state.work_efficiency === false) { if (this.state.work_efficiency === false) {
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} else if (item.title === "效率分") { } else if (item.title === "效率分") {
@ -2087,6 +2111,10 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} }
@ -2100,6 +2128,10 @@ class Listofworksstudentone extends Component {
} }
} else { } else {
if (this.state.work_efficiency === false) { if (this.state.work_efficiency === false) {
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} else if (item.title === "效率分") { } else if (item.title === "效率分") {
@ -2476,7 +2508,7 @@ class Listofworksstudentone extends Component {
} }
// 设置数据 // 设置数据 老师列表数据处理
seacthdatat = (teacherdata, student_works, work_efficiency, course_group_info) => { seacthdatat = (teacherdata, student_works, work_efficiency, course_group_info) => {
let {page, limit} = this.state; let {page, limit} = this.state;
@ -2522,6 +2554,7 @@ class Listofworksstudentone extends Component {
// pageSize: 20, //一页显示几条 // pageSize: 20, //一页显示几条
// current: page, // current: page,
// } // }
if (work_efficiency === false) { if (work_efficiency === false) {
if (JSON.stringify(course_group_info) === "[]" || course_group_info === undefined || course_group_info === null) { if (JSON.stringify(course_group_info) === "[]" || course_group_info === undefined || course_group_info === null) {
//这里没有分班 没有 关卡得分 没有效率分 //这里没有分班 没有 关卡得分 没有效率分
@ -2534,9 +2567,15 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "当前成绩") { if (item.title === "当前成绩") {
continue continue
} }
@ -2552,6 +2591,10 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} else { } else {
@ -2575,6 +2618,10 @@ class Listofworksstudentone extends Component {
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "当前成绩") { if (item.title === "当前成绩") {
continue continue
} }
@ -2590,6 +2637,10 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} else { } else {
@ -2608,6 +2659,10 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} }
@ -2623,6 +2678,10 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} else { } else {
@ -2645,6 +2704,10 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} }
@ -2677,6 +2740,10 @@ class Listofworksstudentone extends Component {
if (item.title === "关卡得分") { if (item.title === "关卡得分") {
continue continue
} }
if (item.key === "efficiencyscore") {
continue
}
if (item.title === "效率分") { if (item.title === "效率分") {
continue continue
} }

@ -37,6 +37,7 @@ class ShixunWorkReport extends Component {
showAppraiseModaltype:false, showAppraiseModaltype:false,
work_comment_hidden:undefined, work_comment_hidden:undefined,
work_comment:undefined, work_comment:undefined,
has_commit: false,
} }
} }
@ -111,7 +112,8 @@ class ShixunWorkReport extends Component {
data:result.data, data:result.data,
work_comment_hidden:result.data.work_comment_hidden, work_comment_hidden:result.data.work_comment_hidden,
work_comment:result.data.work_comment, work_comment:result.data.work_comment,
spinning:false spinning: false,
has_commit: result.data.has_commit
}) })
} }
@ -303,7 +305,7 @@ class ShixunWorkReport extends Component {
} }
render() { render() {
let{data,showAppraiseModaltype,work_comment_hidden,work_comment} =this.state; let {data, showAppraiseModaltype, work_comment_hidden, work_comment, has_commit} = this.state;
let category_id=data===undefined?"":data.category===null?"":data.category.category_id; let category_id=data===undefined?"":data.category===null?"":data.category.category_id;
let homework_common_id=data===undefined?"":data.homework_common_id; let homework_common_id=data===undefined?"":data.homework_common_id;
@ -557,22 +559,24 @@ class ShixunWorkReport extends Component {
showAppraiseModal={(type,id,show,hidden)=>this.showAppraiseModal(type,id,show,hidden)} showAppraiseModal={(type,id,show,hidden)=>this.showAppraiseModal(type,id,show,hidden)}
/> />
{
has_commit === false ? "" :
<div>
<div className="stud-class-set bor-bottom-greyE mt17">
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitle ml20 pd20">图形统计</div>
<Shixunechart
data={data}
/>
</div>
</div>
<div className="stud-class-set bor-bottom-greyE mt17"> <div className="stud-class-set bor-bottom-greyE">
<div className="clearfix edu-back-white poll_list">
<div className="font-16 color-dark-21 shixunreporttitle ml20 pd20">图形统计</div>
<Shixunechart
data={data}
/>
</div>
</div>
<div className="stud-class-set bor-bottom-greyE">
<div className="clearfix edu-back-white poll_list pad40px"> <div className="clearfix edu-back-white poll_list pad40px">
<div className="font-16 color-dark-21 shixunreporttitle ml20 pd20">实训详情</div> <div className="font-16 color-dark-21 shixunreporttitle ml20 pd20">实训详情</div>
<style> <style>
{` {`
.poll_list a{ .poll_list a{
padding:0px !important; padding:0px !important;
} }
@ -580,63 +584,67 @@ class ShixunWorkReport extends Component {
background: #4CACFF; background: #4CACFF;
} }
`} `}
</style> </style>
{ {
data&&data.shixun_detail===undefined?"":data.shixun_detail.map((item,key)=>{ data && data.shixun_detail === undefined ? "" : data.shixun_detail.map((item, key) => {
return( return (
<div id={"id"+item.position} key={key} className={"mb20"}> <div id={"id" + item.position} key={key} className={"mb20"}>
<div className="font-16 color-dark-21 ml20 mr20"> <div className="font-16 color-dark-21 ml20 mr20">
<p className="clearfix mb20"> <p className="clearfix mb20">
<span className="panel-inner-icon mr15 fl mt3 backgroud4CACFF"> <span className="panel-inner-icon mr15 fl mt3 backgroud4CACFF">
<i className="fa fa-code font-16 color_white"></i> <i className="fa fa-code font-16 color_white"></i>
</span> </span>
<span className="fl mt3 font-14"> <span className="fl mt3 font-14">
<span className="font-bd mr15">{item.position}</span> <span className="font-bd mr15">{item.position}</span>
<Link to={/tasks/+item.game_identifier} > <Link to={/tasks/+item.game_identifier} >
<span className={"font-14"}>{item.subject}</span> <span className={"font-14"}>{item.subject}</span>
</Link> </Link>
</span> </span>
</p> </p>
<Coursesshixundetails <Coursesshixundetails
data={item.outputs} data={item.outputs}
/>
</div>
{item.st===0?item.passed_code===null?"":<div className="font-16 color-dark-21 ml20 mr20">
<div className="bor-grey-e mt15">
<p className="clearfix pt5 pb5 pl15 pr15 back-f6-grey codebox">
<span className="fl">最近通过的代码</span>
<span className="fr codeboxright">{item.path}</span>
</p>
<div className="test-code bor-top-greyE">
<li className="clearfix">
<CodeMirror
value={item.passed_code}
options={{
// mode: 'xml',
theme: 'default',
lineNumbers: true,
// extraKeys: {"Ctrl-Q": "autocomplete"}, // 快捷键
indentUnit: 4, //代码缩进为一个tab的距离
matchBrackets: true,
autoRefresh: true,
smartIndent: true,//智能换行
styleActiveLine: true,
lint: true,
readOnly: "nocursor"
}}
/> />
</li> </div>
{item.st === 0 ? item.passed_code === null ? "" :
<div className="font-16 color-dark-21 ml20 mr20">
<div className="bor-grey-e mt15">
<p className="clearfix pt5 pb5 pl15 pr15 back-f6-grey codebox">
<span className="fl">最近通过的代码</span>
<span className="fr codeboxright">{item.path}</span>
</p>
<div className="test-code bor-top-greyE">
<li className="clearfix">
<CodeMirror
value={item.passed_code}
options={{
// mode: 'xml',
theme: 'default',
lineNumbers: true,
// extraKeys: {"Ctrl-Q": "autocomplete"}, // 快捷键
indentUnit: 4, //代码缩进为一个tab的距离
matchBrackets: true,
autoRefresh: true,
smartIndent: true,//智能换行
styleActiveLine: true,
lint: true,
readOnly: "nocursor"
}}
/>
</li>
</div>
</div>
</div> : ""}
</div> </div>
</div> )
</div>:""} })
</div> }
) </div>
}) </div>
} </div>
</div> }
</div>
</div> </div>
</div> </div>

@ -72,11 +72,16 @@ class Osshackathon extends Component {
} }
PaginationTask=(pageNumber)=>{ PaginationTask=(pageNumber)=>{
this.setState({ let {hackathonedit}=this.state;
page:pageNumber if(hackathonedit===true){
}) this.props.showNotification(`请先保存或者关闭编辑状态`);
let {page,limit,search}=this.state; }else {
this.getosshackathon(pageNumber,limit,search) this.setState({
page: pageNumber
})
let {page, limit, search} = this.state;
this.getosshackathon(pageNumber, limit, search)
}
} }
hackathonedit=(id)=>{ hackathonedit=(id)=>{
@ -126,23 +131,29 @@ class Osshackathon extends Component {
} }
editSignupentry=(id,name,description)=>{ editSignupentry=(id,name,description)=>{
// 管理员编辑项目 let {hackathonedit}=this.state;
this.setState({ if(hackathonedit===true){
Osshackathonmodeltype:true this.props.showNotification(`请先保存或者关闭编辑状态`);
})
if(id===undefined){
this.setState({
modelid:undefined,
modelname:undefined,
modeldescription:undefined
})
}else{ }else{
this.setState({ // 管理员编辑项目
modelid:id, this.setState({
modelname:name, Osshackathonmodeltype:true
modeldescription:description })
}) if(id===undefined){
this.setState({
modelid:undefined,
modelname:undefined,
modeldescription:undefined
})
}else{
this.setState({
modelid:id,
modelname:name,
modeldescription:description
})
}
} }
} }
hideeditSignupentry=(id)=>{ hideeditSignupentry=(id)=>{
@ -155,12 +166,17 @@ class Osshackathon extends Component {
delSignupentry=(id)=>{ delSignupentry=(id)=>{
// 管理员删除项目 // 管理员删除项目
this.props.confirm({ let {hackathonedit}=this.state;
content: `是否确认删除该项目?`, if(hackathonedit===true){
onOk: () => { this.props.showNotification(`请先保存或者关闭编辑状态`);
this.delSignupentrys(id) }else {
} this.props.confirm({
}) content: `是否确认删除该项目?`,
onOk: () => {
this.delSignupentrys(id)
}
})
}
} }
delSignupentrys=(id)=>{ delSignupentrys=(id)=>{
let url=`/osshackathon/${id}.json`; let url=`/osshackathon/${id}.json`;
@ -180,14 +196,20 @@ class Osshackathon extends Component {
onsearchvalue=(value)=>{ onsearchvalue=(value)=>{
this.setState({ let {hackathonedit}=this.state;
search:value if(hackathonedit===true){
}) this.props.showNotification(`请先保存或者关闭编辑状态`);
if(value.length>300){ }else {
this.props.showNotification(`搜索字数大于300个字`); this.setState({
search:value
})
if(value.length>300){
this.props.showNotification(`搜索字数大于300个字`);
}
let {page,limit,search}=this.state;
this.getosshackathon(page,limit,value)
} }
let {page,limit,search}=this.state;
this.getosshackathon(page,limit,value)
} }
onsetsearchvalue=(e)=>{ onsetsearchvalue=(e)=>{
@ -240,7 +262,7 @@ class Osshackathon extends Component {
<Col span={3} className={"fr textright"}> <Col span={3} className={"fr textright"}>
<div> <div>
报名整<span className={"color-red"}>{data&&data.hackathon.hackathon_users_count}</span> 报名总<span className={"color-red"}>{data&&data.hackathon.hackathon_users_count}</span>
</div> </div>
</Col> </Col>

@ -197,7 +197,7 @@ class Osshackathonmodel extends Component{
placeholder={"请输入项目描述"} placeholder={"请输入项目描述"}
onInput={(e)=>this.Textarea_comment(e)} onInput={(e)=>this.Textarea_comment(e)}
value={this.state.Textarea_comment} value={this.state.Textarea_comment}
maxlength={500} maxlength={250}
/> />
<li style={{height:"20px",lineHeight:"20px"}} className={textareavaltype===true?"color-red mt20 mb10":"none"}><span>评阅内容至少有一个不为空</span></li> <li style={{height:"20px",lineHeight:"20px"}} className={textareavaltype===true?"color-red mt20 mb10":"none"}><span>评阅内容至少有一个不为空</span></li>

Loading…
Cancel
Save