Merge branch 'cxt_course' into develop

This commit is contained in:
cxt 2016-03-11 19:31:06 +08:00
commit 46d22980c9
26 changed files with 223 additions and 78 deletions

View File

@ -240,6 +240,18 @@ class CoursesController < ApplicationController
# req[:message] = l(:modal_valid_passing) if req[:message].blank?
render :json => req
end
def teacher_assign_group
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
@subPage_title = l :label_student_list
group = CourseGroup.find(params[:object_id])

View File

@ -99,16 +99,18 @@ class StudentWorkController < ApplicationController
else
student_in_group = '(' + group_students.map{|user| user.id}.join(',') + ')'
end
#老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
if @homework.is_open == 1
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, 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
elsif @homework.is_open == 0 && User.current.member_of_course?(@course) || User.current.admin?
if @is_teacher || @homework.homework_detail_manual.nil? ||
(@homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
#开放作品 || 老师 || 超级管理员 || 禁用匿评&&作业截止&&已提交作品 显示所有列表
if @homework.is_open == 1 || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
if @order == 'lastname'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @order == 'student_id'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, 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
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
end
@show_all = true
elsif User.current.member_of_course?(@course)
if @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
if @homework.homework_type == 3
pro = @homework.student_work_projects.where(:user_id => User.current.id).first
if pro.nil?
@ -145,7 +147,13 @@ class StudentWorkController < ApplicationController
if my_work.empty?
@stundet_works = []
else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
if @order == 'lastname'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @order == 'student_id'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name
end
@show_all = true
end
else
@ -158,14 +166,17 @@ class StudentWorkController < ApplicationController
@student_work_count = (search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).where("users.id in #{student_in_group}").order("#{@order} #{@b_sort}"),@name).count
else
if @homework.is_open == 1
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("#{@order} #{@b_sort}"),@name
@show_all = true
elsif @homework.is_open == 0 && User.current.member_of_course?(@course) || User.current.admin?
if @is_teacher || @homework.homework_detail_manual.nil? || (@homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?) #老师 || 超级管理员 显示所有列表
if @homework.is_open == 1 || @is_teacher || User.current.admin? || (User.current.member_of_course?(@course) && @homework.anonymous_comment == 1 && Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") && !@homework.student_works.where(:user_id => User.current.id).empty?)
if @order == 'lastname'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @order == 'student_id'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("#{@order} #{@b_sort}"),@name
@show_all = true
elsif @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
end
@show_all = true
elsif User.current.member_of_course?(@course)
if @homework.homework_detail_manual.comment_status == 1 #学生 && 未开启匿评 只看到自己的
if @homework.homework_type == 3
pro = @homework.student_work_projects.where(:user_id => User.current.id).first
if pro.nil?
@ -202,7 +213,13 @@ class StudentWorkController < ApplicationController
if my_work.empty?
@stundet_works = []
else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("#{@order} #{@b_sort}"),@name
if @order == 'lastname'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins(:user).order("CONVERT(lastname USING gbk) COLLATE gbk_chinese_ci #{@b_sort}, login #{@b_sort}"),@name
elsif @order == 'student_id'
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").joins("join user_extensions on student_works.user_id = user_extensions.user_id").order("#{@order} #{@b_sort}"),@name
else
@stundet_works = search_homework_member @homework.student_works.select("student_works.*,IF(final_score is null,null,IF(final_score = 0, 0, final_score - absence_penalty - late_penalty)) as score").order("#{@order} #{@b_sort}"),@name
end
@show_all = true
end
else

View File

@ -376,13 +376,15 @@ class UsersController < ApplicationController
#用户作业列表
def user_homeworks
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
@user = User.current
@r_sort = @b_sort == "desc" ? "asc" : "desc"
if(params[:type].blank? || params[:type] == "1") #公共题库
visible_course = Course.where("is_public = 1 && is_delete = 0")
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc")
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
elsif params[:type] == "2" #我的题库
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("created_at desc")
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
end
@type = params[:type]
@limit = 15
@ -525,20 +527,22 @@ class UsersController < ApplicationController
end
def user_homework_type
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
@r_sort = @b_sort == "desc" ? "asc" : "desc"
@user = User.current
if(params[:type].blank? || params[:type] == "1") #公共题库
visible_course = Course.where("is_public = 1 && is_delete = 0")
visible_course_ids = visible_course.empty? ? "(-1)" : "(" + visible_course.map{|course| course.id}.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("created_at desc")
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
elsif params[:type] == "2" #我的题库
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("created_at desc")
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}'").order("#{@order} #{@b_sort}")
end
if params[:property] && params[:property] == "1"
@homeworks = @homeworks.where("homework_type = 1").reorder("created_at desc")
@homeworks = @homeworks.where("homework_type = 1").reorder("#{@order} #{@b_sort}")
elsif params[:property] && params[:property] == "2"
@homeworks = @homeworks.where("homework_type = 2").reorder("created_at desc")
@homeworks = @homeworks.where("homework_type = 2").reorder("#{@order} #{@b_sort}")
elsif params[:property] && params[:property] == "3"
@homeworks = @homeworks.where("homework_type = 3").reorder("created_at desc")
@homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}")
end
@type = params[:type]
@property = params[:property]
@ -564,6 +568,8 @@ class UsersController < ApplicationController
#用户主页过滤作业
def user_search_homeworks
@order,@b_sort = params[:order] || "created_at",params[:sort] || "desc"
@r_sort = @b_sort == "desc" ? "asc" : "desc"
@user = User.current
search = params[:name].to_s.strip.downcase
if(params[:type].blank? || params[:type] == "1") #全部
@ -573,16 +579,16 @@ class UsersController < ApplicationController
all_user_ids = all_homeworks.map{|hw| hw.user_id}
user_str_ids = search_user_by_name all_user_ids, search
user_ids = user_str_ids.empty? ? "(-1)" : "(" + user_str_ids.join(",") + ")"
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%' or user_id in #{user_ids})").order("created_at desc")
@homeworks = HomeworkCommon.where("course_id in #{visible_course_ids} and publish_time <= '#{Date.today}' and (name like '%#{search}%' or user_id in #{user_ids})").order("#{@order} #{@b_sort}")
elsif params[:type] == "2" #课程资源
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("created_at desc")
@homeworks = HomeworkCommon.where("user_id = #{@user.id} and publish_time <= '#{Date.today}' and (name like '%#{search}%')").order("#{@order} #{@b_sort}")
end
if params[:property] && params[:property] == "1"
@homeworks = @homeworks.where("homework_type = 1").reorder("created_at desc")
@homeworks = @homeworks.where("homework_type = 1").reorder("#{@order} #{@b_sort}")
elsif params[:property] && params[:property] == "2"
@homeworks = @homeworks.where("homework_type = 2").reorder("created_at desc")
@homeworks = @homeworks.where("homework_type = 2").reorder("#{@order} #{@b_sort}")
elsif params[:property] && params[:property] == "3"
@homeworks = @homeworks.where("homework_type = 3").reorder("created_at desc")
@homeworks = @homeworks.where("homework_type = 3").reorder("#{@order} #{@b_sort}")
end
@type = params[:type]
@limit = 15
@ -592,6 +598,8 @@ class UsersController < ApplicationController
@offset ||= @hw_pages.offset
@homeworks = paginateHelper @homeworks,15
@is_import = params[:is_import]
@property = params[:property]
@search = search
respond_to do |format|
format.js
end

View File

@ -601,6 +601,24 @@ module CoursesHelper
Course.tagged_with(tag_name).order('updated_at desc')
end
#分班下拉框
def course_group_option course
type = []
option1 = []
option1 << "暂无"
option1 << 0
type << option1
unless course.course_groups.nil?
course.course_groups.each do |cg|
option = []
option << cg.name
option << cg.id
type << option
end
end
type
end
#课程实践年份下拉框
def course_time_option year
type = []
@ -762,7 +780,7 @@ module CoursesHelper
return[] unless course
result = []
course.attachments.each do |attachment|
if attachment.is_public? ||User.current == attachment.author ||User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id))|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin?
if (attachment.is_public? && attachment.is_publish == 1) ||User.current == attachment.author ||User.current.allowed_to?(:as_teacher,course)|| (User.current.member_of_course?(course) && attachment.is_publish == 1) || User.current.admin?
result << attachment
end
end

View File

@ -121,7 +121,8 @@ module FilesHelper
def visable_attachemnts attachments
result = []
attachments.each do |attachment|
if attachment.is_public? ||
if (attachment.is_public? && attachment.container_type != "Course") ||
(attachment.is_public? && attachment.container_type == "Course" && attachment.is_publish == 1)||
(attachment.container_type == "Project" && User.current.member_of?(attachment.project)) ||
(attachment.container_type == "Course" && User.current.allowed_to?(:as_teacher,Course.find(attachment.container_id)))||
(attachment.container_type == "Course" && User.current.member_of_course?(Course.find(attachment.container_id)) && attachment.is_publish == 1)||

View File

@ -2,8 +2,8 @@ class PraiseTread < ActiveRecord::Base
attr_accessible :user_id,:praise_tread_object_id,:praise_tread_object_type,:praise_or_tread
belongs_to :user
belongs_to :praise_tread_object, polymorphic: true
after_create :be_user_score
after_destroy :down_user_score
#after_create :be_user_score
#after_destroy :down_user_score
include UserScoreHelper
def self.find_object_by_type_and_id(type,id)
@obj = nil

View File

@ -24,7 +24,8 @@
<ul class="st_box_top">
<li class="ml50" style="padding-right: 5px;"><a href="">姓名</a></li>
<li class="ml10" style="padding-right: 15px;"><a href="">学号</a></li>
<li class="ml358">
<li style="padding-right: 55px; margin-left: 260px;"><a href="">分班</a></li>
<li style="margin-left: 25px;">
<%= link_to '作业积分', member_score_sort_course_path(:sort_by => (@score_sort_by == "desc" ? "asc" : "desc"), :group_id => (@group ? @group.id : 0),:search_name => (@search_name ? @search_name : nil)) ,:result => members,method: 'get', remote: true%>
<% if @score_sort_by == 'desc' %>
<a id="pic" href="javascript:" class= "st_down"></a>
@ -58,11 +59,31 @@
<li><%= link_to("#{l(:label_bidding_user_studentcode)}<span >#{member.user.user_extensions.student_id}</span>".html_safe,user_path(member.user)) %></li>
<% end%>
</ul>
<% if User.current.allowed_to?(:as_teacher, @course) || User.current.admin? %>
<% if @course.course_groups.nil? || @group %>
<div class="select-class-option fl" style="margin-left: 105px;">
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
</div>
<% else %>
<%= form_tag({:controller => 'courses', :action => 'teacher_assign_group', :id => @course.id,:user_id => member.user_id},:remote=>'true', :method => 'post', :id=>"join_group_form_#{member.id}", :class => 'query_form') do %>
<div class="select-class-option fl" style="margin-left: 105px;"><span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
<a style="display: inline-block;" href="javascript:void(0)" class="pic_edit2 ml5"></a>
</div>
<%= select( :name,:group_id, course_group_option(@course),
{ :include_blank => false,:selected => member.course_group_id},
{:onchange=>"join_group_function('#join_group_form_#{member.id}');", :id =>"course_group_id", :name => "course_group_id",:class=>"w125 undis class-edit fl", :style => "margin-left: 105px;"}) %>
<% end %>
<% end %>
<% else %>
<div class="select-class-option fl" style="margin-left: 105px;">
<span style="width: 100px; text-align: center; float: left;" class="hidden"><%=member.course_group_id == 0 ? "暂无" : member.course_group.name %></span>
</div>
<% end %>
<%= link_to format("%0.2f",member.score.nil? ? 0 : member.score.to_s), {
:action => 'show_member_score',
:member_id => member.id,
:remote => true},
:class => 'ml258 c_red' %>
:class => 'ml25 c_red' %>
<span class="fr mr15 c_grey"><%= format_date(member.created_on)%></span>
<%= call_hook(:view_projects_settings_members_table_row, { :course => @course, :member => member}) %>
</div>
@ -79,3 +100,40 @@
</p>
<% end%>
<script>
$(document).ready(function(){
/*$(".select-class-option").mouseover(function(){
$(this).children(".pic_edit2").css("display","inline-block");
});
$(".select-class-option").mouseout(function(){
$(this).children(".pic_edit2").css("display","none");
});*/
$(".pic_edit2").click(function(){
$(this).parent().hide();
$(this).parent().next().show();
});
$(".class-edit").blur(function(){
$(this).hide();
$(this).prev().show();
var editValue = $(this).children("option:selected").text();
$(this).prev().children(":first").text(editValue);
});
function stopPropagation(e) {
if (e.stopPropagation)
e.stopPropagation();
else
e.cancelBubble = true;
};
$(document).bind('click',function(){
$('.class-edit').css('display','none');
$('.select-class-option').show();
});
$('.class-edit,.pic_edit2').bind('click',function(e){
stopPropagation(e);
});
});
function join_group_function(id){
$(id).submit();
}
</script>

View File

@ -0,0 +1 @@
$("#st_groups").html("<%=escape_javascript(render :partial => 'new_groups_name', :locals => {:course_groups => @course_groups}) %>");

View File

@ -2,7 +2,7 @@
<li class="homepageLeftMenuCoursesLine pr">
<% is_teacher = User.current.logged? && (User.current.admin? || User.current.allowed_to?(:as_teacher,course)) %>
<%= link_to course.name, course_path(course.id,:host=>Setting.host_course), :class => "coursesLineGrey hidden #{course_endTime_timeout?(course) ? 'c_dark_grey' : ''}",
:id => "show_course_#{course.id}",:title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+""+current_time_and_term(course)+""%>
:id => "show_course_#{course.id}", :target => '_blank', :title => (course.is_public? ? "公开课程:":"私有课程:")+course.name+""+current_time_and_term(course)+""%>
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Course' and shield_id=#{course.id}").count %>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>

View File

@ -1,7 +1,7 @@
<% projects.each do |project|%>
<li class="homepageLeftMenuCoursesLine pr">
<% count = ShieldActivity.where("container_type='User' and container_id=#{user.id} and shield_type='Project' and shield_id=#{project.id}").count %>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :class => "coursesLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<%= link_to project.name, project_path(project.id,:host=>Setting.host_name), :target => '_blank', :class => "coursesLineGrey hidden",:id => "show_project_#{project.id}", :title => (project.is_public? ? "公开项目:":"私有项目:") + project.name%>
<ul class="<%= count > 0 ? 'shild shildP':'subNavArrow'%>">
<li>
<ul class="subNavMenu boxShadow">

View File

@ -250,6 +250,7 @@
</div><!--项目标签 end-->
<!--课程推荐-->
<%= render :partial => 'courses/recommendation', :locals => {:course => @course} %>
<div class="fontGrey5 mt10 ml10 mb10">访问计数 100</div>
</div><!--LSide end-->
<div id="RSide" class="fl">

View File

@ -132,6 +132,7 @@
<div class="homepageLeftMenuContainer" id="sub_field_left_lists">
<%= render :partial => "organizations/org_left_subfield_list", :locals => {:organization => @organization} %>
</div>
<div class="fontGrey5 mt10 ml20">访问计数 100</div>
</div>
<div class="homepageRight" style="margin-top:<%= (params[:show_homepage].nil? && User.current.logged?) ? '10px':'0px' %>;">
<%= render_flash_messages %>

View File

@ -158,9 +158,12 @@
</div>
<div class="cl"></div>
</div><!--项目标签 end-->
<div class="fontGrey5 mt10 ml10 mb10">访问计数 100</div>
</div>
</div>
<div id="RSide" class="fl">
<%= render_flash_messages %>
<%= yield %>

View File

@ -226,6 +226,7 @@
<div class="cl"></div>
</div>
</div>
<div class="fontGrey5 mt10 ml20">访问计数 100</div>
</div>
<div class="homepageRight">
<%= yield %>

View File

@ -47,7 +47,7 @@
<% end%>
<div class="cl"></div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %>

View File

@ -2,8 +2,16 @@
<li class="hworkList340 hworkH30 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
<span class="c_dark f14 fb fl <%= @homework.homework_type == 2 ? 'mr90 ml50' : 'mr150 ml50'%>">作品名称</span>
<% if @homework.homework_type != 3 %>
<span class="c_dark f14 fb fl mr50">姓名</span>
<span class="c_dark f14 fb fl">学号</span>
<!--<span class="c_dark f14 fb fl mr50">姓名</span>-->
<%= link_to "姓名",@show_all ? student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl" ,:remote => true%>
<% if @show_all && @order == "lastname"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "lastname", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
<% end%>
<!--<span class="c_dark f14 fb fl">学号</span>-->
<%= link_to "学号",@show_all ? student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) : "javascript:void(0)",:class => "c_dark f14 fb fl ml50" ,:remote => true%>
<% if @show_all && @order == "student_id"%>
<%= link_to "", student_work_index_path(:homework => @homework.id,:order => "student_id", :sort => @score, :name => @name, :group => @group) ,:class => "#{@score == 'desc' ? 'st_up' : 'st_down'} mt10" ,:remote => true%>
<% end%>
<% elsif @homework.homework_type == 3 && @homework.homework_detail_group.base_on_project == 1 %>
<span class="c_dark f14 fb fl">关联项目</span>
<% end %>

View File

@ -47,7 +47,7 @@
<% end%>
<div class="cl"></div>
<% if activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif activity.homework_type == 3 && activity.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %>

View File

@ -0,0 +1,21 @@
<ul class="subject-list-banner">
<li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li>
<li class="subject-list-from fl">来源</li>
<li class="subject-list-type fl">类别</li>
<li class="subject-list-publisher fl">贡献者</li>
<li class="subject-list-count fl">
<%= link_to "引用数",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "fl",:remote => true%>
<% if @order == "quotes"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "quotes", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12" ,:remote => true%>
<% end%>
</li>
<li class="fl subject-list-date">
<%= link_to "发布时间",user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "created_at", :sort => @r_sort),:class => "fl",:remote => true%>
<% if @order == "created_at"%>
<%= link_to "", user_search_homeworks_user_path(@user,:name=>search,:type => type,:is_import=>is_import,:property=>property,:order => "created_at", :sort => @r_sort),:class => "#{@r_sort == 'desc' ? 'st_up' : 'st_down'} mt12" ,:remote => true%>
<% end%>
</li>
</ul>
<div id="homework_repository">
<%=render :partial => 'homework_repository', :locals => {:homeworks => homeworks} %>
</div>

View File

@ -48,7 +48,7 @@
<% end%>
<div class="cl"></div>
<% if homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 1%>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"c_red",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<span class="c_red">系统提示:该作业要求各组长<%=link_to "创建项目", new_project_path(:host=>Setting.host_name),:class=>"linkBlue",:title=>"新建项目",:style=>"text-decoration:underline;"%>,组成员加入项目,然后由组长关联项目。谢谢配合!</span>
<% elsif homework_common.homework_type == 3 && homework_common.homework_detail_group.base_on_project == 0%>
<span class="c_red">系统提示:该作业要求各组长提交作品,提交作品时请添加组成员。谢谢配合!</span>
<% end %>

View File

@ -4,7 +4,7 @@ $("#homewrok_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>nil}) %>");
$("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_search_input', :locals=>{:type=>@type,:is_import=>@is_import}) %>");
<% else %>
$("#homework_repository").html('<%= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>''})%>');
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
$("#homework_search_input").html("<%=escape_javascript(render :partial=>'homework_repository_search', :locals=>{:type=>@type,:is_import=>@is_import,:property=>@property}) %>");

View File

@ -58,40 +58,26 @@
</ul>
<div class="cl"></div>
<div id="homework_search_input" class="mt10 fl">
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %>
<%=render :partial=>'homework_repository_search', :locals=>{:type => @type,:is_import => 0,:property => @property} %>
</div>
<!--<form class="resourcesSearchloadBox mt10">
<input type="text" name="serach" placeholder="输入题库关键词进行搜索" class="searchResource" />
<a href="javascript:void(0);" class="homepageSearchIcon"></a>
</form>-->
<div class="cl"></div>
<div class="w583 fl mr10 mt10">
<ul class="subject-list-banner">
<li class="subject-list-name fl hidden"><span style="padding-left:15px;">作业名称</span></li>
<li class="subject-list-from fl">来源</li>
<li class="subject-list-type fl">类别</li>
<li class="subject-list-publisher fl">贡献者</li>
<li class="subject-list-count fl">引用数</li>
<li class="fl subject-list-date">发布时间</li>
</ul>
<div id="homework_repository">
<%=render :partial => 'homework_repository', :locals => {:homeworks => @homeworks} %>
<div class="w583 fl mr10 mt10" id="homework_repository_list">
<%=render :partial => 'homework_repository_list', :locals => {:homeworks => @homeworks,:type=>@type,:is_import => 0,:property => @property,:search=>''} %>
</div>
<div id="homework_repository_detail">
<%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %>
</div>
<div class="cl"></div>
<div>
<ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 395px">
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
</div>
<div class="fl resourcesSelectSendButton mr15 inactive-border mt10">
<a href="javascript:void(0)" onclick="choose_course('<%=User.current.id %>');" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
</div>
<span class="c_red fl mt15" id="choose_homework_notice"></span>
</div>
</div>
</div>
<div id="homework_repository_detail">
<%=render :partial => 'homework_repository_detail', :locals => {:homework => nil} %>
</div>
<div class="cl"></div>
<div>
<ul class="wlist mt10" id="homework_pository_ref_pages" style="margin-top: 5px;margin-right: 395px">
<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
</div>
<div class="fl resourcesSelectSendButton mr15 inactive-border mt10">
<a href="javascript:void(0)" onclick="choose_course('<%=User.current.id %>');" class="sendButtonBlue db inactive-text" data-remote="true">发送至</a>
</div>
<span class="c_red fl mt15" id="choose_homework_notice"></span>
</div>
</div>
</div>
</div>

View File

@ -1,3 +1,4 @@
$("#homework_repository").html('<%= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');
/*$("#homework_repository").html('<%#= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');*/
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => 0,:property => @property,:search=>''})%>');
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");

View File

@ -3,7 +3,7 @@ $("#homework_list_form_show").html('<%= escape_javascript(render :partial => 'us
$("#homewrok_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#homework_detail_information").html("<%=escape_javascript(render :partial => 'users/homework_detail_information', :locals => {:homework=>nil}) %>");
<% else %>
$("#homework_repository").html('<%= escape_javascript(render :partial => 'users/homework_repository', :locals => {:homeworks => @homeworks})%>');
$("#homework_repository_list").html('<%= escape_javascript(render :partial => 'users/homework_repository_list', :locals => {:homeworks => @homeworks,:sort => @order,:b_sort => @b_sort,:type=>@type,:is_import => @is_import,:property => @property,:search=>@search})%>');
$("#homework_pository_ref_pages").html('<%= pagination_links_full @hw_pages, @hw_count, :per_page_links => false, :remote => @is_remote, :flag => true %>');
$("#homework_repository_detail").html("<%=escape_javascript(render :partial => 'users/homework_repository_detail', :locals => {:homework=>nil}) %>");
<% end %>

View File

@ -1005,6 +1005,7 @@ RedmineApp::Application.routes.draw do
get 'course_outline'
post 'search_course_outline'
post 'set_course_outline'
post 'teacher_assign_group'
get 'syllabus'
get 'search_public_orgs_not_in_course'
get "homework_search"

View File

@ -192,6 +192,7 @@ a.c_green{ color:#28be6c;}
.fontGrey {color:#cecece;}
.fontGrey2 {color:#888888;}
.fontGrey3 {color:#484848;}
.fontGrey5 {color:#a1a1a1;}
.fontBlue {color:#3498db;}
a.underline {text-decoration:underline;}
a.fontBlue {color:#297fb8;}
@ -1479,3 +1480,8 @@ a.choose-active {background-color:#269ac9; color:#ffffff;}
.subject-list-type {width:50px; text-align:center;}
.subject-list-count {width:60px; text-align:center;}
.subject-list-from {width:105px; text-align:center;}
a.st_up{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 0 no-repeat; margin-top:5px; margin-left:3px;}
a.st_down{ display: block; width:8px; float:left; height:13px; background:url(../images/pic_up.png) 0 -22px no-repeat; margin-top:5px; margin-left:3px;}
a.st_img { display:block;width:32px; height:32px; border:1px solid #CCC; padding:1px;}
a:hover.st_img { border:1px solid #1c9ec7; }

View File

@ -230,6 +230,7 @@ a.c_green{ color:#28be6c;}
.fontGrey2 {color:#888888;}
.fontGrey3 {color:#484848;}
.fontGrey4{color:#999999;}
.fontGrey5 {color:#a1a1a1;}
.fontBlue {color:#3498db;}
.fontBlue2 {color:#269ac9 !important;}
a.underline {text-decoration:underline;}