分组作业的导入

This commit is contained in:
cxt 2015-12-17 10:38:14 +08:00
parent 51e082a551
commit 89d3d3821c
2 changed files with 14 additions and 1 deletions

View File

@ -415,6 +415,7 @@ class UsersController < ApplicationController
def user_select_homework
homework = HomeworkCommon.find_by_id params[:checkMenu]
homework_detail_programing = homework.homework_detail_programing
homework_detail_group = homework.homework_detail_group
@homework = HomeworkCommon.new
@select_course = params[:select_course] || 0
if homework
@ -444,6 +445,14 @@ class UsersController < ApplicationController
)
end
end
if homework_detail_group
@homework.homework_detail_group = HomeworkDetailGroup.new
@homework_detail_group = @homework.homework_detail_group
@homework_detail_group.min_num = homework_detail_group.min_num
@homework_detail_group.max_num = homework_detail_group.max_num
@homework_detail_group.base_on_project = homework_detail_group.base_on_project
end
end
respond_to do |format|
format.js

View File

@ -5,9 +5,13 @@ $("#homework_end_time").val("<%= @homework.end_time%>");
<% if @select_course == "0"%>
$("#course_id").val("<%= @homework.course_id%>");
<% end%>
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework,:has_program => true,:has_group => true })%>");
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework,:has_program => true,:has_group => true,:show_member=>true})%>");
homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>");
<% if @homework_detail_group %>
$('span.group_detail_info').text('分组人数:<%=@homework_detail_group.min_num %>-<%=@homework_detail_group.max_num %> 人');
<% end %>
$("#BluePopupBox").html("<%=escape_javascript( render :partial => 'users/user_programing_attr', :locals => {:edit_mode => true, :homework => @homework})%>");
$("#GroupPopupBox").html("<%=escape_javascript( render :partial => 'users/user_group_attr', :locals => {:edit_mode => true, :homework => @homework})%>");
//$("input[name='homework_type']").val("<%#= @homework.homework_type%>");
$("#homework_editor").show();
$("#BluePopupBox a.BlueCirBtn").click();