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

competitions
hjm 5 years ago
commit 0c06258f7c

@ -160,7 +160,8 @@ class HomeworkCommonsController < ApplicationController
# 作品状态 0 未提交, 1 按时提交, 2 延迟提交
if params[:work_status].present?
work_status = params[:work_status].map{|status| status.to_i}
params_work_status = request.get? ? params[:work_status].split(",") : params[:work_status]
work_status = params_work_status.split(",").map{|status| status.to_i}
all_student_works = @student_works.left_joins(:myshixun)
@student_works = all_student_works.where(work_status: work_status)
@ -170,7 +171,8 @@ class HomeworkCommonsController < ApplicationController
# 分班情况
unless params[:course_group].blank?
group_user_ids = @course.students.where(course_group_id: params[:course_group]).pluck(:user_id)
group_ids = request.get? ? params[:course_group].split(",") : params[:course_group]
group_user_ids = @course.students.where(course_group_id: group_ids).pluck(:user_id)
# 有分组只可能是老师身份查看列表
@student_works = @student_works.where(user_id: group_user_ids)
end
@ -482,7 +484,7 @@ class HomeworkCommonsController < ApplicationController
publish_time = setting[:publish_time] == "" ? Time.now : setting[:publish_time]
# 截止时间为空时取发布时间后一个月
end_time = setting[:end_time] == "" ? Time.at(publish_time.to_time.to_i+30*24*3600) : setting[:end_time]
end_time = setting[:end_time]
HomeworkGroupSetting.where(homework_common_id: @homework.id, course_group_id: setting[:group_id]).
update_all(publish_time: publish_time, end_time: end_time)
setting_group_ids << setting[:group_id]
@ -1170,7 +1172,7 @@ class HomeworkCommonsController < ApplicationController
# 可立即截止的分班:统一设置则是用户管理的所有分班,否则是当前用户管理的分班中已发布且未截止的
charge_group_ids = @course.charge_group_ids(@current_user) # 当前用户管理的分班
group_ids = @homework.unified_setting ? charge_group_ids :
@homework.homework_group_settings.where(course_group_id: charge_group_ids).none_end.pluck(:course_group_id)
@homework.homework_group_settings.where(course_group_id: charge_group_ids).published_no_end.pluck(:course_group_id)
@course_groups = @course.course_groups.where(id: group_ids)
else
tip_exception("没有可截止的分班")

@ -452,7 +452,7 @@ module ExportHelper
end
end
out_file_name = "作品附件_#{homework_common&.course&.name}_#{homework_common.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.zip"
out_file_name = "作品附件_#{homework_common.name}_#{Time.now.strftime('%Y%m%d_%H%M%S')}.zip"
out_file_name.gsub!(" ", "-")
out_file_name.gsub!("/", "_")
out_file = find_or_pack(homework_common, homework_common.user_id, digests.sort){

@ -6,6 +6,6 @@ class HomeworkGroupSetting < ApplicationRecord
scope :none_published, -> {where("homework_group_settings.publish_time IS NULL OR homework_group_settings.publish_time > ?", Time.now)}
scope :published_no_end, -> {where("homework_group_settings.publish_time IS NOT NULL AND homework_group_settings.publish_time < ?
and homework_group_settings.end_time > ?", Time.now, Time.now)}
scope :none_end, -> {where("homework_group_settings.end_time IS NOT NULL AND homework_group_settings.end_time > ?", Time.now)}
scope :none_end, -> {where("homework_group_settings.end_time IS NULL or homework_group_settings.end_time > ?", Time.now)}
end

@ -287,7 +287,8 @@ class BoardsNew extends Component{
const isAdmin = this.props.isAdmin()
const courseId=this.props.match.params.coursesId;
const boardId = this.props.match.params.boardId
const isCourseEnd = this.props.isCourseEnd()
const isCourseEnd = this.props.isCourseEnd();
document.title=this.props.coursedata&&this.props.coursedata.name;
return(
<div className="newMain ">
<AddDirModal {...this.props}

@ -526,8 +526,10 @@ class TopicDetail extends Component {
const isAdmin = this.props.isAdmin()
// TODO 图片上传地址
const courseId=this.props.match.params.coursesId;
const boardId = this.props.match.params.boardId
const isCourseEnd = this.props.isCourseEnd()
const boardId = this.props.match.params.boardId;
const isCourseEnd = this.props.isCourseEnd();
document.title=this.props.coursedata&&this.props.coursedata.name;
return (
<div className="edu-back-white edu-class-container edu-position course-message topicDetail" id="yslforum_index_list"> {/* fl with100 */}
<style>{`

@ -171,6 +171,8 @@ class CommonWorkAppraise extends Component{
let category_id=this.props.match.params.category_id;
let studentWorkId=this.props.match.params.studentWorkId;
const isAdmin = this.props.isAdmin()
document.title=course_name&&course_name;
return(
<WorkDetailPageHeader
{...this.props} {...this.state}

@ -225,6 +225,7 @@ class CommonWorkDetailIndex extends Component{
// console.log(params);
let exportUrl = `/homework_commons/${workId}/works_list.zip?${queryString.stringify(params)}`
let exportResultUrl = `/homework_commons/${workId}/works_list.xlsx?${queryString.stringify(params)}`
document.title=course_name === undefined ? "" : course_name;
return (
<div>
<PublishRightnow ref={this.publishModal} showActionButton={false} {...this.props} checkBoxValues={[workId]}

@ -161,8 +161,8 @@ class NewWork extends Component{
doNew: this.doNew,
doEdit: this.doEdit,
}
return(
document.title=this.state.course_name && this.state.course_name
return(
<div className="newMain">
<div className="educontent mt20 mb50">
<CBreadcrumb items={[

@ -57,8 +57,9 @@ class ExerciceNew extends Component{
const courseId=this.props.match.params.coursesId;
const isEdit = this.isEdit
const isEdit = this.isEdit;
document.title=this.props.coursedata&&this.props.coursedata.name;
return(
<div className="newMain exerciseNew">

@ -612,6 +612,7 @@ class ExerciseReviewAndAnswer extends Component{
let isStudent =this.props.isStudent();
const { current_user } = this.props
// console.log(data&&data.exercise.user_name)
document.title=courseName&&courseName.name;
return(
<div className="newMain" style={{paddingTop:"0px"}}>
<Spin size="large" spinning={isSpin}>

@ -271,7 +271,7 @@ class Testpapersettinghomepage extends Component{
// TODO
// console.log(Commonheadofthetestpaper.exercise_status);
document.title=this.props.coursedata&&this.props.coursedata.name;
return(
<div className="newMain clearfix ">
{/*<DownloadMessage*/}

@ -316,6 +316,8 @@ class GraduationTaskDetail extends Component{
setTab:this.setTab,
getdatas:this.getdatas
}
document.title=questionslist&&questionslist.course_name;
return(
<div className="newMain clearfix">
{

@ -537,7 +537,7 @@ class GraduationTasksSubmitedit extends Component{
},
};
document.title=workslist&&workslist.course_name;
return(
<React.Fragment>

@ -560,10 +560,10 @@ render(){
},
};
console.log(this.props)
// console.log(this.props)
document.title=workslist&&workslist.course_name;
return(
<React.Fragment>

@ -146,6 +146,8 @@ class GraduationTasksappraise extends Component{
let graduation_id=datalist===undefined?"":datalist.graduation_id;
let task_id=datalist===undefined?"":datalist.task_id;
// console.log(datalist);
document.title=datalist&&datalist.course_name;
return(
<React.Fragment>

@ -328,7 +328,7 @@ class GraduationTasksedit extends Component{
};
document.title=this.props.current_user&&this.props.current_user.course_name;
return(
<React.Fragment>

@ -313,6 +313,7 @@ class GraduationTasksnew extends Component {
};
// this.ifHasAnchorJustScorll();
// console.log(this.props.current_user.course_name)
document.title=this.props.current_user&&this.props.current_user.course_name;
return (
<React.Fragment>

@ -100,7 +100,7 @@ class GraduateTopicDetail extends Component{
let {course_id,graduation_topic_id}=this.props.match.params;
const isStudent =this.props.isStudent();
const isAdmin =this.props.isAdmin();
document.title=tableData && tableData.course_name;
return(
<div className="newMain">
<div className="educontent mt10 mb50">

@ -323,6 +323,7 @@ class GraduateTopicNew extends Component{
};
// console.log("dfsf");
// console.log(this.props);
document.title=course_name===undefined?"":course_name;
return(
<div className="newMain ">
<style>{`

@ -115,6 +115,7 @@ class PollDetailIndex extends Component{
const { current_user } = this.props;
const isAdmin =this.props.isAdmin();
const isStudent = this.props.isStudent();
document.title=this.props.coursedata&&this.props.coursedata.name;
return(
<div className="newMain">
<DownloadMessageysl

@ -301,6 +301,7 @@ class PollInfo extends Component{
const { current_user } = this.props
let isAdmin=this.props.isAdmin();
let isStudent=this.props.isStudent();
document.title=courseName&&courseName;
return(
<div className="newMain" style={{paddingTop:"0px"}}>
{/*<p style={{height:"60px"}}></p>*/}

@ -2765,6 +2765,7 @@ class PollNew extends Component {
// console.log(this.state.projects===undefined?"":this.state.projects.poll_questions)
var displaymysave = (mysave === true) ? "" : "display:none;";
document.title=this.props.coursedata&&this.props.coursedata.name;
return (
<div className="newMain">
{/*提示*/}

@ -95,6 +95,7 @@ class ShixunWorkDetails extends Component {
}
render() {
let{data}=this.state;
document.title=data&&data.course_name;
return (
<Spin size="large" spinning={this.state.spinning} style={{marginTop:"13%"}}>
<div className="newMain clearfix ">

@ -310,7 +310,7 @@ class ShixunWorkReport extends Component {
// let showAppraiseModals=this.props&&this.props.isAdminOrTeacher()===true?work_comment===null||work_comment===undefined?false:true:work_comment===null||work_comment===undefined?false:true;
let showAppraiseModals=work_comment===null||work_comment===undefined?false:true;
document.title=data&&data.course_name;
return (
data===undefined?"":<Spin indicator={antIcon} spinning={this.state.spinning}>

Loading…
Cancel
Save