Merge branch 'dev_aliyun' into dev_tj

merge aliyun
dev_new_shixunsrepository
tangjiang 5 years ago
commit 523e0147f4

@ -140,8 +140,8 @@ class GraduationTopicsController < ApplicationController
update_graduation_topic_status
# 拒绝后将该学生移动到未分班中
student_member = @course.course_members.where(:user_id => student_graduation_topic.user_id).first
student_member.update_attributes(:course_group_id => 0) if student_member.present?
# student_member = @course.course_members.where(:user_id => student_graduation_topic.user_id).first
# student_member.update_attributes(:course_group_id => 0) if student_member.present?
student_graduation_topic.tidings.update_all(:status => 1)
Tiding.create(:user_id => student_graduation_topic.user_id, :trigger_user_id => current_user.id,
@ -175,10 +175,10 @@ class GraduationTopicsController < ApplicationController
teacher_group = TeacherCourseGroup.find_or_create_by!(:course_id => @course.id, :course_member_id => member.try(:id),
:user_id => @graduation_topic.tea_id,
:course_group_id => course_group.try(:id))
student_member = @course.course_members.where(:user_id => student_graduation_topic.user_id).first
student_member.update_attributes(:course_group_id => teacher_group.course_group_id) if student_member.present?
end
end
student_member = @course.course_members.where(:user_id => student_graduation_topic.user_id).first
student_member.update_attributes(:course_group_id => teacher_group.course_group_id) if student_member.present?
student_graduation_topic.tidings.update_all(:status => 1)
Tiding.create(:user_id => student_graduation_topic.user_id, :trigger_user_id => current_user.id,

@ -5,6 +5,7 @@ class HackUserLastestCodesController < ApplicationController
before_action :update_user_hack_status, only: [:code_debug, :code_submit]
before_action :require_auth_identity, only: [:add_notes]
before_action :require_manager_identity, only: [:show, :update_code, :restore_initial_code, :sync_code]
skip_before_action :check_sign, only: [:listen_result]
def show
@my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1

@ -1,6 +1,8 @@
class ModifyCourseGroupForCourses < ActiveRecord::Migration[5.2]
def change
groups = CourseGroup.where(course_id:3429).order("created_at desc").group(:name)
course_ids = [1135, 1208, 1309, 1528, 1563, 1800, 2025, 2086, 2346, 2915, 2917, 2919, 2954, 3064, 3136, 3387, 3423,
3429, 3467, 3651, 3704, 3732]
groups = CourseGroup.where(course_id: course_ids).order("created_at desc").group(:name)
ActiveRecord::Base.transaction do
groups.each do |g|
CourseGroup.where(name: g.name).where.not(id: g.id).each do |cg|
@ -11,7 +13,7 @@ class ModifyCourseGroupForCourses < ActiveRecord::Migration[5.2]
cg.attachment_group_settings.update_all(course_group_id: g.id)
cg.homework_group_reviews.update_all(course_group_id: g.id)
cg.homework_group_settings.update_all(course_group_id: g.id)
cg.teacher_course_groups.update_all(course_group_id: g.id)
#cg.teacher_course_groups.update_all(course_group_id: g.id)
cg.destroy!
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

@ -96,6 +96,7 @@ class PublishRightnow extends Component{
}
homeworkstartend=(arg_group_ids,endtime)=>{
debugger
if (this.usingCheckBeforePost && this.props.checkBeforePost) {
const goOn = this.props.checkBeforePost();
if (!goOn) {
@ -103,6 +104,7 @@ class PublishRightnow extends Component{
return;
}
}
debugger
const isPublish = this.props.isPublish;
let group_ids = arg_group_ids
if (this.usingCheckBeforePost) {
@ -110,13 +112,16 @@ class PublishRightnow extends Component{
return item.id
})
}
if (this.state.course_groups.length && (!group_ids || group_ids.length == 0)) {
this.props.showNotification('请至少选择一个分班');
return;
debugger
if(this.state.course_groups.length>0){
if (this.state.course_groups.length && (!group_ids || group_ids&&group_ids.length == 0)) {
this.props.showNotification('请至少选择一个分班');
return;
}
}
let data={}
if(arg_group_ids.length===0){
if(arg_group_ids&&arg_group_ids.length===0){
data = {
homework_ids: this.props.checkBoxValues,
end_time: endtime==="Invalid date"?undefined:endtime,

@ -41,7 +41,7 @@ class GraduationTasksSubmitedit extends Component{
componentDidMount(){
this.props.form.validateFields();
let workId=this.props.match.params.work_Id;
let url = "/graduation_works/"+workId+"/edit.json";
@ -367,7 +367,6 @@ class GraduationTasksSubmitedit extends Component{
let {fileList,selectmemberslist,workslist}=this.state;
this.Commoninterface(fileList,selectmemberslist,workslist);
// setTimeout(function () {
// GraduationTasksnewtype=true
@ -380,27 +379,37 @@ class GraduationTasksSubmitedit extends Component{
let workId=this.props.match.params.work_Id;
let userids=[];
// for(var list of selectmemberslist){
// if(list.user_id!=undefined&&list.user_id!=null){
// userids.push(list.user_id)
// }
// }
if(selectmemberslist!=undefined&&selectmemberslist.length>0){
selectmemberslist.map((list,key)=>{
if(list.user_id!=undefined&&list.user_id!=null){
userids.push(list.user_id)
}
})
}
for(var list of selectmemberslist){
if(list.user_id!=undefined&&list.user_id!=null){
userids.push(list.user_id)
}
}
let listid=[];
for(var list of fileList){
listid.push(list.response == undefined ? list.id : list.response.id)
// for(var list of fileList){
// listid.push(list.response == undefined ? list.id : list.response.id)
// }
if(fileList!=undefined&&fileList.length>0){
fileList.map((list,key)=>{
listid.push(list.response == undefined ? list.id : list.response.id)
})
}
console.log(userids)
this.props.form.validateFields((err, values) => {
this.props.form.validateFields((err, values) => {
// console.log(fileList);
if(values.description===undefined||values.description===""){
this.scrollToAnchor("valuestypes");
// debugger
return
}
@ -593,7 +602,7 @@ class GraduationTasksSubmitedit extends Component{
{description&&description?
<div>
{/*<Form onSubmit={this.handleSubmit} >*/}
<Form>
<div className="stud-class-set pd20 coursenavbox edu-back-white" id={"valuestypes"}>
<style>{`
.uploadBtn.ant-btn {
@ -831,13 +840,13 @@ class GraduationTasksSubmitedit extends Component{
<Form.Item>
{/*<Form.Item></Form.Item>*/}
<div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" onClick={()=>this.handleSubmit()} className="defalutSubmitbtn fl mr20">提交</Button>
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
<a onClick={this.goback} className="defalutCancelbtn fl">取消</a>
</div>
</Form.Item>
{/*</Form>*/}
</Form>
</div>
:""}

@ -382,24 +382,27 @@ class GraduationTasksSubmitnew extends Component{
Commoninterface = (fileList,selectmemberslist,workslist)=>{
// debugger
let userids=[];
if(selectmemberslist!=undefined&&selectmemberslist.length>0){
for(var list of selectmemberslist){
if(list.user_id!=undefined&&list.user_id!=null){
userids.push(list.user_id)
}
for(var list of selectmemberslist){
debugger
if(list.user_id!=undefined&&list.user_id!=null){
userids.push(list.user_id)
}
}
if(workslist.task_type===1){
userids=undefined
}
let listid=[];
for(var list of fileList){
listid.push(list.response.id)
if(fileList!=undefined&&fileList.length>0){
for(var list of fileList){
listid.push(list.response.id)
}
}
// if( GraduationTasksnewtype===true){
this.props.form.validateFields((err, values) => {
@ -836,7 +839,7 @@ render(){
<Form.Item>
<div className="clearfix mt30 mb30">
<Button type="primary" htmlType="submit" onClick={()=>this.handleSubmit()} className="defalutSubmitbtn fl mr20">提交</Button>
<Button type="primary" onClick={this.handleSubmit} className="defalutSubmitbtn fl mr20">提交</Button>
<a onClick={this.goback} className="defalutCancelbtn fl">取消</a>
</div>
</Form.Item>

@ -382,6 +382,7 @@ class Challengesjupyter extends Component {
setTimeout(()=>{
this.setState({
jupyter_url :response.data.url,
jupyter_port:response.data.port,
booljupyterurls:true,
})
},500);

@ -204,7 +204,7 @@ export const saveJupyterTpi = () => {
payload: false
});
});
}, 500)
}, 800)
}
}

Loading…
Cancel
Save