课程创建属性添加 是否允许学生上传资源

This commit is contained in:
lizanle 2015-11-19 15:13:34 +08:00
parent dffabce806
commit 34a2c2c90d
2 changed files with 8 additions and 0 deletions

View File

@ -186,6 +186,7 @@ class CoursesService
#params[:setup_time]:暂不传(貌似已经没用了)
#params[:endup_time]: 暂不传(貌似已经没用了)
#params[:class_period]:学时总数
#params[:course][:publish_resource]允许学生上传资源
def create_course(params,current_user)
if current_user.user_extensions.identity
@course = Course.new
@ -202,6 +203,7 @@ class CoursesService
@course.class_period = params[:class_period].to_i
params[:course][:is_public] ? @course.is_public = 1 : @course.is_public = 0
params[:course][:open_student] ? @course.open_student = 1 : @course.open_student = 0
params[:course][:publish_resource] ? @course.publish_resource = 1 : @course.publish_resource = 0
else
end

View File

@ -50,6 +50,12 @@
<span class="c_grey">(打钩为"学生列表公开",不打钩为不公开,若不公开,则课程外部人员看不到学生列表)</span>
<div class="cl"></div>
</li>
<li class=" mb5 ml30">
<label >学生上传资源&nbsp;&nbsp;</label>
<input <%= @course.publish_resource == 1 ? 'checked' : ''%> id="course_publish_resource" name="course[publish_resource]" type="checkbox" />
<span class="c_grey">(打钩为"允许学生上传资源",不打钩为"不允许学生上传资源"</span>
<div class="cl"></div>
</li>
<li class=" ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_course();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "blue_btn grey_btn fl c_white"%>