作品名称的缺省值为 作业名称+的作品提交(可修改) 若学生不修改则保存为 作业名称+的作品提交
This commit is contained in:
parent
2466184d8a
commit
119b12349b
|
@ -1,3 +1,4 @@
|
|||
#encoding: utf-8
|
||||
class StudentWorkController < ApplicationController
|
||||
layout "base_courses"
|
||||
include StudentWorkHelper
|
||||
|
@ -282,7 +283,7 @@ class StudentWorkController < ApplicationController
|
|||
@submit_result = true
|
||||
student_work = StudentWork.find(params[:student_work_id]) if params[:student_work_id]
|
||||
student_work ||= StudentWork.new
|
||||
student_work.name = params[:student_work][:name]
|
||||
student_work.name = params[:student_work][:name] == "#{@homework.name}的作品提交(可修改)" ? "#{@homework.name}的作品提交" : params[:student_work][:name]
|
||||
student_work.description = params[:student_work][:description]
|
||||
student_work.homework_common_id = @homework.id
|
||||
student_work.user_id = User.current.id
|
||||
|
|
|
@ -242,7 +242,7 @@
|
|||
<%=hidden_field_tag 'group_member_ids', params[:group_member_ids], :value=>User.current.id %>
|
||||
<% end %>
|
||||
<div>
|
||||
<%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请输入作品名称",:value=>"#{@homework.name}的作品提交", :onkeyup => "regexStudentWorkName();" %>
|
||||
<%= f.text_field "name", :required => true, :size => 60, :class => "InputBox W700", :maxlength => 200, :placeholder => "请输入作品名称",:value=>"#{@homework.name}的作品提交(可修改)", :onkeyup => "regexStudentWorkName();" %>
|
||||
<div class="cl"></div>
|
||||
<p id="student_work_name_span" class="c_red mb10"></p>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue