Merge branch 'Homework' into develop

This commit is contained in:
sw 2014-11-04 13:34:46 +08:00
commit 59849be07a
84 changed files with 3322 additions and 2155 deletions

View File

@ -200,7 +200,7 @@ class BidsController < ApplicationController
flash[:notice] = l(:label_bid_succeed)
end
end
redirect_to respond_path(@homework)
redirect_to course_for_bid_path(@homework)
else
@bid.safe_attributes = params[:bid]
@courses = []
@ -454,6 +454,7 @@ class BidsController < ApplicationController
# 显示作业课程
# add by nwb
def show_courseEx
if (User.current.logged? && (User.current.member_of_course?(@bid.courses.first) || User.current.admin?))
# flash[:notice] = ""
@membership = User.current.coursememberships.all(:conditions => Course.visible_condition(User.current))
@ -489,26 +490,39 @@ class BidsController < ApplicationController
if @bid.homework_type
@homework = HomeworkAttach.new
if @bid.proportion
teacher_proportion = @bid.proportion * 1.0 / 100
else
teacher_proportion = 1.0
@is_teacher = is_course_teacher(User.current,@bid.courses.first)
teachers = "("
teacher_members = searchTeacherAndAssistant(@bid.courses.first)
teacher_members.each do |member|
if member == teacher_members.last
teachers += member.user_id.to_s + ")"
else
teachers += member.user_id.to_s + ","
end
end
if @is_teacher
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY s_score DESC,created_at ASC) AS table1
WHERE table1.t_score IS NULL")
@cur_type = 1
else
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM(SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = 3123) AS m_score
FROM homework_attaches
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id}) AS table1
WHERE table1.m_score IS NULL")
@is_student_batch_homework = true
@cur_type = 4
end
#@homework_list = @bid.homeworks
#增加作业按评分排序,
#@homework_list = @bid.homeworks.eager_load(:rate_averages, :user, :attachments).order('seems_rateable_cached_ratings.avg DESC').order("#{HomeworkAttach.table_name}.created_at ASC")
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = #{@bid.author_id}) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id <> #{@bid.author_id}) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id} ORDER BY
(CASE WHEN t_score IS NULL THEN 0 ELSE t_score * #{teacher_proportion} END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * #{1 - teacher_proportion} END) DESC,created_at ASC")
limit = 10
feedback_count = all_homework_list.count
@feedback_pages = Paginator.new feedback_count, limit, params['page']
offset ||= @feedback_pages.offset
@homework_list = all_homework_list[offset, limit]
@cur_page = params[:page] || 1
@homework_list = paginateHelper all_homework_list,10
@jours_count = @bid.journals_for_messages.where('m_parent_id IS NULL').count
if params[:student_id].present?
@temp = []
@homework_list.each do |pro|
@ -635,13 +649,8 @@ class BidsController < ApplicationController
end
@user = @bid.author
@jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@limit = 10
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
@jour = paginateHelper @jours,10
@bid.set_commit(@feedback_count)
respond_to do |format|
format.js
#format.api { render_api_ok }
@ -813,7 +822,7 @@ class BidsController < ApplicationController
flash[:notice] = l(:label_bid_succeed)
end
end
redirect_to respond_url(@bid)
redirect_to course_for_bid_path(@bid)
else
@bid.safe_attributes = params[:bid]
@homework = @bid
@ -991,6 +1000,46 @@ class BidsController < ApplicationController
def manage
end
# 启动匿评
def start_anonymous_comment
@bid = Bid.find(params[:id])
homeworks = @bid.homeworks
users = homeworks.map { |h| h.user }
@start_index = rand(homeworks.size)
while users[0] == homeworks[@start_index].user
@start_index = rand(homeworks.size)
end
3.times do |i|
homework_start_index = @start_index + i
users.each_with_index do |user, index|
actual_index = homework_start_index + index
actual_index = (actual_index < homeworks.size ? actual_index : actual_index - homeworks.size)
if user != homeworks[actual_index]
@homework_evaluation = HomeworkEvaluation.new(user_id: user.id, homework_attach_id: homeworks[actual_index].id)
@homework_evaluation.save
end
end
end
# 修改状态为 '启动匿评'
@bid.update_column('comment_status', 1)
respond_to do |format|
format.js
end
end
def stop_anonymous_comment
@bid = Bid.find(params[:id])
@bid.update_column('comment_status', 2)
respond_to do |format|
format.js
end
end
private

View File

@ -1,24 +1,155 @@
class HomeworkAttachController < ApplicationController
layout "course_base"
include CoursesHelper
include HomeworkAttachHelper
helper :words
###############################
before_filter :can_show_course,except: []
#判断当前角色权限时需先找到当前操作的project
before_filter :find_course_by_bid_id, :only => [:new]
before_filter :find_course_by_hoemwork_id, :only => [:edit,:update,:destroy,:show,:add_homework_users,:destory_homework_users]
before_filter :find_bid_and_course,:only => [:get_not_batch_homework,:get_batch_homeworks,:get_homeworks,:get_homework_jours, :get_student_batch_homework, :get_my_homework]
before_filter :find_course_by_hoemwork_id, :only => [:edit,:update,:destroy,:show,:add_homework_users,:destory_homework_users, :praise_homework]
#判断当前角色是否有操作权限
#勿删 before_filter :authorize, :only => [:new,:edit,:update,:destroy]
def find_course_by_bid_id
@bid = Bid.find(params[:id])
@course = @bid.courses[0]
rescue ActiveRecord::RecordNotFound
render_404
#@cur_type:
#1.未批作业列表
#2.已批作业列表
#3.全部作业列表
#4.匿评作业列表
#根据此字段判断关闭homework_attach的show界面后是否要调用js刷新页面
#获取未批作业列表
def get_not_batch_homework
sort, direction = params[:sort], params[:direction]
order_by = sort == 'socre'? "s_score #{direction}" : "created_at #{direction}"
teachers = find_course_teachers @course
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}) AS table1
WHERE table1.t_score IS NULL")
@cur_page = params[:page] || 1
@cur_type = 1
@homework_list = paginateHelper all_homework_list,10
@direction = direction == 'asc'? 'desc' : 'asc'
respond_to do |format|
format.js
end
end
def find_course_by_hoemwork_id
@homework = HomeworkAttach.find(params[:id])
@course = @homework.bid.courses[0]
#获取已评作业列表
def get_batch_homeworks
sort, direction = params[:sort], params[:direction]
teacher_proportion = get_teacher_proportion @bid
order_by = sort == 'socre'? "(CASE WHEN t_score IS NULL THEN 0 ELSE t_score * #{teacher_proportion} END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * #{1 - teacher_proportion} END) #{direction}" : "created_at #{direction}"
teachers = find_course_teachers @course
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM (SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers} and stars IS NOT NULL) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}) AS table1
WHERE table1.t_score IS NOT NULL")
@cur_page = params[:page] || 1
@cur_type = 2
@homework_list = paginateHelper all_homework_list,10
@direction = direction == 'asc'? 'desc' : 'asc'
respond_to do |format|
format.js
end
end
#获取所有作业列表
def get_homeworks
sort, direction = params[:sort], params[:direction]
teacher_proportion = get_teacher_proportion @bid
order_by = sort == 'socre'? "(CASE WHEN t_score IS NULL THEN 0 ELSE t_score * #{teacher_proportion} END + CASE WHEN s_score IS NULL THEN 0 ELSE s_score * #{1 - teacher_proportion} END) #{direction}" : "created_at #{direction}"
teachers = find_course_teachers @course
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id in #{teachers}) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id not in #{teachers}) AS s_score
FROM homework_attaches WHERE bid_id = #{@bid.id}
ORDER BY #{order_by}")
@cur_page = params[:page] || 1
@cur_type = 3
@homework_list = paginateHelper all_homework_list,10
@direction = direction == 'asc'? 'desc' : 'asc'
respond_to do |format|
format.js
end
end
#获取学生匿评列表
def get_student_batch_homework
@is_student_batch_homework = true
teachers = find_course_teachers @course
all_homework_list = HomeworkAttach.eager_load(:attachments,:user,:rate_averages).find_by_sql("SELECT * FROM(SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score,
(SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id = 3123) AS m_score
FROM homework_attaches
INNER JOIN homework_evaluations ON homework_evaluations.homework_attach_id = homework_attaches.id
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_evaluations.user_id = #{User.current.id}) AS table1
WHERE table1.m_score IS NULL")
@cur_page = params[:page] || 1
@cur_type = 4
@homework_list = paginateHelper all_homework_list,10
respond_to do |format|
format.js
end
end
#获取我的作业
def get_my_homework
@is_my_homework = true
teachers = find_course_teachers @course
all_homework_list = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score
FROM homework_attaches
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_attaches.user_id = #{User.current.id}")
#如果我没有创建过作业,就检索我是否参与了某个作业
if all_homework_list.empty?
all_homework_list = HomeworkAttach.find_by_sql("SELECT homework_attaches.*,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id IN #{teachers}) AS t_score,
(SELECT AVG(stars) FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = homework_attaches.id AND rater_id NOT IN #{teachers}) AS s_score
FROM homework_attaches
INNER JOIN homework_users ON homework_users.homework_attach_id = homework_attaches.id
WHERE homework_attaches.bid_id = #{@bid.id} AND homework_users.user_id = #{User.current.id}")
end
@cur_page = params[:page] || 1
@homework_list = paginateHelper all_homework_list,10
respond_to do |format|
format.js
end
end
#获取作业的留言列表
def get_homework_jours
@user = @bid.author
@jours = @bid.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC')
@jour = paginateHelper @jours,10
@state = false
respond_to do |format|
format.js
end
end
#为作业点赞
def praise_homework
pt = PraiseTread.new
pt.user_id = User.current.id
pt.praise_tread_object_id = @homework.id
pt.praise_tread_object_type = "HomeworkAttach"
pt.praise_or_tread = 1
if pt.save
respond_to do |format|
format.js
end
else
render_404
end
end
#获取作业的成员
@ -66,6 +197,9 @@ class HomeworkAttachController < ApplicationController
homework_user = @homework.homework_users.where("user_id = #{params[:user_id]}").first
homework_user.destroy
get_homework_member @homework
@homework_list = []
@is_my_homework = true
respond_to do |format|
format.js
end
@ -90,8 +224,8 @@ class HomeworkAttachController < ApplicationController
project_id = 0
end
sta = 0
name = params[:new_form][:name]
description = params[:new_form][:description]
name = params[:homework_attach][:name]
description = params[:homework_attach][:description]
options = {
:user_id => user_id,
:state => sta,
@ -212,9 +346,14 @@ class HomeworkAttachController < ApplicationController
def destroy
if User.current.admin? || User.current == @homework.user
if @homework.destroy
#respond_to do |format|
# format.html { redirect_to course_for_bid_url @homework.bid }
# format.json { head :no_content }
#end
@homework_list = []
@is_my_homework = true
respond_to do |format|
format.html { redirect_to course_for_bid_url @homework.bid }
format.json { head :no_content }
format.js
end
else
end
@ -227,11 +366,9 @@ class HomeworkAttachController < ApplicationController
def show
if User.current.admin? || User.current.member_of_course?(@homework.bid.courses.first)
# 打分统计
stars_reates = @homework.
rates(:quality)
stars_reates = @homework. rates(:quality)
stars_reates_count = stars_reates.count == 0 ? 1 : stars_reates.count
stars_status = stars_reates.select("stars, count(*) as scount").
group("stars")
stars_status = stars_reates.select("stars, count(*) as scount").group("stars")
@stars_status_map = Hash.new(0.0)
stars_status.each do |star_status|
percent = (star_status.scount * 1.0/ stars_reates_count) * 100.to_f
@ -243,16 +380,55 @@ class HomeworkAttachController < ApplicationController
@has_evaluation = stars_reates.where("rater_id = ?",User.current).count > 0
#是否开启互评功能
@is_evaluation = @homework.bid.is_evaluation == 1 || @homework.bid.is_evaluation == nil
@limit = 10
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation is null").order("created_on DESC")
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation is not null").order("created_on DESC")
#@limit = 10
#@jours留言 is null条件用以兼容历史数据
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
@cur_page = params[:cur_page] || 1
@cur_type = params[:cur_type] || 5
@jour = paginateHelper @jours,5
#@feedback_count = @jours.count
#@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
#@offset ||= @feedback_pages.offset
#@jour = @jours[@offset, @limit]
#@comprehensive_evaluation教师评论
#@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1").order("created_on DESC")
teachers = searchTeacherAndAssistant @course
@comprehensive_evaluation = []
teachers.each do|teacher|
temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first
@comprehensive_evaluation << temp if temp
end
#@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id in #{convert_array(teachers)}").order("created_on DESC")
#@anonymous_comments 匿评
#@anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2").order("created_on DESC")
annymous_users = @homework.homework_evaluations.map(&:user)
unless annymous_users.nil? || annymous_users.count == 0
@anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC")
end
@totle_score = score_for_homework @homework
@teaher_score = teacher_score_for_homework @homework
is_student = is_cur_course_student @homework.bid.courses.first
is_teacher = is_course_teacher User.current,@homework.bid.courses.first
@is_anonymous_comments = @homework.bid.comment_status == 1 #是否开启了匿评
if !User.current.member_of_course?(@homework.bid.courses.first)
@is_comprehensive_evaluation = 3 #留言
elsif is_student && @is_anonymous_comments && !@has_evaluation#是学生且开启了匿评且未进行评分
@is_comprehensive_evaluation = 2 #匿评
elsif is_student && @is_anonymous_comments && @has_evaluation #是学生且开启了匿评,但已评分
@is_comprehensive_evaluation = 3 #留言
elsif is_student && !@is_anonymous_comments #是学生未开启匿评
@is_comprehensive_evaluation = 3 #留言
elsif is_teacher
@is_comprehensive_evaluation = 1 #教师评论
else
@is_comprehensive_evaluation = 3
end
respond_to do |format|
format.html
format.js
end
else
render_403 :message => :notice_not_authorized
end
@ -260,7 +436,30 @@ class HomeworkAttachController < ApplicationController
#删除留言
def destroy_jour
@journal_destroyed = JournalsForMessage.delete_message(params[:object_id])
@homework = HomeworkAttach.find(params[:jour_id])
@journal_destroyed = JournalsForMessage.find(params[:object_id])
@is_comprehensive_evaluation = @journal_destroyed.is_comprehensive_evaluation
@journal_destroyed.destroy
if @is_comprehensive_evaluation == 3
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
@jour = paginateHelper @jours,5
elsif @is_comprehensive_evaluation == 2
annymous_users = @homework.homework_evaluations.map(&:user)
unless annymous_users.nil? || annymous_users.count == 0
@anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC")
end
elsif @is_comprehensive_evaluation == 1
teachers = searchTeacherAndAssistant @course
@comprehensive_evaluation = []
teachers.each do|teacher|
temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first
@comprehensive_evaluation << temp if temp
end
end
respond_to do |format|
format.js
end
@ -270,13 +469,30 @@ class HomeworkAttachController < ApplicationController
def addjours
@homework = HomeworkAttach.find(params[:jour_id])
@add_jour = @homework.addjours User.current.id, params[:new_form][:user_message],0,params[:is_comprehensive_evaluation]
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation is null").order("created_on DESC")
@limit = 10
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation is not null").order("created_on DESC")
if @add_jour.is_comprehensive_evaluation == 3
@jours = @homework.journals_for_messages.where("is_comprehensive_evaluation = 3 or is_comprehensive_evaluation is null").order("created_on DESC")
@jour = paginateHelper @jours,5
elsif @add_jour.is_comprehensive_evaluation == 2
annymous_users = @homework.homework_evaluations.map(&:user)
unless annymous_users.nil? || annymous_users.count == 0
@anonymous_comments = @homework.journals_for_messages.where("is_comprehensive_evaluation = 2 and user_id in #{convert_array(annymous_users)}").order("created_on DESC")
end
elsif @add_jour.is_comprehensive_evaluation == 1
teachers = searchTeacherAndAssistant @homework.bid.courses.first
@comprehensive_evaluation = []
teachers.each do|teacher|
temp = @homework.journals_for_messages.where("is_comprehensive_evaluation = 1 and user_id = #{teacher.user_id}").order("created_on DESC").first
@comprehensive_evaluation << temp if temp
end
end
#@limit = 10
#@feedback_count = @jours.count
#@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
#@offset ||= @feedback_pages.offset
#@jour = @jours[@offset, @limit]
#@comprehensive_evaluation = @homework.journals_for_messages.where("is_comprehensive_evaluation is not null").order("created_on DESC")
@totle_score = score_for_homework @homework
@teaher_score = teacher_score_for_homework @homework
@ -321,6 +537,7 @@ class HomeworkAttachController < ApplicationController
end
end
private
#验证是否显示课程
def can_show_course
@first_page = FirstPage.find_by_page_type('project')
@ -328,5 +545,51 @@ class HomeworkAttachController < ApplicationController
render_404
end
end
def find_bid_and_course
@bid = Bid.find(params[:bid_id])
@course = @bid.courses.first
rescue ActiveRecord::RecordNotFound
render_404
end
def find_course_by_bid_id
@bid = Bid.find(params[:id])
@course = @bid.courses.first
rescue ActiveRecord::RecordNotFound
render_404
end
def find_course_by_hoemwork_id
@homework = HomeworkAttach.find(params[:id])
@bid = @homework.bid
@course = @bid.courses.first
rescue ActiveRecord::RecordNotFound
render_404
end
#获取课程的老师列表
def find_course_teachers course
teachers = "("
teacher_members = searchTeacherAndAssistant(course)
teacher_members.each do |member|
if member == teacher_members.last
teachers += member.user_id.to_s + ")"
else
teachers += member.user_id.to_s + ","
end
end
teachers
end
#获取作业教师评分所占比例
def get_teacher_proportion bid
if bid.proportion
teacher_proportion = bid.proportion * 1.0 / 100
else
teacher_proportion = 1.0
end
teacher_proportion
end
end

View File

@ -82,7 +82,12 @@ class WordsController < ApplicationController
def destroy
@journal_destroyed = JournalsForMessage.delete_message(params[:object_id])
if @journal_destroyed.jour_type == "Bid"
@bid = Bid.find(@journal_destroyed.jour_id)
end
if @bid
@jours_count = @bid.journals_for_messages.where('m_parent_id IS NULL').count
end
respond_to do |format|
format.js
#format.api { render_api_ok }

View File

@ -127,7 +127,8 @@ module ApplicationHelper
# * :text - Link text (default to attachment filename)
# * :download - Force download (default: false)
def link_to_short_attachment(attachment, options={})
text = h(truncate(options.delete(:text) || attachment.filename, length: 23, omission: '...'))
length = options[:length] ? options[:length]:23
text = h(truncate(options.delete(:text) || attachment.filename, length: length, omission: '...'))
route_method = options.delete(:download) ? :download_named_attachment_path : :named_attachment_path
html_options = options.slice!(:only_path)
url = send(route_method, attachment, attachment.filename, options)
@ -1892,5 +1893,18 @@ module ApplicationHelper
content_tag(:ul, logos.join("").html_safe, :class => ul_class.to_s).html_safe
end
def sort_homework_path(bid, sort, direction)
case self.action_name
when 'show_courseEx'
get_not_batch_homework_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: 'asc')
when 'get_not_batch_homework'
get_not_batch_homework_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
when 'get_batch_homeworks'
get_batch_homeworks_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
when 'get_homeworks'
get_homeworks_homework_attach_index_path(bid_id: bid.id, sort: sort, direction: direction)
else
'#'
end
end
end

View File

@ -394,10 +394,7 @@ module CoursesHelper
#获取作业的教师评分
#多个教师只获取一份教师评分
def teacher_score_for_homework homework
members = searchTeacherAndAssistant(homework.bid.courses.first)#searchPeopleByRoles(homework.bid.courses.first,TeacherRoles).first
#if member.nil?
# return "0.00"
#end
members = searchTeacherAndAssistant(homework.bid.courses.first)
teacher_ids = []
members.each do |user|
teacher_ids << user.user_id
@ -407,7 +404,7 @@ module CoursesHelper
teacher_stars.each do |star|
teacher_stars_count = teacher_stars_count + star.stars
end
return format("%.2f",teacher_stars_count)
return format("%.2f",teacher_stars.count > 0 ? teacher_stars_count/teacher_stars.count : 0)
end
#获取指定项目的得分

View File

@ -74,4 +74,35 @@ module HomeworkAttachHelper
end
type
end
#判断指定用户是不是已经赞过该作业
def is_praise_homework user_id, obj_id
PraiseTread.where("user_id = #{user_id} AND praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'HomeworkAttach'").empty?
end
#获取赞的总数
def praise_homework_count obj_id
PraiseTread.where("praise_tread_object_id = #{obj_id} AND praise_tread_object_type = 'HomeworkAttach'").count
end
#获取用户对作业的评分
def get_homework_score user, homework
seems_rateable_rate = HomeworkAttach.find_by_sql("SELECT * FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{homework.id} AND rater_id = #{user.id}")
seems_rateable_rate.nil? || seems_rateable_rate.count == 0 ? 0:seems_rateable_rate[0].stars
end
def convert_array array
ary = "("
if array.nil? || array.count == 0
return "()"
end
array.each do |member|
if member == array.last
ary += member.id.to_s + ")"
else
ary += member.id.to_s + ","
end
end
ary
end
end

View File

@ -138,7 +138,7 @@ module StoresHelper
return [link_to('unkown', '#')]
end
bid_list = link_to l(:label_homework), homework_course_path(bid.courses.first)
bid_item = link_to bid.name, respond_path(bid)
bid_item = link_to bid.name, course_for_bid_path(bid)
return project_link(bid.courses.first).push(bid_list, bid_item)
else
xxx

View File

@ -28,6 +28,7 @@ class Bid < ActiveRecord::Base
has_many :homework_for_courses, :dependent => :destroy
has_many :courses, :through => :homework_for_courses, :source => :course
has_many :homeworks, :class_name => 'HomeworkAttach', :dependent => :destroy
has_many :homework_evaluations, :through => :homeworks
has_many :join_in_contests, :dependent => :destroy
has_many :praise_tread, as: :praise_tread_object, dependent: :destroy
# has_many :fork_homework, :class_name => 'Bid', :conditions => "#{Bid.table_name}.parent_id = #{id}"

View File

@ -10,6 +10,7 @@ class HomeworkAttach < ActiveRecord::Base
has_many :users, :through => :homework_users
seems_rateable :allow_update => true, :dimensions => :quality
belongs_to :project
has_many :homework_evaluations, :dependent => :destroy
safe_attributes "bid_id",
"user_id"

View File

@ -0,0 +1,9 @@
class HomeworkEvaluation < ActiveRecord::Base
attr_accessible :homework_attach_id, :user_id
belongs_to :homework_attach
belongs_to :user
validate :user, presence: true
validate :homework_attach, presence: true
end

View File

@ -14,6 +14,7 @@ class JournalsForMessage < ActiveRecord::Base
"is_readed", # 留言是否已读
"m_reply_count", # 留言的回复数量
"m_reply_id" # 回复某留言的留言id(a留言回复了b留言这是b留言的id)
"is_comprehensive_evaluation" # 1 教师评论、2 匿评、3 留言
acts_as_tree :foreign_key => 'm_parent_id', :counter_cache => :m_reply_count, :order => "#{JournalsForMessage.table_name}.created_on ASC"
belongs_to :project,

View File

@ -42,7 +42,7 @@ class Mailer < ActionMailer::Base
@url = case journals_for_message.jour.class.to_s.to_sym # 判断留言的对象所属类型
when :Bid
respond_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
course_for_bid_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")
when :Project
return -1 if journals_for_message.jour.project_type == Project::ProjectType_project
project_feedback_url(journals_for_message.jour, anchor: "word_li_#{journals_for_message.id}")

View File

@ -75,6 +75,7 @@ class User < Principal
has_many :homework_users
has_many :homework_attaches, :through => :homework_users
has_many :homework_evaluations
has_and_belongs_to_many :groups, :after_add => Proc.new {|user, group| group.user_added(user)},
:after_remove => Proc.new {|user, group| group.user_removed(user)}

View File

@ -27,25 +27,28 @@
// file.click();
// }
</script>
<span class="add_attachment">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description)
} %>
<span id="upload_file_count"><%= l(:label_no_file_uploaded)%></span>
(<%= l(:label_max_size) %>: <%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
<span class="add_attachment" style="font-weight:normal;">
<%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %>
<!--%= link_to image_tag(),"javascript:void(0)", :onclick => "_file.click()"%-->
<%= button_tag "浏览", :type=>"button", :onclick=>"_file.click()",:onmouseover => 'this.focus()' %>
<%= file_field_tag 'attachments[dummy][file]',
:id => '_file',
:class => 'file_selector',
:multiple => true,
:onchange => 'addInputFiles(this);',
:style => 'display:none',
:data => {
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
:upload_path => uploads_path(:format => 'js'),
:description_placeholder => l(:label_optional_description)
} %>
<span id="upload_file_count">
<%= l(:label_no_file_uploaded)%>
</span>
(<%= l(:label_max_size) %>:
<%= number_to_human_size(Setting.attachment_max_size.to_i.kilobytes) %>)
</span>
<% content_for :header_tags do %>

View File

@ -1,8 +1,13 @@
<div class="attachments">
<div class="attachments" style="font-weight:normal;">
<% for attachment in attachments %>
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<span title="<%= attachment.filename%>">
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<span title="<%= attachment.filename%>" id = "attachment_">
<% if options[:length] %>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
<% else %>
<%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
<% end %>
</span>
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
@ -12,9 +17,10 @@
:filename => attachment.filename%>
<% end %>
<span title="<%= attachment.description%>">
<%= h(truncate(" - #{attachment.description}", length: 15, omission: '...')) unless attachment.description.blank? %>
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>
</span>
<span class="size">(<%= number_to_human_size attachment.filesize %>)</span>
<% if options[:deletable] %>
<% if attachment.container_type == 'HomeworkAttach' %>
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},
@ -32,6 +38,10 @@
:title => l(:button_delete) %>
<% end %>
<% end %>
<% if options[:wrap] %>
<br/>
&nbsp;
<% end %>
<% if options[:author] %>
<span class="author" title="<%= attachment.author%>">
<%= link_to h(truncate(attachment.author.name, length: 10, omission: '...')),user_path(attachment.author) %>,

View File

@ -5,94 +5,157 @@
<% else %>
<% bids.each do |bid|%>
<table class="content-text-list">
<tr><td colspan="2" valign="top" width="50" ><%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %></td>
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top"><strong><%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %></strong>
<span class="font_lighter"><%= l(:label_user_create_project_homework) %></span>
<span><%= link_to(bid.name, respond_path(bid), :class => 'bid_path') %></span>
<span style="float: right">
<% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
<%# 提交作业按钮 %>
<!--<%#= link_to l(:label_commit_homework), '#OpenWindow', rel: 'leanModal', onclick: "showSubH(#{bid.id}, '#{bid.name}');" if User.current.member_of?(@course) %>-->
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
<% if cur_user_homework!= nil && cur_user_homework.count == 0 %>
<%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %>
<% else %>
<span style="color: green; float: right"><%= l(:lable_has_commit_homework)%></span>
<% end %>
<% end %>
<% if (User.current.admin?||User.current.id==bid.author_id) %>
<%= link_to(
l(:button_edit),
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id},
:class => 'icon icon-edit'
) %>
<%= link_to(
l(:button_delete),
{:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'icon icon-del'
) %></span>
<% end %>
</td>
</tr>
<tr>
<td colspan="2"><span class="font_lighter">
<% bidding_project = bid.biding_projects.all
temp = []
bidding_project.each do |pro|
if pro.project && pro.project.project_status
temp << pro
end
temp
end
%>
<% if bid.homework_type == 1%>
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>(<strong><%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %></strong>)
<% else %>
<%= l(:label_x_homework_project, :count => temp.count) %>(<strong><%= link_to temp.count, course_for_bid_path(bid.id) %></strong>)
<% end %></span>
<span class="font_lighter"><%= l(:label_x_responses, :count => bid.commit) %>(<strong><%= link_to bid.commit, respond_path(bid) %></strong>)</span>
<span style="float: right">
<% if betweentime(bid.deadline) < 0 %>
<span style="color: red; float: right"><%= l(:label_commit_limit)%></span>
<% else %>
<% if betweentime(bid.deadline) < 3 %>
<span style="color: red"><%= l(:label_commit_ar) %></span>
<% else %>
<% end %>
<% end %> </span>
</td>
</tr>
<tr>
<td colspan="2"> <% if bid.reward_type.nil? or bid.reward_type == 1 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: '微软雅黑'"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %>
<%= bid.budget%></span></strong> <% elsif bid.reward_type == 2 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family:' 微软雅黑'"><%= bid.budget%></span></strong>
<% else %>
<% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%#= l(:label_price) %><%#= l(:label_RMB_sign) %><%#= bid.budget%></strong></td> --></td>
</tr>
<tr>
<td colspan="2" width="580px" ><span class="font_description">
<%#= bid.description %>
<%= textilizable bid, :description %>
</span></td>
</tr>
<tr>
<tr>
<td colspan="2" valign="top" width="50" >
<%= link_to(image_tag(url_to_avatar(bid.author), :class => 'avatar'), user_path(bid.author), :class => "avatar") %>
</td>
<td>
<table width="580px" border="0">
<tr>
<td colspan="2" valign="top">
<strong>
<%= link_to(bid.author.lastname+bid.author.firstname, user_path(bid.author)) %>
</strong>
<span class="font_lighter">
<%= l(:label_user_create_project_homework) %>
</span>
<span>
<%= link_to(bid.name, course_for_bid_path(bid), :class => 'bid_path') %>
</span>
<span style="float: right">
<% if(User.current.logged? && (!Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, bid.courses.first.id).first.roles&Role.where('id = ? or id = ? or id =?',5, 10, 7)).size >0)) %>
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
<% if cur_user_homework!= nil && cur_user_homework.count == 0 %>
<%= link_to l(:label_commit_homework),new_homework_attach_path(bid) %>
<% else %>
<span style="color: green; float: right">
<%= l(:lable_has_commit_homework)%>
</span>
<% end %>
<% end %>
<% if (User.current.admin?||User.current.id==bid.author_id) %>
<span id="<%=bid.id %>_anonymous_comment">
<% case bid.comment_status %>
<% when 0 %>
<%= link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true %>
<% when 1 %>
<%= link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true %>
<% when 2 %>
匿评结束
<% end %>
</span>
<%= link_to(
l(:button_edit),
{:action => 'edit', :controller=>'bids', :course_id =>@course.id, :bid_id => bid.id},
:class => 'icon icon-edit'
) %>
<%#= link_to(
l(:button_delete),
{:action => 'homework_destroy', :controller=>'bids', :course_id => bid.id},
:method => :post,
:data => {:confirm => l(:text_are_you_sure)},
:class => 'icon icon-del'
) %>
<% end %>
</span>
</td>
</tr>
<tr>
<td colspan="2">
<span class="font_lighter">
<% bidding_project = bid.biding_projects.all
temp = []
bidding_project.each do |pro|
if pro.project && pro.project.project_status
temp << pro
end
temp
end
%>
<% if bid.homework_type == 1%>
<%= l(:label_x_homework_project, :count => bid.homeworks.count) %>
(
<strong>
<%= link_to bid.homeworks.count, course_for_bid_path(bid.id) %>
</strong>)
<% else %>
<%= l(:label_x_homework_project, :count => temp.count) %>
(
<strong>
<%= link_to temp.count, course_for_bid_path(bid.id) %>
</strong>)
<% end %>
</span>
<span class="font_lighter">
<%= l(:label_students_responses) %>
(
<strong>
<%= bid.commit.nil? ? bid.commit : 0 %>
</strong>
)
</span>
<span style="float: right">
<% if betweentime(bid.deadline) < 0 %>
<span style="color: red; float: right">
<%= l(:label_commit_limit)%>
</span>
<% else %>
<% if betweentime(bid.deadline) < 3 %>
<span style="color: red">
<%= l(:label_commit_ar) %>
</span>
<% end %>
<% end %>
</span>
</td>
</tr>
<tr>
<td colspan="2">
<% if bid.reward_type.nil? or bid.reward_type == 1 %>
<strong>
<%= l(:label_bids_reward_method) %>
<span style="color: #ed8924;font-family: 14px; font-family: '微软雅黑'">
<%= l(:label_call_bonus) %>
&nbsp;
<%= l(:label_RMB_sign) %>
<%= bid.budget%>
</span>
</strong>
<% elsif bid.reward_type == 2 %>
<strong>
<%= l(:label_bids_reward_method) %>
<span style="color: #15bccf;font-family: 14px; font-family:' 微软雅黑'">
<%= bid.budget%>
</span>
</strong>
<% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%#= l(:label_price) %><%#= l(:label_RMB_sign) %><%#= bid.budget%></strong></td> -->
</td>
</tr>
<tr>
<td colspan="2" width="580px" >
<span class="font_description">
<%= textilizable bid, :description %>
</span>
</td>
</tr>
<tr>
<td style="text-align: left">
<span class="font_lighter">
<%= l(:label_create_time) %> :&nbsp; <%=format_time bid.created_on %></span><span style="float: right"> <%= l(:field_deadline) %> :&nbsp; <%=bid.deadline %>
</span></td>
<%= l(:label_create_time) %>
:&nbsp;
<%=format_time bid.created_on %>
</span>
<span style="float: right">
<%= l(:field_deadline) %>
:&nbsp;
<%=bid.deadline %>
</span>
</td>
<td></td>
</tr>
</table></td>
</table></td>
</tr>
</table>
<% end %>
<% end %>
<div class="pagination">

View File

@ -1,15 +1,15 @@
<%= render_flash_messages %>
<div id="put-bid-form" style="display: none">
<%= form_for HomeworkAttach.new, :url => {:controller => 'bids', :action => 'add_homework'}, :update => "bidding_project_list", :complete => '$("#put-bid-form").hide();', :html => {:multipart => true, :id => 'add_homework_form'} do |f| %>
<fieldset>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
</fieldset>
<%= submit_tag l(:button_create), :onclick => "return true" %>
<fieldset>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p id="put-bid-form-partial">
<%= render :partial => 'attachments/form' %>
</p>
</fieldset>
<%= submit_tag l(:button_create), :onclick => "return true" %>
<% end %>
<script type="text/javascript">
function j_submit () {
@ -26,44 +26,76 @@
{
$("#what_is_project_div").slideToggle();
}
window.onready = function()
{
<% if !@is_teacher && @homework_list.count > 0 && @bid.comment_status == 1%>
//登录者不是老师且作业列表数目不为0且作业处于开启匿评阶段
var alert_model = "'#ajax-modal'";
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'homework_attach/praise_alert') %>');
showModal('ajax-modal', '480px');
$('#ajax-modal').css('height','240px');
$('#ajax-modal').before("<span style='float: right;padding-left: 455px;cursor:pointer;'>" +
"<a href='#' onclick='hiddent_alert_model();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
<% end %>
}
function hiddent_alert_model(){hideModal($('#popbox02'));}
function hidden_homework_atert_form(cur_page,cur_type)
{
hideModal($("#popbox"));
// 评了分的则刷新列表
switch (cur_type)
{
case 1:
$.ajax({
type: "GET",
url: "<%= get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
data: 'text',
success: function (data) {
}
});
break;
case 2:
$.ajax({
type: "GET",
url: "<%= get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
data: 'text',
success: function (data) {
}
});
break;
case 3:
$.ajax({
type: "GET",
url: "<%= get_homeworks_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
data: 'text',
success: function (data) {
}
});
break;
case 4:
$.ajax({
type: "GET",
url: "<%= get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id)%>&page=" + cur_page,
data: 'text',
success: function (data) {
}
});
break;
case 5:
break;
default :
break;
}
}
</script>
</div>
<% if User.current.logged? && User.current.member_of_course?(@bid.courses.first) && cur_user_homework_for_bid(@bid).count == 0 && is_cur_course_student(@bid.courses.first) %>
<div class='icon icon-add'>
<%#= link_to l(:label_commit_homework), new_submit_homework_path, :onclick => "$('#put-bid-form').slideToggle(); this.blur(); return false;" %>
<%= link_to l(:label_course_new_homework),new_homework_attach_path %><strong style="color: #a9a9a9">&nbsp;&nbsp;(每一个作业都可以是一个精美的作品)</strong>
</div>
<% end %>
<table style="width: 100%">
<tr>
<td style="width: 50%">
<% if @homework_list.empty? %>
<div class="font_lighter_sidebar" style="padding-left: 10px;">
<span>暂无学生提交作业!</span>
</div>
<% end %>
</td>
<td style="width: 50%">
<div class="font_lighter_sidebar" style="padding-left: 200px;">
<strong><a href="#" onclick="show()" style="color:#919294;">什么是项目?</a></strong>
</div>
</td>
</tr>
<tr>
<td style="width: 50%">
</td>
<td style="width: 50%">
<div id = "what_is_project_div" style="display: none">
<p>项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。</p>
<p>项目托管平台:<%= link_to Setting.protocol + "://" + Setting.host_name + "/", home_path %> </p>
<%= link_to "我要创建项目",new_project_path(course: 0, project_type: 0), :target => '_blank'%>
</div>
</td>
</tr>
</table>
<div id='bidding_project_list'>
<%= render :partial => 'homework_list', :locals => {:homework => @homework_list} %>
<%= render :partial => 'homework_list' %>
</div>

View File

@ -40,7 +40,7 @@
<p>
<%= f.select :is_evaluation, is_evaluation_option %>
</p>
<p>
<p style="display: none;">
<%= f.select :proportion, proportion_option %>
</p>
<p>

View File

@ -1,163 +1,65 @@
<!-- fq -->
<% is_student = is_cur_course_student(@bid.courses.first) %>
<% is_teacher = is_course_teacher(User.current,@bid.courses.first) %>
<!-- 当is_evaluation为1或者null(null主要是为了兼容前面数据)时代表启用互评功能2表示未启用 -->
<% is_evaluation = @bid.is_evaluation == 1 || @bid.is_evaluation == nil %>
<%= form_tag(:controller => 'bids', :action => "show_courseEx", :method => :get) do %>
<div class="project-search-block">
<table width="100%" valign="center">
<tr>
<td ><span style="margin-left:0px"><%= l(:label_task_plural)%>(<%= @homework_list.count%>)</span>
<%= link_to "作业打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "button_submit button_submit_font_white", style: "margin: 5px 10px;line-height: 20px;height: 20px;display: inline-block;" if(is_teacher && @bid.homeworks.count > 0) %>
</td>
<td align="right">
<div class="project-search">
<% if is_teacher %>
<%= text_field_tag 'student_id', params[:student_id], :size => 30 %>
<%= submit_tag l(:label_search_by_student_id), :class => "small", :name => nil %>
<% end %>
</div>
</td>
</tr>
</table>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>作业列表页_老师界面</title>
<%= stylesheet_link_tag 'css', :media => 'all' %>
</head>
<body>
<div id="content">
<div id="tb_" class="tb_">
<% if @is_teacher %>
<ul>
<li id="tb_1" class="hovertab">
<%= link_to "未批作品", get_not_batch_homework_homework_attach_index_path(:bid_id => @bid.id), { id: 'not_batch_homework', :remote => true}%>
</li>
<li id="tb_2" class="normaltab">
<%= link_to "已改作品", get_batch_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
</li>
<li id="tb_3" class="normaltab">
<%= link_to "全部作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
</li>
<li id="tb_4" class="normaltab">
<%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
(<span id="jours_count" class="c_red f_12"><%= @jours_count %></span>)
</li>
<li >
<%= link_to "作品打包下载", zipdown_assort_path(obj_class: @bid.class, obj_id: @bid), class: "tb_all" unless @bid.homeworks.empty? %>
</li>
</ul>
<% else %>
<ul>
<li id="tb_5" class="hovertab">
<%= link_to "待评作品", get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
</li>
<li id="tb_6" class="normaltab">
<%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
</li>
<% if @bid.comment_status == 2 %>
<!-- 匿评结束后才能看到全部作业列表 -->
<li id="tb_7" class="normaltab">
<%= link_to "所有作品", get_homeworks_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
</li>
<% end %>
<li id="tb_8" class="normaltab">
<%= link_to "留言", get_homework_jours_homework_attach_index_path(:bid_id => @bid.id), {:remote => true}%>
(<span id="jours_count" class="c_red f_12">
<%= @jours_count %>
</span>)
</li>
</ul>
<% end %>
</div>
<% end %>
<% display_id = im_watching_student_id? @bid%>
<% @homework_list.each do |homework|%>
<table width="660px" border="0" align="center" id="homework_attach_<%= homework.id %>" >
<tr>
<td style="vertical-align: top;width: 70px" >
<table style="text-align: center;width: 100%;table-layout: fixed">
<% user_name = is_teacher ? (homework.user.lastname + homework.user.firstname) : homework.user.login %>
<tr>
<td title="<%= user_name %>"><%= image_tag(url_to_avatar(homework.user), :class => "avatar")%></td>
</tr>
<tr>
<td title="<%= user_name %>">
<p style="width: 100%;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;"><strong>
<%= link_to user_name, user_path(homework.user),{:style => "color:#727272"} %>
</strong></p>
</td>
</tr>
<tr>
<td>
<% if (users_for_homework(homework).include?(User.current) || is_teacher) %>
<%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
<% if homework.user == User.current || is_teacher %>
<%= link_to(l(:label_bid_respond_delete), homework,
method: :delete, :confirm => l(:text_are_you_sure)) %>
<% end %>
<% end %>
</td>
</tr>
</table>
<span></span>
</td>
<td colspan="2">
<table width="580px" border="0" style="table-layout: fixed">
<tr>
<td style="width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<strong>作品名称:</strong>&nbsp;
<% if homework.name == nil || homework.name == "" %>
<% homework_filename = homework.user.name + "提交的作业" %>
<% else %>
<% homework_filename = homework.name %>
<% end %>
<strong title="<%=homework_filename%>">
<%= link_to homework_filename , homework_attach_path(homework)%>
</strong>
</td>
<td style="vertical-align: top;width: 200px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<strong>合作成员:&nbsp;</strong>
<% homework_users = homework_user_of_homework(homework,is_teacher) %>
<% if homework.users.count == 0 %>
<% else %>
<span title="<%= homework_users%>"><%= homework_users %></span>
<% end %>
</td>
<td rowspan="4" style="text-align: center;vertical-align: middle;width: 30px">
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="required">迟交</span>
<% end %>
</td>
</tr>
<tr>
<td style="width: 300px;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;">
<strong>开发项目</strong>:&nbsp;
<% if homework.project != nil %>
<span title="<%= homework.project.name %>">
<%= link_to homework.project.name,project_path(homework.project.id)%>
</span>
<% else %>
暂无
<% end %>
</td>
<td>
<strong>项目得分:&nbsp;
<span style="color: <%= homework.project.nil? ? "#727272" : "#EC6300"%>;">
<%= homework.project.nil? ? "N/A" : project_scores(homework.project) %>
</span>
</strong>
</td>
</tr>
<tr>
<td>
<strong>提交文件:&nbsp;
<% if is_evaluation || is_teacher%>
<%= link_to "打包下载", :controller => "zipdown", :action => "download_user_homework",:homework => homework%>
<% else %>
<span class="required">未开启互评功能作业不允许下载</span>
<% end %>
</strong>
</td>
<td>
<strong>互评得分:&nbsp;
<%# student_homework_score = student_score_for_homework(homework) %>
<span style="color:<%= homework.s_score.nil? ? "#727272" : "#EC6300"%>;">
<% score = homework.s_score.nil? ? "N/A" : format("%.2f",homework.s_score) %>
<%= score %>
</span>&nbsp;&nbsp;
<% if is_evaluation && is_student && (!users_for_homework(homework).include? User.current)%>
<%= link_to "学生互评>>",homework_attach_path(homework) %>
<% end %>
</strong>
</td>
</tr>
<tr>
<td style="vertical-align: top;width: 200px;">
<% if is_evaluation || is_teacher%>
<%= render :partial => 'app_link', :locals => {:attachments => homework.attachments} %>
<% end %>
</td>
<td>
<strong>终评得分:&nbsp;
<%# totle_homework_score = score_for_homework(homework) %>
<% totle_homework_score = format("%.2f",(homework.t_score.nil? ? 0.00 : homework.t_score) * ((@bid.proportion.nil? ? 60 : @bid.proportion) * 1.0 / 100) +
(homework.s_score.nil? ? 0.00 : homework.s_score) * (1 - (@bid.proportion.nil? ? 60 : @bid.proportion) * 1.0 / 100)) %>
<span style="color:<%= totle_homework_score == "0.00"? "#727272" : "#EC6300"%> ;">
<% score = totle_homework_score == "0.00"? "N/A" : totle_homework_score %>
<%= score %>
</span>&nbsp;&nbsp;
<% if is_teacher %>
<%= link_to "教师评分>>",homework_attach_path(homework) %>
<% end %>
</strong>
</td>
</tr>
</table>
</td>
</tr>
</table>
<div class="line_under"></div>
<% end %>
<!--分页-->
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>
<div class="cl"></div>
<div class="ctt">
<div class="dis" id="tbc_01">
<%= render :partial => 'homework_attach/homeworks_list',
:locals => {:homeworks => @homework_list,
:homework_count => @obj_count,
:remote => false,
:is_student_batch_homework => @is_student_batch_homework}%>
</div>
</div>
</div>
<div id="show_homework_attach_model"></div>
</body>
</html>

View File

@ -13,13 +13,17 @@
$('#' + id).val(content);
}
}
function submit1(button)
{
$('#jours_submit').parent().submit();
}
</script>
<%= form_for('bid_message', :remote => true, :method => :post,
<%= form_for('bid_message', :id=>"bid_message_form",:remote => true, :method => :post,
:url => {:controller => 'bids',
:action => 'create',
:id => bid,
:sta => sta}) do |f|%>
:sta => sta}) do |f|%>
<div id = 'pre_show'>
<%= render :partial => 'pre_show', :locals => {:content => @content} %>
@ -29,21 +33,21 @@
<table border="0" width="525px" align="center" >
<tr>
<% if @bid.reward_type ==3 %>
<td><%= f.text_area 'message', :rows => 3, :cols => 65, :placeholder => l(:label_my_question), :style => "resize: none;", :class => 'noline'%></td>
<td><%= f.text_area 'message', :rows => 3, :cols => 65, :placeholder => l(:label_max_length), :style => "resize: none;", :class => 'noline'%></td>
<% else %>
<td><%= f.text_area 'message', :rows => 3, :cols => 65, :placeholder => l(:label_my_respond), :style => "resize: none;", :class => 'noline'%></td>
<td><%= f.text_area 'message', :rows => 3, :cols => 65, :placeholder => l(:label_max_length), :style => "resize: none;", :class => 'noline'%></td>
<% end %>
</tr>
<tr>
<td><%= f.text_field :reference_user_id, :style=>"display:none"%>
<a href="javascript:void(0);" class="ping_sub" onclick = "clearMessage('bid_message_message');"><%= l(:button_clear_meassge) %></a>
<a href="#" class="ping_sub" id="jours_submit" onclick="submit1();"><%= l(:label_responses) %></a></td>
</tr>
</table>
<%= f.text_field :reference_user_id, :style=>"display:none"%>
<!-- modified by bai -->
<table border="0" width="525px" align="center">
<tr>
<td align="right"> <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'"%>
<%= submit_tag l(:button_clear_meassge), :name => nil, :onclick => "clearMessage('bid_message_message');", :type => 'button', :class => "bid_btn", :onmouseout => "this.style.backgroundPosition = 'left top'", :onmouseover => "this.style.backgroundPosition = 'left -31px'" %> </td>
</tr>
</table>
<!-- modified by bai 525px -->
<!-- end -->
<% else %>

View File

@ -54,6 +54,7 @@
<p class="buttons" style="padding-top: 10px; padding-bottom: 1px; margin-bottom: 1px">
<%= submit_tag l(:label_new_join), :name => nil, :class => "bid_btn", :onclick => "hideModal(this);" %>
<%= submit_tag l(:button_cancel), :name => nil, :class => "bid_btn", :onclick => "hideModal(this);", :type => 'button' %>
</p>
</td>
</tr></table>
<% end %>

View File

@ -1,6 +1,6 @@
<!-- fq -->
<% unless content.nil?%>
<table width="60%" style="margin-left: 60px;">
<table width="80%" style="margin-left: 60px;">
<tr>
<td> <%= textilizable content %></td>
</tr>

View File

@ -1,4 +1,6 @@
$('#history').html('<%= escape_javascript(render(:partial => 'bids/history', :locals => {:bid => @bid, :journals => @jour, :state => true})) %>');
$('#history').html('<%= escape_javascript(render(:partial => 'homework_attach/history', :locals => {:bid => @bid, :journals => @jour, :state => true})) %>');
//$('#tbc_01').html('<#%= escape_javascript(render(:partial => 'homework_attach/homework_jours',:locals => { :bid => @bid, :journals => @jour, :state => false} )) %>');
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
$('#jours_count').html("<%= @jours.count %>");
$('#bid_message_message').val("");
$('#bid_message_reference_user_id').val("");

View File

@ -0,0 +1,2 @@
alert('启动成功')
$("#<%= @bid.id %>_start_anonymous_comment").html('<%= link_to "关闭匿评", stop_anonymous_comment_bid_path(@bid), remote: true %>')

View File

@ -0,0 +1,2 @@
alert('关闭成功')
$("#<%= @bid.id %>_anonymous_comment").html('已关闭匿评')

View File

@ -42,7 +42,7 @@
<span id="bid_deadline_span">
</span>
</p>
<p>
<p style="display: none">
<%= f.select :is_evaluation, is_evaluation_option %>
</p>
<p>

View File

@ -49,6 +49,11 @@
$('#' + id).val(content);
}
}
function submit1(button)
{
$('#jours_submit').parent().submit();
}
</script>
<%= form_for('new_form', :remote => true, :method => :post,
@ -63,27 +68,13 @@
</div>
<% if User.current.logged? %>
<table border="0" width="525px" align="center" >
<tr>
<td><%= f.text_area 'user_message', :rows => 3, :cols => 65, :value => "#{l(:label_leave_a_message)}",
:onfocus => "clearInfo('new_form_user_message','#{l(:label_leave_a_message)}')",
:onblur => "showInfo('new_form_user_message','#{l(:label_leave_a_message)}')",
:style => "resize: none;", :class => 'noline'%></td>
</tr>
</table>
<%= f.text_area 'user_message', :rows => 3, :cols => 65,
:style => "resize: none;", :class => 'noline', :placeholder => l(:text_caracters_maximum,:count=>250)%>
<%= f.text_field :reference_user_id, :style=>"display:none"%>
<table border="0" width="525px" align="center">
<tr>
<td align="right"> <%= submit_tag l(:button_leave_meassge),
:name => nil , :class => "enterprise",
:onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -31px'"%>
<%= submit_tag l(:button_clear_meassge), :name => nil, :class => "enterprise",
:onclick => "clearMessage('new_form_user_message');",
:onmouseout => "this.style.backgroundPosition = 'left top'",
:onmouseover => "this.style.backgroundPosition = 'left -31px'" %> </td>
</tr>
</table>
<div style="float:right">
<a href="#" class="ping_sub1" id="jours_submit" onclick="submit1();"><%= l(:label_submit_comments) %></a>
</div>
<% else %>
<div style="font-size: 14px;margin:10px;text-align: center">
<%= l(:label_user_login_tips) %>

View File

@ -1,4 +1,4 @@
<div style="text-align: center;">评分:
<div>评分:
<%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %>
<span style="font-size: 11px">(您可以对作业进行多次评价,以最后一次评价为最终结果)</span>
</div>

View File

@ -0,0 +1,25 @@
<div class="ping_list">
<div id="ping_tb_" class="ping_tb_">
<ul>
<li id="ping_tb_4" class="ping_normaltab" onclick="i:HoverLi(4);">
<%= l(:label_teacher_comments) %><span class="c_red" id="jour_count_4"><%= @comprehensive_evaluation.nil? ? 0 : @comprehensive_evaluation.count %></span></li>
<li id="ping_tb_5" class="ping_normaltab" onclick="i:HoverLi(5);">
<%= l(:label_anonymous_comments) %><span class="c_red" id="jour_count_5" ><%= @anonymous_comments.nil? ? 0 : @anonymous_comments.count %></span></li>
<li id="ping_tb_3" class="ping_hovertab" onclick="x:HoverLi(3);">
<%= l(:label_responses) %><span class="c_red" id="jour_count_3"><%= @jours.nil? ? 0 : @jours.count %></span></li>
</ul>
</div>
<div class="cl"></div>
<div class="ping_ctt">
<div class="ping_dis" id="tbc_03">
<%= render :partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true} %>
</div>
<div class="ping_undis" id="tbc_04">
<%= render :partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false} %>
</div>
<div class="ping_undis" id="tbc_05">
<%= render :partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false} %>
</div>
</div>
</div><!---ping_list end--->

View File

@ -0,0 +1,65 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% label = ''
case bid.reward_type
when 1
label = l(:label_respond_requirement)
when 2
label = l(:label_contest_requirement)
when 3
label = l(:label_question_requirement)
else
end
%>
<div class="ping_ctt">
<div id="tbc_01" class="ping_dis">
<% if journals.size > 0 %>
<% for journal in journals %>
<div class="ping_C" id='word_li_<%= journal.id.to_s %>'>
<div class="ping_dispic"><a target="_blank" href="#"><%= image_tag(url_to_avatar(journal.user)) %></a></div>
<div class="ping_discon" style="width: 85%;">
<div class="ping_distop">
<!-- <a style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;" target="_blank" href="#">gugu01</a> -->
<span><%= link_to journal.user, user_path(journal.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span><span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= format_time(journal.created_on) %></span>
<div class="cl"></div>
<p><%= textilizable journal.notes%></p>
</div>
<div class="ping_disfoot">
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span style="float: right">
<% if journal.user == User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete),
{:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete',
:class => "delete", :title => l(:button_delete)) %>
<% end %>
<% if reply_allow %>
<%= link_to l(:label_bid_respond_quote),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"} %>
<%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal},
:remote => true,:method => 'post', :title => l(:button_quote))%>
<% end %>
</span>
<span class="font_lighter" style="float: right">
<%= l(:label_bids_published) %>&nbsp;
<%= time_tag(journal.created_on).html_safe %>&nbsp;
<%= l(:label_bids_published_ago) %>
</span>
</div>
<div style="clear: both;"></div>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<% if reply_allow %>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
</div>
<% end %>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
</div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>
</div>
</div>

View File

@ -0,0 +1,101 @@
<li class="pic_head">
<% if is_student_batch_homework %>
<!-- 学生匿评 不现实姓名、头像,以及相关的连接 -->
<a><%= image_tag(url_to_avatar("匿名"), :width => "40", :height => "40")%></a>
<a>匿名</a>
<% else %>
<%= link_to image_tag(url_to_avatar(homework.user), :width => "40", :height => "40"), user_path(homework.user) %>
<span>
<% user_realname = homework.user.lastname.to_s + homework.user.firstname.to_s %>
<% user_name = is_teacher ? (user_realname.empty? ? homework.user.login : user_realname) : homework.user.login %>
<%= link_to user_name, user_path(homework.user), :title => user_name %>
</span>
<% end %>
</li>
<li class="wname">
<% if homework.name == nil || homework.name == "" %>
<% homework_filename = homework.user.name + "提交的作业" %>
<% else %>
<% homework_filename = homework.name %>
<% end %>
<%= link_to homework_filename , homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type), :title => homework_filename, :remote => true%>
</li>
<li class="wdown">
<%= link_to "(#{homework.attachments.count.to_s}个附件)", zipdown_download_user_homework_path(:homework => homework)%>
</li>
<li class="wscore">
<%= l(:label_teacher_score)%>:
<span class="c_red">
<%= homework.t_score.nil? ? l(:label_without_score) : format("%.2f",homework.t_score)%>
</span>
&nbsp;&nbsp;
</li>
<li class="wscore">
<%= l(:label_student_score)%>:
<span class="c_red">
<%= homework.s_score.nil? ? l(:label_without_score) : format("%.2f",homework.s_score) %>
</span>
</li>
<% if is_teacher %>
<!-- 是老师,所有列表正常显示 -->
<li class="wping">
<%= link_to l(:label_work_rating),homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type),:remote => true %>
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>
<% else %>
<!-- 是学生 -->
<% if is_my_homework %>
<!-- 我的作品,显示为编辑和删除 -->
<% if @bid.comment_status == 0 %>
<li class="wmine">
<%= link_to l(:button_edit), edit_homework_attach_path(homework) %>
<% if homework.user == User.current || User.current.admin? %>
<!-- 作业创建者显示删除作业 -->
<%= link_to(l(:label_bid_respond_delete), homework,
method: :delete, :confirm => l(:text_are_you_sure), :remote => true ) %>
<% else %>
<!-- 作业参与者显示退出作业 -->
<%= link_to l(:label_logout), destory_homework_users_homework_attach_path(homework,:user_id=>User.current.id),
:remote => true, :confirm => l(:label_sure_exit_homework) %>
<% end %>
</li>
<% else %>
<li class="wmine" title="只有开启匿评之前才能修改和删除作业哦!">
<a style="color:#8e8e8e;"><%= l(:button_edit) %></a>
<% if homework.user == User.current || User.current.admin? %>
<!-- 作业创建者显示删除作业 -->
<a style="color:#8e8e8e;"><%=l(:label_bid_respond_delete)%></a>
<% else %>
<!-- 作业参与者显示退出作业 -->
<a style="color:#8e8e8e;"><%=l(:label_logout) %></a>
<% end %>
</li>
<% end %>
<% elsif is_student_batch_homework%>
<!-- 学生匿评列表 -->
<% if @bid.comment_status == 1 %>
<!-- 处于开启匿评阶段,可以正常评分 -->
<li class="wping">
<%= link_to l(:label_work_rating),homework_attach_path(homework,:cur_page => @cur_page,:cur_type => @cur_type),:remote => true %>
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>
<% elsif @bid.comment_status == 2%>
<!-- 处于匿评已关闭阶段,不容许评分 -->
<li class="wping" title="关闭匿评后不可继续评分">
<a style="color:#8e8e8e;">评分</a>
<% if Time.parse(@bid.deadline.to_s).strftime("%Y-%m-%d") < Time.parse(homework.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">&nbsp;&nbsp;迟交!</span>
<% end %>
</li>
<% end %>
<% else %>
<!-- 学生众评列表,显示为点赞 -->
<li class="wzan" id="homeworl_praise_li_<%= homework.id%>">
<%= render :partial => "homework_attach/homework_praise", locals: {:homework => homework} %>
</li>
<% end %>
<% end %>

View File

@ -0,0 +1,14 @@
<div class="msg_box" id='leave-message'>
<h4>留言内容</h4>
<%= render :partial => 'bids/new', :locals => {:bid => @bid, :sta => @state} %>
<!-- <textarea id="ta_msg_content" name="content" placeholder="最多250个字"></textarea> -->
<!-- <a href="#">取&nbsp;&nbsp;消</a><a href="#">留&nbsp;&nbsp;言</a> -->
</div>
<div id="history">
<%= render :partial => 'homework_attach/history',:locals => { :bid => @bid, :journals => @jour, :state => false} %>
</div>
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true%></ul>

View File

@ -1,11 +1,22 @@
<script>
function submit_homework_user()
{
$(".edit_user").submit();
}
</script>
<%= error_messages_for 'member' %>
<div style="float:left; width:60%;padding-left: 10px;padding-right: 10px"
xmlns="http://www.w3.org/1999/html" id = "homework_of_users">
<table class="list members" style="width: 100%">
<thead>
<tr>
<th><%= l(:label_user) %></th>
<th><%= l(:label_role_plural) %></th>
<th>
<%= l(:label_user) %>
</th>
<th>
<%= l(:label_role_plural) %>
</th>
<th style="width:10%"></th>
</tr>
</thead>
@ -19,9 +30,15 @@
<% hoemwork_users.each do |user| %>
<tr id="member-<%= user.id %>" class="<%= cycle 'odd', 'even' %> member" style="text-align: center">
<% if homework.user != user %>
<td style="width: 40%"><%= link_to_user user %></td>
<td style="text-align: center;width: 50%"> 参与人员 </td>
<td><%= link_to l(:button_delete),destory_homework_users_homework_attach_path(:user_id=>user),:remote => true, :method => :post %></td>
<td style="width: 40%">
<%= link_to_user user %>
</td>
<td style="text-align: center;width: 50%">
参与人员
</td>
<td>
<%= link_to l(:button_delete),destory_homework_users_homework_attach_path(:user_id=>user),:remote => true, :method => :post, :confirm => l(:label_delete_confirm) %>
</td>
<% end %>
</tr>
<% end %>
@ -31,14 +48,23 @@
<div class="splitcontentright" style="width: 37%">
<%= form_for(hoemwork_users, {:url => add_homework_users_homework_attach_path(homework), :remote => true, :method => :post}) do |f| %>
<fieldset>
<legend><%= l(:label_member_new) %></legend>
<p><%= label_tag "principal_search", l(:label_principal_search) %><%= text_field_tag 'principal_search', nil %></p>
<fieldset style=" border:none; margin-top:10px;">
<legend style=" font-weight:bold; color:#15bccf;">
<%= l(:label_member_new) %>
</legend>
<p style="padding-left: 20px;">
<%= label_tag "principal_search", l(:label_principal_search) %>
<%= text_field_tag 'principal_search', nil ,{:class => "N_search",:style => "width:50%;"}%>
</p>
<%= javascript_tag "observeSearchfield('principal_search', null, '#{ escape_javascript get_homework_member_list_homework_attach_index_path(:q => params[:q], :bid_id => params[:id]||homework, :format => 'js') }')" %>
<div id="principals_for_new_member">
<div id="principals_for_new_member" style="padding-left: 20px;">
<%= render_new_members_for_homework(members) %>
</div>
<p><%= submit_tag l(:button_add), :id => 'member-add-submit' %></p>
</fieldset>
<p style="padding-left: 20px;">
<a href="#" class="tijiao" id='member-add-submit' onclick="submit_homework_user();">
<%= l(:button_add) %>
</a>
</p>
</fieldset>
<% end %>
</div>

View File

@ -0,0 +1,9 @@
<% if is_praise_homework User.current.id,homework.id %>
<%= link_to "",praise_homework_homework_attach_path(homework),
:class => "wzan_img", :remote => true, :title => "点赞"%>
<% else %>
<a class="wzan_img wzan_visited" title="您已经赞过该作业"></a>
<% end %>
<a>
<%= praise_homework_count homework.id %>
</a>

View File

@ -0,0 +1,64 @@
<% is_teacher = is_course_teacher(User.current,@bid.courses.first) %>
<% is_my_homework ||= false %>
<% is_student_batch_homework ||= false %>
<% unless is_my_homework || is_student_batch_homework %>
<div class="code_list">
<span>
<%= l(:label_homework_list)%>
(<font color="#CC0000">
<%= homework_count%>
</font>)
</span><span class="fr">
按&nbsp;
<%= link_to l(:label_work_rating), sort_homework_path(@bid, 'socre', @direction), {:remote => true}%>
&nbsp;/&nbsp;
<%= link_to l(:label_time), sort_homework_path(@bid, 'time', @direction), {:remote => true}%>
&nbsp;<%= l(:label_sort) %>
</span>
</div>
<% end %>
<div class="cl"></div>
<% unless homeworks.nil? %>
<% if !is_teacher && is_my_homework && homeworks.empty? %>
<!-- 是学生,我的作业,且作业列表为空,即我未提交作业 -->
<ul>
<li class="pic_head">
<%= link_to image_tag(url_to_avatar(User.current), :width => "40", :height => "40"), user_path(User.current) %>
<span>
<%= link_to User.current.login, user_path(User.current), :title => User.current.login%>
</span>
</li>
<li class="c_red" style="margin:25px 0 0 20px;"> 您还没交作业,请创建作业!</li>
<% if @bid.comment_status == 0 %>
<!-- 老师布置的作业在创建和开启匿评这段时间才允许创建作品 -->
<li class="wping">
<%= link_to "创建作业", new_exercise_book_path(@bid), :style => "width:80px; margin:20px 0 0 350px;" %>
</li>
<% else %>
<li class="wping">
<a style="width:80px; margin:20px 0 0 350px;">创建作业</a>
</li>
<% end %>
</ul>
<div class="cl"></div>
<% end %>
<% homeworks.each do |homework| %>
<ul id="homework_li_<%= homework.id%>">
<%= render :partial => 'homework_attach/homework',
:locals => {:homework => homework, :is_student_batch_homework => is_student_batch_homework,
:is_my_homework => is_my_homework, :is_teacher => is_teacher}%>
</ul>
<div class="cl"></div>
<% end %>
<% else %>
<% end %>
<!-- 如果是我的作业或者匿评列表界面不现实分页控件 -->
<% unless is_my_homework || is_student_batch_homework %>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => remote, :flag => true%>
</ul>
<% end %>

View File

@ -0,0 +1,54 @@
<% jours.nil? || jours.count == 0 || jours.each do |jour| %>
<div class="ping_C">
<div class="ping_dispic">
<% if show_name %>
<%= link_to image_tag(url_to_avatar(jour.user)) , user_path(jour.user), :target =>"_blank" %>
<% else %>
<a><%= image_tag(url_to_avatar(nil))%></a>
<a><%= l(:label_anonymous) %></a>
<% end %>
</div>
<div class="ping_discon">
<div class="ping_distop">
<span><%= link_to jour.user, user_path(jour.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%></span>
<span style="color:#a6a6a6; margin-right:40px; margin-left:30px;"><%= format_time(jour.created_on) %></span>
<span style="font-weight:bold; color:#a6a6a6; ">
<% if show_score %>
<%= l(:label_work_rating) %>
<%= render :partial => 'show_score', locals: {:stars => get_homework_score(jour.user,@homework ) } %>
<% end %>
</span>
<div class="cl"></div>
<p><%= textilizable jour.notes%></p>
</div>
<div class="ping_disfoot">
<% ids = 'project_respond_form_'+ jour.id.to_s%>
<span>
<% if jour.user==User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete), {:controller => 'homework_attach', :action => 'destroy_jour', :object_id => jour, :user_id => jour.user,:jour_id =>@homework.id },
:remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
<% end %>
<%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{jour.user.name}: '); $('##{ids} textarea') ;return false;"}
%>
</span>
</div>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => jour, :m_reply_id => jour} %>
</div>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => jour } %>
</div>
</div>
<div class="cl"></div>
</div>
<div class="cl"></div>
<% end %>
<% if is_jour%>
<div class="dis">
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => true, :flag => true%></ul>
</div>
<% end %>

View File

@ -0,0 +1,20 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>作业评分弹框</title>
</head>
<body>
<div id="popbox02">
<div class="ni_con">
<h2><img src="/images/bid/pic_top.jpg" width="188" height="37" alt="匿名评价" /></h2>
<p>&nbsp;&nbsp;&nbsp;&nbsp;据说雷锋做完好事是从来不留名的呢,我们这次评分也不留名!!!但是,但是,您给的分数一定要公正哦,老天爷看不到,我们的系统可是清楚得很!</p>
<p style="margin-bottom:15px;">&nbsp;&nbsp;&nbsp;&nbsp;别怪我没告诉你,系统分配给你的作品不评价可是要扣分的哈!</p>
<a href="#" class="tijiao" style="margin-left:100px;" onclick="hideModal(this)">匿名评分</a>
<a href="#" style="color:#15bccf; margin-top:20px; display:block;" onclick="hideModal(this)">冒着扣分的危险残忍拒绝</a>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,79 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<script type="text/javascript" language="javascript">
//<!CDATA[
function g(o){return document.getElementById(o);}
function HoverLi(n){
//如果有N个标签,就将i<=N;
for(var i=3;i<=5;i++){g('ping_tb_'+i).className='ping_normaltab';g('tbc_0'+i).className='ping_undis';}g('tbc_0'+n).className='ping_dis';g('ping_tb_'+n).className='ping_hovertab';
}
//如果要做成点击后再转到请将<li>中的onmouseover 改成 onclick;
//]]>
</script>
<%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%>
<div id="popbox">
<div class="ping_con">
<h2><%= @homework.name %></h2>
<ul>
<li><%= l(:label_create_person) %>
<span class="c_grey">
<% if @is_anonymous_comments && @is_comprehensive_evaluation != 1 %>
<%= l(:label_anonymous) %>
<% else %>
<%= link_to @homework.user, user_path(@homework.user)%>
<% end %>
</span>
</li>
<li style=" margin-left:130px;"><%= l(:label_activity_time) %><span class="c_grey" ><%=format_time @homework.created_at %></span></li>
</ul>
<div class="cl"></div>
<% if @homework.users.count > 0 %>
<div><%= l(:label_participation_person) %>
<% if @is_anonymous_comments && @is_comprehensive_evaluation != 1 %>
<%= l(:label_anonymous) %>
<%else%>
<% @homework.users.each do |homework_user| %>
<span class="c_grey"><%= link_to homework_user, user_path(homework_user)%></span>
<% if @homework.users.count > 1 && homework_user != @homework.users.last %>
、&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<% end %>
<% end %>
<% end %>
</div>
<% end %>
<p>
<% if @homework.description != nil && @homework.description != "" %>
<%= @homework.description %>
<% else %>
<div style="font-size: 15px;color: #15BCCC;vertical-align:middle;padding-top: 10px;padding-left: 10px ">
<strong><%= l(:label_homework_without_description) %></strong>
</div>
<% end %>
</p>
<p style=" border-bottom:none; color:#333; margin-top:8px;"><strong><%= l(:label_attachment) %>
</strong>
<span>
<% if @is_evaluation || is_teacher%>
<% options = {:author => true } %>
<%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %>
<% else %>
<%= l(:label_cant_download) %>
<% end %>
</span>
</p>
<div class="ping_star" id="star_score">
<%= render :partial => 'show_star',:locals => {:is_comprehensive_evaluation => @is_comprehensive_evaluation,:totle_score => @totle_score,:has_evaluation => @has_evaluation ,
:homework => @homework} %>
</div>
<div class="cl"></div>
<%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation} %>
<div class="cl"></div>
</div><!---ping_con end--->
<%= render :partial => 'histoey_new' %>
</div>
</div>

View File

@ -0,0 +1,15 @@
<% if is_comprehensive_evaluation == 3 %>
<%= l(:label_work_rating) %>
<%= render :partial => 'show_score', locals: {:stars => totle_score} %>
<% elsif is_comprehensive_evaluation == 2 %>
<%= l(:label_work_rating) %>
<% if has_evaluation %>
<%= render :partial => 'show_score', locals: {:stars => totle_score} %>
<% else %>
<%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %>
<% end %>
<% elsif @is_comprehensive_evaluation == 1%>
<%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality, class: 'rateable div_inline' %>
<% end %>

View File

@ -64,15 +64,15 @@
<%= l(:label_bids_published_ago) %>
</span>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span>
<span>
<%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.name}: '); $('##{ids} textarea') ;return false;"}
%>
<% if journal.user==User.current|| User.current.admin? %>
<% if journal.user==User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete), {:controller => 'homework_attach', :action => 'destroy_jour', :object_id => journal, :user_id => journal.user},
:remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
<% end %>
</span>
</span>
</span>
<div style="clear: both;"></div>
<div id='<%= ids %>' class="respond-form">

View File

@ -1,9 +1,22 @@
//教师评论
<% if @add_jour.is_comprehensive_evaluation == 1 %>
$('#comprehensive_evaluation').html('<%= escape_javascript(render(:partial => 'comprehensive_evaluation',
:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>');
//$('#comprehensive_evaluation').html('<#%= escape_javascript(render(:partial => 'comprehensive_evaluation',
//:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>');
HoverLi(4);
$('#jour_count_4').html('<%= @comprehensive_evaluation.count %>')
$('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>')
//匿评
<% elsif @add_jour.is_comprehensive_evaluation == 2 %>
// $('#message').html('<#%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false,:homework => @homework} )) %>');
// $('#pre_show').html('<#%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
HoverLi(5);
$('#jour_count_5').html('<%= @anonymous_comments.count %>')
$('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>')
//留言
<% else %>
$('#message').html('<%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false,:homework => @homework} )) %>');
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
$('#new_form_user_message').val("");
$('#new_form_reference_user_id').val("");
<% end %>
HoverLi(3);
$('#jour_count_3').html('<%= @jours.count %>')
$('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>')
<% end %>
$('#new_form_user_message').val("");
$('#new_form_reference_user_id').val("");

View File

@ -1 +1,4 @@
$('#content2').html('<%= escape_javascript(render(:partial => 'homework_member', :locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} )) %>');
$('#content2').html('<%= escape_javascript(render(:partial => 'homework_member', :locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} )) %>');
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list',
:locals => {:homeworks => @homework_list, :bid => @bid, :remote => true, :is_my_homework => @is_my_homework} )) %>');

View File

@ -0,0 +1,2 @@
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list',
:locals => {:homeworks => @homework_list, :bid => @bid, :remote => true, :is_my_homework => @is_my_homework} )) %>');

View File

@ -1,8 +1,24 @@
<% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>');
<% else %>
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
destroyedItem.fadeOut(600,function(){
destroyedItem.remove();
});
//教师评论
<% if @is_comprehensive_evaluation == 1 %>
//$('#comprehensive_evaluation').html('<#%= escape_javascript(render(:partial => 'comprehensive_evaluation',
//:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework,:teaher_score => @teaher_score} )) %>');
HoverLi(4);
$('#jour_count_4').html('<%= @comprehensive_evaluation.count %>')
$('#tbc_04').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @comprehensive_evaluation,:show_score => true,:show_name => true,:is_jour => false})) %>')
//匿评
<% elsif @is_comprehensive_evaluation == 2 %>
// $('#message').html('<#%= escape_javascript(render(:partial => 'showjour', :locals => {:jour =>@jour, :state => false,:homework => @homework} )) %>');
// $('#pre_show').html('<#%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
HoverLi(5);
$('#jour_count_5').html('<%= @anonymous_comments.count %>')
$('#tbc_05').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @anonymous_comments,:show_score => true,:show_name => false,:is_jour => false})) %>')
//留言
<% else %>
HoverLi(3);
$('#jour_count_3').html('<%= @jours.count %>')
$('#tbc_03').html('<%= escape_javascript(render(:partial => 'homework_attach/jour',:locals => {:jours => @jour,:show_score => false,:show_name => true,:is_jour => true})) %>')
<% end %>
<% end %>

View File

@ -1,91 +1,103 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>新建作业</title>
<%= stylesheet_link_tag 'css'%>
<script type="text/javascript" language="javascript">
function switchTab(ProTag){
var display_index = 3 - ProTag;
$("#tb_" + ProTag).attr("class","hovertab");
$("#tb_" + display_index).attr("class","normaltab");
$("#content" + ProTag).show();
$("#content" + display_index).hide();
}
function submit_homework_form()
{
$('#edit_homework_attach_<%= @homework.id%>').submit();
}
</script>
</head>
<script type="text/javascript">
function switchTab(ProTag) {
var display_index = 3 - ProTag;
$("#tab" + ProTag).attr("class","selected");
$("#tab" + display_index).attr("class","");
$("#content" + ProTag).show();
$("#content" + display_index).hide();
}
</script>
<body>
<div class="container">
<div class="Newwork">
<div id="tb_" class="tb_">
<ul>
<li id="tb_1" class="hovertab" onclick="switchTab(1);this.blur();return false;" style="width: auto; padding:5px 10px 0;">
修改作业
</li>
<li id="tb_2" class="normaltab" onclick="switchTab(2);this.blur();return false;">
成员
</li>
<li class="N_top" style="width: 747px;">
<%= link_to(l(:label_project_new), {:controller => 'projects',
:action => 'new',
:course => 0,
:project_type => 0}) if User.current.allowed_to?(:add_project, nil, :global => true) %>
</li>
</ul>
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="width: auto; color: #15bccf"><strong><%= l(:label_user_location) %> : </strong></td>
</div>
<div id="content1">
<div class="N_con">
<%= form_for(@homework) do |f|%>
<p>
<label><span class="c_red">*</span>&nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp;</label>
<%= f.text_field :name, :required => true, :name => "homework_name", :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称"%>
</p>
<p>
<label>&nbsp;&nbsp;&nbsp;提交项目
<img src="/images/bid/pic_question.png" width="16" height="16"
title="项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。
项目托管平台http://forge.trustie.ne">
</label>
<% if @homework.project.nil? %>
<%= f.select :project_id, options_for_select(user_projects_option),{}, {:name => "project_id", :required => true,:class => "w350 bo"}%>
<% else %>
<%= f.select :project_id, options_for_select(user_projects_option,@homework.project.id),{},{:name => "project_id", :required => true, :class => "w350 bo"}%>
<% end %>
</p>
<p>
<label style="float:left;">
<span class="c_red">*</span>
&nbsp;&nbsp;作业描述&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620",
:maxlength => 3000, :placeholder => "最多3000个汉字" %>
</p>
<div class="cl"></div>
<p>
<label style="float: left;">&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;</label>
<%#= render :partial => 'attachments/form' %>
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
<% options = {:author => true, :deletable => attach_delete(@homework)} %>
<%= render :partial => 'attachments/links',
:locals => {:attachments => @homework.attachments, :options => options} %>
</p>
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
<%= render :partial => 'attachments/form' %>
</p>
</p>
</tr>
<tr>
<td style="padding-left: 8px"><a><%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index'%></a></td>
<td><p class="top-content-list-homework"><%=link_to "主页", home_path %> > <%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> >
<span><%= link_to(@homework.bid.courses.first.name.to_s, homework_course_path(@homework.bid.courses.first)) if @homework.bid.courses.first%></span> >
<%=link_to(@homework.bid.name, respond_path(@homework.bid)) %> > <span><%= link_to "修改作业",edit_homework_attach_path(@homework)%></span></p></td>
</tr>
</table>
</div>
<p style="font-weight: bold; color: rgb(237,137,36)" xmlns="http://www.w3.org/1999/html"> <%=raw l(:label_edit_homework)%> </p>
<div class="tabs">
<ul>
<li>
<a id = "tab1" href="#" class = "selected" onclick="switchTab(1);this.blur();return false;">
<%= l(:label_information_plural) %>
</a>
</li>
<li>
<a id="tab2" href="#" onclick="switchTab(2); this.blur(); return false;">
<%= l(:label_member_plural) %>
</a>
</li>
</ul>
</div>
<div class="box" id="content1">
<%= form_for(@homework) do |f|%>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<strong>标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题&nbsp;<span style="color: red">*</span></strong>&nbsp;
<%= f.text_field :name, :required => true, :name => "homework_name", :size => 60, :style => "width:490px;", :maxlength => 254%>
</p>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<strong>提交项目&nbsp;&nbsp;</strong>
<% if @homework.project.nil? %>
<%= f.select :project_id, options_for_select(user_projects_option),:name => "project_id", :required => true%>
<% else %>
<%= f.select :project_id, options_for_select(user_projects_option,@homework.project.id),:name => "project_id", :required => true%>
<p>
<span style="float: left;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>
<a href="#" class="tijiao" onclick="submit_homework_form();">
<%= l(:label_button_ok) %>
</a>
<a href="javascript:history.back()" class="tijiao">取&nbsp;&nbsp;消</a>
<div class="cl"></div>
</p>
<% end %>
</div><!---创建作业内容结束-->
</div>
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
<p class="font_lighter" style="padding-left:120px;clear:left;">提交项目可以为空</p>
</p>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<strong style="vertical-align: top">描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;</strong>&nbsp;
<span style="margin-left:-10px;padding-right: 20px;">
<%= f.text_area :description, :rows => 8, :name => "homework_description", :class => 'wiki-edit', :maxlength => 65534, :style => "font-size:small;width:490px;margin-left:10px;" %>
</span>
</p>
<p style="padding-left: 60px">
<fieldset style="text-align: left;">
<p style="padding-left: 60px">
<% options = {:author => true, :deletable => attach_delete(@homework)} %>
<%= render :partial => 'attachments/links',
:locals => {:attachments => @homework.attachments, :options => options} %>
</p>
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<%= render :partial => 'attachments/form' %>
</p>
</fieldset>
</p>
<p style="padding-left: 60px;padding-top: 10px;">
<span >
<%= submit_tag t(:label_button_ok), :sta => 0, :class => "enterprise"%>
</span>
</p>
<% end %>
</div>
<div id="content2" style="display: none" >
<%= render :partial => "homework_member",:locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} %>
</div>
<div id="content2" class="undis">
<%= render :partial => "homework_member",:locals => {:members => @members,:hoemwork_users =>@hoemwork_users,:homework => @homework} %>
</div><!---成员结束-->
</div>
</div><!--新建作业结束-->
</body>
</html>

View File

@ -0,0 +1,4 @@
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list',
:locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true} )) %>');
for(var i=1;i<=4;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_2").removeClass().addClass("hovertab");

View File

@ -0,0 +1,6 @@
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homework_jours',:locals => { :bid => @bid, :journals => @jour, :state => false} )) %>');
for(var i=1;i<=4;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_4").removeClass().addClass("hovertab");
for(var i=5;i<=8;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_8").removeClass().addClass("hovertab");

View File

@ -0,0 +1,8 @@
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list',
:locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true} )) %>');
for(var i=1;i<=4;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_3").removeClass().addClass("hovertab");
for(var i=5;i<=8;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_7").removeClass().addClass("hovertab");

View File

@ -0,0 +1,4 @@
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list',
:locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true, :is_my_homework => @is_my_homework} )) %>');
for(var i=5;i<=8;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_6").removeClass().addClass("hovertab");

View File

@ -0,0 +1,4 @@
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list',
:locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true} )) %>');
for(var i=1;i<=4;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_1").removeClass().addClass("hovertab");

View File

@ -0,0 +1,4 @@
$('#tbc_01').html('<%= escape_javascript(render(:partial => 'homeworks_list',
:locals => {:homeworks => @homework_list, :homework_count => @obj_count, :bid => @bid, :remote => true, :is_student_batch_homework => @is_student_batch_homework} )) %>');
for(var i=5;i<=8;i++){$("#tb_"+i).removeClass().addClass("normaltab");}
$("#tb_5").removeClass().addClass("hovertab");

View File

@ -1,85 +1,81 @@
<div class="top-content">
<table>
<tr>
<td class="info_font" style="width: 240px; color: #15bccf">高校课程实践社区</td>
<td style="width: auto; color: #15bccf">
<strong>
<%= l(:label_user_location) %> :
</strong>
</td>
</tr>
<tr>
<td style="padding-left: 8px">
<a>
<%= link_to request.host()+"/courses", :controller => 'courses', :action => 'index'%>
</a>
</td>
<td>
<p class="top-content-list-homework">
<%=link_to "主页", home_path %> >
<%=link_to l(:label_course_practice), :controller => 'courses', :action => 'index' %> >
<span>
<%= link_to(@bid.courses.first.name.to_s, homework_course_path(@bid.courses.first)) if @bid.courses.first%>
</span> >
<%=link_to(@bid.name, respond_path(@bid)) %> >
<span>
<%= link_to "创建作业", new_homework_attach_path(@bid)%>
</span>
</p>
</td>
</tr>
</table>
</div>
<p style="font-weight: bold; color: rgb(237,137,36)" xmlns="http://www.w3.org/1999/html">
<%=h l(:label_new_homework)%>
</p>
<div class="box">
<%= form_for('new_form', :method => :post,
:url => {:controller => 'homework_attach',
:action => 'create',
:user_id => User.current.id,
:bid_id => @bid
}) do |f|%>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<strong>标&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;题&nbsp;<span style="color: red">*</span></strong>
<%= f.text_field "name", :required => true, :size => 60, :style => "width:490px;", :maxlength => 254 %>
</p>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<strong>
提交项目&nbsp;&nbsp;
</strong>
<%= f.select :project_id,options_for_select(user_projects_option), {},{:style => "width:490px;"} %>
<%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target => '_blank' %>
<p class="font_lighter" style="padding-left:120px;clear:left;">
提交项目可以为空
</p>
</p>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<strong style="vertical-align: top">
描&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;述&nbsp;&nbsp;
</strong>
<span style="margin-left:-10px;padding-right: 20px;">
<%= f.text_area "description", :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => 5000 %>
</span>
</p>
<p style="padding-left: 60px">
<fieldset style="text-align: left;">
<legend>
<%= l(:label_attachment_plural) %>
</legend>
<p style=" padding: 3px 0 3px 0;padding-left: 50px; clear:left;">
<%= render :partial => 'attachments/form' %>
<%= stylesheet_link_tag 'css', :media => 'all' %>
<script type="text/javascript" language="javascript">
function submit_homework_form()
{
$('#new_homework_attach').submit();
}
</script>
<div class="container">
<div class="Newwork">
<div id="tb_" class="tb_">
<ul>
<li id="tb_1" class="hovertab" onmouseover="x:HoverLi(1);" style="width: auto; padding:5px 10px 0;">
创建作品
</li>
<li class="N_top" style="width: 835px;">
<%= link_to(l(:label_project_new), {:controller => 'projects',
:action => 'new',
:course => 0,
:project_type => 0}) if User.current.allowed_to?(:add_project, nil, :global => true) %>
</li>
</ul>
</div>
<div class="dis" id="tbc_01">
<div class="N_con">
<%= form_for(HomeworkAttach.new, :method => :post,
:name => 'new_form',
:url => {:controller => 'homework_attach',
:action => 'create',
:user_id => User.current.id,
:bid_id => @bid
}) do |f|%>
<p>
<label>
<span class="c_red">
*
</span>
&nbsp;&nbsp;作品名称&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<%= f.text_field "name", :required => true, :size => 60, :class => "w430 bo", :maxlength => 254, :placeholder => "作品名称" %>
</p>
<p>
<label>&nbsp;&nbsp;&nbsp;提交项目
<img src="/images/bid/pic_question.png" width="16" height="16"
title="项目是一种由用户创建的基于网络的协作空间,能够为个人或小组提供分布式的协同交流和资料管理等方面的支持。
项目托管平台http://forge.trustie.ne">
</label>
<%= f.select :project_id,options_for_select(user_projects_option), {},{:class => "w350 bo"} %>
</p>
<p>
<label style="float:left;">
<span class="c_red">
*
</span>
&nbsp;&nbsp;作业描述&nbsp;&nbsp;&nbsp;&nbsp;
</label>
<%= f.text_area "description", :class => "w620", :maxlength => 3000, :placeholder => "最多3000个汉字" %>
</p>
<div class="cl"></div>
<p>
<label style="float: left;">&nbsp;&nbsp;&nbsp;添加附件&nbsp;&nbsp;&nbsp;&nbsp;</label>
<%#= render :partial => 'attachments/form' %>
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
<%= render :partial => 'attachments/form' %>
</p>
</p>
</fieldset>
</p>
<p style="padding-left: 60px;padding-top: 5px;">
<span >
<%= submit_tag t(:label_button_ok), :sta => 0, :class => "enterprise"%>
</span>
</p>
<% end %>
</div>
<p>
<span style="float: left;">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
</span>
<a href="#" class="tijiao" onclick="submit_homework_form();">
<%= l(:label_button_ok) %>
</a>
<a href="javascript:history.back()" class="tijiao">取&nbsp;&nbsp;消</a>
<div class="cl"></div>
</p>
<% end %>
</div><!---创建作业内容结束-->
</div>
</div>
</div><!--新建作业结束-->

View File

@ -0,0 +1,3 @@
$('#homeworl_praise_li_<%= @homework.id%>').
html('<%= escape_javascript(render :partial => 'homework_attach/homework_praise',
:locals => {:homework => @homework})%>');

View File

@ -0,0 +1,9 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show',:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework, :teaher_score => @teaher_score}) %>');
showModal('ajax-modal', '503px');
$('#ajax-modal').css('height','569px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;padding-left: 455px;cursor:pointer;'>" +
"<a href='#' onclick='hidden_homework_atert_form("+
<%= @cur_page%> + "," + <%= @cur_type%> +
");'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");

View File

@ -205,9 +205,13 @@
<%= l(:label_course_organizers) %> :
</td>
<td class="font_lighter_sidebar">
<a href="http://<%= Setting.host_course%>/?school_id=<%= @course.school.id%>">
<%= @course.school %>
</a>
<% if @course.school %>
<a href="http://<%= Setting.host_course%>/?school_id=<%= @course.school.id%>">
<%= @course.school %>
</a>
<% else%>
<% end %>
</td>
</tr>
<% else %>

View File

@ -52,7 +52,7 @@
<%= link_to(course.name.to_s, homework_course_path(course)) if course %>
</span>
>
<%= link_to(@bid.name, respond_path(@bid)) %>
<%= link_to(@bid.name, course_for_bid_path(@bid)) %>
</p>
</td>
</tr>
@ -87,8 +87,7 @@
<tr>
<td style=" word-wrap: break-word; word-break: break-all;font-size: 16px;text-align: center">
<span style=" color:#ed8924">
<!-- modified by zjc 添加超链接 -->
<strong><%=link_to(@bid.name, respond_path(@bid)) %></strong>
<strong><%=link_to(@bid.name, course_for_bid_path(@bid)) %></strong>
</span>
</td>
</tr>
@ -105,66 +104,26 @@
<tr>
<td valign="top" colspan="2" style="font-size: 16px;padding-left: 8px;">
<strong>
<%= l(:label_new_course_description) %> :
<%= l(:label_homework_description) %> :
</strong>
</td>
</tr>
<tr>
<td class="font_lighter_sidebar" colspan="2" style="padding-left: 8px;">
<%= textilizable course.description %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_create_time) %> :
</td>
<td class="font_lighter_sidebar">
<%= format_time course.created_at %>
<td class="font_lighter_sidebar" colspan="2" style="padding-left: 8px;" title="<%= @bid.description %>">
<%= textilizable truncate(@bid.description, length: 200, omission: '...') %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px; width:62px;">
<%= l(:lable_course_teacher) %> :
<%= l(:label_limit_time) %>:
</td>
<td class="font_lighter_sidebar">
<%= link_to(course.teacher.lastname+course.teacher.firstname, user_path(course.teacher)) %>
<%= @bid.deadline %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_class_period) %> :
</td>
<td class="font_lighter_sidebar">
<%= course.class_period.to_s %>&nbsp;
<%= l(:label_class_hour) %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_main_term) %> :
</td>
<td class="font_lighter_sidebar">
<%= course.time.to_s %>
<%= course.term %>
</td>
</tr>
<tr>
<td valign="top" style="padding-left: 8px;">
<%= l(:label_teacher_work_unit) %> :
</td>
<!-- modified by zjc 有@user.user_extensions.occupation改为 @user.user_extensions.school 并添加超链接 -->
<% unless @user.user_extensions.nil? || @user.user_extensions.school.nil? %>
<td class="font_lighter_sidebar">
<%= link_to @user.user_extensions.school,"http://#{Setting.host_course}/?school_id=#{@user.user_extensions.school.id}" %>
</td>
<% end %>
</tr>
</table>
</div>
<div class="user_underline"></div>
@ -173,9 +132,18 @@
<div class="inf_user_image">
<table>
<tr>
<td>
<%= l(:label_limit_time) %>:
<%= @bid.deadline %>
<td valign="top" colspan="2" style="font-size: 16px;padding-left: 8px;">
<strong>
<%= l(:label_attachment) %> :
</strong>
</td>
</tr>
<tr>
<td valign="top" colspan="2">
<% if @bid.attachments.any?%>
<% options = {:author => true,:deletable => (@bid.author.id == User.current.id || User.current.admin? ? true : false),:wrap => true,:length => 7} %>
<%= render :partial => 'attachments/links', :locals => {:attachments => @bid.attachments, :options => options} %>
<% end %>
</td>
</tr>
<tr>
@ -183,95 +151,14 @@
<%#= @bid.homework_type==Bid::HomeworkFile ? "提交文件" : "提交项目" %>
</td-->
</tr>
<% unless @bid.parent_id.nil? %>
<tr>
<td>
<div style=" color: rgb(255, 0, 0); width:200px">
<% author=Bid.find(@bid.parent_id).author %>
作业来源于<%= link_to(author.lastname+author.firstname, user_path(Bid.find(@bid.parent_id).author)) %>
的需求:<%= link_to(Bid.find(@bid.parent_id).name, respond_path(Bid.find(@bid.parent_id))) %>
</div>
</td>
</tr>
<% end %>
</table>
</div>
<!-- tags -->
<div class="user_fans">
<div class="user_underline"></div>
<table style="font-family:'微软雅黑'; padding-left: 8px">
<tr>
<td><!-- added by william -for tag -->
<%= render :partial => 'tags/tag', :locals => {:obj => @bid, :object_flag => "4"} %>
</td>
</tr>
</table>
</div>
<!--homework-->
<div class="user_fans">
<div class="user_underline"></div>
<div class="font_title_left">
<strong><%= l(:label_commit_homework) %></strong>
</div>
<div class="left_wf">
<table>
<tr>
<td style="padding-top: 5px">
<% if @bid.homework_type == 1 %>
<% if @bid.homeworks.size>0 %>
<% for homework in @bid.homeworks.eager_load(:user) %>
<%= link_to image_tag(url_to_avatar(homework.user), :class => "avatar", :title => homework.user.name), user_path(homework.user), :class => "avatar" %>
<% end %>
<% else %>
<p class="font_lighter">
<%= l(:label_no_course_project) %>
</p>
<% end %>
<% else %>
<% if @bid.courses.size>0 %>
<% for course in @bid.courses %>
<%= link_to image_tag(url_to_avatar(course), :class => "avatar", :title => course.name), course_path(course), :class => "avatar" %>
<% end %>
<% else %>
<p class="font_lighter">
<%= l(:label_no_course_project) %>
</p>
<% end %>
<% end %> </td>
</tr>
</table>
</div>
</div>
<div class="user_underline"></div>
</div>
</div>
<!-- end -->
</div>
<div id="content">
<div class="tabs_new">
<ul>
<li>
<%= link_to l(:label_question_student), {:controller => 'bids', :action => 'show'}, :class => link_class(:respond) %>
</li>
<% if User.current.member_of_course? course %>
<li>
<% if User.current.logged? && course && (!Member.where('user_id = ? and course_id = ?', User.current.id, course.id).first.nil? && (Member.where('user_id = ? and course_id = ?', User.current.id, course.id).first.roles&Role.where('id = ? or id = ? or id =?', 5, 10, 7)).size >0) %>
<%= link_to l(:label_homework_commit), course_for_bid_path, :class => link_class(:course) %>
<% else %>
<%= link_to l(:label_homework_info), course_for_bid_path, :class => link_class(:course) %>
<% end %>
</li>
<% end %>
<!-- <li><%#= link_to l(:label_homework_statistics), {:controller => 'bids', :action => 'homework_statistics'}, :class => link_class(:homework_statistics) %></li> -->
<!-- <li><%#= link_to l(:label_homework_respond), {:controller => 'bids', :action => 'homework_respond'}, :class => link_class(:homework_respond) %></li>-->
</ul>
</div>
<%= yield %>
<%= call_hook :view_layouts_base_content %>
<div style="clear:both;"></div>

View File

@ -3,38 +3,57 @@
<% if horizontal %>
<!-- 横排 -->
<div id="praise_tread_<%= obj.id %>" style="float:right;">
<% @is_valuate = is_praise_or_tread(obj,user_id)%>
<% if @is_valuate.size > 0 %> <!-- 评价过 1代表赞 0代表踩 -->
<% @flag = @is_valuate.first.praise_or_tread %>
<% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai -->
<table style="line-height: 1px">
<tr>
<td ><%= image_tag "/images/praise_tread/praise_false.png" , weight:"22px", height:"22px",:title => l(:label_issue_praise_over) %></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_appraise_over) %></td>
<td >
<%= image_tag "/images/praise_tread/praise_false.png" , weight:"22px", height:"22px",:title => l(:label_issue_praise_over) %>
</td>
<td align="center">
<strong class="font_small_watch">
<%= get_praise_num(obj)%>
</strong>
</td>
<td>
<%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_appraise_over) %>
</td>
</tr>
</table>
<% elsif @flag == 0 %> <!-- 踩过 0-->
<table style="line-height: 1px">
<tr>
<td > <%= image_tag "/images/praise_tread/praise_false.png",weight:"22px", height:"22px", :title => l(:label_issue_appraise_over) %></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_tread_over) %> </td>
<td >
<%= image_tag "/images/praise_tread/praise_false.png",weight:"22px", height:"22px", :title => l(:label_issue_appraise_over) %>
</td>
<td align="center">
<strong class="font_small_watch">
<%= get_praise_num(obj)%>
</strong>
</td>
<td>
<%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_tread_over) %>
</td>
</tr>
</table>
<% end %>
<% else %>
<% if user_id == obj.author_id %>
<table style="line-height: 1px">
<tr>
<td ><%= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %></td>
<td >
<%= image_tag "/images/praise_tread/praise_true.png" , weight:"22px", height:"22px",:title => l(:label_issue_not_praise_over) %>
</td>
<td align="center">
<strong class="font_small_watch">
<%= get_praise_num(obj)%>
</strong>
</td>
<td>
<%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %>
</td>
</tr>
</table>
<% else %>
@ -42,30 +61,42 @@
<% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
<table style="line-height: 1px">
<tr>
<td ><%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %></td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %></td>
<td >
<%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %>
</td>
<td align="center">
<strong class="font_small_watch">
<%= get_praise_num(obj)%>
</strong>
</td>
<td>
<%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %>
</td>
</tr>
</table>
<% else %>
<table style="line-height: 1px">
<tr>
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %> </td>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread",
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %></td>
<td >
<%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %>
</td>
<td align="center">
<strong class="font_small_watch">
<%= get_praise_num(obj)%>
</strong>
</td>
<td>
<%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread",
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class,:horizontal => horizontal %>
</td>
</tr>
</table>
<% end %>
<% end %>
<!-- end -->
<% end %>
</div>
<% else %>
<!-- 竖排 -->
<div id="praise_tread_<%= obj.id %>" style="float:right;">
@ -75,80 +106,115 @@
<% if @flag == 1 %> <!-- 顶过 --><!-- modified by bai -->
<table style="line-height: 1px">
<tr>
<td ><%= image_tag "/images/praise_tread/praise_false.png" , weight:"22px", height:"22px",:title => l(:label_issue_praise_over) %></td>
<td >
<%= image_tag "/images/praise_tread/praise_false.png" , weight:"22px", height:"22px",:title => l(:label_issue_praise_over) %>
</td>
</tr>
<tr>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td align="center">
<strong class="font_small_watch">
<%= get_praise_num(obj)%>
</strong>
</td>
</tr>
<tr>
<td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_appraise_over) %></td>
<td>
<%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_appraise_over) %>
</td>
</tr>
</table>
<% elsif @flag == 0 %> <!-- 踩过 0-->
<table style="line-height: 1px">
<tr>
<td > <%= image_tag "/images/praise_tread/praise_false.png",weight:"22px", height:"22px", :title => l(:label_issue_appraise_over) %></td>
<td >
<%= image_tag "/images/praise_tread/praise_false.png",weight:"22px", height:"22px", :title => l(:label_issue_appraise_over) %>
</td>
</tr>
<tr>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td align="center">
<strong class="font_small_watch">
<%= get_praise_num(obj)%>
</strong>
</td>
</tr>
<tr>
<td><%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_tread_over) %> </td>
<td>
<%= image_tag "/images/praise_tread/tread_false.png",weight:"22px", height:"22px",:title => l(:label_issue_tread_over) %>
</td>
</tr>
</table>
<% end %>
<% else %>
<% if user_id == obj.author_id %>
<table style="line-height: 1px">
<tr>
<td > <%= image_tag "/images/praise_tread/praise_true.png",weight:"22px", height:"22px", :title => l(:label_issue_not_praise_over) %></td>
<td >
<%= image_tag "/images/praise_tread/praise_true.png",weight:"22px", height:"22px", :title => l(:label_issue_not_praise_over) %>
</td>
</tr>
<tr>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td align="center">
<strong class="font_small_watch">
<%= get_praise_num(obj)%>
</strong>
</td>
</tr>
<tr>
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %> </td>
<td>
<%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_not_treed_over) %>
</td>
</tr>
</table>
<% else %>
<% if OptionNumber.get_user_option_number(user_id).nil? || OptionNumber.get_user_option_number(user_id).total_score < 2 %>
<table style="line-height: 1px">
<tr>
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %></td>
<td >
<%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %>
</td>
</tr>
<tr>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td align="center">
<strong class="font_small_watch">
<%= get_praise_num(obj)%>
</strong>
</td>
</tr>
<tr>
<td><%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %> </td>
<td>
<%= image_tag "/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issues_score_not_enough) %>
</td>
</tr>
</table>
<% else %>
<table style="line-height: 1px">
<tr>
<td > <%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %> </td>
<td >
<%= link_to image_tag("/images/praise_tread/praise_true.png",weight:"22px", height:"22px",:title => l(:label_issue_praise)),
:controller=>"praise_tread",:action=>"praise_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %>
</td>
</tr>
<tr>
<td align="center"><strong class="font_small_watch"><%= get_praise_num(obj)%></strong></td>
<td align="center">
<strong class="font_small_watch">
<%= get_praise_num(obj)%>
</strong>
</td>
</tr>
<tr>
<td> <%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread",
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %></td>
<td>
<%= link_to image_tag("/images/praise_tread/tread_true.png",weight:"22px", height:"22px",:title => l(:label_issue_tread)),:controller=>"praise_tread",
:action=>"tread_plus",:remote=>true,:obj_id => obj.id,:obj_type => obj.class ,:horizontal => horizontal %>
</td>
</tr>
</table>
<% end %>
<% end %>
<!-- end -->
<% end %>
</div>

View File

@ -19,7 +19,7 @@
<div class="homeworks panel panel-default ">
<div class="homeworks panel-heading">
<div class="panel-title">
<%= link_to homework.name, respond_path(homework) %>(<%=homework.homeworks.count %>)<%#Bid%>
<%= link_to homework.name, course_for_bid_path(homework) %>(<%=homework.homeworks.count %>)<%#Bid%>
<%#= link_to "打包下载", zipdown_assort_path(obj_class: homework.class, obj_id: homework.id), :class => "btn btn-primary btn-sm" %><br/>
</div>
</div>

View File

@ -34,7 +34,7 @@
<table border="0">
<tr>
<td> <% if bid.reward_type.nil? or bid.reward_type == 1 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong> <% elsif bid.reward_type == 2 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong> <% else %> <!-- <strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong> --> <% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> --></td>
<td> <% if bid.reward_type.nil? or bid.reward_type == 1 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #ed8924;font-family: 14px; font-family: 微软雅黑;"><%= l(:label_call_bonus) %>&nbsp;<%= l(:label_RMB_sign) %><%= bid.budget%></span></strong> <% elsif bid.reward_type == 2 %> <strong><%= l(:label_bids_reward_method) %><span style="color: #15bccf;font-family: 14px; font-family: 微软雅黑"><%= bid.budget%></span></strong> <% else %> <!-- <strong><%= l(:label_bids_reward_method) %><span style="color: #00aa83;font-family: 14px; font-family: 微软雅黑"><%= l(:label_bids_credit) %>&nbsp;<%= bid.budget%>&nbsp;<%= l(:label_bids_credit_number) %></span></strong> --> <% end %> <!-- <td style="color: rgb(255, 0, 0);"><strong><%= l(:label_price) %><%= l(:label_RMB_sign) %><%= bid.budget%></strong></td> --></td>
</tr>
<tr>
<td><span class="font_lighter">

View File

@ -1,7 +1,7 @@
<% id = "journal_reply_ul_" + journal.id.to_s%>
<ul class="messages-for-user-reply" id = '<%= id %>' >
<div id = '<%= id %>' >
<% fetch_user_leaveWord_reply(journal).each do |reply|%>
<%= render :partial => "words/journal_reply_items", :locals => {:reply => reply, :journal => journal, :m_reply_id => reply} %>
<% end %>
</ul>
</div>

View File

@ -1,16 +1,15 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
<li id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
<span class="portrait">
<%= image_tag url_to_avatar(reply.user), :class => "avatar-3" %>
</span>
<div class="message-body">
<div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
<div class="recall_head">
<%= image_tag url_to_avatar(reply.user) %>
</div>
<div class="recall_con">
<% id = 'project_respond_form_'+ reply.id.to_s %>
<p>
<span>
<%= link_to reply.user.name, user_path(reply.user) %>
:&nbsp;
</span>
<%= link_to reply.user.name, user_path(reply.user) %>
回复
<%= link_to reply.at_user.name,user_path(reply.at_user) %>
<p>
<span class="message-notes">
<%= reply.notes %>
</span>
@ -19,15 +18,15 @@
<span class="time">
<%= format_time reply.created_on %>
</span>
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.name}: '); return false;"} %>
<% end %>
<span class="ping_disfoot" style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => reply, :user_id => reply.user},
:remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %>
<% end %>
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'',
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{m_reply_id.user.name}: '); return false;"} %>
<% end %>
</span>
</p>
</div>
@ -37,4 +36,4 @@
<% end %>
</div>
<div style="clear: both;"></div>
</li>
</div>

View File

@ -1,10 +1,13 @@
<% if @journal_destroyed.nil? %>
alert('<%=l(:notice_failed_delete)%>');
<% elsif (['Principal','Project','Course', 'Bid', 'Contest', 'Softapplication'].include? @journal_destroyed.jour_type)%>
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
destroyedItem.fadeOut(600,function(){
destroyedItem.remove();
});
<% if @jours_count %>
$('#jours_count').html("<%= @jours_count %>");
<% end %>
var destroyedItem = $('#word_li_<%=@journal_destroyed.id%>')
destroyedItem.fadeOut(600,function(){
destroyedItem.remove();
});
<% else %>
$('#message').html('<%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages})) %>');
$('#new_form_reference_user_id').val("");

View File

@ -1842,4 +1842,13 @@ en:
label_select_province: Please select the provinces
label_search_conditions_not_null: The search conditions can not be empty
lable_school_list: List of schools
button_delete_file: delete
button_delete_file: delete
label_attachment: attachment
label_max_length: A maximum of 250 characters
label_create_person: Create personnel
label_participation_person: The participation of personnel
label_homework_without_description: The homework without any description!
label_teacher_comments: Teacher comments
label_anonymous_comments: Anonymous comments
label_anonymous: Anonymous
label_submit_comments: Submit_comments

View File

@ -1487,10 +1487,7 @@ zh:
one: 留言
other: 留言
#end
label_x_responses: #modify by huang
zero: 学生提问
one: 学生提问
other: 学生提问
label_students_responses: 学生提问
#end
label_x_bids_responses: #modify by huang
zero: 用户反馈
@ -1894,6 +1891,7 @@ zh:
label_new_course_password: 课程密码
label_new_course_school: 开课学校
label_new_course_description: 课程描述
label_homework_description: 作业描述
label_new_join_order: 请输入课程密码
label_task_submit_form_accessory: 作业最终以附件形式提交
label_task_submit_form_project: 作业最终以项目形式提交
@ -2171,3 +2169,18 @@ zh:
label_contest_news_title_condition: 竞赛标题超过255个汉字
label_subject_empty: 主题不能为空
label_course_organizers: 开设单位
label_teacher_score: 教师评分
label_student_score: 学生评分
label_without_score: 未评分
label_homework_list: 作品列表
label_time: 时间
label_attachment: 附件
label_max_length: 最多250个字
label_create_person: 创建人员
label_participation_person: 参与人员
label_homework_without_description: 该作业无任何描述!
label_sure_exit_homework: 是否确认退出该作业
label_teacher_comments: 教师评论
label_anonymous_comments: 匿评
label_anonymous: 匿名
label_submit_comments: 提交评论

View File

@ -44,10 +44,17 @@ RedmineApp::Application.routes.draw do
match 'add_jour_reply', :via => [:get,:post]
match 'destroy_jour', :via => [:get,:post]
match 'comprehensive_evaluation_jour', :via => [:get,:post]
get 'get_not_batch_homework'
get 'get_batch_homeworks'
get 'get_homeworks'
get 'get_homework_jours'
get 'get_student_batch_homework'
get 'get_my_homework'
end
member do
match 'add_homework_users', :via => [:get,:post]
match 'destory_homework_users', :via => [:get,:post]
get 'praise_homework'
end
end
@ -322,6 +329,8 @@ RedmineApp::Application.routes.draw do
resources :bids, :only=>[:edit,:update,:show] do
member do
match 'homework_ajax_modal'
get 'start_anonymous_comment', as: 'start_anonymous_comment'
get 'stop_anonymous_comment', as: 'stop_anonymous_comment'
end
end
resources :projects do
@ -695,7 +704,7 @@ RedmineApp::Application.routes.draw do
match 'contest/new_contest', :to => 'bids#new_contest' #huang
match 'calls/:id/show_project', :to => 'bids#show_project', :as => 'project_for_bid'
match 'calls/:id/show_course', :to => 'bids#show_courseEx', :as => 'course_for_bid' # nwb added
match 'calls/:id/new_exercise_book', :to => 'homework_attach#new', :as => 'new_homework_attach'
match 'calls/:id/new_exercise_book', :to => 'homework_attach#new', :as => 'new_exercise_book'
match 'calls/:id/add', :to => 'bids#add'
match 'calls/:id/delete', :to => 'bids#delete'
match 'calls/:id/add_homework', :to => 'bids#add_homework', :via => :post

View File

@ -0,0 +1,10 @@
class CreateHomeworkEvaluations < ActiveRecord::Migration
def change
create_table :homework_evaluations do |t|
t.string :user_id
t.string :homework_attach_id
t.timestamps
end
end
end

View File

@ -0,0 +1,5 @@
class AddCommentStatusToBid < ActiveRecord::Migration
def change
add_column :bids, :comment_status, :integer, default: 0
end
end

File diff suppressed because it is too large Load Diff

View File

@ -219,50 +219,75 @@ module Redmine
#Added by Nie guanghui
#Designed for pagination.
def pagination_links_each(paginator, count=nil, options={}, &block)
options.assert_valid_keys :per_page_links
#options.assert_valid_keys :per_page_links
per_page_links = options.delete(:per_page_links)
#per_page_links = options.delete(:per_page_links)
per_page_links = options[:per_page_links]
remote = options[:remote] ? options[:remote] : false
flag = options[:flag] ? options[:flag] : false
per_page_links = false if count.nil?
page_param = paginator.page_param
html = ''
if paginator.previous_page
# \xc2\xab(utf-8) = &#171;
text = "\xc2\xab " + l(:label_previous)
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous') << '</li>' + ' '
if flag
text = l(:label_previous)
else
text = "\xc2\xab " + l(:label_previous)
end
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous', :remote => remote) << '</li>' + ' '
end
unless paginator.previous_page
if paginator.next_page
text = "\xc2\xab " + l(:label_previous)
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous') << '</li>' + ' '
if flag
text = l(:label_previous)
else
text = "\xc2\xab " + l(:label_previous)
end
html << '<li>' << yield(text, {page_param => paginator.previous_page}, :class => 'previous', :remote => remote) << '</li>' + ' '
end
end
previous = nil
paginator.linked_pages.each do |page|
if previous && previous != page - 1
html << '<li>' << content_tag('span', '...', :class => 'spacer') << '</li>' + ' '
if flag
html << '<li>' << content_tag('a', '...') << '</li>' + ' '
else
html << '<li>' << content_tag('span', '...', :class => 'spacer') << '</li>' + ' '
end
end
if page == paginator.page
html << '<li>' << content_tag('span', page.to_s, :class => 'current-page') << '</li>'
if flag
html << '<li class = "wlist_select">' << page.to_s << '</li>'
else
html << '<li>' << content_tag('span', page.to_s, :class => 'current-page') << '</li>'
end
else
html << '<li>' << yield(page.to_s, {page_param => page}, :class => 'page') << '</li>'
html << '<li>' << yield(page.to_s, {page_param => page}, :class => 'page', :remote => remote) << '</li>'
end
html << ' '
previous = page
end
if paginator.next_page
# \xc2\xbb(utf-8) = &#187;
text = l(:label_next) + " \xc2\xbb"
html << '<li>' << yield(text, {page_param => paginator.next_page}, :class => 'next') << '</li>' + ' '
if flag
text = l(:label_next)
else
text = l(:label_next) + " \xc2\xbb"
end
html << '<li>' << yield(text, {page_param => paginator.next_page}, :class => 'next', :remote => remote) << '</li>' + ' '
end
unless paginator.next_page
if paginator.previous_page
# \xc2\xbb(utf-8) = &#187;
text = l(:label_front) + " \xc2\xbb"
html << "<li>" << yield(text, {page_param => paginator.next_page}, :class => 'next') << "</li>" + ' '
if flag
text = l(:label_next)
else
text = l(:label_next) + " \xc2\xbb"
end
html << "<li>" << yield(text, {page_param => paginator.next_page}, :class => 'next', :remote => remote) << "</li>" + ' '
end
end

BIN
public/images/bid/close.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

File diff suppressed because one or more lines are too long

View File

@ -1271,6 +1271,14 @@ a.user.locked, a.user.locked:link, a.user.locked:visited {color: #999;}
#sidebar a.selected {line-height:1.7em; padding:1px 3px 2px 2px; margin-left:-2px; background-color:#9DB9D5; color:#fff; border-radius:2px;}
#sidebar a.selected:hover {text-decoration:none;}
#sidebar #attachment_ a {
background-position: 0% 50%;
background-repeat: no-repeat;
font-family: '微软雅黑'; /*modify by men*/
padding-left: 20px !important;
padding-top: 2px !important;
padding-bottom: 3px !important;
}
#admin-menu a {line-height:1.7em;}
#admin-menu a.selected {padding-left: 20px !important; background-position: 2px 40%;}
@ -2528,6 +2536,14 @@ a.close-icon:hover {background-image:url('../images/close_hl.png');}
padding-top: 2px;
padding-bottom: 3px;
}
#sidebar #attachemnt_.icon {
background-position: 0% 50%;
background-repeat: no-repeat;
font-family: '微软雅黑'; /*modify by men*/
padding-left: 20px;
padding-top: 2px;
padding-bottom: 3px;
}
.icon_enterprise {
background-position: 0% 50%;
background-repeat: no-repeat;

158
public/stylesheets/css.css Normal file
View File

@ -0,0 +1,158 @@
/* CSS Document */
body{ font-size:12px !important; font-family:"微软雅黑","宋体" !important; line-height:1.9; background:#fff; font-style:normal;}
div,html,img,ul,li,p,body,h1,h2,h3,h4,p,a,table,tr,td,fieldset,input,span,textarea{ margin:0; padding:0;}
div,img,tr,td,textarea{ border:0;}
table,tr,td{border:0; cellspacing:0; cellpadding:0;}
ul,li{ list-style-type:none}
.cl{ clear:both; overflow:hidden; }
a{ text-decoration:none; }
a:hover{ text-decoration:underline;}
.container{ width:940px; margin:0 auto; }
/* 作业列表 */
.ttl{ }
.ctt{height:820px;clear:both; }
/* TAB 切换效果 */
.tb_{ background-color: #eaeaea; height:40px; }
.tb_ ul{height:40px; }
.tb_ li{float:left;height:35px;width: 90px;cursor:pointer; font-size:14px; padding-top:5px; text-align:center; }
a.tb_all{ margin-left:235px; font-size:12px; display:block; height:23px; padding-top:4px; width:90px; color:#7a7a7a; border:1px solid #cbcbcb; background:#fff; text-align: center;}
a:hover.tb_all{ background:#eaeaea; text-decoration:none;}
/* 控制显示与隐藏css类 */
.normaltab { color:#64bdd9 ; }
.hovertab { color:#fff; background-color:#64bdd9; }
.normaltab a { color:#64bdd9 ; }
.hovertab a{color:#fff; background-color:#64bdd9; text-decoration:none;}
.dis{display:block; }
.undis{display:none;}
.c_red{ color:#de030d;}
.f_12{ font-size:12px;}
.w_40{ width:40px; border:1px solid red;}
.dis ul{ height:75px; border-bottom:1px dashed #64bdd9;}
.dis ul li{ float:left;}
.dis ul li a{ display:block; color:#15bccf; }
.pic_head{ width:42px; padding:8px 15px 0 8px;}
.pic_head a{ text-align:center; width:42px; overflow:hidden;text-overflow:ellipsis; white-space:nowrap;}
.pic_head img{ border:1px solid #fff;}
.pic_head img:hover{border:1px solid #15bccf;}
.dis ul li.wname a{ width:260px; font-size:14px; color:#595959; padding:20px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.dis ul li.wdown a{padding-top:22px; color:#3d7ec2; margin-right:35px;}
.wscore{ padding-top:22px; color:#888888; width:96px;}
.dis ul li.wping{margin-left:12px; }
.dis ul li.wping a{ margin-top:18px; margin-bottom:3px; width:43px; height:23px; background:#15bccf; color:#fff; text-align:center; padding-top:3px;}
.dis ul li.wping a:hover{ background-color:#03a1b3;}
ul.wlist{ float:right; border-bottom:none; height:30px; margin-top:20px; }
.wlist span{ border:1px solid #15bccf; padding:0 5px; margin-left:3px;}
.wlist a{ border:1px solid #15bccf; padding:0 5px; margin-left:3px;}
.wlist a:hover{ background:#15bccf; color:#fff; text-decoration:none;}
.wlist_select { background-color:#64bdd9; color:#fff; padding:0 5px; margin-left:3px; border:1px solid #64bdd9;}
.code_list{ float:right; font-size:12px; color:#484848; padding:5px 3px; border-bottom:2px solid #15bccf; width:687px; }
.code_list a{ color:#787878;}
.fr{ float:right;}
.c_grey{ color:#999; font-weight:normal;}
.dis ul li.wname02 a{ width:200px; font-size:14px; color:#595959; padding:20px 0 0 15px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.dis ul li.wmine{ margin:12px 0 0 10px;}
.dis ul li.wmine a{ color:#3d7ec2; text-align:center; width:50px; font-weight: bold;}
.wzan{ margin:15px 0 0 25px; width:32px; height:44px;}
.wzan a{ display: block;text-align: center;}
a.wzan_img{background:url(images/pic_zan.png) 0 -59px no-repeat; display:block; height:31px; width:30px; color:#fff;}
a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;}
.msg_box{ width:693px; border-bottom:1px dashed #CCC; padding-top:20px;}
.msg_box h4{ margin-left:15px;border-style: none;}
.msg_box textarea{width:660px;height:90px;padding:2px;overflow:hidden;background-color: #ffffff; border:1px solid #CCC; margin:5px 15px; color:#666; font-size:12px;}
.msg_box a{ float:right; display:block; width:50px; height:22px; background:#15bccf; color:#fff; margin-right:10px; text-align:center; margin-top:5px; }
.msg_box a:hover{ background-color:#03a1b3; text-decoration:none;}
/****评分弹框****/
.alert .close{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-502px;background:url(images/close.png) no-repeat;cursor:pointer;}
.alert .C{width:476px;height:296px;position:absolute;left:5px;top:5px; }
.ping_con{ margin:5px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
.ping_con ul{ height:30px;}
.ping_con ul li{ float:left; color:#656767; font-weight:bold;}
.ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; }
.ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;}
.ping_con p span a{ color:#777777;}
.ping_star{ width:160px; color:#333; font-weight:bold; margin-bottom:5px;}
.ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png) -2px 0 no-repeat; margin-right:3px;}
.ping_star span a:hover{background:url(images/star.png) -24px 0 no-repeat;}
.ping_con textarea{ width:455px; height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;}
a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;}
a.ping_sub1{ float:right; height:22px; width:60px; background:#15bccf; color:#fff; text-align:center;}
a:hover.ping_sub{ background:#14a8b9;}
.recall{ border-top:1px solid #CCC; padding:5px 0;}
.recall_head{ float:left;}
.recall_head a{ display:block; width:30px; height:30px; border:1px solid #CCC; padding:1px;}
.recall_head img{ height:30px; width:30px;}
.recall_head a:hover{border:1px solid #15bccf;}
.recall_head img:hover{border:1px solid #15bccf;}
.recall_con{ float:left;color:#777777; width:90%; margin-left:10px; }
.recall_con a{ color:#15bccf; }
.ping_list{ margin-top:15px;}
.ping_ttl{height:18px;}
.ping_ctt{height:auto;padding:6px;clear:both;}
.ping_tb_{ border-bottom:3px solid #e4e4e4; text-align:center;}
.ping_tb_ ul{height:24px;}
.ping_tb_ li{float:left;height: 24px;width: auto; padding:0 10px;cursor:pointer;}
.ping_normaltab { color:#15bccf ; border-bottom:3px solid #e4e4e4;}
.ping_hovertab { color:#656767; font-weight:bold; border-bottom:3px solid #15bccf; }
.ping_dis{display:block; }
.ping_undis{display:none;}
.ping_C{border-bottom:1px dashed #CCC; padding:5px;}
.ping_dispic a{ display:block; height:46px; width:46px; border:1px solid #CCC; padding:1px; float:left;}
.ping_dispic img{ height:46px; width:46px;}
.ping_discon{ float:left; width:372px; margin-left:15px;}
.ping_distop span{ float:left;}
.ping_distop p{ color:#5f5f5f;}
.ping_disfoot a{ float:right; color:#15bccf; margin-left:5px;}
.ping_distop span a{ float:right; width:20px; height:20px; background:url(images/star.png) -24px 0 no-repeat; margin-right:3px;}
/* 创建作业 */
.Newwork{ width:940px; border:1px solid #c3c3c3;}
.N_top{ height:35px; background:#e5e5e5; border:1px solid #fff; width:691px; padding:5px 10px 0 15px;}
.N_top h2{ color:#616161; font-size:14px; float:left;}
.N_top a{ float:right; font-size:14px; color:#15bccf; display:block; background:url(images/pic_ad.png) 0 5px no-repeat; height:20px; width:60px; padding-left:16px;}
.N_con{ color:#484747 !important; font-weight:bold; width: 691px;; margin:15px auto;}
.N_con p{ margin-bottom:15px;}
.w430{ width:430px;}
.w350{ width:350px;}
.w620{ width:580px; height:160px; border:1px solid #CCC;}
.bo{height:26px; border:1px solid #CCC !important; padding: 0 !important;}
a.tijiao{ height:28px !important; display:block !important; width:80px !important; color:#fff !important; background:#15bccf !important; text-align:center !important; padding-top:4px !important; float:left !important; margin-right:10px !important;}
a:hover.tijiao{ background:#0f99a9 !important;}
.members_left{ float:left; width:570px; margin-right:20px;}
.members_left{}
.members_left ul li{ height:30px; border-bottom:1px solid #CCC; width:570px; padding-top:5px; }
.members_left ul li a{ float:left;}
.members_left ul li span{ float:left; text-align:center; color:#484747;}
.w260{ text-align:center; width:260px;}
.f_b{ font-weight: bold;}
.members_right label{ margin-left:15px;}
.N_search{ height:20px !important; border:1px solid #999 !important;}
/* 匿名评分弹框 */
.alert .close02{width:26px;height:26px;overflow:hidden;position:absolute;top:-10px;right:-490px;background:url(images/close.png) no-repeat;cursor:pointer;}
.ni_con { width:425px; margin:25px 30px;}
.ni_con h2{ display:block; height:40px; width:188px; margin:0 auto;}
.ni_con p{ color:#808181;}
.ni_con a:hover{ text-decoration:none;}
.ui-widget-header{display: none;}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 521 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 714 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 502 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB