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

dev_aliyun_beta
杨树林 6 years ago
commit e61c39d8c5

@ -13,13 +13,8 @@ module SubjectsHelper
# 实训路径的所有用户获得的标签 # 实训路径的所有用户获得的标签
def user_shixun_tags challenge_ids, user_id def user_shixun_tags challenge_ids, user_id
logger.info("#####################")
ChallengeTag.joins("join games on challenge_tags.challenge_id = games.challenge_id"). ChallengeTag.joins("join games on challenge_tags.challenge_id = games.challenge_id").
where(challenge_id: challenge_ids, games: {status: 2, user_id: user_id}).pluck("challenge_tags.name").uniq where(challenge_id: challenge_ids, games: {status: 2, user_id: user_id}).pluck("challenge_tags.name").uniq
logger.info("#####################")
pass_challenge_ids = Game.where(status: 2, user_id: user_id, challenge_ids: challenge_ids).pluck(:challenge_id)
ChallengeTag.where(challenge_id: pass_challenge_ids).pluck(:name).uniq
logger.info("#####################")
end end
# 金课的课堂状态 0未开课1进行中2已结束 # 金课的课堂状态 0未开课1进行中2已结束

@ -82,16 +82,9 @@ class Subject < ApplicationRecord
end end
def my_subject_progress def my_subject_progress
logger.info("#-----------")
my_challenge_count = Game.joins(:challenge).where(user_id: User.current.id, status: 2, challenges: {shixun_id: shixuns.published_closed}). my_challenge_count = Game.joins(:challenge).where(user_id: User.current.id, status: 2, challenges: {shixun_id: shixuns.published_closed}).
pluck(:challenge_id).uniq.size pluck(:challenge_id).uniq.size
logger.info("#-----------") count = self.subject_challenge_count == 0 ? 0 : ((my_challenge_count.to_f / self.subject_challenge_count).round(2) * 100).to_i
new_challenge_count = Challenge.left_joins(:games)
.where(games: {user_id: current_user.id, status: 2}, shixun_id: shixuns.published_closed)
.uniq.count
logger.info("#-----------")
subject_challenge_count = shixuns.challenges_count
subject_challenge_count == 0 ? 0 : ((my_challenge_count.to_f / subject_challenge_count).round(2) * 100).to_i
end end
def my_consume_time def my_consume_time

@ -36,6 +36,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

@ -50,12 +50,11 @@ Rails.application.configure do
# Debug mode disables concatenation and preprocessing of assets. # Debug mode disables concatenation and preprocessing of assets.
# This option may cause significant delays in view rendering with a large # This option may cause significant delays in view rendering with a large
# number of complex assets. # number of complex assets.
config.assets.debug = false config.assets.debug = true
# Suppress logger output for asset requests. # Suppress logger output for asset requests.
config.assets.quiet = true config.assets.quiet = true
config.assets.compile = true
# config.assets.prefix = '/dev-assets' # config.assets.prefix = '/dev-assets'
# Raises error for missing translations # Raises error for missing translations

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

@ -446,8 +446,8 @@ table.text-file{}
/*-------------------------------实训路径-------------------------------*/ /*-------------------------------实训路径-------------------------------*/
.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png"); .path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png");
background-color: #081C4B; background-color: #131b39;
background-size: cover; /*background-size: cover;*/
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
} }

@ -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>');
})() })()

@ -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,8 +297,13 @@ 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){
if(ChooseShixunList.shixun_list.length===0){
return
}else{
// console.log("到达底部"); // console.log("到达底部");
this.setState({ this.setState({
hometypepvisible:true hometypepvisible:true
@ -334,6 +339,7 @@ class DetailCardsEditAndAdd extends Component{
console.log(error); console.log(error);
}) })
}
} }

@ -338,8 +338,12 @@ 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){
if(ChooseShixunList.shixun_list.length===0){
return
}else{
this.setState({ this.setState({
hometypepvisible:true hometypepvisible:true
}) })
@ -383,6 +387,11 @@ class DetailCardsEditAndEdit extends Component{
console.log(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";
axios.put(url,{ let newchallenge={
tab:1,
challenge:{
path:shixunfilepath, path:shixunfilepath,
exec_path:shixunfilepathplay, exec_path:shixunfilepathplay,
show_type:pathoptionvalue, show_type:pathoptionvalue===-1?undefined:pathoptionvalue,
original_picture_path:shixunfileexpectpicturepath, original_picture_path:pathoptionvalue===-1?undefined:shixunfileexpectpicturepath===undefined?null:shixunfileexpectpicturepath,
expect_picture_path:shixunfilestandardpicturepath, expect_picture_path:pathoptionvalue===-1?undefined:shixunfilestandardpicturepath===undefined?null:shixunfilestandardpicturepath,
picture_path:shixunfilepicturepath, picture_path:pathoptionvalue===-1?undefined:shixunfilepicturepath===undefined?null:shixunfilepicturepath,
test_set_score:newscorevalue, test_set_score:newscorevalue,
test_set_average:markvalue, test_set_average:markvalue,
web_route:web_route===null?undefined:web_route web_route:web_route===null?undefined:web_route
}, }
axios.put(url,{
tab:1,
challenge:newchallenge,
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/'
} }

@ -448,8 +448,8 @@ table.text-file{}
/*-------------------------------实训路径-------------------------------*/ /*-------------------------------实训路径-------------------------------*/
.path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png"); .path-head{width: 100%;height: 300px;background-image: url("/images/educoder/path.png");
background-color: #081C4B; background-color: #131b39;
background-size: cover; /*background-size: cover;*/
background-position: center; background-position: center;
background-repeat: no-repeat; background-repeat: no-repeat;
} }

Loading…
Cancel
Save