学生收索功能
This commit is contained in:
parent
92808fe8ea
commit
ab3a3a8573
|
@ -178,22 +178,19 @@ class CoursesController < ApplicationController
|
|||
|
||||
def searchmembers
|
||||
@subPage_title = l :label_student_list
|
||||
@render_file = 'member_list'
|
||||
@canShowCode = isCourseTeacher(User.current.id,@course) && params[:role] != '1'
|
||||
@is_remote = true
|
||||
@canShowCode = User.current.allowed_to?(:as_teacher,@course) && params[:role] != '1'
|
||||
# @is_remote = true
|
||||
@score_sort_by = "desc"
|
||||
q = "#{params[:name].strip}"
|
||||
#(redirect_to stores_url, :notice => l(:label_sumbit_empty);return) if params[:name].blank?
|
||||
if params[:incourse]
|
||||
@results = searchmember_by_name(student_homework_score(0,0,0,"desc"), q)
|
||||
|
||||
results = searchmember_by_name(student_homework_score(0,0,0,"desc"), q)
|
||||
elsif params[:ingroup]
|
||||
@group = CourseGroup.find(params[:search_group_id])
|
||||
@results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q)
|
||||
results = searchmember_by_name(student_homework_score(@group.id,0,0,"desc"), q)
|
||||
end
|
||||
@is_remote = true
|
||||
@result_count = @results.count
|
||||
@results = paginateHelper @results, 10
|
||||
@result_count = results.count
|
||||
@results = paginateHelper results, 10
|
||||
@search_name = q
|
||||
end
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
<% end %>
|
||||
<% end %>
|
||||
<a href="javascript:" class="f_l" onclick="$('#search_student').submit();">搜索</a>
|
||||
<%= link_to l(:label_export_excel), export_course_member_excel_course_path(@course,:format => 'xls'),:class=>'xls'%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
@ -18,6 +19,8 @@
|
|||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
<%= render :partial => 'new_member_list', :locals => {:members => members} %>
|
||||
<div id="member_content">
|
||||
<%= render :partial => 'new_member_list', :locals => {:members => members} %>
|
||||
</div>
|
||||
</div> <!-- st_list end-->
|
||||
<div class="cl"></div>
|
|
@ -64,7 +64,7 @@
|
|||
</div>
|
||||
|
||||
<ul class="wlist">
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
|
||||
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
|
||||
</ul>
|
||||
<% else%>
|
||||
<p class="nodata">
|
||||
|
|
|
@ -1,49 +1,3 @@
|
|||
<script type="text/javascript">
|
||||
function check_groupname() {
|
||||
var $group_name = $('#group_name');
|
||||
$.get(
|
||||
'<%=valid_ajax_course_path%>',
|
||||
{ valid: "name",
|
||||
value: document.getElementById('group_name').value,
|
||||
course_id: <%= @course.id %> },
|
||||
function (data) {
|
||||
if (!data.valid) {
|
||||
alert(data.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
function validate_groupname(value1) {
|
||||
|
||||
if(value1.length > 20) {
|
||||
alert('<%= l(:label_limit_groupname) %>');
|
||||
}
|
||||
}
|
||||
function checkclass(value) {
|
||||
for(var i = 0; i < document.getElementsByName("check_group_name").length; i++) {
|
||||
if(document.getElementsByName("check_group_name")[i].id == value) {
|
||||
document.getElementById(value).className = "selected";
|
||||
}
|
||||
else {
|
||||
document.getElementsByName("check_group_name")[i].className = "classbox";
|
||||
}
|
||||
}
|
||||
}
|
||||
function validate_groupname_null(value1) {
|
||||
value1 = value1.trim();
|
||||
if(value1.length == 0 ) {
|
||||
alert('<%= l(:label_limit_groupname_null) %>');
|
||||
}
|
||||
}
|
||||
function validate_update(name) {
|
||||
value1 = document.getElementById(name).value;
|
||||
validate_groupname(value1);
|
||||
|
||||
}
|
||||
function validate_add_group() {
|
||||
check_groupname();
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= @subPage_title%></h2>
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
* Created by Administrator on 2014/12/2.
|
||||
*/
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => @render_file, :locals => {:members => @results})%>");
|
||||
$("#member_content").html("<%= escape_javascript( render :partial => 'new_member_list', :locals => {:members => @results})%>");
|
|
@ -1,3 +1,50 @@
|
|||
///////////////////////////////////////////////////////////////
|
||||
function check_groupname(course_id) {
|
||||
var $group_name = $('#group_name');
|
||||
$.get(
|
||||
'<%=valid_ajax_course_path%>',
|
||||
{ valid: "name",
|
||||
value: document.getElementById('group_name').value,
|
||||
course_id: course_id },
|
||||
function (data) {
|
||||
if (!data.valid) {
|
||||
alert(data.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function validate_groupname(value1) {
|
||||
if(value1.length > 20) {
|
||||
alert('<%= l(:label_limit_groupname) %>');
|
||||
}
|
||||
}
|
||||
|
||||
function checkclass(value) {
|
||||
for(var i = 0; i < document.getElementsByName("check_group_name").length; i++) {
|
||||
if(document.getElementsByName("check_group_name")[i].id == value) {
|
||||
document.getElementById(value).className = "selected";
|
||||
}
|
||||
else {
|
||||
document.getElementsByName("check_group_name")[i].className = "classbox";
|
||||
}
|
||||
}
|
||||
}
|
||||
function validate_groupname_null(value1) {
|
||||
value1 = value1.trim();
|
||||
if(value1.length == 0 ) {
|
||||
alert('<%= l(:label_limit_groupname_null) %>');
|
||||
}
|
||||
}
|
||||
function validate_update(name) {
|
||||
value1 = document.getElementById(name).value;
|
||||
validate_groupname(value1);
|
||||
|
||||
}
|
||||
function validate_add_group() {
|
||||
check_groupname();
|
||||
}
|
||||
///////////////////////////////////////////////////////////////
|
||||
|
||||
//验证搜索时输入名字
|
||||
function regexName(content)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue