From c7688b981aac7d1643219fdc537d1a75afb1b05d Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 24 Oct 2015 15:27:27 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E6=8F=90=E7=A4=BA=E4=BF=A1=E6=81=AF=EF=BC=8C?= =?UTF-8?q?=E4=BB=A5=E4=BE=BF=E7=94=A8=E6=88=B7=E6=9B=B4=E6=B8=85=E6=A5=9A?= =?UTF-8?q?=E5=8C=BF=E8=AF=84=E8=BF=87=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_message_course.html.erb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb index 91ea32a62..d7042b6c2 100644 --- a/app/views/users/_user_message_course.html.erb +++ b/app/views/users/_user_message_course.html.erb @@ -157,7 +157,8 @@
  • 匿评截止:<%= ma.course_message.homework_detail_manual.evaluation_end %>  24点
  • <% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%> -

    请您尽早完成匿评!如果您在规定时间内未完成匿评,一次将被扣<%= ma.course_message.homework_detail_manual.absence_penalty %>分。

    +

    请您尽早完成匿评!如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。

    +

    例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分

    <% end%>
  • <%= time_tag(ma.created_at).html_safe %>
  • From a42a58fb42ec457e77d92141a673969b5e3955fa Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Sat, 24 Oct 2015 16:09:44 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=81=AB=E7=8B=90?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=E5=87=BA=E7=8E=B0=E5=A4=9A=E4=BD=99?= =?UTF-8?q?=E7=9C=81=E7=95=A5=E5=8F=B7=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/new_user.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css index 3b79af2bb..5ccf68516 100644 --- a/public/stylesheets/new_user.css +++ b/public/stylesheets/new_user.css @@ -1269,7 +1269,7 @@ a:hover.tijiao{ background:#0f99a9;} #cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;} #cboxNext{position:absolute; bottom:0px; left:63px; color:#444;} #cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;} -.system_message_style {line-height: 19.1px; max-width: 681px; work-wrap: break-word; word-break: break-all; text-overflow:clip;} +.system_message_style {line-height: 19.1px; max-width: 681px; work-wrap: break-word; word-break: break-all; text-overflow:clip; z-index:9999} .system_message_style img {max-width: 100%;} /*20150906关联项目LB*/ a.RalationIcon{ background: url(../images/homepage_icon.png) -183px -396px no-repeat; height:20px; display:block; padding-left:20px; color:#888888;} From 479b23a1fd77879841b57c157df84218c3aebc39 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 24 Oct 2015 16:12:03 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E9=87=8D=E5=A4=8D=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E7=BB=99=E5=87=BA=E6=8F=90=E7=A4=BA=20?= =?UTF-8?q?=E5=B9=B6=E4=B8=8D=E5=8F=91=E9=80=81=E6=B6=88=E6=81=AF=20?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E9=87=8D=E5=A4=8D=E5=8F=91=E9=80=81?= =?UTF-8?q?=E7=9B=B8=E5=90=8C=E7=9A=84=E7=94=B3=E8=AF=B7=20=E7=82=B9?= =?UTF-8?q?=E5=87=BB=E7=A1=AE=E5=AE=9A=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/services/courses_service.rb | 12 ++++++++++-- app/views/courses/join.js.erb | 10 +++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 1e0bfbec2..fb01e0398 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -300,6 +300,7 @@ class CoursesService #@state == 4 您加入的课程不存在 #@state == 5 您还未登录 #@state == 6 申请成功,请等待审核完毕 + #@state == 7 您已经发送过申请了,请耐心等待 #@state 其他 未知错误,请稍后再试 def join_course params,current_user course = Course.find_by_id params[:object_id] @@ -313,6 +314,8 @@ class CoursesService #如果加入角色为学生 if params[:role] == "10" @state = 3 + elsif current_user.allowed_to?(:as_teacher,course) + @state = 3 else #如果加入角色为教师或者教辅 CourseMessage.create(:user_id => course.tea_id, :course_id => course.id, :viewed => false,:content=> params[:role],:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest',:status=>0) @@ -330,8 +333,13 @@ class CoursesService StudentsForCourse.create(:student_id => current_user.id, :course_id => params[:object_id]) @state = 0 else - CourseMessage.create(:user_id => course.tea_id, :course_id => course.id, :viewed => false,:content=> params[:role],:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest',:status=>0) - @state = 6 + #如果已经发送过消息了,那么就要给个提示 + if CourseMessage.where("course_message_type = 'JoinCourseRequest' and user_id = #{course.tea_id} and content = #{params[:role]} and course_message_id = #{User.current.id} and course_id = #{course.id} and status = 0").count != 0 + @state = 7 + else + CourseMessage.create(:user_id => course.tea_id, :course_id => course.id, :viewed => false,:content=> params[:role],:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest',:status=>0) + @state = 6 + end end else @state = 1 diff --git a/app/views/courses/join.js.erb b/app/views/courses/join.js.erb index 53cf250d7..e2de705fe 100644 --- a/app/views/courses/join.js.erb +++ b/app/views/courses/join.js.erb @@ -5,21 +5,25 @@ $("#join_in_course_header").html("<%= escape_javascript(join_in_course_header(@c <% if @state == 0 %> alert("加入成功"); hideModal($("#popbox02")); -$("#try_join_course_link").replaceWith(" 'index',:course=>course.id, :host=>Setting.host_course)%>' target='_blank' class='blue_n_btn fr mt20'>提交作品"); -window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= course.id%>" +$("#try_join_course_link").replaceWith(" 'index',:course=>@course.id, :host=>Setting.host_course)%>' target='_blank' class='blue_n_btn fr mt20'>提交作品"); +window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" <% elsif @state == 1 %> alert("密码错误"); <% elsif @state == 2 %> alert("课程已过期\n请联系课程管理员重启课程。(在配置课程处)"); <% elsif @state == 3 %> alert("您已经加入了课程"); -window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= course.id%>" +window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" <% elsif @state == 4 %> alert("您加入的课程不存在"); <% elsif @state == 5 %> alert("您还未登录"); <% elsif @state == 6 %> alert("申请成功,请等待审核") +hideModal($("#popbox02")); +<% elsif @state == 7%> + alert("您已经发送过申请了,请耐心等待") + hideModal($("#popbox02")); <% else %> alert("未知错误,请稍后再试"); <% end %> From 4431f4664f5cce2abc6191708ac6bcf8e0a8ed67 Mon Sep 17 00:00:00 2001 From: lizanle <491823689@qq.com> Date: Sat, 24 Oct 2015 16:16:04 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E7=82=B9=E5=87=BB=E7=A1=AE=E5=AE=9A?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=85=B3=E9=97=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/courses/join.js.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/courses/join.js.erb b/app/views/courses/join.js.erb index e2de705fe..8e6f8ce20 100644 --- a/app/views/courses/join.js.erb +++ b/app/views/courses/join.js.erb @@ -4,7 +4,7 @@ $("#join_in_course_header").html("<%= escape_javascript(join_in_course_header(@c <% if @state %> <% if @state == 0 %> alert("加入成功"); -hideModal($("#popbox02")); +hidden_join_course_form(); $("#try_join_course_link").replaceWith(" 'index',:course=>@course.id, :host=>Setting.host_course)%>' target='_blank' class='blue_n_btn fr mt20'>提交作品"); window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>" <% elsif @state == 1 %> @@ -19,11 +19,11 @@ alert("您加入的课程不存在"); <% elsif @state == 5 %> alert("您还未登录"); <% elsif @state == 6 %> -alert("申请成功,请等待审核") -hideModal($("#popbox02")); +alert("申请成功,请等待审核"); +hidden_join_course_form(); <% elsif @state == 7%> - alert("您已经发送过申请了,请耐心等待") - hideModal($("#popbox02")); + alert("您已经发送过申请了,请耐心等待"); +hidden_join_course_form(); <% else %> alert("未知错误,请稍后再试"); <% end %>