Merge branches 'dev_aliyun' and 'dev_new_shixunsrepository' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_new_shixunsrepository

dev_new_shixunsrepository
杨树明 5 years ago
commit cb84b0d372

@ -6,10 +6,10 @@ class Weapps::ChallengesController < Weapps::BaseController
# 关卡有展示效果 || 选择题 || jupyter实训 || vnc || 隐藏代码窗口 || html+css实训
# @challenge.show_type != -1 || @challenge.st == 1 || @shixun.is_jupyter? || @shixun.vnc ||
# @shixun.hide_code? || (@shixun.small_mirror_name & ["Css", "Html", "Web"]).present?
play = @shixun.is_jupyter? || @shixun.vnc ||
play = @challenge.st == 1 || @shixun.is_jupyter? || @shixun.vnc ||
@shixun.hide_code? || (@shixun.small_mirror_name & ["Css", "Html", "Web"]).present?
if @challenge.st != 1 && play
if play
normal_status(-5, "该关卡暂不支持小程序")
else
render_ok

@ -387,7 +387,7 @@ class Course < ApplicationRecord
end
def max_activity_time
course_acts.pluck(:updated_at).max
course_activities.pluck(:updated_at).max
end
# 课堂作业数

@ -44,7 +44,7 @@ class Admins::SchoolDailyStatisticService < ApplicationService
courses = Course.where(is_delete: 0, school_id: ids).group('school_id')
course_map = courses.count
nearly_course_time_map = courses.joins(:course_acts).maximum('course_activities.updated_at')
nearly_course_time_map = courses.joins(:course_activities).maximum('course_activities.updated_at')
active_course_map = courses.where(is_end: false).count
shixun_map = Shixun.joins(user: :user_extension).where(user_extensions: { identity: :teacher, school_id: ids })

@ -17,7 +17,7 @@ namespace :migrate_course_resource do
if atta.course_second_category.present?
target_category = CourseSecondCategory.find_by(name: atta.course_second_category.name, course_id: target_course.id, category_type: "attachment")
unless target_category.present?
course_module = Course.course_modules.find_by(module_type: "attachment")
course_module = target_course.course_modules.find_by(module_type: "attachment")
target_category = CourseSecondCategory.create(name: atta.course_second_category.name, course_id: target_course.id,
category_type: "attachment", course_module_id: course_module&.id,
position: course_module&.course_second_categories&.count.to_i + 1)
@ -53,7 +53,7 @@ namespace :migrate_course_resource do
if homework.course_second_category.present?
target_category = CourseSecondCategory.find_by(name: homework.course_second_category.name, course_id: target_course.id, category_type: "shixun_homework")
unless target_category.present?
course_module = Course.course_modules.find_by(module_type: "shixun_homework")
course_module = target_course.course_modules.find_by(module_type: "shixun_homework")
target_category = CourseSecondCategory.create(name: homework.course_second_category.name, course_id: target_course.id,
category_type: "shixun_homework", course_module_id: course_module&.id,
position: course_module&.course_second_categories&.count.to_i + 1)
@ -193,6 +193,16 @@ namespace :migrate_course_resource do
target_course = Course.find_by(id: target_id)
return if source_course.blank? || target_course.blank?
# 先把target——course中的老师创建分班权限
target_course.teachers.each do |member|
if member.teacher_course_groups.blank?
target_course.course_groups.each do |group|
TeacherCourseGroup.create!(course_group_id: group.id, course_id: target_course.id, course_member_id: member&.id, user_id: member&.user_id)
end
end
end
source_course.course_members.where(role: %i[PROFESSOR ASSISTANT_PROFESSOR]).each do |teacher|
new_member = target_course.teachers.find_by(user_id: teacher.user_id)
unless new_member.present?
@ -208,25 +218,37 @@ namespace :migrate_course_resource do
end
new_user_ids = []
group.course_members.where(role: 4).each do |member|
new_member = target_course.course_members.find_by(user_id: member.user_id)
new_member = target_course.students.find_by(user_id: member.user_id)
if new_member.present?
new_member.update_column("course_group_id", new_group.id)
new_member.update_attributes(course_group_id: new_group.id)
else
CourseMember.create!(course_id: target_course.id, course_group_id: new_group.id, user_id: member.user_id, role: member.role)
new_user_ids << member.user_id
end
end
# CourseAddStudentCreateWorksJob.perform_later(target_course.id, new_user_ids) unless new_user_ids.blank?
CourseAddStudentCreateWorksJob.perform_later(target_course.id, new_user_ids) unless new_user_ids.blank?
group.teacher_course_groups.each do |teacher_group|
member = CourseMember.find_by(course_id: target_course.id, user_id: teacher_group.user_id, role: %i[CREATOR PROFESSOR ASSISTANT_PROFESSOR])
if member.present?
if member.present? && !member.teacher_course_groups.where(course_group_id: new_group.id).exists?
TeacherCourseGroup.create!(course_group_id: new_group.id, course_id: target_course.id, course_member_id: member&.id, user_id: member&.user_id)
end
end
end
user_ids = []
source_course.students.where(course_group_id: 0).each do |member|
new_member = target_course.students.find_by(user_id: member.user_id)
if new_member.present?
new_member.update_attributes(course_group_id: 0)
else
CourseMember.create!(course_id: target_course.id, course_group_id: 0, user_id: member.user_id, role: member.role)
user_ids << member.user_id
end
end
CourseAddStudentCreateWorksJob.perform_later(target_course.id, user_ids) unless user_ids.blank?
end
end

@ -175,6 +175,9 @@ class ListPageIndex extends Component{
isexcellent:excellent
})
}
updatabanners=()=>{
this.refs.CoursesBanner.updatabanner()
}
render() {
let {yslGuideone} =this.state;
// console.log("98");
@ -187,7 +190,7 @@ class ListPageIndex extends Component{
<div>
<div className="newMain clearfix">
{/*头部banner*/}
<CoursesBanner {...this.props} ispostexcellenttype={(excellent)=>this.ispostexcellenttype(excellent)}></CoursesBanner>
<CoursesBanner ref={"CoursesBanner"} {...this.props} ispostexcellenttype={(excellent)=>this.ispostexcellenttype(excellent)}></CoursesBanner>
{/*下面是指引哦*/}
{/*{yslGuideone!==undefined?*/}
{/*(*/}
@ -249,7 +252,7 @@ class ListPageIndex extends Component{
></Route>
<Route path="/courses/:coursesId/teachers"
render={
(props) => (<TeacherList {...this.props} {...props} {...this.state} />)
(props) => (<TeacherList updatabanners={()=>this.updatabanners()} {...this.props} {...props} {...this.state} />)
}
></Route>
{/* 学生列表*/}

@ -42,7 +42,7 @@ class ModalWrapper extends Component{
{
`
body {
overflow: hidden !important;
width: calc(100%) !important;
}
`
}

@ -954,7 +954,7 @@ class Coursesleftnav extends Component{
{
`
body {
overflow: hidden !important;
width: calc(100%) !important;
}
`
}

@ -130,7 +130,9 @@ class CoursesHome extends Component{
<div className="newMain clearfix">
<style>
{
`
` ::-webkit-scrollbar {
width: 0px !important;
}
.courses-head{
width: 100%;
height: 300px;

@ -153,7 +153,7 @@ class HomeworkModal extends Component{
{
`
body {
overflow: hidden !important;
width: calc(100%) !important;
}
`
}

@ -43,6 +43,16 @@ class ModalsRename extends Component{
centered={true}
className={"Navmodal"}
>
{this.props.Navmodalnametype===undefined?false:this.props.Navmodalnametype===true?<style>
{
`
body{
width: calc(100%) !important;
}
`
}
</style>:""}
<div className={"fl mt5"}>{this.props.Navname}名称</div>
<Input placeholder={"请输入名称最大限制60个字符"}
className={"inputNav greyInput fl"}

@ -443,7 +443,7 @@ class NewShixunModel extends Component{
<div>
<style>
{
`body{ overflow: hidden !important; }
`body{ width: calc(100%) !important; }
.ant-drawer-content{ overflow:auto !important; background: #f5f5f5; }
.yslbottomsj{position: absolute;bottom: -8px;}
.ant-drawer-close{

@ -64,6 +64,7 @@ function CourseGroupChooser({ course_groups, isAdminOrCreator = true, item, inde
<Checkbox.Group onChange={(e) => onCheckAllChange(e, item, index)} value={[checkAllValue]}>
<Checkbox
value={true}
disabled={!isAdminOrCreator}
style={{ marginRight: '6px' }} onClick={() => {}}
>全选</Checkbox>
</Checkbox.Group>

@ -382,6 +382,7 @@ class studentsList extends Component{
.then((response) => {
if (response.data.status == 0) {
this.props.showNotification('修改成功')
this.props.updatabanners()
const newArray = ids.map((item) => {return {id: item, name: this.state.course_groups_map[item]}});
this.setState(
(prevState) => ({

@ -1126,7 +1126,7 @@ class ShixunHomework extends Component{
{
`
body {
overflow: hidden !important;
width: calc(100%) !important;
}
`
}

@ -27,7 +27,7 @@ render() {
{
`
body{
overflow: hidden !important;
width: calc(100%) !important;
}
.ant-modal-body {
padding: 20px 40px;

@ -109,9 +109,9 @@ positon:0
{( item.category === 1 ? "单选题" : "多选题" )}
</div> */}
<div className="clearfix">
<span className="fl" style={{"color":"#8B9399"}}>{index+1}.</span>
<div id={`choose_subject_${index+1}`} className="fl choiceMD">
<textarea style={{display:'none'}}>{item.subject}</textarea>
<span className="fl" style={{"color":"#8B9399"}}>{index+1}.</span><textarea style={{display:'none'}}>{item.subject}</textarea>
</div>
</div>

@ -166,6 +166,9 @@ class ShixunPathSearch extends Component{
<style>
{
`
::-webkit-scrollbar {
width: 0px !important;
}
.pathImg{
width: 100%;
height: 300px;

Loading…
Cancel
Save