Merge branch 'develop' into szzh

This commit is contained in:
sw 2014-11-08 16:35:25 +08:00
commit bf10e0234b
121 changed files with 2953 additions and 1249 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,38 @@ 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 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 = #{User.current.id}) 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} ORDER BY s_score DESC")
@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 +648,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 }
@ -797,6 +805,7 @@ class BidsController < ApplicationController
@bid.description = params[:bid][:description]
@bid.is_evaluation = params[:bid][:is_evaluation]
@bid.proportion = params[:bid][:proportion]
@bid.evaluation_num = params[:bid][:evaluation_num]
@bid.reward_type = 3
# @bid.budget = params[:bid][:budget]
@bid.deadline = params[:bid][:deadline]
@ -813,7 +822,7 @@ class BidsController < ApplicationController
flash[:notice] = l(:label_bid_succeed)
end
end
redirect_to respond_url(@bid)
redirect_to course_homework_url(params[:course_id])
else
@bid.safe_attributes = params[:bid]
@homework = @bid
@ -852,6 +861,7 @@ class BidsController < ApplicationController
@bid.description = params[:bid][:description]
@bid.is_evaluation = params[:bid][:is_evaluation]
@bid.proportion = params[:bid][:proportion]
@bid.evaluation_num = params[:bid][:evaluation_num]
@bid.reward_type = 3
@bid.deadline = params[:bid][:deadline]
@bid.budget = 0
@ -992,8 +1002,81 @@ class BidsController < ApplicationController
end
# 启动匿评
def start_anonymous_comment
@bid = Bid.find(params[:id])
@course = @bid.courses.first
if(@bid.comment_status == 0)
homeworks = @bid.homeworks
if(homeworks && homeworks.size >= 2)
homeworks.each_with_index do |homework, index|
user = homework.user
n = @bid.evaluation_num
n = n < homeworks.size ? n : homeworks.size - 1
assigned_homeworks = get_assigned_homeworks(homeworks, n, index)
assigned_homeworks.each do |h|
@homework_evaluation = HomeworkEvaluation.new(user_id: user.id, homework_attach_id: h.id)
@homework_evaluation.save
end
end
@bid.update_column('comment_status', 1)
@statue = 1
else
@statue = 2
end
else
@statue = 3
end
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
def alert_anonymous_comment
@bid = Bid.find params[:id]
@course = @bid.courses.first
if @bid.comment_status == 0
@totle_size = searchStudent(@course).size
@cur_size = @bid.homeworks.size
elsif @bid.comment_status == 1
@totle_size = 0
@bid.homeworks.map { |homework| @totle_size += homework.homework_evaluations.count}
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
@cur_size = 0
@bid.homeworks.map { |homework| @cur_size += homework.rates(:quality).where("seems_rateable_rates.rater_id not in #{teachers}").count}
end
@percent = format("%.2f",(@cur_size.to_f / ( @totle_size == 0 ? 1 : @totle_size)) * 100)
respond_to do |format|
format.js
end
end
private
def get_assigned_homeworks(homeworks, n, index)
homeworks += homeworks
homeworks[index + 1 .. index + n]
end
def find_bid
if params[:id]
@bid = Bid.find(params[:id], :include => [{:homeworks => :user}])
@ -1026,6 +1109,5 @@ class BidsController < ApplicationController
render_404
end
end
end

View File

@ -124,11 +124,12 @@ class ContestsController < ApplicationController
def show_contest
@user = @contest.author
@jours = @contest.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]
#@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
@state = false
respond_to do |format|

View File

@ -410,6 +410,7 @@ class CoursesController < ApplicationController
@course = Course.new
@course.safe_attributes = params[:course]
month = Time.now.month
render :layout => 'base'
end
@ -672,10 +673,10 @@ class CoursesController < ApplicationController
page = 1 + offset / @limit
end
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, page
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
#@feedback_count = @jours.count
#@feedback_pages = Paginator.new @feedback_count, @limit, page
#@offset ||= @feedback_pages.offset
@jour = paginateHelper @jours,10
@state = false
respond_to do |format|
format.html{render :layout => 'base_courses'}

View File

@ -1,24 +1,170 @@
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] || "s_socre", params[:direction] || "desc"
if sort == 't_socre'
order_by = "t_score #{direction}"
elsif sort == 's_socre'
order_by = "s_score #{direction}"
elsif sort == 'time'
order_by = "created_at #{direction}"
end
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] || "s_socre", params[:direction] || "desc"
if sort == 't_socre'
order_by = "t_score #{direction}"
elsif sort == 's_socre'
order_by = "s_score #{direction}"
elsif sort == 'time'
order_by = "created_at #{direction}"
end
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] || "s_socre", params[:direction] || "desc"
if sort == 't_socre'
order_by = "t_score #{direction}"
elsif sort == 's_socre'
order_by = "s_score #{direction}"
elsif sort == 'time'
order_by = "created_at #{direction}"
end
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 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 = #{User.current.id}) 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} ORDER BY s_score DESC")
@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 +212,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
@ -77,7 +226,7 @@ class HomeworkAttachController < ApplicationController
def create
bid = Bid.find params[:bid_id]
if User.current.admin? || User.current.member_of_course?(bid.courses.first) # modify by nwb
if bid.homeworks.where("user_id = ?",User.current).count == 0
if bid.homeworks.where("user_id = ?",User.current).empty?
user_id = params[:user_id]
bid_id = params[:bid_id]
if params[:homework_attach]
@ -90,8 +239,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 +361,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,32 +381,71 @@ 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_count = stars_reates.count == 0 ? 1 : stars_reates.count
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
percent_m = format("%.2f", percent)
@stars_status_map["star#{star_status.stars.to_i}".to_sym] =
percent_m.to_s + "%"
end
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_map = Hash.new(0.0)
#stars_status.each do |star_status|
# percent = (star_status.scount * 1.0/ stars_reates_count) * 100.to_f
# percent_m = format("%.2f", percent)
# @stars_status_map["star#{star_status.stars.to_i}".to_sym] =
# percent_m.to_s + "%"
#end
#是否已经进行过评价
temp = HomeworkAttach.find_by_sql("SELECT stars FROM seems_rateable_rates WHERE rateable_type = 'HomeworkAttach' AND rateable_id = #{@homework.id} AND rater_id = #{User.current.id}").first
@m_score = temp.nil? ? 0:temp.stars
@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")
#@is_evaluation = @homework.bid.is_evaluation == 1 || @homework.bid.is_evaluation == nil
#@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 = 2 #匿评
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 +453,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,16 +486,53 @@ 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
stars_reates = @homework. rates(:quality)
is_student = is_cur_course_student @homework.bid.courses.first
is_teacher = is_course_teacher User.current,@homework.bid.courses.first
@has_evaluation = stars_reates.where("rater_id = ?",User.current).count > 0
@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.js
end
@ -321,6 +574,7 @@ class HomeworkAttachController < ApplicationController
end
end
private
#验证是否显示课程
def can_show_course
@first_page = FirstPage.find_by_page_type('project')
@ -328,5 +582,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

@ -424,10 +424,10 @@ class ProjectsController < ApplicationController
end
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, @page
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
#@feedback_count = @jours.count
#@feedback_pages = Paginator.new @feedback_count, @limit, @page
#@offset ||= @feedback_pages.offset
@jour = paginateHelper @jours,10
@state = false
@base_courses_tag = @project.project_type

View File

@ -280,11 +280,11 @@ class UsersController < ApplicationController
fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false)
end
@limit = 10
@feedback_count = @jours.count
@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
@offset ||= @feedback_pages.offset
@jour = @jours[@offset, @limit]
#@limit = 10
#@feedback_count = @jours.count
#@feedback_pages = Paginator.new @feedback_count, @limit, params['page']
#@offset ||= @feedback_pages.offset
@jour = paginateHelper @jours,10
@state = false
end
# end

View File

@ -27,11 +27,7 @@ class WordsController < ApplicationController
end
end
@jours = @user.journals_for_messages.where('m_parent_id IS NULL').reverse
@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
respond_to do |format|
# format.html { redirect_to_referer_or {render :text => 'Watcher added.', :layout => true}}
@ -56,6 +52,7 @@ class WordsController < ApplicationController
reply_user_id = params[:reference_user_id]
reply_id = params[:reference_message_id] # 暂时不实现
content = params[:user_notes]
@show_name = params[:show_name] == "true"
options = {:user_id => author_id,
:status => true,
:m_parent_id => parent_id,
@ -82,7 +79,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,64 @@ 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
def anonymous_comment_link(bid, course)
link = case bid.comment_status
when 0
confirm_info = "开启匿评后学生将不能对作业进行提交、修改、删除等操作\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定开启匿评?'
link_to '启动匿评', start_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, :confirm => confirm_info, disable_with: '加载中...'
when 1
confirm_info = "关闭匿评后所有同学将不能继续进行匿评,且将公开已提交作业列表\n"
confirm_info += anonymous_comment_notice(bid,course)
confirm_info += '是否确定关闭匿评?'
link_to '关闭匿评', stop_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true, :confirm => confirm_info
when 2
'匿评结束'
end
content_tag('span', link, id: "#{bid.id}_anonymous_comment")
end
def anonymous_comment_notice(bid, course)
case bid.comment_status
when 0
@student_size ||= searchStudent(course).size
@homework_size = bid.homeworks.size
percent = @homework_size.to_f / (@student_size == 0 ? 1 : @student_size)
confirm_info = "目前#{@student_size}个学生,总共提交了#{@homework_size}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n"
when 1
@homework_evaluations = 0
bid.homeworks.map { |homework| @homework_evaluations += homework.homework_evaluations.count}
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
@has_evaluations = 0
bid.homeworks.map { |homework| @has_evaluations += homework.rates(:quality).where("seems_rateable_rates.rater_id not in #{teachers}").count}
percent = @has_evaluations.to_f / (@homework_evaluations == 0 ? 1 : @homework_evaluations)
confirm_info = "目前总共分配了#{@homework_evaluations}份匿评作业,已评价#{@has_evaluations}份作业,占#{number_to_percentage(percent * 100, precision: 1)}\n"
end
confirm_info
end
end

View File

@ -343,8 +343,7 @@ module CoursesHelper
end
#获取当前用户在指定作业下提交的作业的集合
def cur_user_homework_for_bid bid
cur_user_homework = HomeworkAttach.where("user_id = ? and bid_id = ?",User.current,bid.id)
cur_user_homework
bid.homeworks.where("user_id = ?",User.current)
end
#判断当前用户对指定作业是否已经评价过
@ -394,10 +393,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 +403,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
#获取指定项目的得分
@ -479,6 +475,17 @@ module CoursesHelper
type << option2
type
end
def cur_course_term
month = Time.now.month
if month >= 9 || month < 3
term = "秋季学期"
else
term = "春季学期"
end
term
end
#获取课程动态
def get_course_activity courses, activities
@course_ids=activities.keys()

View File

@ -74,4 +74,44 @@ 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.length.times do |i|
if i == array.length - 1
ary += array[i].id.to_s + ")"
else
if !(array[i].nil? || array[i].id.nil? || array[i].id.to_s == "")
ary += array[i].id.to_s + ","
end
end
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

@ -99,7 +99,7 @@ module WatchersHelper
# 主讲教师不允许退出课程
return '' if user.id == course.tea_id || course.is_public == 0
joined = user.member_of_course?(course)
text = joined ? l(:label_exit_course) : l(:label_join_course)
text = joined ? l(:label_exit_course) : l(:label_new_join)
url_t = join_path(:object_id => course.id)
url_f = try_join_path(:object_id => course.id)
method = joined ? 'delete' : 'post'

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

@ -0,0 +1,90 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>开启匿评功能</title>
<style>
body{ font-size:12px; font-family:"微软雅黑","宋体"; 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;}
/* 匿名评分弹框 */
.anonymos{width:480px;height:180px;position:absolute;z-index:100;left:50%;top:50%;margin:-215px 0 0 -300px; background:#fff; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px; box-shadow:0px 0px 8px #194a81; overflow:auto;}
.ni_con { width:425px; margin:25px 30px;}
.ni_con h2{ display:block; height:40px; width:425px; text-align:center; color:#3a3a3a;}
.ni_con p{ color:#808181; }
.ni_con a:hover{ text-decoration:none;}
.ni_btn{ width:190px; margin:15px auto; }
a.tijiao{ height:28px; display:block; width:80px; color:#fff; background:#15bccf; text-align:center; padding-top:4px; float:left; margin-right:15px;}
a:hover.tijiao{ background:#0f99a9;}
.c_blue{ color:#0195bd;}
.c_pink{ color:#e65d5e;}
</style>
<script type="text/javascript">
function clickOK()
{
hideModal("#popbox02");
$.ajax({
type: "GET",
url: "<%= bid.comment_status == 0 ? start_anonymous_comment_bid_path(bid) : stop_anonymous_comment_bid_path(bid)%>",
data: 'text',
success: function (data) {
}
});
}
function clickCanel(){hideModal("#popbox02");}
</script>
</head>
<body>
<div id="popbox02">
<div class="ni_con">
<% if @bid.comment_status == 0%>
<h2>开启匿评功能</h2>
<p>
开启匿评后学生将不能对作业进行
<span class="c_blue">提交、修改、删除</span>
等操作,目前有
<span class="c_pink"><%= totle_size%>个</span>
学生,共提交了
<span class="c_pink"><%= cur_size %></span>
份作业,占
<span class="c_pink"><%= percent %>%</span>
是否确定开启匿评?
</p>
<% elsif @bid.comment_status == 1 %>
<h2>关闭匿评功能</h2>
<p>
关闭匿评后学生将不能对作业进行
<span class="c_blue">匿评</span>
,且作业列表将会
<span class="c_blue">公开</span>
目前分配了
<span class="c_pink"><%= totle_size%>份</span>
匿评作业,已评了
<span class="c_pink"><%= cur_size %></span>
份作业,占
<span class="c_pink"><%= percent %>%</span>
是否确定关闭匿评?
</p>
<% end %>
<div class="ni_btn">
<a href="#" class="tijiao" onclick="clickOK();" >
确&nbsp;&nbsp;定
</a>
<a href="#" class="tijiao" onclick="clickCanel();">
取&nbsp;&nbsp;消
</a>
</div>
</div>
</div>
</body>
</html>

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>
<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? && is_cur_course_student(@course) %>
<% cur_user_homework = cur_user_homework_for_bid(bid) %>
<% if cur_user_homework!= nil && cur_user_homework.empty? %>
<%= link_to l(:label_commit_homework),new_exercise_book_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 '启动匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...' %>
<% when 1 %>
<%= link_to '关闭匿评', alert_anonymous_comment_bid_path(bid), id: "#{bid.id}_stop_anonymous_comment", remote: true %>
<% when 2 %>
匿评结束
<% 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>
</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? ? 0 : bid.commit %>
</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

@ -62,12 +62,12 @@
<% 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} %>
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal,:show_name => true} %>
</div>
<% end %>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal,:show_name => true } %>
</div>
</li>
<% end %>

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,88 @@
{
$("#what_is_project_div").slideToggle();
}
$(document).ready(
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;cursor:pointer;'>" +
"<a href='#' onclick='hiddent_alert_model();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","").css("width","511");
$('#ajax-modal').parent().addClass("alert_praise");
<% end %>
<% unless @is_teacher%>
<% if @bid.comment_status == 0%>
$("#my_homework").click();
<% elsif @bid.comment_status == 2%>
$("#all_homeworks").click();
<% end %>
<% 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

@ -32,17 +32,21 @@
<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>
</p>
<p>
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;", :readonly => true, :onchange => "regexDeadLine();") %>
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:100px;", :readonly => true, :onchange => "regexDeadLine();") %>
<%= calendar_for('bid_deadline')%>
<span id="bid_deadline_span">
</span>
</p>
<p>
<p style="display: none;">
<%= f.select :is_evaluation, is_evaluation_option %>
</p>
<p>
<%= f.select :proportion, proportion_option %>
</p>
<p>
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%>
<span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span>
</p>
<p>
<%= hidden_field_tag 'course_id', @course.id %>
</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 @bid.comment_status == 2 ? "已评作品" : "待评作品", get_student_batch_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'student_batch_homework',:remote => true}%>
</li>
<li id="tb_6" class="normaltab">
<%= link_to "我的作品", get_my_homework_homework_attach_index_path(:bid_id => @bid.id), {id: 'my_homework',: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), {id: 'all_homeworks',: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 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

@ -0,0 +1,8 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'alert_anonyoms', locals: { bid: @bid, totle_size:@totle_size, cur_size:@cur_size, percent:@percent}) %>');
showModal('ajax-modal', '500px');
$('#ajax-modal').css('height','180px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='#' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("anonymos");

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

@ -1,7 +1,7 @@
<script type="text/javascript">
function regexName()
{
var name = $("#bid_name").val();
var name = $.trim($("#bid_name").val());
if(name=="")
{
@ -18,7 +18,7 @@
}
function regexDeadLine()
{
var deadline = $("#bid_deadline").val();
var deadline = $.trim($("#bid_deadline").val());
var regex = /^\d{4}-\d{2}-\d{2}$/;
if(deadline=="")
{
@ -39,10 +39,42 @@
return false;
}
}
function regexEvaluationNum()
{
var evaluation_num = $.trim($("#bid_evaluation_num").val());
var regex = /^\d+$/;
if(evaluation_num=="")
{
$("#bid_evaluation_num_span").text("匿评分配数量不能为空");
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
else if(regex.test(evaluation_num))
{
if(evaluation_num > 0)
{
$("#bid_evaluation_num_span").text("填写正确");
$("#bid_evaluation_num_span").css('color','#008000');
return true;
}
else
{
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
}
else
{
$("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
}
function submitHomework(id)
{
if(regexDeadLine()&&regexName())
if(regexDeadLine()&&regexName()&&regexEvaluationNum())
{
$("#edit_bid_" + id).submit();
}

View File

@ -0,0 +1,9 @@
<% if @statue == 1%>
alert('启动成功');
$("#<%= @bid.id %>_start_anonymous_comment").remove();
$("#<%= @bid.id %>_anonymous_comment").append('<%= link_to "关闭匿评", alert_anonymous_comment_bid_path(@bid), remote: true, id:"#{@bid.id}_stop_anonymous_comment" %>');
<% elsif @statue == 2 %>
alert('启动失败\n作业总数大于等于2份时才能启动匿评');
<% elsif @statue == 3%>
alert("已开启匿评,请务重复开启");
<% end %>

View File

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

View File

@ -16,7 +16,7 @@
<div class="add_frame_header" >
<%= l(:label_message_new) %>
</div>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
<%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => false, :id => 'message-form'} do |f| %>
<%= render :partial => 'messages/form', :locals => {:f => f} %>
<p>
<input type="button" onclick="submitCoursesBoard();" class = "whiteButton m3p10 h30" value="<%= l(:button_submit)%>">

View File

@ -0,0 +1,14 @@
<div class="dis">
<div class="msg_box" id='leave-message'>
<h4>留言内容</h4>
<%= render :partial => 'new', :locals => {:contest => @contest, :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 => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
</div>
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
</div>

View File

@ -1,79 +1,63 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% tip1 = l(:label_user_response) %>
<p class="font_lighter" style="font-size: 15px; padding-left: 12px; "><%=tip1%></p>
<div id='leave-message'>
<%= render :partial => 'new', :locals => {:contest => @contest, :sta => @state} %>
<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), contests_path(:id => contest,
: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,:show_name => true} %>
</div>
<% end %>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %>
</div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>
</div>
</div>
<% if journals.size >0 %>
<ul class="message-for-user">
<% for journal in journals%>
<li id='word_li_<%= journal.id.to_s %>' class="outer-message-for-user">
<span class="portrait">
<%= image_tag(url_to_avatar(journal.user), :class => "avatar") %>
</span>
<span class="body">
<span class="user">
<%= link_to journal.user, user_path(journal.user)%>
</span>
<span class="font_lighter">
<% label = l(:label_contest_requirement) %>
</span>
<div> <%= textilizable journal.notes%> </div>
<span class="font_lighter">
<%= l(:label_bids_published) %>&nbsp;
<%= time_tag(journal.created_on).html_safe %>&nbsp;
<%= l(:label_bids_published_ago) %>
</span>
<% ids = 'project_respond_form_'+ journal.id.to_s%>
<span>
<% if reply_allow %>
<%= link_to(l(:button_quote),
contests_path(:id => contest,
:journal_id => journal),
:remote => true,
:method => 'post',
:title => l(:button_quote))
%>
<%= link_to l(:label_bid_respond_quote),
'',
{:focus => 'project_respond',
:onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user}: '); $('##{ids} textarea') ;return false;"
}
%>
<% end %>
<% if @user==User.current|| User.current.admin? %>
<%= link_to(l(:label_bid_respond_delete),
words_destroy_path(:user_id => @user, :object_id => journal),
:remote => true,
:confirm => l(:text_are_you_sure),
:method => 'delete',
:class => "delete",
:title => l(:button_delete)) %>
<% end %>
</span>
</span>
<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>
</li>
<% end %>
</ul>
<% end %>

View File

@ -1,15 +1,8 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%= stylesheet_link_tag 'css', :media => 'all' %>
<div id="history">
<%= render :partial => 'history',
<%= render :partial => 'contest_jours',
:locals => { :contest => @contest, :journals => @jour, :state => false}
%>
</div>
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>
<% html_title(l(:label_user_response)) -%>

View File

@ -43,7 +43,11 @@
<span class="info" style="width: 10px;">
<%= text_field_tag :class_period, @course.class_period, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
</span>
<span>&nbsp;<strong><%= l(:label_class_hour) %></strong></span>
<span>&nbsp;
<strong>
<%= l(:label_class_hour) %>
</strong>
</span>
</td>
</tr>
</table>
@ -53,12 +57,16 @@
<table>
<tr>
<td>
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px"><%= l(:label_class_period) %>
<span class="required"> *&nbsp;&nbsp;</span></span>
<span class="info" align="right" style="width: 90px; font-weight: bold ;margin-left:22px">
<%= l(:label_class_period) %>
<span class="required"> *&nbsp;&nbsp;</span>
</span>
<span class="info" style="width: 10px;">
<%= text_field_tag :class_period, nil, :placeholder => "#{l(:lable_input_class)}", :maxlength => 5 %>
</span>
<strong><%= l(:label_class_hour) %></strong>
<strong>
<%= l(:label_class_hour) %>
</strong>
</td>
</tr>
</table>
@ -72,13 +80,16 @@
<table>
<tr>
<td class="info" align="right" style="width: 86px">
<strong><%= l(:label_term) %><span class="required"> *&nbsp;&nbsp;</span></strong>
<strong>
<%= l(:label_term) %>
<span class="required"> *&nbsp;&nbsp;</span>
</strong>
</td>
<td class="info" style="width: 10px">
<%= select_tag :time,options_for_select(course_time_option,@course.time), {} %>
</td>
<td class="info" style="width: 10px">
<%= select_tag :term,options_for_select(course_term_option,@course.term),{} %>
<%= select_tag :term,options_for_select(course_term_option,@course.term || cur_course_term),{} %>
</td>
</tr>
</table>
@ -88,12 +99,15 @@
</table>
</p>
<p style="margin-left:-10px;">
<label for="course[course]_password" style="font-size: 13px;"><%= l(:label_new_course_password) %>
<label for="course[course]_password" style="font-size: 13px;">
<%= l(:label_new_course_password) %>
<span class="required">*</span>
</label>
<input id="course_course_password" type="text" style="width:488px;margin-left: 10px;" value="<%= @course.password %>" size="60" name="course[password]"/>
</p>
<em class="info" style="margin-left:95px;"><%= l(:text_command) %></em>
<em class="info" style="margin-left:95px;">
<%= l(:text_command) %>
</em>
<% end %>
<p style="padding-right: 20px;">
<label for="course_description" style="font-size: 13px;">
@ -111,10 +125,14 @@
<%= l(:label_course_public_info) %>
</em>
</p><!-- modified by bai -->
<p style="display:none;"><%= f.text_field :course_type, :value => 1 %></p>
<p style="display:none;">
<%= f.text_field :course_type, :value => 1 %>
</p>
<%= wikitoolbar_for 'course_description' %>
<% @course.custom_field_values.each do |value| %>
<p><%= custom_field_tag_with_label :course, value %></p>
<p>
<%= custom_field_tag_with_label :course, value %>
</p>
<% end %>
<%= call_hook(:view_courses_form, :course => @course, :form => f) %>
<!--[eoform:course]-->

View File

@ -0,0 +1,31 @@
<div class="dis">
<div class="msg_box" id='leave-message'>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<h3><%= l(:label_user_response) %></h3>
<% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;">
<%= l(:label_user_login_tips) %>
<%= link_to l(:label_user_login_new), signin_path %>
<hr/>
</div>
<% else %>
<div style="width: 80%; margin-left:10%;">
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%>
<%= f.text_area 'course_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}",
:style => "resize: none; width: 98%",
:class => 'noline'%>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
<% end %>
</div>
<% end %>
</div>
<div id="history">
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
</div>
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
</div>

View File

@ -0,0 +1,59 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<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;"} %>
<% 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,:show_name => true} %>
</div>
<% end %>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %>
</div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>
</div>
</div>

View File

@ -37,17 +37,21 @@
</p>
<% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %>
<p>
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %>
<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:100px;",:value => "#{time}", :onchange => "regexDeadLine();", :readonly => true) %>
<%= calendar_for('bid_deadline')%>
<span id="bid_deadline_span">
</span>
</p>
<p>
<p style="display: none">
<%= f.select :is_evaluation, is_evaluation_option %>
</p>
<p>
<%= f.select :proportion, proportion_option %>
</p>
<p>
<%= f.text_field :evaluation_num, :required => true, :size => 60, :style => "width:150px;", :onblur => "regexEvaluationNum();" , :maxlength => 4%>
<span id="bid_evaluation_num_span">匿评分配数量不宜太大,否则会影响开启匿评速度</span>
</p>
<p>
<%= hidden_field_tag 'course_id', @course.id %>
</p>

View File

@ -7,7 +7,7 @@
<% linkPath = course_endTime_timeout?(course) ? restartcourse_course_path(course) : finishcourse_course_path(course, format: :js) %>
<% desc = course_endTime_timeout?(course) ? '重启' : '关闭' %>
<%= link_to "#{desc}课程", linkPath, :remote => true, :method => :post, :id => id, :confirm => ("确定要#{desc}课程?") %>
<%= link_to "#{desc}", linkPath, :remote => true, :method => :post, :id => id, :confirm => ("确定要#{desc}课程?") %>
<% else %>
<!-- 关闭课程block -->
<% end %>

View File

@ -1,3 +1,11 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%= stylesheet_link_tag 'css', :media => 'all' %>
<%= render :partial => 'courses_jours',
:locals => { :contest => @contest, :journals => @jour, :state => false}
%>
<% html_title(l(:label_user_response)) -%>
<script>
var W3CDOM = document.createElement && document.getElementsByTagName;
@ -35,72 +43,4 @@ function checkMaxLength() {
}
</script>
<!-- fq -->
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<h3><%= l(:label_user_response) %></h3>
<% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;">
<%= l(:label_user_login_tips) %>
<%= link_to l(:label_user_login_new), signin_path %>
<hr/>
</div>
<% else %>
<div style="width: 80%; margin-left:10%;">
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_course_message'}) do |f|%>
<%= f.text_area 'course_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}",
:style => "resize: none; width: 98%",
:class => 'noline'%>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
<% end %>
</div>
<% end %>
<div style="clear: both;"></div>
<% if @jour.size >0 %>
<ul class="message-for-user">
<% for journal in @jour%>
<li id='word_li_<%=journal.id.to_s%>' class="outer-message-for-user">
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
<span class="body">
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
<%= textilizable journal.notes%>
<span class="font_lighter"> <%= l :label_update_time %>: <%= format_time journal.created_on %></span>
<% id = 'course_respond_form_'+journal.id.to_s%>
<span>
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'#',
{:focus => 'course_respond',
:onclick => "toggleAndSettingWordsVal($('##{id}'),
$('##{id} textarea'),
'#{l(:label_reply_plural)} #{journal.user.name}: ');
return false;"} %>
<% end %>
<% if journal.delete_by_user?(User.current) %>
<%= link_to(l(:button_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => journal.user}, :method => :delete,:confirm => l(:text_are_you_sure),:remote => true)%>
<% end %>
</span>
</span>
<div style="clear: both;"></div>
<% if reply_allow %>
<div id='<%= id %>' 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>
</li>
<% end %>
</ul>
<% end %>
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>
<% html_title(l(:label_course_feedback)) -%>

View File

@ -6,7 +6,9 @@
<%= labelled_form_for @course do |f| %>
<div class="box tabular">
<%= render :partial => 'course_form', :locals => { :f => f } %>
<span style="padding-left: 60px"><%= submit_tag l(:button_create), :class => "enterprise"%></span>
<span style="padding-left: 60px">
<%= submit_tag l(:button_create), :class => "enterprise"%>
</span>
<!-- <%#= submit_tag l(:button_create_and_continue), :name => 'course_continue' %> -->
<%= javascript_tag "$('#course_name').focus();" %>
</div>

View File

@ -1,7 +1,7 @@
<script type="text/javascript">
function regexName()
{
var name = $("#bid_name").val();
var name = $.trim($("#bid_name").val());
if(name=="")
{
@ -18,7 +18,7 @@
}
function regexDeadLine()
{
var deadline = $("#bid_deadline").val();
var deadline = $.trim($("#bid_deadline").val());
var regex = /^\d{4}-\d{2}-\d{2}$/;
if(deadline=="")
{
@ -39,10 +39,42 @@
return false;
}
}
function regexEvaluationNum()
{
var evaluation_num = $.trim($("#bid_evaluation_num").val());
var regex = /^\d+$/;
if(evaluation_num=="")
{
$("#bid_evaluation_num_span").text("匿评分配数量不能为空");
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
else if(regex.test(evaluation_num))
{
if(evaluation_num > 0)
{
$("#bid_evaluation_num_span").text("填写正确");
$("#bid_evaluation_num_span").css('color','#008000');
return true;
}
else
{
$("#bid_evaluation_num_span").text("匿评分配数量必须为大于0");
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
}
else
{
$("#bid_evaluation_num_span").text("匿评分配数量只能为数字");
$("#bid_evaluation_num_span").css('color','#ff0000');
return false;
}
}
function submitHomework()
{
if(regexDeadLine()&&regexName())
if(regexDeadLine()&&regexName()&&regexEvaluationNum())
{
$("#new_bid").submit();
}

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,55 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<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,:show_name => true} %>
</div>
<% end %>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %>
</div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>
</div>
</div>

View File

@ -0,0 +1,103 @@
<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">
<% unless is_student_batch_homework %>
<%= l(:label_teacher_score)%>:
<span class="c_red">
<%= homework.t_score.nil? ? l(:label_without_score) : format("%.2f",homework.t_score)%>
</span>
&nbsp;&nbsp;
<% end %>
</li>
<li class="wscore">
<%= is_student_batch_homework ? l(:label_my_score) : l(:label_student_score)%>:
<span class="c_red">
<%= is_student_batch_homework ? (homework.m_score.nil? ? l(:label_without_score) : homework.m_score) : (homework.s_score.nil? ? l(:label_without_score) : 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_anonymous_comments),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="background:#8e8e8e;"><%= l(:label_anonymous_comments) %></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,73 @@
<% 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_anonymous_comments), sort_homework_path(@bid, 's_socre', @direction), {:remote => true}%>
&nbsp;/&nbsp;
<%= link_to l(:label_teacher_score), sort_homework_path(@bid, 't_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" title="只有开启匿评之前才能创建作业哦!">
<a style="width:80px; margin:20px 0 0 350px;background:#8e8e8e;">提交作业</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 %>
<% if is_teacher %>
<span style="color: red;">
<%= anonymous_comment_notice(@bid, @bid.courses.first) %>
</span>
<% end %>

View File

@ -0,0 +1,61 @@
<% 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>
<% end %>
</div>
<div class="ping_discon">
<div class="ping_distop">
<span>
<% if show_name %>
<%= link_to jour.user, user_path(jour.user),:style => " font-weight:bold; color:#15bccf; margin-right:30px; background:none;", :target => "_blank"%>
<% else%>
<span style=" font-weight:bold; color:#15bccf; margin-right:30px; background:none;"><%= l(:label_anonymous) %></span>
<% end %>
</span>
<span style="color:#a6a6a6; margin-right:20px; margin-left:10px;"><%= format_time(jour.created_on) %></span>
<span style="font-weight:bold; color:#a6a6a6; ">
<% if show_score %>
<span style="float:left">
<%= l(:label_work_rating) %>
</span>
<%= 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?) && show_name %>
<%= 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'), ''); $('##{ids} textarea') ;return false;"} ##{l(:label_reply_plural)} #{jour.user.name}:
%>
</span>
</div>
<div id='<%= ids %>' class="respond-form">
<%= render :partial => 'words/new_respond', :locals => {:journal => jour, :m_reply_id => jour,:show_name=> show_name} %>
</div>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => jour,:show_name=> show_name } %>
</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

@ -1,34 +1,48 @@
<% 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">
<% id = 'project_respond_form_'+ reply.id.to_s %>
<p>
<span><%= link_to reply.user.name, user_path(reply.user) %>:&nbsp;</span>
<span class="message-notes"> <%= reply.notes %></span>
</p>
<p>
<span class="time"><%= format_time reply.created_on %></span>
<span style="display: none; margin-left: 4px;" id='<%=ids_r%>' >
<div class="recall" id='word_li_<%=reply.id.to_s%>' onmouseover="$('#<%= ids_r %>').show()" onmouseout="$('#<%= ids_r %>').hide()">
<div class="recall_head">
<% if show_name %>
<%= image_tag url_to_avatar(reply.user) %>
<% else %>
<%= image_tag url_to_avatar(nil) %>
<% end %>
</div>
<div class="recall_con">
<% id = 'project_respond_form_'+ reply.id.to_s %>
<%= link_to reply.user.name, user_path(reply.user) %>
回复
<% if show_name %>
<%= link_to reply.at_user.name,user_path(reply.at_user) %>
<% else %>
<%= l(:label_anonymous) %>
<% end %>
<p>
<span class="message-notes">
<%= reply.notes %>
</span>
</p>
<p>
<span class="time">
<%= format_time reply.created_on %>
</span>
<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 %>
<% if @user == User.current || User.current.admin? || reply.user.id == User.current.id %>
<%= link_to(l(:label_newfeedback_delete), {:controller => 'homework_attach', :action => 'destroy_jour', :object_id => reply, :user_id => reply.user},
:remote => true, :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %>
<% end %>
</span>
</p>
</div>
<div id='<%=id %>' class="respond-form">
<% if reply_allow %>
<%= render :partial => "add_jour_reply", :locals => {:journal => journal, :m_reply_id => m_reply_id} %>
<% end %>
{:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), ''); return false;"} %>
<% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: -->
</span>
</p>
</div>
<div id='<%=id%>' class="respond-form">
<% if reply_allow %>
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %>
<% end %>
</div>
<div style="clear: both;"></div>
</li>
</div>

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,77 @@
<% 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>
<% options = {:author => true } %>
<%= render :partial => 'app_link', :locals => {:attachments => @homework.attachments, :options => options} %>
</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>
<div id="add_jour">
<%= render :partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation} %>
</div>
<div class="cl"></div>
</div><!---ping_con end--->
<%= render :partial => 'histoey_new' %>
</div>
</div>

View File

@ -1,6 +1,6 @@
<span class="user" style="font-size: 15px">
<div data-kls="HomeworkAttach" data-id="2" data-dimension="quality" data-average="3.25" class="rateable div_inline jDisabled"
style="height: 15px; width: 100px; overflow: hidden; z-index: 1; position: relative;">
style="height: 20px; width: 115px; overflow: hidden; z-index: 1; position: relative;">
<% if stars != nil %>
<div class="jRatingColor" style="width: <%=stars.to_f * 20 %>%;"></div>
<% else %>

View File

@ -0,0 +1,16 @@
<% if is_comprehensive_evaluation == 3 || User.current == homework.user%>
<!-- <#%= l(:label_work_rating) %>
<%#= render :partial => 'show_score', locals: {:stars => totle_score} %> -->
<% elsif is_comprehensive_evaluation == 2 %>
<% if has_evaluation %>
<%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality,start_score: @m_score, class: 'rateable div_inline' %>
<% else %>
<%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality,start_score: 0, class: 'rateable div_inline' %>
<% end %>
<% elsif @is_comprehensive_evaluation == 1%>
<%= l(:label_work_rating) %>
<%= rating_for homework, dimension: :quality,start_score: 0, 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,23 @@
//教师评论
<% 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})) %>');
$('#add_jour').html('<%= escape_javascript(render(:partial => 'addjour', :locals => {:homework_attach => @homework, :sta => 0, :is_comprehensive_evaluation => @is_comprehensive_evaluation})) %>')
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("");
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} )) %>');
$('#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,123 @@
<!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()
{
if(regexName()){$('#edit_homework_attach_<%= @homework.id%>').submit();}
}
function regexName()
{
var name = $("#homework_attach_name").val();
<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>
if(name=="")
{
$("#homework_attach_name_span").text("名称不能为空");
$("#homework_attach_name_span").css('color','#ff0000');
return false;
}
else
{
$("#homework_attach_name_span").text("填写正确");
$("#homework_attach_name_span").css('color','#008000');
return true;
}
}
</script>
</head>
<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>
<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>
</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>
</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 => "作品名称", :onblur => "regexName();"%>
<span id="homework_attach_name_span"></span>
</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' %>
<% unless @homework.attachments.empty?%>
<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>
<% end %>
<p style=" padding: 3px 0 3px 0;padding-left: 90px;">
<%= render :partial => 'attachments/form' %>
</p>
</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 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,97 @@
<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>
<%= stylesheet_link_tag 'css', :media => 'all' %>
<script type="text/javascript" language="javascript" xmlns="http://www.w3.org/1999/html">
function regexName()
{
var name = $("#homework_attach_name").val();
</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>
if(name=="")
{
$("#homework_attach_name_span").text("名称不能为空");
$("#homework_attach_name_span").css('color','#ff0000');
return false;
}
else
{
$("#homework_attach_name_span").text("填写正确");
$("#homework_attach_name_span").css('color','#008000');
return true;
}
}
<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' %>
function submit_homework_form(){if(regexName()){$('#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 => "作品名称", :onblur => "regexName();" %>
<span id="homework_attach_name_span"></span>
</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>
<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>
</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,11 @@
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'show',:locals => {:comprehensive_evaluation => @comprehensive_evaluation,:homework => @homework, :teaher_score => @teaher_score}) %>');
showModal('ajax-modal', '513px');
$('#ajax-modal').css('height','569px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;padding-left: 513px;'>" +
"<a href='#' onclick='hidden_homework_atert_form("+
<%= @cur_page%> + "," + <%= @cur_type%> +
");'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().addClass("alert_box");

View File

@ -88,7 +88,7 @@
<div id="join_in_course">
<% if User.current.logged? %>
<% if User.current.allowed_to?(:as_teacher,@course) %>
<%= link_to l(:label_course_modify_settings), {:controller => 'courses', :action => 'settings', :id => @course} %>
<%= link_to l(:button_configure), {:controller => 'courses', :action => 'settings', :id => @course} %>
<%= render :partial => 'courses/set_course_time', :locals => {:course => @course} %>
<% else %>
<%= join_in_course(@course, User.current) %>
@ -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>
@ -76,19 +76,20 @@
<td>
<table>
<tr>
<td style="vertical-align: top;font-size: 16px;text-align: center;">
<td style="vertical-align: top;font-size: 15px;">
<span style=" word-wrap: break-word; word-break: break-all">
<strong>
<%= link_to course.name.to_s, homework_course_path(course) if course %>
<%= link_to "返回课程主页", homework_course_path(course) if course %>
</strong>
</span>
</td>
</tr>
<tr>
<td style=" word-wrap: break-word; word-break: break-all;font-size: 16px;text-align: center">
<td style=" word-wrap: break-word; word-break: break-all;font-size: 15px;">
<span style=" color:#ed8924">
<!-- modified by zjc 添加超链接 -->
<strong><%=link_to(@bid.name, respond_path(@bid)) %></strong>
<strong>
<%=link_to("第#{course.homeworks.index(@bid) + 1}次作业", course_for_bid_path(@bid)) %>
</strong>
</span>
</td>
</tr>
@ -102,69 +103,45 @@
<div class="inf_user_image">
<table>
<% if (User.current.admin?||User.current.id==@bid.author_id) %>
<tr>
<td valign="top" style="padding-left: 8px; font-size: 15px" colspan="2">
<span id="<%=@bid.id %>_anonymous_comment">
<% case @bid.comment_status %>
<% when 0 %>
<%= link_to '启动匿评', alert_anonymous_comment_bid_path(@bid), id: "#{@bid.id}_start_anonymous_comment", remote: true, disable_with: '加载中...' %>
<% when 1 %>
<%= link_to '关闭匿评', alert_anonymous_comment_bid_path(@bid), id: "#{@bid.id}_stop_anonymous_comment", remote: true %>
<% when 2 %>
匿评结束
<% end %>
</span>
</td>
</tr>
<% end %>
<tr>
<td valign="top" colspan="2" style="font-size: 16px;padding-left: 8px;">
<td valign="top" colspan="2" style="font-size: 15px;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 +150,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 +169,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

@ -0,0 +1,59 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<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;"} %>
<% 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,:show_name => true} %>
</div>
<% end %>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %>
</div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>
</div>
</div>

View File

@ -0,0 +1,31 @@
<div class="dis">
<div class="msg_box" id='leave-message'>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<h3><%= l(:label_user_response) %></h3>
<% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;">
<%= l(:label_user_login_tips) %>
<%= link_to l(:label_user_login_new), signin_path %>
<hr/>
</div>
<% else %>
<div style="width: 80%; margin-left:10%;">
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}",
:style => "resize: none; width: 98%",
:class => 'noline'%>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
<% end %>
</div>
<% end %>
</div>
<div id="history">
<%= render :partial => 'history',:locals => { :journals => @jour, :state => false} %>
</div>
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
</div>

View File

@ -1,3 +1,11 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%= stylesheet_link_tag 'css', :media => 'all' %>
<%= render :partial => 'project_jours',
:locals => { :contest => @contest, :journals => @jour, :state => false}
%>
<% html_title(l(:label_user_response)) -%>
<script>
var W3CDOM = document.createElement && document.getElementsByTagName;
@ -35,80 +43,5 @@ function checkMaxLength() {
}
</script>
<!-- fq -->
<h3><%= l(:label_user_response) %></h3>
<% if !User.current.logged?%>
<div style="font-size: 14px;margin:20px;">
<%= l(:label_user_login_tips) %>
<%= link_to l(:label_user_login_new), signin_path %>
<hr/>
</div>
<% else %>
<div style="width: 80%; margin-left:10%;">
<%= form_for('new_form', :method => :post,
:url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%>
<%= f.text_area 'project_message', :rows => 3, :cols => 65,
:placeholder => "#{l(:label_welcome_my_respond)}",
:style => "resize: none; width: 98%",
:class => 'noline'%>
<%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%>
<% end %>
</div>
<% end %>
<div style="clear: both;"></div>
<div id="project_feedback">
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<% if @jour.size >0 %>
<ul class="message-for-user">
<% for journal in @jour%>
<li id='word_li_<%=journal.id.to_s%>' class="outer-message-for-user">
<span class="portrait"><%= image_tag(url_to_avatar(journal.user), :class => "avatar") %></span>
<span class="body">
<span class="user"><%= link_to journal.user, user_path(journal.user)%></span>
<%= textilizable journal.notes%>
<span class="font_lighter"> <%= l :label_update_time %>: <%= format_time journal.created_on %></span>
<% id = 'project_respond_form_'+journal.id.to_s%>
<span>
<% if reply_allow %>
<%= link_to l(:label_projects_feedback_respond),'#',
{:focus => 'project_respond',
:onclick => "toggleAndSettingWordsVal($('##{id}'),
$('##{id} textarea'),
'#{l(:label_reply_plural)} #{journal.user.name}: ');
return false;"} %>
<% end %>
<% if User.current.logged? %>
<% if journal.user_id==User.current.id|| User.current.admin? %>
<%= link_to(l(:button_delete),{:controller => 'words', :action => 'destroyJournal', :object_id => journal.id, :project_id=>@project.id, :page=>@page},
:remote => true, :title => l(:button_delete), :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete") %>
<% end %>
<% end %>
</span>
</span>
<div style="clear: both;"></div>
<% if reply_allow %>
<div id='<%= id %>' 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>
</li>
<% end %>
</ul>
<% end %>
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>
</div>
<% html_title(l(:label_project_tool_response)) -%>

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

@ -0,0 +1,55 @@
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<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;"} %>
<% 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,:show_name => true} %>
</div>
<% end %>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal, :show_name => true} %>
</div>
</div>
<div class="cl"></div>
</div>
<% end %>
<% end %>
</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

@ -0,0 +1,14 @@
<div class="dis">
<div class="msg_box" id='leave-message'>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<h3><%= l(:label_user_response) %><span id="jour_count"><%= @obj_count%></span></h3>
<%= render :partial => 'words/new', :locals => {:user => @user, :sta => @state} %>
</div>
<div id="history">
<%= render :partial => 'history',:locals => { :contest => @contest, :journals => @jour, :state => false} %>
</div>
<ul class="wlist"><%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%></ul>
</div>

View File

@ -1,18 +1,7 @@
<div style="margin-top: 30px">
<div id='leave-message'>
<%= render :partial => 'words/new', :locals => {:user => @user, :sta => @state} %>
</div>
<div style="border-bottom: 1px dashed rgb(204, 204, 204);font-size: 14px; font-family: '微软雅黑'; padding-bottom: 10px; font-weight: bold; color:#807a76">
<%= l(:label_newfeedback_message) %><%= @feedback_count%>
</div>
<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%= stylesheet_link_tag 'css', :media => 'all' %>
<div id="message" style="font-size: 14px;">
<%= render :partial => 'words/message', :locals => {:jour => @jour, :state => @state, :user => @user, :feedback_pages => @feedback_pages} %>
</div>
<div class="pagination" style="float:left;">
<ul>
<%= pagination_links_full @feedback_pages %>
</ul>
</div>
</div>
<%= render :partial => 'user_jours',
:locals => { :journals => @jour, :state => false}
%>
<% html_title(l(:label_responses)) -%>

View File

@ -5,17 +5,17 @@
</div>
<!-- 上左下右 -->
<div class='desc_item'>
<span class=''>
<% unless course.is_public == 1 %>
<span class="private_project"><%= l(:label_private) %></span>
<% end %>
<%= link_to(course.name.truncate(30, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
<span class=''>
<% unless course.is_public == 1 %>
<span class="private_project"><%= l(:label_private) %></span>
<% end %>
<%= link_to(course.name.truncate(30, omission: '...')+":", course_path(course.id), :class => "d-g-blue d-p-project-name", :title => "#{course.name}") %>
</span>
<span class='font_bolder'>
<%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
<%#=course.try(:teacher).try(:name)%>
</span>
</span>
<span class='font_bolder'>
<%= link_to(course.try(:teacher).try(:realname), user_path(course.teacher)) %>
<%#=course.try(:teacher).try(:name)%>
</span>
</div>
<div class='desc_item text_nowrap'>
[<%= get_course_term course %>]

View File

@ -1,7 +1,7 @@
<% id = "journal_reply_ul_" + journal.id.to_s%>
<ul class="messages-for-user-reply" 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 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,:show_name=> show_name} %>
<% end %>
</div>

View File

@ -1,16 +1,24 @@
<% 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">
<% if show_name %>
<%= image_tag url_to_avatar(reply.user) %>
<% else %>
<%= image_tag url_to_avatar(nil) %>
<% end %>
</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) %>
回复
<% if show_name %>
<%= link_to reply.at_user.name,user_path(reply.at_user) %>
<% else %>
<%= l(:label_anonymous) %>
<% end %>
<p>
<span class="message-notes">
<%= reply.notes %>
</span>
@ -19,22 +27,22 @@
<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'), ''); return false;"} %>
<% end %> <!-- #{l(:label_reply_plural)} #{m_reply_id.user.name}: -->
</span>
</p>
</div>
<div id='<%=id%>' class="respond-form">
<% if reply_allow %>
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id} %>
<%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id,:show_name => show_name} %>
<% end %>
</div>
<div style="clear: both;"></div>
</li>
</div>

View File

@ -64,12 +64,12 @@ function checkMaxLength() {
<div style="clear: both;"></div>
<div id='<%= ids %>' class="respond-form">
<% if reply_allow %>
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal,:show_name => show_name} %>
<% end %>
</div>
<div style="clear: both;"></div>
<div>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal,:show_name => show_name } %>
</div>
</li>
<% end %>

View File

@ -1,13 +1,14 @@
<%= form_tag(words_create_reply_path, :remote => true) do %>
<%= text_area_tag 'user_notes', "", :class => 'noline',
:style => "resize: none;", :rows => 4,
:placeholder => l(:label_projects_feedback_respond_content),
:maxlength => 250 %>
:style => "resize: none;", :rows => 4,
:placeholder => l(:label_projects_feedback_respond_content),
:maxlength => 250 %>
<%= hidden_field_tag 'reference_id', params[:reference_id], :value => journal.id %>
<%= hidden_field_tag 'reference_user_id', params[:reference_user_id], :value => m_reply_id.user.id %>
<%= hidden_field_tag 'reference_message_id', params[:reference_message_id], :value => m_reply_id.id %>
<%= hidden_field_tag 'show_name',params[:show_name],:value => show_name.nil? ? true : show_name %>
<%= submit_tag l(:button_projects_feedback_respond), :name => nil ,
:class => "enterprise",
:style => "float: right; margin-top: 1px; margin-right: 4px;"%>

View File

@ -1,4 +1,6 @@
$('#message').html('<%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages})) %>');
//$('#message').html('<#%= escape_javascript(render(:partial => 'words/message', :locals => {:jour => @jour, :state => false, :user => @user, :feedback_pages => @feedback_pages,:show_name => true})) %>');
$('#history').html('<%= escape_javascript(render(:partial => 'users/history',:locals => { :journals => @jour, :state => false})) %>')
$('#jour_count').html('<%= @obj_count%>')
$('#pre_show').html('<%= escape_javascript(render(:partial => 'pre_show', :locals => {:content => nil})) %>');
$('#new_form_user_message').val("");
$('#new_form_reference_user_id').val("");

View File

@ -1,7 +1,7 @@
<% if @save_succ %>
var pre_append = $('<%= j(
render :partial => "words/journal_reply_items",
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm}
:locals => {:reply => @jfm, :journal => @jfm.parent, :m_reply_id => @jfm,:show_name => @show_name}
) %>').hide();
$('#journal_reply_ul_<%=@jfm.m_parent_id%>').append(pre_append);
pre_append.fadeIn(600);

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

@ -1843,3 +1843,12 @@ en:
label_search_conditions_not_null: The search conditions can not be empty
lable_school_list: List of schools
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

@ -463,7 +463,7 @@ zh:
permission_view_courses: 查看课程
permission_new_course: 新建课程
permission_configure_course: 配置课程
permission_close_course: 关闭/重开课程
permission_close_course: 关闭/重开
permission_new_assignment: 新建任务
permission_edit_assignment: 编辑任务
permission_delete_assignment: 删除任务
@ -603,7 +603,7 @@ zh:
#by young
label_requirement: 需求
label_new_course: 课程列表
label_course_practice: 课程实践
label_course_practice: 课程作业
label_course_all: 课程列表
label_teacher_all: 所有教师
label_project_deposit: 项目托管
@ -1459,7 +1459,7 @@ zh:
label_newtype_contest: 发布竞赛
label_user_information: "与我相关"
label_bid_succeed: "需求发布成功"
label_bid_succeed: "作业创建成功"
label_wrong_budget: 错误的金额格式
label_wrong_date: 时间格式错误,请输入正确的时间 yyyy-mm-dd
label_bidding_succeed: 应标成功
@ -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: 用户反馈
@ -1801,7 +1798,6 @@ zh:
label_course_public_info: (打钩为公开,不打钩则不公开,若不公开,仅课程成员可见该课程。)
label_course_view_student: 查看其他课程
label_course_student: 学生
label_homework: 课程作业
label_course_file: 资源库 #资料共享
label_stores_index: 资源搜索
label_course_new_homework: 新建作业
@ -1889,11 +1885,12 @@ zh:
label_bids_task_list: 作业列表
label_join_course: 加入课程
label_exit_course: 退出课程
label_exit_course: 退出
label_new_join: 加入
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: 作业最终以项目形式提交
@ -2053,7 +2050,7 @@ zh:
label_coursefile_sharingarea: 课程资源共享区
label_sort_by_activity: 按动态数排序
label_homework: 课程实践
label_homework: 课程作业
label_x_activity:
zero: 个动态
one: 个动态
@ -2171,3 +2168,20 @@ 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: 提交评论
field_evaluation_num: 匿评分配数量
label_my_score: 我的评分

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,9 @@ 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'
get 'alert_anonymous_comment'
end
end
resources :projects do
@ -695,7 +705,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

Some files were not shown because too many files have changed in this diff Show More