From 2faddd7d753b6cc125b060d994da573b000b75ca Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 10:00:26 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=88=86=E7=BB=84=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=9F=BA=E4=BA=8E=E9=A1=B9=E7=9B=AE=E5=AE=9E?= =?UTF-8?q?=E6=96=BD=E9=BB=98=E8=AE=A4=E5=8B=BE=E9=80=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_user_group_attr.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb index 652cb723a..a815d85e7 100644 --- a/app/views/users/_user_group_attr.html.erb +++ b/app/views/users/_user_group_attr.html.erb @@ -10,7 +10,7 @@

提醒:勾选后各小组必须在Trustie平台创建项目,教师可随时观察平台对各小组最新进展的实时统计。

From b65e84d166d574ce421b8f99b6fda14694ed8e84 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 12:47:34 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9C=AA=E7=AD=94=E6=B5=8B=E9=AA=8C?= =?UTF-8?q?=E7=9A=84=E5=AD=A6=E7=94=9F=E5=9C=A8=E6=B5=8B=E9=AA=8C=E6=88=AA?= =?UTF-8?q?=E6=AD=A2=E6=97=B6=E9=97=B4=E5=88=B0=E4=BA=86=E5=90=8E=E7=AE=97?= =?UTF-8?q?=E4=BD=9C=E9=9B=B6=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/exercise_controller.rb | 10 ++-------- app/views/exercise/_student_exercise.html.erb | 3 +++ lib/tasks/exercise_publish.rake | 12 ++++++++++++ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/controllers/exercise_controller.rb b/app/controllers/exercise_controller.rb index 8fa90ea46..25b5dacec 100644 --- a/app/controllers/exercise_controller.rb +++ b/app/controllers/exercise_controller.rb @@ -16,10 +16,7 @@ class ExerciseController < ApplicationController exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2) end end - end_exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now) - end_exercises.each do |exercise| - exercise.update_column('exercise_status', 3) - end + if @course.is_public == 0 && !(User.current.member_of_course?(@course)||User.current.admin?) render_403 return @@ -46,10 +43,7 @@ class ExerciseController < ApplicationController exercise.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2) end end - end_exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now) - end_exercises.each do |exercise| - exercise.update_column('exercise_status', 3) - end + unless User.current.member_of_course?(@course) || User.current.admin? render_403 return diff --git a/app/views/exercise/_student_exercise.html.erb b/app/views/exercise/_student_exercise.html.erb index bbbe9026d..3bcd6b83f 100644 --- a/app/views/exercise/_student_exercise.html.erb +++ b/app/views/exercise/_student_exercise.html.erb @@ -75,6 +75,9 @@
  • <% if exercise.created_at%> <%= Time.parse(format_time(exercise.created_at)).strftime("%m-%d %H:%M")%>  + <% if @exercise.end_time <= exercise.created_at %> + [未答] + <% end %> <% end %>
  • diff --git a/lib/tasks/exercise_publish.rake b/lib/tasks/exercise_publish.rake index a27c6a6fb..13ae8c484 100644 --- a/lib/tasks/exercise_publish.rake +++ b/lib/tasks/exercise_publish.rake @@ -14,9 +14,21 @@ namespace :exercise_publish do end task :end => :environment do + include ExerciseHelper exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now) exercises.each do |exercise| + course = exercise.course exercise.update_column('exercise_status', 3) + course.student.each do |student| + if ExerciseUser.where("user_id = ? && exercise_id = ?",student.student_id,exercise.id).empty? + ExerciseUser.create(:user_id => student.student_id, :exercise_id => exercise.id, :start_at => exercise.end_time, :status => true,:score=>0) + end +=begin + s_score = calculate_student_score(exercise, student.student) + exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", student.student_id, exercise.id).first + exercise_user.update_attributes(:score => s_score) +=end + end end end end From ca77af9221a9e3eb8a1a678d85a02837a42c1238 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 13:13:23 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=89=A3=E5=88=86=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/users/_course_homework.html.erb | 14 ++++++++++++-- app/views/users/_user_homework_detail.html.erb | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb index 60b8e6728..f02105fb6 100644 --- a/app/views/users/_course_homework.html.erb +++ b/app/views/users/_course_homework.html.erb @@ -97,11 +97,21 @@
    -
    + +
    + 迟交扣分:<%= activity.late_penalty%>分 +
    +
    匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%> 00:00
    -
    +
    +
    +
    +
    + 缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品 +
    +
    匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%> 23:59
    diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb index d9421f5ea..5bfe1814d 100644 --- a/app/views/users/_user_homework_detail.html.erb +++ b/app/views/users/_user_homework_detail.html.erb @@ -102,11 +102,21 @@
    -
    + +
    + 迟交扣分:<%= homework_common.late_penalty%>分 +
    +
    匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%> 00:00
    -
    +
    +
    +
    +
    + 缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品 +
    +
    匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%> 23:59
    From c230ff5bed99cddaf5af17b3d8d443f8c8a1b9ee Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 13:16:01 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=99=AE=E9=80=9A=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=8A=A5500?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_choose_group_member.html.erb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/views/student_work/_choose_group_member.html.erb b/app/views/student_work/_choose_group_member.html.erb index dc650cfa8..c47c31d9d 100644 --- a/app/views/student_work/_choose_group_member.html.erb +++ b/app/views/student_work/_choose_group_member.html.erb @@ -1,3 +1,4 @@ +<% if @homework.homework_detail_group %>
    请从<%= @homework.homework_detail_group.base_on_project == 1 ? '项目成员':'课程成员' %>中添加小组成员
    @@ -105,4 +106,5 @@ <% end %> <% end %> }); - \ No newline at end of file + +<% end %> \ No newline at end of file From a7c006c59fec38264de2f239632939562a3325b5 Mon Sep 17 00:00:00 2001 From: cxt Date: Fri, 18 Dec 2015 15:02:36 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E7=9A=84=E5=B1=95=E5=BC=80=E6=9B=B4=E5=A4=9A=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_show.html.erb | 74 +------------------ app/views/boards/_course_show_detail.html.erb | 70 ++++++++++++++++++ app/views/boards/show.js.erb | 2 +- 3 files changed, 73 insertions(+), 73 deletions(-) create mode 100644 app/views/boards/_course_show_detail.html.erb diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 306a0c7ce..de3b038e6 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -1,20 +1,3 @@ -<%= content_for(:header_tags) do %> - <%= import_ke(enable_at: false, prettify: false) %> - <%= javascript_include_tag "init_activity_KindEditor" %> -<% end %> - - - <% if topic %> - <%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %> - <% end %> - <% end %> - - <% if topics.count == 10 %> -
    展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %>
    - <% end %> -<% end%> + <%= render :partial=> 'course_show_detail',:locals =>{:topics => @topics, :page => 0} %>
    - - diff --git a/app/views/boards/_course_show_detail.html.erb b/app/views/boards/_course_show_detail.html.erb new file mode 100644 index 000000000..c324f1d69 --- /dev/null +++ b/app/views/boards/_course_show_detail.html.erb @@ -0,0 +1,70 @@ +<%= content_for(:header_tags) do %> + <%= import_ke(enable_at: false, prettify: false) %> + <%= javascript_include_tag "init_activity_KindEditor" %> +<% end %> + + +<% if topics%> + <% topics.each do |topic| %> + + <% if topic %> + <%= render :partial => 'users/course_message', :locals => {:activity => topic, :user_activity_id => topic.id} %> + <% end %> + <% end %> + + <% if topics.count == 10 %> +
    展开更多<%= link_to "", boards_topic_path(@board, :course_id => @board.course.id ,:page => page), :id => "more_topic_link", :remote => "true", :class => "none" %>
    + <% end %> +<% end%> + + \ No newline at end of file diff --git a/app/views/boards/show.js.erb b/app/views/boards/show.js.erb index dd5fa4688..c088abce5 100644 --- a/app/views/boards/show.js.erb +++ b/app/views/boards/show.js.erb @@ -1 +1 @@ -$("#show_more_course_topic").replaceWith("<%= escape_javascript( render :partial => 'boards/course_show',:locals => {:topics => @topics, :page => @page} )%>"); \ No newline at end of file +$("#show_more_course_topic").replaceWith("<%= escape_javascript( render :partial => 'boards/course_show_detail',:locals => {:topics => @topics, :page => @page} )%>"); \ No newline at end of file