From 9a4a1594630575261c2d2686de9b3e0501025422 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 21 Jul 2015 16:34:48 +0800
Subject: [PATCH 1/3] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E5=8F=96=E6=B6=88?=
=?UTF-8?q?=E7=BC=96=E7=A8=8B=E4=BD=9C=E4=B8=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_common_controller.rb | 44 +++++++++----------
app/views/homework_common/new.html.erb | 28 ++++--------
2 files changed, 31 insertions(+), 41 deletions(-)
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 04a07e9a8..e71fd5e29 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -18,28 +18,28 @@ class HomeworkCommonController < ApplicationController
end
def new
- @homework_type = "1"
-
- @homework = HomeworkCommon.new
- @homework.safe_attributes = params[:homework_common]
- @homework.late_penalty = 0
- @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
- @homework.publish_time = Time.now.strftime('%Y-%m-%d')
-
- if @homework_type == "1"
- #匿评作业相关属性
- @homework_detail_manual = HomeworkDetailManual.new
- @homework_detail_manual.ta_proportion = 0.6
- @homework_detail_manual.absence_penalty = 0
- @homework_detail_manual.evaluation_num = 3
- @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
- @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
- @homework.homework_detail_manual = @homework_detail_manual
- elsif @homework_type == "2"
- #编程作业相关属性
- @homework_detail_programing = HomeworkDetailPrograming.new
- @homework.homework_detail_programing = @homework_detail_programing
- end
+ # @homework_type = "1"
+ #
+ # @homework = HomeworkCommon.new
+ # @homework.safe_attributes = params[:homework_common]
+ # @homework.late_penalty = 0
+ # @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
+ # @homework.publish_time = Time.now.strftime('%Y-%m-%d')
+ #
+ # if @homework_type == "1"
+ # #匿评作业相关属性
+ # @homework_detail_manual = HomeworkDetailManual.new
+ # @homework_detail_manual.ta_proportion = 0.6
+ # @homework_detail_manual.absence_penalty = 0
+ # @homework_detail_manual.evaluation_num = 3
+ # @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
+ # @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
+ # @homework.homework_detail_manual = @homework_detail_manual
+ # elsif @homework_type == "2"
+ # #编程作业相关属性
+ # @homework_detail_programing = HomeworkDetailPrograming.new
+ # @homework.homework_detail_programing = @homework_detail_programing
+ # end
respond_to do |format|
format.html
end
diff --git a/app/views/homework_common/new.html.erb b/app/views/homework_common/new.html.erb
index cdc2ceca0..6fc0fff0e 100644
--- a/app/views/homework_common/new.html.erb
+++ b/app/views/homework_common/new.html.erb
@@ -1,27 +1,17 @@
+<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>
+<%= error_messages_for 'homework_common' %>
- <%= form_for("new_homework_common",:url => next_step_homework_common_index_path) do |f|%>
-
-
- 请选择将要发布的作业类型
-
-
-
- 人工评分的作业(支持匿名互评、灵活设置评分比例)
-
-
-
-
- 自动评测的编程作业(支持C/C++程序的自动评分)
-
-
-
- 下一步
-
+
+ <%= labelled_form_for @homework,:url => {:controller => 'homework_common',:action => 'create'} do |f| %>
+ <%= hidden_field_tag "course",@course.id%>
+ <%= render :partial => 'homework_common/homework_detail_manual_form', :locals => { :homework => @homework,:f => f,:edit_mode => false } %>
+
提交
+ <%#= link_to "上一步", new_homework_common_path(:course => @course.id), :class => "orange_btn_homework fl"%>
+ <%= link_to '取消',homework_common_index_path(:course => @course.id),:class => 'grey_btn fl'%>
<% end%>
From 45dd135c819f71db1062e0c10a5240d372265108 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Tue, 21 Jul 2015 16:39:23 +0800
Subject: [PATCH 2/3] =?UTF-8?q?=E5=88=9B=E5=BB=BA=E4=BD=9C=E4=B8=9A?=
=?UTF-8?q?=E6=8A=A5500?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/homework_common_controller.rb | 44 +++++++++----------
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index e71fd5e29..04a07e9a8 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -18,28 +18,28 @@ class HomeworkCommonController < ApplicationController
end
def new
- # @homework_type = "1"
- #
- # @homework = HomeworkCommon.new
- # @homework.safe_attributes = params[:homework_common]
- # @homework.late_penalty = 0
- # @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
- # @homework.publish_time = Time.now.strftime('%Y-%m-%d')
- #
- # if @homework_type == "1"
- # #匿评作业相关属性
- # @homework_detail_manual = HomeworkDetailManual.new
- # @homework_detail_manual.ta_proportion = 0.6
- # @homework_detail_manual.absence_penalty = 0
- # @homework_detail_manual.evaluation_num = 3
- # @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
- # @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
- # @homework.homework_detail_manual = @homework_detail_manual
- # elsif @homework_type == "2"
- # #编程作业相关属性
- # @homework_detail_programing = HomeworkDetailPrograming.new
- # @homework.homework_detail_programing = @homework_detail_programing
- # end
+ @homework_type = "1"
+
+ @homework = HomeworkCommon.new
+ @homework.safe_attributes = params[:homework_common]
+ @homework.late_penalty = 0
+ @homework.end_time = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
+ @homework.publish_time = Time.now.strftime('%Y-%m-%d')
+
+ if @homework_type == "1"
+ #匿评作业相关属性
+ @homework_detail_manual = HomeworkDetailManual.new
+ @homework_detail_manual.ta_proportion = 0.6
+ @homework_detail_manual.absence_penalty = 0
+ @homework_detail_manual.evaluation_num = 3
+ @homework_detail_manual.evaluation_start = Time.now.strftime('%Y-%m-%d')
+ @homework_detail_manual.evaluation_end = (Time.now + 3600 * 24).strftime('%Y-%m-%d')
+ @homework.homework_detail_manual = @homework_detail_manual
+ elsif @homework_type == "2"
+ #编程作业相关属性
+ @homework_detail_programing = HomeworkDetailPrograming.new
+ @homework.homework_detail_programing = @homework_detail_programing
+ end
respond_to do |format|
format.html
end
From baccd28493292b0453d61a2ad47aac4d44684efa Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 22 Jul 2015 10:48:46 +0800
Subject: [PATCH 3/3] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E5=87=BA=E9=94=99?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb b/db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb
index e3f0611db..dc973e142 100644
--- a/db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb
+++ b/db/migrate/20150722015428_add_errormsg_to_studen_work_test.rb
@@ -4,6 +4,6 @@ class AddErrormsgToStudenWorkTest < ActiveRecord::Migration
end
def down
- remove_column :student_work_tests,:error_msg,
+ remove_column :student_work_tests,:error_msg
end
end