From cbe34ea0a7991c3cacbad35875056deaed039c13 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 28 Jun 2016 15:57:56 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E5=88=86=E7=BB=84=E4=BD=9C=E4=B8=9A?= =?UTF-8?q?=E6=8F=90=E4=BA=A4=E4=BD=9C=E5=93=81=E6=97=B6=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=88=90=E5=91=98=E5=88=97=E8=A1=A8=E4=B8=BA=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/student_work_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 9006c8a79..661770206 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -1096,7 +1096,7 @@ class StudentWorkController < ApplicationController all_student_ids = "(" + pro.members.map{|member| member.user_id}.join(",") + ")" end all_students = User.where("id in #{all_student_ids}") - student_work_id = @homework.student_work_projects.where("user_id=?",User.current.id).empty? ? -1 : @homework.student_work_projects.where("user_id=?",User.current.id).first.student_work_id + student_work_id = @homework.student_work_projects.where("user_id=? and student_work_id is not null",User.current.id).first.nil? ? -1 : @homework.student_work_projects.where("user_id=?",User.current.id).first.student_work_id @commit_student_ids = @homework.student_work_projects.where("student_work_id != #{student_work_id}").map{|student| student.user_id} @users = searchstudent_by_name all_students,name respond_to do |format| From 4983d5283bd1b930882c09c6984051a4c048ba74 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 28 Jun 2016 16:30:33 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=85=B3=E8=81=94=E6=88=90=E5=91=98?= =?UTF-8?q?=E8=83=BD=E5=A4=9A=E6=AC=A1=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/student_work/search_course_students.js.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/student_work/search_course_students.js.erb b/app/views/student_work/search_course_students.js.erb index 2ac4eeaab..65179317f 100644 --- a/app/views/student_work/search_course_students.js.erb +++ b/app/views/student_work/search_course_students.js.erb @@ -8,19 +8,19 @@ $("#all_students_list").empty(); $("#all_students_list").append(link); var str = $("#group_member_ids").val(); - /*var str = ""; + var choose_str = ""; var lists = $("#choose_students_list li"); if(lists.length > 0) { for(var i=0; i - if (str.indexOf(<%=user.id.to_s %>) < 0) { + if (str.indexOf(<%=user.id.to_s %>) < 0 && choose_str.indexOf(<%=user.id.to_s %>) < 0) { $("#student_<%=user.id %>").one("click",function choose_student() { var li = "