Merge branch 'szzh' of http://repository.trustie.net/xianbo/trustie2 into szzh
This commit is contained in:
commit
b9c7f7ba5c
|
@ -75,7 +75,7 @@ class StudentWorkController < ApplicationController
|
||||||
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
|
@order,@b_sort,@name,@group = params[:order] || "score",params[:sort] || "desc",params[:name] || "",params[:group]
|
||||||
@homework_commons = @course.homework_commons.order("created_at desc")
|
@homework_commons = @course.homework_commons.order("created_at desc")
|
||||||
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
|
||||||
@is_evaluation = @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
|
@is_evaluation = @homework.homework_detail_manual && @homework.homework_detail_manual.comment_status == 2 && !@is_teacher #是不是匿评
|
||||||
@show_all = false
|
@show_all = false
|
||||||
|
|
||||||
course_group = CourseGroup.find_by_id(@group) if @group
|
course_group = CourseGroup.find_by_id(@group) if @group
|
||||||
|
@ -86,7 +86,7 @@ class StudentWorkController < ApplicationController
|
||||||
else
|
else
|
||||||
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
|
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
|
||||||
end
|
end
|
||||||
if @is_teacher #老师 || 超级管理员 显示所有列表
|
if @is_teacher || @homework.homework_detail_manual.nil? #老师 || 超级管理员 显示所有列表
|
||||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
|
||||||
@show_all = true
|
@show_all = true
|
||||||
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
||||||
|
@ -106,7 +106,7 @@ class StudentWorkController < ApplicationController
|
||||||
@stundet_works = []
|
@stundet_works = []
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if @is_teacher #老师 || 超级管理员 显示所有列表
|
if @is_teacher || @homework.homework_detail_manual.nil? #老师 || 超级管理员 显示所有列表
|
||||||
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,final_score - absence_penalty - late_penalty) as score").order("#{@order} #{@b_sort}"),@name
|
||||||
@show_all = true
|
@show_all = true
|
||||||
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
|
||||||
|
|
|
@ -75,7 +75,7 @@ module ApiHelper
|
||||||
# 学生获取课程作业的状态
|
# 学生获取课程作业的状态
|
||||||
def get_homework_status homework
|
def get_homework_status homework
|
||||||
homework_status = ""
|
homework_status = ""
|
||||||
if !homework.nil?
|
if homework
|
||||||
if homework.homework_type == 1 && homework.homework_detail_manual
|
if homework.homework_type == 1 && homework.homework_detail_manual
|
||||||
case homework.homework_detail_manual.comment_status
|
case homework.homework_detail_manual.comment_status
|
||||||
when 1
|
when 1
|
||||||
|
|
|
@ -2299,7 +2299,7 @@ module ApplicationHelper
|
||||||
def homework_anonymous_comment homework
|
def homework_anonymous_comment homework
|
||||||
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
|
||||||
link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "作业截止日期之前不可以启动匿评"
|
link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "作业截止日期之前不可以启动匿评"
|
||||||
elsif homework.student_works.count >= 2 #作业份数大于2
|
elsif homework.student_works.count >= 2 && homework.homework_detail_manual#作业份数大于2
|
||||||
case homework.homework_detail_manual.comment_status
|
case homework.homework_detail_manual.comment_status
|
||||||
when 1
|
when 1
|
||||||
link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'postOptionLink'
|
link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'postOptionLink'
|
||||||
|
@ -2309,7 +2309,7 @@ module ApplicationHelper
|
||||||
# link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束"
|
# link = link_to "匿评结束","javascript:void(0)", :class => "postOptionLink", :title => "匿评结束"
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "学生提交作业数大于2时才可以启动匿评"
|
link = link_to "启动匿评","javascript:void(0)", :class => "postOptionLink", :title => "学生提交作业数大于等于2时才可以启动匿评"
|
||||||
end
|
end
|
||||||
link
|
link
|
||||||
end
|
end
|
||||||
|
|
|
@ -582,7 +582,7 @@ module UsersHelper
|
||||||
option << "请选择发布作业的课程"
|
option << "请选择发布作业的课程"
|
||||||
option << -1
|
option << -1
|
||||||
type << option
|
type << option
|
||||||
user.courses.select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
|
user.courses.visible.select("courses.*,(SELECT MAX(created_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS a").order("a desc").select{|c| user.allowed_to?(:as_teacher,c)}.each do |course|
|
||||||
option = []
|
option = []
|
||||||
option << course.name+"("+course.time.to_s+course.term+")"
|
option << course.name+"("+course.time.to_s+course.term+")"
|
||||||
option << course.id
|
option << course.id
|
||||||
|
|
|
@ -14,12 +14,15 @@
|
||||||
<span class="homepagePostTitle hidden m_w530 fl">
|
<span class="homepagePostTitle hidden m_w530 fl">
|
||||||
<%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
|
<%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
|
||||||
</span>
|
</span>
|
||||||
<% if homework_common.homework_detail_manual.comment_status == 1%>
|
|
||||||
|
<% if homework_common.homework_detail_manual%>
|
||||||
|
<% if homework_common.homework_detail_manual.comment_status == 1%>
|
||||||
<span class="grey_btn_cir ml10">未开启匿评</span>
|
<span class="grey_btn_cir ml10">未开启匿评</span>
|
||||||
<% elsif homework_common.homework_detail_manual.comment_status == 2%>
|
<% elsif homework_common.homework_detail_manual.comment_status == 2%>
|
||||||
<span class="green_btn_cir ml10">匿评中</span>
|
<span class="green_btn_cir ml10">匿评中</span>
|
||||||
<% elsif homework_common.homework_detail_manual.comment_status == 3%>
|
<% elsif homework_common.homework_detail_manual.comment_status == 3%>
|
||||||
<span class="grey_btn_cir ml10">匿评已结束</span>
|
<span class="grey_btn_cir ml10">匿评已结束</span>
|
||||||
|
<% end%>
|
||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
<div class="homepagePostSubmitContainer">
|
<div class="homepagePostSubmitContainer">
|
||||||
|
|
|
@ -1,94 +1,70 @@
|
||||||
<script type="text/javascript">
|
<div id="wrapper">
|
||||||
function searchUser(){
|
<div id="wrapper2">
|
||||||
var name = $("#name").val();
|
<div id="wrapper3">
|
||||||
if(name == "")
|
<div id="main" class="nosidebar">
|
||||||
{
|
<div id="content_">
|
||||||
alert("搜索条件不能为空");
|
<script type="text/javascript">
|
||||||
return;
|
function searchUser(){
|
||||||
}
|
var name = $("#name").val();
|
||||||
$("#search_user_form").submit();
|
if(name == "")
|
||||||
}
|
{
|
||||||
|
alert("搜索条件不能为空");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$("#search_user_form").submit();
|
||||||
|
}
|
||||||
|
|
||||||
function searchByChange()
|
function searchByChange()
|
||||||
{
|
{
|
||||||
$("#search_by_input").val($("#search_by").val());
|
$("#search_by_input").val($("#search_by").val());
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="top-content">
|
<div class="top-content">
|
||||||
<%= form_tag( users_search_path, :method => :get, :id => 'search_user_form') do %>
|
<%= form_tag( users_search_path, :method => :get, :id => 'search_user_form') do %>
|
||||||
<table width="940px">
|
<table width="940px">
|
||||||
<tr>
|
<tr>
|
||||||
<td class="info_font" style="width: 220px; color: #15bccf " rowspan="2">
|
<td class="info_font" style="width: 220px; color: #15bccf " rowspan="2">
|
||||||
<%= l(:label_software_user ) %>
|
<%= l(:label_software_user ) %>
|
||||||
</td>
|
</td>
|
||||||
<td class="location-list">
|
<td class="location-list">
|
||||||
<strong><%= l(:label_user_location) %> :</strong>
|
<strong><%= l(:label_user_location) %> :</strong>
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="2">
|
<td rowspan="2">
|
||||||
</td>
|
</td>
|
||||||
<td rowspan="2" >
|
<td rowspan="2" >
|
||||||
<!--<div class="project-search" style="float: right">-->
|
</td>
|
||||||
<!--<!–label for="user_browse_label"><%#= l(:label_user_search_type) %></label–>-->
|
</tr>
|
||||||
<!--<%#= select_tag(:search_by,options_for_select([["昵称","0"],["姓名","1"],["邮箱","2"]],@search_by), :onchange => "searchByChange();",:style=>'display:none;' ) %>-->
|
<tr>
|
||||||
<!--<%#= text_field_tag 'name', params[:name], :size => 30, :placeholder=>'昵称/姓名/邮箱' %>-->
|
<td >
|
||||||
<!--<input type="text" name="search_by_input" hidden="hidden;" id="search_by_input" value="0">-->
|
<%=link_to l(:field_homepage), home_path %> >
|
||||||
<!--<input type="button" class="enterprise" value="<%= l(:label_search) %>" onclick="searchUser();"/>-->
|
<a><%= l(:label_software_user)%></a>
|
||||||
<!--<%#= submit_tag l(:label_search), :class => "enterprise", :name => nil %>-->
|
</td>
|
||||||
<!--</div> -->
|
</tr>
|
||||||
</td>
|
</table>
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td >
|
|
||||||
<%=link_to l(:field_homepage), home_path %> >
|
|
||||||
<a><%= l(:label_software_user)%></a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
|
|
||||||
<div class="autoscroll">
|
|
||||||
<% if @users.size > 0 %>
|
|
||||||
<%= render :partial => 'user_show' %>
|
|
||||||
|
|
||||||
<!--
|
|
||||||
<%# @users.each do |user| -%>
|
|
||||||
<%# unless user.id == 1%>
|
|
||||||
<div class="well">
|
|
||||||
<%#= content_tag "p", "#{format_date(user.created_on)}#{l(:label_member_since)}", :class => "float_right member_since" %>
|
|
||||||
<%#= image_tag "/images/time_member.png", :class => "img_member_time"%>
|
|
||||||
<div>
|
|
||||||
<%#= image_tag(url_to_avatar(user), :class => 'avatar') %>
|
|
||||||
<%#= content_tag "span", link_to_user(user), :class => "nomargin avatar_name" %>
|
|
||||||
</div>
|
|
||||||
<div style="margin-top: 20px;margin-left:66px">
|
|
||||||
<%#= l(:label_has_fans,:count=>user.watcher_users.count)%>
|
|
||||||
<%#= l(:label_has_watchers,:count=>User.watched_by(user.id).count) %>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="user-bottom">
|
|
||||||
<%# unless user.memberships.empty? %>
|
|
||||||
<%#= l(:label_contribute_to, :project_count => "#{user.memberships.count}") %>
|
|
||||||
<%# for member in user.memberships %>
|
|
||||||
<%#= link_to_project(member.project) %><%#= (user.memberships.last == member) ? '' : ',' %>
|
|
||||||
<%# end %>
|
|
||||||
<%# end %>
|
|
||||||
<%#= user.changesets.count == 0 ? '' : ",#{l(:label_total_commit, :total_commit => user.changesets.count)}" %>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
<%# end -%>
|
<% end %>
|
||||||
<%# end -%>
|
|
||||||
-->
|
|
||||||
<% else %>
|
<div class="autoscroll">
|
||||||
<%= render :partial => "layouts/no_content"%>
|
<% if @users.size > 0 %>
|
||||||
<% end %>
|
<%= render :partial => 'user_show' %>
|
||||||
</div>
|
<% else %>
|
||||||
<div class="pagination">
|
<%= render :partial => "layouts/no_content"%>
|
||||||
<ul>
|
<% end %>
|
||||||
<%= pagination_links_full @user_pages, @user_count %>
|
<div class="cl"></div>
|
||||||
</ul>
|
<div class="pagination">
|
||||||
</div>
|
<ul style="float: left;margin-bottom: 10px;margin-left: 10px;">
|
||||||
<% html_title(l(:label_user_plural)) -%>
|
<%= pagination_links_full @user_pages, @user_count %>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
<% html_title(l(:label_user_plural)) -%>
|
||||||
|
<div class="cl"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -115,7 +115,7 @@ $(function(){
|
||||||
minWidth: 753
|
minWidth: 753
|
||||||
});
|
});
|
||||||
|
|
||||||
$('a.ProBtn').on('click', function(){
|
$('a.ProBtn').live('click', function(){
|
||||||
$("#BluePopupBox").dialog("open");
|
$("#BluePopupBox").dialog("open");
|
||||||
$(".ui-dialog-titlebar").hide();
|
$(".ui-dialog-titlebar").hide();
|
||||||
$("a.CloseBtn").on('click', function(){
|
$("a.CloseBtn").on('click', function(){
|
||||||
|
@ -173,7 +173,7 @@ $(function(){
|
||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
$("#BluePopupBox a.BlueCirBtn").on('click', function(){
|
$("#BluePopupBox a.BlueCirBtn").live('click', function(){
|
||||||
if(saveProgramAnswers()){
|
if(saveProgramAnswers()){
|
||||||
if($( "#BluePopupBox" ).dialog( "isOpen" )){
|
if($( "#BluePopupBox" ).dialog( "isOpen" )){
|
||||||
$("#BluePopupBox").dialog( "close" );
|
$("#BluePopupBox").dialog( "close" );
|
||||||
|
|
Loading…
Reference in New Issue