Merge branch 'develop' into dev_aliyun

dev_tj
daiao 5 years ago
commit 74f44671f5

@ -16,6 +16,10 @@ namespace :subjects do
passed_count = (study_count == sr.study_count ? sr.passed_count : data.passed_count)
course_used_count = (study_count == sr.study_count ? sr.course_used_count : data.course_used_count)
school_used_count = (study_count == sr.study_count ? sr.school_used_count : data.school_used_count)
unless course_study_count == sr.course_study_count &&
passed_count == sr.passed_count &&
course_used_count == sr.course_used_count &&
school_used_count == sr.school_used_count
update_params = {
study_count: study_count,
course_study_count: course_study_count,
@ -26,6 +30,7 @@ namespace :subjects do
}
sr.update_attributes!(update_params)
end
end
puts("---------------------data_statistic_end")
Rails.logger.info("---------------------data_statistic_end")
end
@ -40,6 +45,11 @@ namespace :subjects do
data = Subjects::CourseUsedInfoService.call(subject)
data.each do |key|
scr = SubjectCourseRecord.find_or_create_by!(school_id: key[:school_id], subject_id: subject.id)
unless key[:school_name] == scr.school_name &&
key[:course_count] == scr.course_count &&
key[:student_count] == scr.student_count &&
key[:choice_shixun_num] == scr.choice_shixun_num &&
key[:choice_shixun_frequency] == scr.choice_shixun_frequency
update_params = {
school_name: key[:school_name],
course_count: key[:course_count],
@ -50,6 +60,7 @@ namespace :subjects do
scr.update_attributes(update_params)
end
end
end
puts("---------------------course_info_statistic_end")
Rails.logger.info("---------------------course_info_statistic_end")
end
@ -64,6 +75,13 @@ namespace :subjects do
data = Subjects::ShixunUsedInfoService.call(subject)
data.each do |key|
ssi = SubjectShixunInfo.find_or_create_by!(shixun_id: key[:shixun_id], subject_id: subject.id)
unless key[:challenge_count] == ssi.challenge_count &&
key[:course_count] == ssi.course_count &&
key[:school_count] == ssi.school_count &&
key[:used_count] == ssi.used_count &&
key[:passed_count] == ssi.passed_count &&
key[:evaluate_count] == ssi.evaluate_count &&
key[:passed_ave_time] == ssi.passed_ave_time
update_params = {
stage: key[:stage],
shixun_name: key[:name],
@ -78,12 +96,13 @@ namespace :subjects do
ssi.update_attributes(update_params)
end
end
end
puts("---------------------shixun_info_statistic_end")
Rails.logger.info("---------------------shixun_info_statistic_end")
end
task user_info_statistic: :environment do
puts("---------------------user_info_statistic_begin")
puts("---------------------vim ./")
Rails.logger.info("---------------------user_info_statistic_begin")
subjects = Subject.where(status: 2)
subjects.find_each(batch_size: 100) do |subject|
@ -91,6 +110,11 @@ namespace :subjects do
data = Subjects::UserUsedInfoService.call(subject)
data.each do |key|
sui = SubjectUserInfo.find_or_create_by!(user_id: key[:user_id], subject_id: subject.id)
unless key[:passed_myshixun_count] == sui.passed_myshixun_count &&
key[:passed_games_count] == sui.passed_games_count &&
key[:code_line_count] == sui.code_line_count &&
key[:evaluate_count] == sui.evaluate_count &&
key[:cost_time] == sui.cost_time
update_params = {
username: key[:name],
passed_myshixun_count: key[:passed_myshixun_count],
@ -101,6 +125,8 @@ namespace :subjects do
}
sui.update_attributes(update_params)
end
end
end
puts("---------------------user_info_statistic_end")
Rails.logger.info("---------------------user_info_statistic_end")

@ -77,20 +77,20 @@ class Challengesjupyter extends Component {
}else{
if(boxoffsetHeigh>=300){
if(this.props&&this.props.is_jupyter===true&&this.props&&this.props.user.user_identity==="学生"){
this.setState({
opentitletype:false,
isopentitletype:"greater",
boxoffsetHeigh:boxoffsetHeigh
})
}else{
// if(this.state.enlarge===false){
// this.setState({
// opentitletype:false,
// isopentitletype:"greater",
// boxoffsetHeigh:boxoffsetHeigh
// })
// }else{
//
// }
this.setState({
opentitletype:true,
isopentitletype:"greater",
boxoffsetHeigh:boxoffsetHeigh
})
}
}else{
this.setState({
isopentitletype:"Less",
@ -284,7 +284,7 @@ class Challengesjupyter extends Component {
.then((result) => {
if (result.data.status === 0) {
// this.props.showNotification(`应用成功`);
console.log("应用成功了");
// console.log("应用成功了");
this.props.showNotification('保存成功!');
setTimeout(() => {
this.setState({
@ -645,8 +645,8 @@ class Challengesjupyter extends Component {
`
}
</style>
{this.props&&this.props.is_jupyter===true&&this.props&&this.props.user.user_identity==="学生"?"":this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
{/*this.state.enlarge===false?"":*/}
{this.state.isopentitletype==="Less"?"":this.state.opentitletype===true?<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
<a className={"font-14 color-grey-9"}>阅读全文 <i className={"iconfont icon-jiantou9 font-14"}></i></a>
</Divider>:<Divider dashed={true} onClick={()=>this.opentitle()} className={"pointer Breadcrumbfont color-grey-9 "}>
<a className={"font-14 color-grey-9"}>收起全文 <i className={"iconfont icon-changyongtubiao-xianxingdaochu-zhuanqu- font-14"}></i></a>
@ -725,10 +725,11 @@ class Challengesjupyter extends Component {
</div>
</div>
:""
: ""
:
(
admin===true||business===true||mysidentity===true?
<div style={{
height: '63px',
}} className={enlarge?"shixunjianjiecballenges edu-back-white intermediatecenter fangdaone":"shixunjianjiecballenges edu-back-white mt20"}>

Loading…
Cancel
Save