Merge branch 'dev_aliyun' into dev_hss

dev_aliyun_beta
SylorHuang 6 years ago
commit 10f356a3c8

@ -20,10 +20,20 @@ if question.question_type <= 2 #当为选择题或判断题时,只显示选
#TODO: 旧版本来一个题只有一个标准答案的新版又做成了一个题有多个标准答案exercise_choice_id存放的是标准答案的位置.. #TODO: 旧版本来一个题只有一个标准答案的新版又做成了一个题有多个标准答案exercise_choice_id存放的是标准答案的位置..
standard_answer_b = standard_answers_array.join("").include?(a.choice_position.to_s) standard_answer_b = standard_answers_array.join("").include?(a.choice_position.to_s)
user_answer_b = user_answer.include?(a.id) user_answer_b = user_answer.include?(a.id)
choice_text = a.choice_text
if question.question_type == 2
if choice_text == "对"
choice_text = "正确"
end
if choice_text == "错"
choice_text = "错误"
end
end
json.c_position (index+1) if ex_choice_random_boolean #当选项随机时,选项位置以此为准,否则不出现 json.c_position (index+1) if ex_choice_random_boolean #当选项随机时,选项位置以此为准,否则不出现
json.choice_id a.id json.choice_id a.id
# json.choice_text (edit_type.present? || question.question_type == 2) ? a.choice_text : "#{(index+65).chr}.#{a.choice_text}" # json.choice_text (edit_type.present? || question.question_type == 2) ? a.choice_text : "#{(index+65).chr}.#{a.choice_text}"
json.choice_text a.choice_text
json.choice_text choice_text
json.choice_position a.choice_position json.choice_position a.choice_position
if exercise_type == 1 || exercise_type == 4 #1为教师编辑/预览 试卷或问题2为空白试卷即标准答案和用户答案都不显示3为用户开始答题的显示4为老师评阅试卷或学生在截止后查看试卷 if exercise_type == 1 || exercise_type == 4 #1为教师编辑/预览 试卷或问题2为空白试卷即标准答案和用户答案都不显示3为用户开始答题的显示4为老师评阅试卷或学生在截止后查看试卷
json.standard_boolean standard_answer_b json.standard_boolean standard_answer_b
@ -36,6 +46,14 @@ if question.question_type <= 2 #当为选择题或判断题时,只显示选
if exercise_type == 1 || exercise_type == 4 #1为老师4为试卷截止且答案公开的情况 if exercise_type == 1 || exercise_type == 4 #1为老师4为试卷截止且答案公开的情况
json.standard_answer standard_answers_array json.standard_answer standard_answers_array
if question.question_type == 2 #返回答案的文字
standard_text = standard_answers_array.first.to_i == 1 ? "正确" : "错误"
else
array_text_answer = []
standard_answers_array.each{|a| array_text_answer.push((a+64).chr)}
standard_text = array_text_answer.join("")
end
json.standard_answer_show standard_text
end end
if exercise_type == 3 || exercise_type == 4 if exercise_type == 3 || exercise_type == 4
json.user_answer user_answer json.user_answer user_answer

Binary file not shown.

Before

Width:  |  Height:  |  Size: 53 KiB

After

Width:  |  Height:  |  Size: 107 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

@ -236,8 +236,7 @@ $(function(){
if(dragging) { if(dragging) {
clickX = e.pageX || e.originalEvent.touches[0].pageX;; clickX = e.pageX || e.originalEvent.touches[0].pageX;;
if(clickX > leftOffset+0&&clickX<leftOffset+1600) { if(clickX > leftOffset+0&&clickX<leftOffset+1600) {
console.log('resize') // console.log('resize')
//console.log(1);
lab.css('left', clickX - 7 - leftOffset + 'px'); lab.css('left', clickX - 7 - leftOffset + 'px');
$("#game_left_contents").width( clickX-leftOffset + 'px'); $("#game_left_contents").width( clickX-leftOffset + 'px');
nextW2 = clickX-leftOffset; nextW2 = clickX-leftOffset;
@ -314,10 +313,16 @@ $(function(){
window.top.__updateWebsshRows && window.top.__updateWebsshRows(rows) window.top.__updateWebsshRows && window.top.__updateWebsshRows(rows)
} }
window.refresh_editor_monaco = function(height) { window.refresh_editor_monaco = function(height) {
console.log('refresh_editor_monaco')
if (window.editor_monaco) { if (window.editor_monaco) {
height && $('#codetab_con_1').height(height) height && $('#codetab_con_1').height(height)
window.editor_monaco.layout(); window.editor_monaco.layout();
} }
// if ($('#game_operate_action').width() < 720) {
// $('#game_operate_action .time_limit').hide()
// } else {
// $('#game_operate_action .time_limit').show()
// }
} }
// end; // end;
//解決IE瀏覽器大小改變時webssh佈局變亂。 //解決IE瀏覽器大小改變時webssh佈局變亂。

@ -203,12 +203,12 @@ function generateNewIndexJsp() {
<script> <script>
(function() { (function() {
var _host = '/react/build/' var _host = '/react/build/'
/* /**/
if (window.location.host == 'pre-newweb.educoder.net') { if (window.location.host == 'pre-newweb.educoder.net') {
_host = 'https://testali-cdn.educoder.net/react/build/' _host = 'https://testali-cdn.educoder.net/react/build/'
} else if (window.location.host == 'www.educoder.net') { } else if (window.location.host == 'www.educoder.net') {
_host = 'https://ali-newweb.educoder.net/react/build/' _host = 'https://ali-newweb.educoder.net/react/build/'
}*/ }
document.write('<script type="text/javascript" src="' + _host + 'js/js_min_all.js"><\\/script>'); document.write('<script type="text/javascript" src="' + _host + 'js/js_min_all.js"><\\/script>');
document.write('<script type="text/javascript" src="' + _host + 'static/js/main.${matchResult[1]}.js"><\\/script>'); document.write('<script type="text/javascript" src="' + _host + 'static/js/main.${matchResult[1]}.js"><\\/script>');
})() })()

@ -167,7 +167,7 @@ class Bullsubdirectory extends Component{
<div> <div>
<div> <div>
<div className="fudonyingxiangysl"> <div className="fudonyingxiangysl">
<div style={{marginRight:"59px"}}> <div style={{marginRight:"60px"}}>
<span className="ysltitbt">{myname}</span> <span className="ysltitbt">{myname}</span>
</div> </div>
<div> <div>

@ -35,6 +35,7 @@ const buildColumns = (that) => {
dataIndex: 'login', dataIndex: 'login',
key: 'login', key: 'login',
align:'center', align:'center',
width:"10%",
className:"color-grey-6", className:"color-grey-6",
render: (login, record) => { render: (login, record) => {
return <span className="color-dark overflowHidden1" style={{maxWidth: '160px'}} return <span className="color-dark overflowHidden1" style={{maxWidth: '160px'}}
@ -57,9 +58,10 @@ const buildColumns = (that) => {
dataIndex: 'student_id', dataIndex: 'student_id',
key: 'student_id', key: 'student_id',
align:'center', align:'center',
width:"10%",
className:"color-grey-6", className:"color-grey-6",
render: (student_id, record) => { render: (student_id, record) => {
return <span className="color-dark overflowHidden1 "title={student_id && student_id.length > 10 ? student_id : ''} return <span className="color-dark overflowHidden1 " title={student_id && student_id.length > 10 ? student_id : ''}
style={{maxWidth: '160px'}} >{student_id}</span> style={{maxWidth: '160px'}} >{student_id}</span>
} }
}]; }];
@ -69,7 +71,7 @@ const buildColumns = (that) => {
dataIndex: 'course_group_name', dataIndex: 'course_group_name',
key: 'course_group_name', key: 'course_group_name',
align:'center', align:'center',
width:"50%", width:"40%",
className:"color-grey-6" className:"color-grey-6"
}) })
} }

@ -52,9 +52,16 @@ class ActionView extends Component {
componentDidMount() { componentDidMount() {
// request // request
window._tpiWidthResize = () => { window._tpiWidthResize = () => {
if (window.$('#actionView').width() < 580) { const _w = window.$('#actionView').width();
if (_w < 446) {
window.$('#time-consuming').hide()
// window.$('#time-consuming').hide()
} else if (_w < 746) {
// 文字放出来之前是 580
window.$('#time-consuming').show()
window.$('.time_limit').hide() window.$('.time_limit').hide()
} else { } else {
window.$('#time-consuming').show()
window.$('.time_limit').show() window.$('.time_limit').show()
} }
} }
@ -71,16 +78,27 @@ class ActionView extends Component {
<div className="-flex -layout-h" id="game_operate_action"> <div className="-flex -layout-h" id="game_operate_action">
<style>{` <style>{`
.time_limit { .time_limit {
margin-right: 16px; margin-right: 0px;
}
.spliter {
border-right: 1px solid;
padding-right: 8px;
margin-right: 8px;
height: 14px;
display: inline-block;
position: relative;
top: 3px;
} }
`}</style> `}</style>
<span className="mt10 -flex c_grey ml15" id="time-consuming"> <span className="mt10 -flex c_grey ml15" id="time-consuming">
{!!time_limit && {!!time_limit &&
<span className="time_limit">{`本关最大执行时间:${real_time_limit}`}</span>} <span className="time_limit">{`本关最大执行时间:${real_time_limit}`}
<span className="spliter"></span>
</span>}
{!gameBuilding && record ? {!gameBuilding && record ?
<Tooltip title={ "本次评测耗时(编译、运行总时间)" }> // <Tooltip title={ "本次评测耗时(编译、运行总时间)" }></Tooltip>
<span>{ record } </span> <span>本次评测耗时(编译运行总时间){ record } </span>
</Tooltip>
: ""} : ""}
</span> </span>

@ -14,13 +14,16 @@
min-width: 280px; min-width: 280px;
} }
#time-consuming .time_limit {
display: none;
}
.actionViewfirstButton { .actionViewfirstButton {
display: none !important; display: none !important;
} }
} }
@media (max-width: 800px) {
#time-consuming .time_limit {
display: none;
}
}
@media (max-width: 628px) { @media (max-width: 628px) {
.-header-right { display: none } .-header-right { display: none }
.exitBtn span { display: none } .exitBtn span { display: none }

@ -297,43 +297,49 @@ class DetailCardsEditAndAdd extends Component{
contentViewScrolladd=(e)=>{ contentViewScrolladd=(e)=>{
const {ChooseShixunList}=this.state;
//滑动到底判断 //滑动到底判断
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
// console.log("到达底部");
this.setState({
hometypepvisible:true
})
let pathId=this.props.pathid;
let {search,page,type,ChooseShixunListshixun_list}=this.state;
let newpage=page+1;
let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(type!=0){
url+="&type="+type;
}
axios.get(url).then((result)=>{
if(result.status===200){
let list =result.data.shixun_list;
for(var i=0; i<list.length; i++){
newChooseShixunListshixun_list.push(list[i])
}
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:type,
search:search,
page:newpage,
ChooseShixunListshixun_list:newChooseShixunListshixun_list
})
}
}).catch((error)=>{
console.log(error);
})
if(ChooseShixunList.shixun_list.length===0){
return
}else{
// console.log("到达底部");
this.setState({
hometypepvisible:true
})
let pathId=this.props.pathid;
let {search,page,type,ChooseShixunListshixun_list}=this.state;
let newpage=page+1;
let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
if(search!="" && search!=undefined){
url+="&search="+search;
}
if(type!=0){
url+="&type="+type;
}
axios.get(url).then((result)=>{
if(result.status===200){
let list =result.data.shixun_list;
for(var i=0; i<list.length; i++){
newChooseShixunListshixun_list.push(list[i])
}
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:type,
search:search,
page:newpage,
ChooseShixunListshixun_list:newChooseShixunListshixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
} }

@ -338,50 +338,59 @@ class DetailCardsEditAndEdit extends Component{
contentViewScrolledit=(e)=>{ contentViewScrolledit=(e)=>{
//滑动到底判断 //滑动到底判断
const {ChooseShixunList}=this.state;
if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){ if(e.currentTarget.scrollHeight-e.currentTarget.scrollTop===e.currentTarget.clientHeight){
this.setState({
hometypepvisible:true
})
// console.log("到达底部");
let {page,type,search,ChooseShixunListshixun_list}=this.state; if(ChooseShixunList.shixun_list.length===0){
return
}else{
this.setState({
hometypepvisible:true
})
// console.log("到达底部");
let newpage=page+1; let {page,type,search,ChooseShixunListshixun_list}=this.state;
let pathId=this.props.pathid; let newpage=page+1;
let newChooseShixunListshixun_list=ChooseShixunListshixun_list; let pathId=this.props.pathid;
let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage let newChooseShixunListshixun_list=ChooseShixunListshixun_list;
if(search!="" && search!=undefined){ let url='/paths/'+pathId+'/choose_subject_shixun.json?page='+newpage
url+="&search="+search;
}
if(type!=0){ if(search!="" && search!=undefined){
url+="&type="+type; url+="&search="+search;
} }
axios.get(url).then((result)=>{
if(result.status===200){ if(type!=0){
url+="&type="+type;
}
axios.get(url).then((result)=>{
if(result.status===200){
let list =result.data.shixun_list;
for(var i=0; i<list.length; i++){
newChooseShixunListshixun_list.push(list[i])
}
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:type,
page:newpage,
search:search,
ChooseShixunListshixun_list:newChooseShixunListshixun_list
})
}
}).catch((error)=>{
console.log(error);
})
}
let list =result.data.shixun_list;
for(var i=0; i<list.length; i++){
newChooseShixunListshixun_list.push(list[i])
}
this.setState({
ChooseShixunList:result.data,
hometypepvisible:false,
type:type,
page:newpage,
search:search,
ChooseShixunListshixun_list:newChooseShixunListshixun_list
})
}
}).catch((error)=>{
console.log(error);
})
} }

@ -475,7 +475,10 @@ export default class TPMevaluation extends Component {
} }
handpathoptionvalue=(value)=>{ handpathoptionvalue=(value)=>{
this.setState({ this.setState({
pathoptionvalue:value pathoptionvalue:value,
shixunfileexpectpicturepath:undefined,
shixunfilestandardpicturepath:undefined,
shixunfilepicturepath:undefined
}) })
} }
showrepositoryurltip=(type)=>{ showrepositoryurltip=(type)=>{
@ -640,19 +643,20 @@ export default class TPMevaluation extends Component {
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let{checkpointId}=this.state; let{checkpointId}=this.state;
let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json"; let url = "/shixuns/"+id+"/challenges/"+checkpointId+".json";
let newchallenge={
path:shixunfilepath,
exec_path:shixunfilepathplay,
show_type:pathoptionvalue===-1?undefined:pathoptionvalue,
original_picture_path:pathoptionvalue===-1?undefined:shixunfileexpectpicturepath===undefined?null:shixunfileexpectpicturepath,
expect_picture_path:pathoptionvalue===-1?undefined:shixunfilestandardpicturepath===undefined?null:shixunfilestandardpicturepath,
picture_path:pathoptionvalue===-1?undefined:shixunfilepicturepath===undefined?null:shixunfilepicturepath,
test_set_score:newscorevalue,
test_set_average:markvalue,
web_route:web_route===null?undefined:web_route
}
axios.put(url,{ axios.put(url,{
tab:1, tab:1,
challenge:{ challenge:newchallenge,
path:shixunfilepath,
exec_path:shixunfilepathplay,
show_type:pathoptionvalue,
original_picture_path:shixunfileexpectpicturepath,
expect_picture_path:shixunfilestandardpicturepath,
picture_path:shixunfilepicturepath,
test_set_score:newscorevalue,
test_set_average:markvalue,
web_route:web_route===null?undefined:web_route
},
test_set:evaluationlist test_set:evaluationlist
} }
).then((response) => { ).then((response) => {

@ -1,6 +1,6 @@
/*global __webpack_public_path__ */ /*global __webpack_public_path__ */
if (window._enableCDN && window.location.host == 'pre-newweb.educoder.net') { if ( window.location.host == 'pre-newweb.educoder.net') {
__webpack_public_path__ = 'http://testali-cdn.educoder.net/react/build/' __webpack_public_path__ = 'https://testali-cdn.educoder.net/react/build/'
} else if (window._enableCDN && window.location.host == 'www.educoder.net') { } else if ( window.location.host == 'www.educoder.net') {
__webpack_public_path__ = 'https://ali-newweb.educoder.net/react/build/' __webpack_public_path__ = 'https://ali-newweb.educoder.net/react/build/'
} }
Loading…
Cancel
Save