diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 81c21eb3d..98e195e30 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -242,9 +242,14 @@ class CoursesController < ApplicationController end def teacher_assign_group - member = Member.where(:course_id => @course.id, :user_id => User.current.id).first + member = Member.where(:course_id => @course.id, :user_id => params[:user_id]).first member.course_group_id = params[:course_group_id].to_i member.save + @course_groups = @course.course_groups + @canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1' + respond_to do |format| + format.js + end end def join_group diff --git a/app/views/courses/_new_member_list.html.erb b/app/views/courses/_new_member_list.html.erb index 12a5d9626..b399c6035 100644 --- a/app/views/courses/_new_member_list.html.erb +++ b/app/views/courses/_new_member_list.html.erb @@ -60,12 +60,12 @@ <% end%> <% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %> - <% if @course.course_groups.nil? %> + <% if @course.course_groups.nil? || @group %>