diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb index 706c9f39d..73eb97eae 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 6fc0fff0e..b3e433b74 100644 --- a/app/views/homework_common/new.html.erb +++ b/app/views/homework_common/new.html.erb @@ -1,17 +1,27 @@ -<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> -<%= error_messages_for 'homework_common' %>

<%= l(:label_course_homework_new)%>

-
- <%= 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'%> +
+ <%= form_for("new_homework_common",:url => next_step_homework_common_index_path) do |f|%> + +

+ 请选择将要发布的作业类型 +

+ + + 人工评分的作业(支持匿名互评、灵活设置评分比例) + +
+ + + 自动评测的编程作业(支持C程序的自动评分) + +
+ + 下一步 + <% end%>
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css index 8e16c9436..b3d16908d 100644 --- a/public/stylesheets/public.css +++ b/public/stylesheets/public.css @@ -96,6 +96,7 @@ h4{ font-size:14px; color:#3b3b3b;} .w60{ width:60px;} .w70{ width:70px;} .w90{ width:90px;} +.w100{width: 100px;} .w210{ width:210px;} .w150{ width:150px;} .w280{ width:280px;}