From caae04e77eb1ca8c1c946fe3e6ab0b626447198a Mon Sep 17 00:00:00 2001 From: Tim Date: Wed, 14 Sep 2016 19:57:17 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=BB=84=E5=91=98=E8=AF=84=E5=88=86?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../student_work/_evaluation_un_group_member_work.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/student_work/_evaluation_un_group_member_work.html.erb b/app/views/student_work/_evaluation_un_group_member_work.html.erb index 85ae7a70d..842e1c899 100644 --- a/app/views/student_work/_evaluation_un_group_member_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_member_work.html.erb @@ -67,7 +67,7 @@ - + From f880ab1c14131d6a26d47a6f0029a3a5966bc6c2 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 14 Sep 2016 20:02:43 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/_evaluation_un_group_work.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/student_work/_evaluation_un_group_work.html.erb b/app/views/student_work/_evaluation_un_group_work.html.erb index c937ac9e9..3c3a02281 100644 --- a/app/views/student_work/_evaluation_un_group_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_work.html.erb @@ -26,7 +26,7 @@
助教:<%= student_work.teaching_asistant_score.nil? ? "--" : format("%.1f",student_work.teaching_asistant_score)%>
<% if @homework.anonymous_comment == 0 %>
匿评: -
+
<% if student_work.student_score.nil? %> 未参与 <% else %> @@ -48,7 +48,7 @@ <% end %>
成绩: <% score = student_work.work_score %> -
+
<%= score.nil? ? "--" : format("%.1f",score<0 ? 0 : score)%> <% unless score.nil?%>
From abdc08c7afb9ff49efc231701b1a5bf6ce974b47 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 14 Sep 2016 20:58:15 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E5=93=81?= =?UTF-8?q?=E6=97=B6=E5=B7=A6=E4=BE=A7=E5=AF=BC=E8=88=AA=E6=A0=8F=E5=AF=B9?= =?UTF-8?q?=E5=BA=94=E7=8F=AD=E7=BA=A7=E7=9A=84=E5=AF=BC=E8=88=AA=E6=A0=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_common_controller.rb | 8 ++++++++ app/controllers/student_work_controller.rb | 4 ++-- app/views/student_work/edit.html.erb | 2 ++ app/views/student_work/new.html.erb | 6 ++++-- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 5e290d678..b8c6a4a0a 100644 --- a/app/controllers/homework_common_controller.rb +++ b/app/controllers/homework_common_controller.rb @@ -85,6 +85,14 @@ class HomeworkCommonController < ApplicationController homework_detail_manual = @homework.homework_detail_manual || HomeworkDetailManual.new @homework.end_time = params[:homework_common][:end_time] || Time.now @homework.course_id = params[:course_id] + if params[:homework_type] && params[:homework_type].to_i != @homework.homework_type + if @homework.homework_type == 2 + @homework.homework_detail_programing.destroy if @homework.homework_detail_programing + @homework.homework_tests.destroy_all + elsif @homework.homework_type == 3 + @homework.homework_detail_group.destroy if @homework.homework_detail_group + end + end @homework.homework_type = params[:homework_type].to_i || @homework.homework_type anonymous = params[:homework_common][:anonymous_comment] ? params[:homework_common][:anonymous_comment].to_i : 1 if anonymous != @homework.anonymous_comment diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index a6dec8161..e8c061b5c 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -571,7 +571,7 @@ class StudentWorkController < ApplicationController @student_work = StudentWork.new #end respond_to do |format| - format.html{ render :layout => "new_base_user"} + format.html{ render :layout => "base_courses"} end end @@ -657,7 +657,7 @@ class StudentWorkController < ApplicationController render_403 else respond_to do |format| - format.html{ render :layout => "new_base_user"} + format.html{ render :layout => "base_courses"} end end end diff --git a/app/views/student_work/edit.html.erb b/app/views/student_work/edit.html.erb index 931cdc1de..657bdf486 100644 --- a/app/views/student_work/edit.html.erb +++ b/app/views/student_work/edit.html.erb @@ -2,6 +2,7 @@ <%= import_ke(enable_at: true, prettify: false, init_activity: false) %> <%= javascript_include_tag 'homework','baiduTemplate' %> <% end %> +
编辑作品
@@ -83,6 +84,7 @@ <% end%>
+
-
+
+
提交作品
@@ -297,4 +298,5 @@
<% end%>
-
\ No newline at end of file +
+
From 0d12acd42a16f84576835b338abcd84c647d617b Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 14 Sep 2016 21:11:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../_evaluation_un_group.html.erb | 2 +- .../_evaluation_un_group_work.html.erb | 2 +- .../student_work/_group_work_show.html.erb | 145 ------------------ 3 files changed, 2 insertions(+), 147 deletions(-) delete mode 100644 app/views/student_work/_group_work_show.html.erb diff --git a/app/views/student_work/_evaluation_un_group.html.erb b/app/views/student_work/_evaluation_un_group.html.erb index 91907aadf..75614a909 100644 --- a/app/views/student_work/_evaluation_un_group.html.erb +++ b/app/views/student_work/_evaluation_un_group.html.erb @@ -1,6 +1,6 @@
<% @stundet_works.each_with_index do |student_work, i| %> -
+
<%= render :partial => 'evaluation_un_group_work', :locals => {:student_work => student_work} %>
diff --git a/app/views/student_work/_evaluation_un_group_work.html.erb b/app/views/student_work/_evaluation_un_group_work.html.erb index 3c3a02281..5ce2545e7 100644 --- a/app/views/student_work/_evaluation_un_group_work.html.erb +++ b/app/views/student_work/_evaluation_un_group_work.html.erb @@ -1,5 +1,5 @@
- + diff --git a/app/views/student_work/_group_work_show.html.erb b/app/views/student_work/_group_work_show.html.erb deleted file mode 100644 index 00e90b2d0..000000000 --- a/app/views/student_work/_group_work_show.html.erb +++ /dev/null @@ -1,145 +0,0 @@ -
-
- <% is_teacher = User.current.allowed_to?(:as_teacher, @homework.course) || User.current.admin? %> - <% pro = @homework.student_work_projects.where(:user_id => User.current.id).first %> - <% is_my_work = pro && pro.student_work_id == work.id%> -
    -
  • - 上交时间: - <%=format_time work.created_at %> -
  • - - <% if work.user == User.current && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d") %> - -
  • - <%= link_to("", student_work_path(work),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "pic_del",:title=>"删除") %> -
  • -
  • - <%= link_to "",edit_student_work_path(work),:class => "pic_edit",:title => "修改"%> -
  • - <% end%> - <% if @homework.homework_detail_manual.comment_status == 3 && !is_my_work %> - -
  • - <%= render :partial => 'student_work_praise',:locals => {:work => work} %> -
  • - <% end%> -
    - - - - <% if work.student_work_projects && (@homework.homework_detail_manual.comment_status != 2 || is_my_work || is_teacher ) %> -
    -
  • - 参与人员: - <%= link_to(work.user.show_name+"(组长)", user_path(work.user.id), :class => "linkBlue" )%> - <% members = work.student_work_projects.where("is_leader = 0") %> - <% members.each do |member| if !members.empty? %> - 、<%=link_to((User.find member.user_id).show_name, user_path(member.user.id), :class => "linkBlue" ) %> - <% end %> - <% end %> -
  • - <% if @homework.homework_detail_group.base_on_project == 1 %> -
  • - 关联项目: - <% if work.project_id == 0 || work.project_id.nil? %> - 暂无 - <% elsif work.project.is_public || User.current.member_of?(work.project) || User.current.admin? %> - <%= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%> - (综合评分:<%=static_project_score(work.project.project_score).to_i %>) - <% else %> - <%=work.project.name %> - (综合评分:<%=static_project_score(work.project.project_score).to_i %>) - <% end %> - <%#= link_to( work.project.name, project_path(work.project.id), :class => "linkBlue" )%> -
  • - <% end %> -
  • - 内容: -
    - <%= work.description.html_safe if work.description%> -
    -
    -
  • -
  • - 附件: - <% com_attachments = work.attachments.where("attachtype IS NULL OR attachtype <> 7") %> - <% if com_attachments.empty?%> - 尚未提交附件 - <% else%> -
    - <%= render :partial => 'work_attachments_status', :locals => {:attachments => com_attachments, :status => @homework.homework_detail_manual.comment_status} %> -
    - <% end%> -
    -
  • - <% end%> - -
  • - <% if @is_teacher || (@homework.homework_detail_manual.comment_status == 2 && !is_my_work)%> - -
    - <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%> -
    - <% end%> -
    -
  • -
- -
- <%= render :partial => 'student_work/revise_attachment', :locals => {:work => work} %> -
-
- -
- <%student_work_scores.each do |student_score|%> -
- <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%> -
- <% end%> -
-
- - 收起 -
-
- \ No newline at end of file