单个课程作业不显示的BUG修改,加入班级时如果班级已被删除需要提示!
This commit is contained in:
parent
f0840d0f31
commit
86731c34d5
|
@ -99,12 +99,13 @@ module Mobile
|
|||
homework_expose :coursename #所属班级名
|
||||
|
||||
expose :current_user_is_teacher, if: lambda { |instance, options| options[:user] } do |instance, options|
|
||||
current_user = options[:user]
|
||||
current_user_is_teacher = false
|
||||
current_user_is_teacher = is_course_teacher(current_user,instance.course)
|
||||
current_user_is_teacher
|
||||
if instance[:current_user_is_teacher].nil?
|
||||
current_user = options[:user]
|
||||
current_user_is_teacher = false
|
||||
current_user_is_teacher = is_course_teacher(current_user,instance.course)
|
||||
current_user_is_teacher
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
end
|
|
@ -277,7 +277,7 @@ class WechatsController < ActionController::Base
|
|||
user: user
|
||||
)
|
||||
ws = WechatService.new
|
||||
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台", user.login, format_time(Time.now))
|
||||
ws.binding_succ_notice(user.id, "您已成功绑定Trustie平台!", user.login, format_time(Time.now))
|
||||
render :json => {status:0, msg: "绑定成功"}
|
||||
rescue Exception=>e
|
||||
render :json => {status: -1, msg: e.message}
|
||||
|
|
|
@ -335,6 +335,7 @@ class CoursesService
|
|||
8, '您已经是该班级的教师了',
|
||||
9, '您已经是该班级的教辅了',
|
||||
10, '您已经是该班级的管理员了',
|
||||
11, '该班级不存在或已被删除啦',
|
||||
'未知错误,请稍后再试'
|
||||
]
|
||||
end
|
||||
|
@ -348,6 +349,8 @@ class CoursesService
|
|||
if course
|
||||
if course_endTime_timeout? course
|
||||
@state = 2
|
||||
elsif course[:is_delete] == 1
|
||||
@state = 11
|
||||
else
|
||||
if current_user.member_of_course?(course) #如果已经是成员
|
||||
member = course.members.where("user_id=#{current_user.id} and course_id=#{course.id}")[0]
|
||||
|
@ -632,7 +635,7 @@ class CoursesService
|
|||
:homework_submit_num => bid.student_works.count,
|
||||
:homework_status_student => get_homework_status( bid),:homework_status_teacher => homework_status_desc( bid),
|
||||
:student_evaluation_part => get_evaluation_part( bid ,3),
|
||||
:ta_evaluation_part => get_evaluation_part( bid ,2),:homework_anony_type => bid.homework_type == 1 && !bid.homework_detail_manual.nil?}
|
||||
:ta_evaluation_part => get_evaluation_part( bid ,2),:homework_anony_type => bid.homework_type == 1 && !bid.homework_detail_manual.nil?,:current_user_is_teacher => is_course_teacher}
|
||||
|
||||
end
|
||||
|
||||
|
|
|
@ -229,7 +229,7 @@ class WechatService
|
|||
color:"#707070"
|
||||
},
|
||||
remark:{
|
||||
value:"绑定成功后可使用微信查看Trustie平台最新动态",
|
||||
value:"绑定成功后可使用微信查看Trustie平台最新动态。",
|
||||
color:"#707070"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -59,7 +59,7 @@ app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$lo
|
|||
}).then(function (response) {
|
||||
console.log(response.data);
|
||||
if (response.data.status != 0) {
|
||||
vm.alertService_1.showMessage('错误', response.data.message);
|
||||
vm.alertService_1.showMessage('提示', response.data.message);
|
||||
} else {
|
||||
vm.alertService_1.showMessage('提示', '加入课程成功');
|
||||
vm.alertService_3.invite = "";
|
||||
|
@ -68,9 +68,8 @@ app.controller('ClassListController', ['$scope', 'config', 'auth', '$http', '$lo
|
|||
});
|
||||
} else {
|
||||
if(vm.alertService_3.invite){
|
||||
vm.alertService_1.showMessage('错误', '邀请码格式不正确');
|
||||
vm.alertService_1.showMessage('提示', '邀请码格式不正确');
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
};
|
||||
|
|
|
@ -46,7 +46,15 @@ app.controller('SendClassListController', ['$scope', '$http','$routeParams', 'co
|
|||
}).then(function(response){
|
||||
console.log(response.data);
|
||||
if(response.data.status == 0){
|
||||
vm.alertService.showMessage('发送成功', '题目已发送到目标班级的作业列表,但需要您访问Trustie网站设置发布和截止时间,以激活相应作业,谢谢!', function () {
|
||||
var tip = "";
|
||||
if (vm.myresource_sendIndex == 1){
|
||||
tip = "课件已发送到目标班级。";
|
||||
}
|
||||
else if(vm.myresource_sendIndex == 2){
|
||||
tip = "题目已发送到目标班级的作业列表,但需要您访问Trustie网站设置发布和截止时间,以激活相应作业,谢谢。";
|
||||
}
|
||||
|
||||
vm.alertService.showMessage('发送成功', tip, function () {
|
||||
window.history.back();
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue