diff --git a/app/controllers/homework_common_controller.rb b/app/controllers/homework_common_controller.rb
index 9e3a4b836..7793ef097 100644
--- a/app/controllers/homework_common_controller.rb
+++ b/app/controllers/homework_common_controller.rb
@@ -6,8 +6,8 @@ class HomeworkCommonController < ApplicationController
include StudentWorkHelper
before_filter :find_course, :only => [:index,:new,:create]
- before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr]
- before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr]
+ before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy,:start_evaluation_set,:set_evaluation_attr,:score_rule_set]
+ before_filter :teacher_of_course, :only => [:new, :create, :edit, :update, :destroy, :start_anonymous_comment, :stop_anonymous_comment, :alert_anonymous_comment,:start_evaluation_set,:set_evaluation_attr,:score_rule_set]
before_filter :member_of_course, :only => [:index]
def index
@@ -215,6 +215,11 @@ class HomeworkCommonController < ApplicationController
end
end
+ #评分设置
+ def score_rule_set
+
+ end
+
private
#获取课程
def find_course
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index e5e1bf391..529c5ea72 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -457,7 +457,13 @@ class StudentWorkController < ApplicationController
end
end
respond_to do |format|
- format.html{redirect_to student_work_index_url(:homework => @homework.id)}
+ format.html{
+ if params[:student_path]
+ redirect_to student_work_index_url(:homework => @homework.id)
+ else
+ redirect_to user_homeworks_user_path(User.current.id)
+ end
+ }
end
end
diff --git a/app/controllers/words_controller.rb b/app/controllers/words_controller.rb
index 6304055ed..6ad1a66b4 100644
--- a/app/controllers/words_controller.rb
+++ b/app/controllers/words_controller.rb
@@ -243,7 +243,45 @@ class WordsController < ApplicationController
flash[:error] = feedback.errors.full_messages[0]
redirect_to course_feedback_url(params[:id])
end
+ end
+ #作业的回复
+ def leave_homework_message
+ if User.current.logged?
+ @user = User.current
+ @homework_common = HomeworkCommon.find(params[:id]);
+ if params[:homework_message].size>0 && User.current.logged? && @user
+ feedback = HomeworkCommon.add_homework_jour(@user, params[:homework_message], params[:id])
+ if (feedback.errors.empty?)
+ if params[:asset_id]
+ ids = params[:asset_id].split(',')
+ update_kindeditor_assets_owner ids,feedback[:id],OwnerTypeHelper::JOURNALSFORMESSAGE
+ end
+
+ course_activity = CourseActivity.where("course_act_type='HomeworkCommon' and course_act_id =#{@homework_common.id}").first
+ if course_activity
+ course_activity.updated_at = Time.now
+ course_activity.save
+ end
+ user_activity = UserActivity.where("act_type='HomeworkCommon' and act_id =#{@homework_common.id}").first
+ if user_activity
+ user_activity.updated_at = Time.now
+ user_activity.save
+ end
+ respond_to do |format|
+ format.js{
+ @user_activity_id = params[:user_activity_id]
+ @is_in_course = params[:is_in_course]
+ @homework_common_id = params[:homework_common_id]
+ }
+ end
+ else
+ flash[:error] = feedback.errors.full_messages[0]
+ end
+ end
+ else
+ render_403
+ end
end
def add_brief_introdution
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index ce11bded8..7289d534b 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -2357,8 +2357,10 @@ module ApplicationHelper
if work.nil?
link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
else
- if homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
+ if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 2 #匿评作业,且作业状态不是在开启匿评之前
link_to "作品匿评", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "开启匿评后不可修改作品"
+ elsif homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3
+ link_to "匿评结束", student_work_index_path(:homework => homework.id), :class => 'c_blue', :title => "匿评已结束"
elsif homework.homework_type == 2 #编程作业不能修改作品
link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
else
diff --git a/app/models/homework_common.rb b/app/models/homework_common.rb
index 796080645..03a7644a2 100644
--- a/app/models/homework_common.rb
+++ b/app/models/homework_common.rb
@@ -12,6 +12,7 @@ class HomeworkCommon < ActiveRecord::Base
has_many :homework_tests, :dependent => :destroy
has_many :student_works, :dependent => :destroy, :conditions => "is_test=0"
has_many :student_works_evaluation_distributions, :through => :student_works #一个作业的分配的匿评列表
+ has_many :journals_for_messages, :as => :jour, :dependent => :destroy
has_many :acts, :class_name => 'Activity', :as => :act, :dependent => :destroy #用户活动
# 课程动态
has_many :course_acts, :class_name => 'CourseActivity',:as =>:course_act ,:dependent => :destroy
@@ -60,6 +61,18 @@ class HomeworkCommon < ActiveRecord::Base
self.homework_type == 2 && self.homework_detail_programing
end
+ ###添加回复
+ def self.add_homework_jour(user, notes, id , options = {})
+ homework = HomeworkCommon.find(id)
+ if options.count == 0
+ jfm = homework.journals_for_messages.build(:user_id => user.id, :notes => notes, :reply_id => 0)
+ else
+ jfm = homework.journals_for_messages.build(options)
+ end
+ jfm.save
+ jfm
+ end
+
delegate :language_name, :language, :to => :homework_detail_programing
end
diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb
index 45b49ecf5..325725835 100644
--- a/app/services/courses_service.rb
+++ b/app/services/courses_service.rb
@@ -15,11 +15,11 @@ class CoursesService
page_no = params[:page] || 1
if @school_id == "0" || @school_id.nil?
@courses_all = Course.active.visible.
- joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id")
+ joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id")
else
@courses_all = Course.active.visible.
- joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id").
- where("#{Course.table_name}.school_id = ?", @school_id)
+ joins("LEFT JOIN #{CourseStatus.table_name} ON #{Course.table_name}.id = #{CourseStatus.table_name}.course_id").
+ where("#{Course.table_name}.school_id = ?", @school_id)
end
@course_count = @courses_all.count
@course_pages = Redmine::Pagination::Paginator.new @course_count, per_page_option,page_no
@@ -300,6 +300,7 @@ class CoursesService
#@state == 4 您加入的课程不存在
#@state == 5 您还未登录
#@state == 6 申请成功,请等待审核完毕
+ #@state == 7 您已经发送过申请了,请耐心等待
#@state 其他 未知错误,请稍后再试
def join_course params,current_user
course = Course.find_by_id params[:object_id]
@@ -310,13 +311,18 @@ class CoursesService
else
if current_user.member_of_course?(course) #如果已经是成员
if params[:course_password] == course.password
- #如果加入角色为学生
- if params[:role] == "10"
- @state = 3
+ #如果加入角色为学生
+ if params[:role] == "10"
+ @state = 3
+ elsif current_user.allowed_to?(:as_teacher,course)
+ @state = 3
+ else
+ #如果加入角色为教师或者教辅
+ CourseMessage.create(:user_id => course.tea_id, :course_id => course.id, :viewed => false,:content=> params[:role],:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest',:status=>0)
+ @state = 6
+ end
else
- #如果加入角色为教师或者教辅
- CourseMessage.create(:user_id => course.tea_id, :course_id => course.id, :viewed => false,:content=> params[:role],:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest',:status=>0)
- @state = 6
+ @state = 1
end
else
@state = 1
@@ -330,8 +336,13 @@ class CoursesService
StudentsForCourse.create(:student_id => current_user.id, :course_id => params[:object_id])
@state = 0
else
- CourseMessage.create(:user_id => course.tea_id, :course_id => course.id, :viewed => false,:content=> params[:role],:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest',:status=>0)
- @state = 6
+ #如果已经发送过消息了,那么就要给个提示
+ if CourseMessage.where("course_message_type = 'JoinCourseRequest' and user_id = #{course.tea_id} and content = #{params[:role]} and course_message_id = #{User.current.id} and course_id = #{course.id} and status = 0").count != 0
+ @state = 7
+ else
+ CourseMessage.create(:user_id => course.tea_id, :course_id => course.id, :viewed => false,:content=> params[:role],:course_message_id=>User.current.id,:course_message_type=>'JoinCourseRequest',:status=>0)
+ @state = 6
+ end
end
else
@state = 1
@@ -352,11 +363,11 @@ class CoursesService
if course.is_public != 0 || current_user.member_of_course?(course)
bids = course.homework_commons.page(params[:page] || 1).per(20).order('created_at DESC')
bids = bids.like(params[:name]) if params[:name].present?
- homeworks = []
- bids.each do |bid|
- homeworks << show_homework_info(course,bid,current_user,is_course_teacher(current_user,course))
- end
- homeworks
+ homeworks = []
+ bids.each do |bid|
+ homeworks << show_homework_info(course,bid,current_user,is_course_teacher(current_user,course))
+ end
+ homeworks
else
raise '403'
end
@@ -427,10 +438,10 @@ class CoursesService
#每个作业中学生最后提交的作业
homeworks = []
course.homework_commons.each do |bid|
- homework_attach = bid.student_works.order('updated_at DESC').first
- unless homework_attach.nil?
- homeworks << homework_attach
- end
+ homework_attach = bid.student_works.order('updated_at DESC').first
+ unless homework_attach.nil?
+ homeworks << homework_attach
+ end
end
unless homeworks.count == 0
homeworks.sort!{|order,newer| newer.updated_at <=> order.updated_at}
@@ -449,21 +460,21 @@ class CoursesService
result
end
- # 课程课件
- def course_attachments params
- result = []
- course = Course.find(params[:course_id])
- attachments = course.attachments.order("created_on ")
- if !params[:name].nil? && params[:name] != ""
- attachments.each do |atta|
- result << atta if atta.filename.include?(params[:name])
+ # 课程课件
+ def course_attachments params
+ result = []
+ course = Course.find(params[:course_id])
+ attachments = course.attachments.order("created_on ")
+ if !params[:name].nil? && params[:name] != ""
+ attachments.each do |atta|
+ result << atta if atta.filename.include?(params[:name])
- end
- else
- result = attachments
- end
- result
- end
+ end
+ else
+ result = attachments
+ end
+ result
+ end
# 课程学生列表
def course_members params
@@ -504,20 +515,20 @@ class CoursesService
end
def del_assitant_teacher params
- member = Member.where("user_id = ? and course_id = ?",params[:user_id],params[:course_id])
- member.each do |m|
- m.destroy
- end
- user_admin = CourseInfos.where("user_id = ? and course_id = ?",params[:user_id], params[:course_id])
- if user_admin.size > 0
- user_admin.each do |user|
- user.destroy
- end
- end
- joined = StudentsForCourse.where('student_id = ? and course_id = ?', params[:user_id],params[:course_id])
- joined.each do |join|
- join.delete
- end
+ member = Member.where("user_id = ? and course_id = ?",params[:user_id],params[:course_id])
+ member.each do |m|
+ m.destroy
+ end
+ user_admin = CourseInfos.where("user_id = ? and course_id = ?",params[:user_id], params[:course_id])
+ if user_admin.size > 0
+ user_admin.each do |user|
+ user.destroy
+ end
+ end
+ joined = StudentsForCourse.where('student_id = ? and course_id = ?', params[:user_id],params[:course_id])
+ joined.each do |join|
+ join.delete
+ end
end
def create_course_notice params ,current_user
@@ -586,11 +597,11 @@ class CoursesService
:open_anonymous_evaluation => open_anonymous_evaluation,
#:homework_for_anonymous_comments => homework_for_anonymous_comments,
:created_on => bid.created_at,:deadline => bid.end_time,
- :homework_notsubmit_num => bid.course.members.count - bid.student_works.count,
- :homework_submit_num => bid.student_works.count,
- :homework_status_student => get_homework_status( bid),:homework_status_teacher => homework_status_desc( bid),
- :student_evaluation_part => get_evaluation_part( bid ,3),
- :ta_evaluation_part => get_evaluation_part( bid ,2),:homework_anony_type => bid.homework_type == 1 && !bid.homework_detail_manual.nil?}
+ :homework_notsubmit_num => bid.course.members.count - bid.student_works.count,
+ :homework_submit_num => bid.student_works.count,
+ :homework_status_student => get_homework_status( bid),:homework_status_teacher => homework_status_desc( bid),
+ :student_evaluation_part => get_evaluation_part( bid ,3),
+ :ta_evaluation_part => get_evaluation_part( bid ,2),:homework_anony_type => bid.homework_type == 1 && !bid.homework_detail_manual.nil?}
end
@@ -602,9 +613,9 @@ class CoursesService
homework_count = bid.homeworks.count #已提交的作业数量
student_questions_count = bid.journals_for_messages.where('m_parent_id IS NULL').count
description = bid.description
- #if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
+ #if is_course_teacher(User.current, course) && @bid.open_anonymous_evaluation == 1 && @bid.homeworks.count >= 2
state = bid.comment_status
- #end
+ #end
open_anonymous_evaluation = bid.open_anonymous_evaluation
{:course_name => course.name,:id => bid.id, :course_teacher => author, :homework_times => many_times, :homework_name => name, :homework_count => homework_count,:student_questions_count => student_questions_count,
:description => description, :homework_state => state,:open_anonymous_evaluation => open_anonymous_evaluation}
@@ -701,12 +712,12 @@ class CoursesService
latest_course_dynamics << {:time => latest_news.first.created_on }
end
# 课程讨论区
- latest_message = course.boards.first.topics.page(1).per(2)
- unless latest_message.first.nil?
- topic_count = course.boards.nil? ? 0 : course.boards.first.topics.count
- topics = latest_message.all
- latest_course_dynamics << {:time => latest_message.first.created_on}
- end
+ latest_message = course.boards.first.topics.page(1).per(2)
+ unless latest_message.first.nil?
+ topic_count = course.boards.nil? ? 0 : course.boards.first.topics.count
+ topics = latest_message.all
+ latest_course_dynamics << {:time => latest_message.first.created_on}
+ end
# 课程资源
# latest_attachment = course.attachments.order("created_on desc").page(1).per(2)
# unless latest_attachment.first.nil?
@@ -743,29 +754,29 @@ class CoursesService
unless active_students.empty?
latest_course_dynamics <<{:time=>"1970-01-01 0:0:0 +0800"}
end
- latest_course_dynamic = latest_course_dynamics.first
- unless latest_course_dynamic.nil?
- result << {:course_name => course.name,
- :current_user_is_member => current_user.member_of_course?(course),
- :current_user_is_teacher => is_course_teacher(current_user,course),
- :course_id => course.id,
- :course_img_url => url_to_avatar(course),
- :course_time => course.time,
- :course_term => course.term,
- :news_count => notices_count,
- :homework_count => homework_count,
- :topic_count => topic_count,
- :news => notices,
- :homeworks => homeworkss,
- :topics => topics,
- :better_students => better_students,
- :active_students => active_students,
- :message => "",
- :course_student_num=>course ? course.members.count : 0,
- #:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "前",
- :time_from_now=>time_from_now(latest_course_dynamic[:time].to_time), #.strftime('%Y-%m-%d %H:%M:%S').to_s,
- :time=>latest_course_dynamic[:time].to_time}
- end
+ latest_course_dynamic = latest_course_dynamics.first
+ unless latest_course_dynamic.nil?
+ result << {:course_name => course.name,
+ :current_user_is_member => current_user.member_of_course?(course),
+ :current_user_is_teacher => is_course_teacher(current_user,course),
+ :course_id => course.id,
+ :course_img_url => url_to_avatar(course),
+ :course_time => course.time,
+ :course_term => course.term,
+ :news_count => notices_count,
+ :homework_count => homework_count,
+ :topic_count => topic_count,
+ :news => notices,
+ :homeworks => homeworkss,
+ :topics => topics,
+ :better_students => better_students,
+ :active_students => active_students,
+ :message => "",
+ :course_student_num=>course ? course.members.count : 0,
+ #:time_from_now=> distance_of_time_in_words(Time.now, latest_course_dynamic[:time].to_time) << "前",
+ :time_from_now=>time_from_now(latest_course_dynamic[:time].to_time), #.strftime('%Y-%m-%d %H:%M:%S').to_s,
+ :time=>latest_course_dynamic[:time].to_time}
+ end
end
#返回数组集合
@@ -784,9 +795,9 @@ class CoursesService
sql = "select users.*,ROUND(sum(student_works.final_score),2) score from student_works left outer join users on student_works.user_id = users.id" <<
" where homework_common_id in ( select id from homework_commons where homework_commons.course_id = #{params[:course_id]}) GROUP BY student_works.user_id ORDER BY score desc limit #{page*10},10"
sql_count = " select count(distinct(student_works.user_id) ) " <<
- " from student_works left outer join users on student_works.user_id = users.id " <<
- " where homework_common_id in " <<
- " ( select id from homework_commons where homework_commons.course_id = #{params[:course_id]}) "
+ " from student_works left outer join users on student_works.user_id = users.id " <<
+ " where homework_common_id in " <<
+ " ( select id from homework_commons where homework_commons.course_id = #{params[:course_id]}) "
max_size = ActiveRecord::Base.connection().select_value(sql_count)
user_list = User.find_by_sql(sql)
else
diff --git a/app/views/courses/_course_activity.html.erb b/app/views/courses/_course_activity.html.erb
index aa99236df..4a7cb900d 100644
--- a/app/views/courses/_course_activity.html.erb
+++ b/app/views/courses/_course_activity.html.erb
@@ -68,13 +68,24 @@
}
}
- function expand_reply_input(id) {
- $(id).toggle();
- }
-
$(function () {
init_activity_KindEditor_data(<%= activity.id%>, null, "87%");
showNormalImage('activity_description_<%= activity.id %>');
+ if($("#intro_content_<%= activity.id %>").height() > 360) {
+ $("#intro_content_show_<%= activity.id %>").show();
+ }
+ $("#intro_content_show_<%= activity.id %>").click(function(){
+ $("#activity_description_<%= activity.id %>").toggleClass("maxh360");
+ $("#activity_description_<%= activity.id%>").toggleClass("lh18");
+ $("#intro_content_show_<%= activity.id %>").hide();
+ $("#intro_content_hide_<%= activity.id %>").show();
+ });
+ $("#intro_content_hide_<%= activity.id %>").click(function(){
+ $("#activity_description_<%= activity.id %>").toggleClass("maxh360");
+ $("#activity_description_<%= activity.id%>").toggleClass("lh18");
+ $("#intro_content_hide_<%= activity.id %>").hide();
+ $("#intro_content_show_<%= activity.id %>").show();
+ });
});
<% if activity && activity.course_act%>
diff --git a/app/views/courses/join.js.erb b/app/views/courses/join.js.erb
index 4965de676..8e6f8ce20 100644
--- a/app/views/courses/join.js.erb
+++ b/app/views/courses/join.js.erb
@@ -1,10 +1,10 @@
-<% if @object_id && @state != 6 && @state != 4 %>
+<% if @object_id && @state != 6 && @state !=4 %>
$("#join_in_course_header").html("<%= escape_javascript(join_in_course_header(@course, @user)) %>");
<% end %>
<% if @state %>
<% if @state == 0 %>
alert("加入成功");
-hideModal($("#popbox02"));
+hidden_join_course_form();
$("#try_join_course_link").replaceWith(" 'index',:course=>@course.id, :host=>Setting.host_course)%>' target='_blank' class='blue_n_btn fr mt20'>提交作品");
window.location.href= "http://"+"<%= Setting.host_name%>"+"/courses/" + "<%= @course.id%>"
<% elsif @state == 1 %>
@@ -19,7 +19,11 @@ alert("您加入的课程不存在");
<% elsif @state == 5 %>
alert("您还未登录");
<% elsif @state == 6 %>
-alert("申请成功,请等待审核")
+alert("申请成功,请等待审核");
+hidden_join_course_form();
+<% elsif @state == 7%>
+ alert("您已经发送过申请了,请耐心等待");
+hidden_join_course_form();
<% else %>
alert("未知错误,请稍后再试");
<% end %>
diff --git a/app/views/homework_common/score_rule_set.js.erb b/app/views/homework_common/score_rule_set.js.erb
new file mode 100644
index 000000000..5ff42dff7
--- /dev/null
+++ b/app/views/homework_common/score_rule_set.js.erb
@@ -0,0 +1,6 @@
+$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework, :student_path => false}) %>');
+showModal('ajax-modal', '350px');
+$('#ajax-modal').siblings().remove();
+$('#ajax-modal').before("" +
+ "");
+$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
\ No newline at end of file
diff --git a/app/views/student_work/_set_score_rule.html.erb b/app/views/student_work/_set_score_rule.html.erb
index 7deed7fb8..508b89a1c 100644
--- a/app/views/student_work/_set_score_rule.html.erb
+++ b/app/views/student_work/_set_score_rule.html.erb
@@ -1,4 +1,7 @@
<%= form_for('new_form',:url => {:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id},:method => "post") do |f|%>
+ <% if student_path %>
+ <%=hidden_field_tag 'student_path', params[:student_path], :value => student_path %>
+ <% end %>
diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb
index e28cdb1e2..c8d3a2546 100644
--- a/app/views/student_work/index.html.erb
+++ b/app/views/student_work/index.html.erb
@@ -20,7 +20,7 @@
//设置评分规则
function set_score_rule(){
- $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework}) %>');
+ $('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/set_score_rule',:locals => {:homework => @homework,:student_path => true}) %>');
showModal('ajax-modal', '350px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("" +
@@ -28,6 +28,33 @@
$('#ajax-modal').parent().css("top","25%").css("left","35%").css("position","fixed");
}
+ $(function(){
+ $("#homework_info_hidden").click(function(){
+ $("#homeworkInformation").hide();
+ $("#homework_info_hidden").hide();
+ $("#homework_info_show").show();
+ });
+ $("#homework_info_show").click(function(){
+ $("#homework_info_show").hide();
+ $("#homeworkInformation").show();
+ $("#homework_info_hidden").show();
+ });
+
+ if($("#homework_description").height() > 54) {
+ $("#homeworkDetailShow").show();
+ }
+ $("#homeworkDetailShow").click(function(){
+ $("#homeworkDetail").toggleClass("max_h54");
+ $("#homeworkDetailShow").hide();
+ $("#homeworkDetailHide").show();
+ });
+ $("#homeworkDetailHide").click(function(){
+ $("#homeworkDetail").toggleClass("max_h54");
+ $("#homeworkDetailHide").hide();
+ $("#homeworkDetailShow").show();
+ });
+ });
+
+
+
diff --git a/app/views/users/_course_homework.html.erb b/app/views/users/_course_homework.html.erb
index 2d3bc68de..4bde4476d 100644
--- a/app/views/users/_course_homework.html.erb
+++ b/app/views/users/_course_homework.html.erb
@@ -1,5 +1,5 @@
<% is_teacher = User.current.allowed_to?(:as_teacher,activity.course) %>
-
+
<%= link_to image_tag(url_to_avatar(activity.user), :width => "50", :height => "50"), user_path(activity.user_id), :alt => "用户头像" %>
@@ -43,9 +43,15 @@
截止时间:<%= activity.end_time.to_s %>
-
- <%= activity.description.html_safe %>
+
+
+ <%= activity.description.html_safe %>
+
+
+
+
+
<%# if is_teacher%>
diff --git a/app/views/users/_user_activities.html.erb b/app/views/users/_user_activities.html.erb
index cc8a6c0f2..b7981bdbc 100644
--- a/app/views/users/_user_activities.html.erb
+++ b/app/views/users/_user_activities.html.erb
@@ -39,6 +39,21 @@
$(function() {
init_activity_KindEditor_data(<%= user_activity.id%>, null, "87%");
showNormalImage('activity_description_<%= user_activity.id %>');
+ if($("#intro_content_<%= user_activity.id %>").height() > 360) {
+ $("#intro_content_show_<%= user_activity.id %>").show();
+ }
+ $("#intro_content_show_<%= user_activity.id %>").click(function(){
+ $("#activity_description_<%= user_activity.id %>").toggleClass("maxh360");
+ $("#activity_description_<%= user_activity.id%>").toggleClass("lh18");
+ $("#intro_content_show_<%= user_activity.id %>").hide();
+ $("#intro_content_hide_<%= user_activity.id %>").show();
+ });
+ $("#intro_content_hide_<%= user_activity.id %>").click(function(){
+ $("#activity_description_<%= user_activity.id %>").toggleClass("maxh360");
+ $("#activity_description_<%= user_activity.id%>").toggleClass("lh18");
+ $("#intro_content_hide_<%= user_activity.id %>").hide();
+ $("#intro_content_show_<%= user_activity.id %>").show();
+ });
});
<% unless user_activity.act_type == "ProjectCreateInfo" %>
diff --git a/app/views/users/_user_homework_detail.html.erb b/app/views/users/_user_homework_detail.html.erb
new file mode 100644
index 000000000..b4beb7aa3
--- /dev/null
+++ b/app/views/users/_user_homework_detail.html.erb
@@ -0,0 +1,159 @@
+<% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %>
+
+
+
+ <%=link_to image_tag(url_to_avatar(homework_common.user),width:"50px", height: "50px"), user_activities_path(homework_common.user.id)%>
+
+
+
+ <%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
+ TO
+ <%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
+
+
+ <%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
+
+
+ <% if homework_common.homework_detail_manual%>
+ <% if homework_common.homework_detail_manual.comment_status == 1%>
+
未开启匿评
+ <% elsif homework_common.homework_detail_manual.comment_status == 2%>
+
匿评中
+ <% elsif homework_common.homework_detail_manual.comment_status == 3%>
+
匿评已结束
+ <% end%>
+ <% end%>
+
+
+
+ <%= user_for_homework_common homework_common,is_teacher %>
+
+ <% if homework_common.homework_type == 2 && is_teacher%>
+
+ <%= link_to "模拟答题", new_user_commit_homework_users_path(homework_id: homework_common.id, is_test: true), class: 'c_blue test-program-btn', title: '教师可以通过模拟答题设置作业的标准答案' %>
+
+ <% end %>
+ <% if homework_common.homework_type == 2%>
+
+ 语言:
+ <%= homework_common.language_name%>
+
+ <% end %>
+
+ <%= l(:label_end_time)%>:<%= homework_common.end_time%>
+
+
+
+
+ <%= homework_common.description.html_safe %>
+
+
+
+
+
+
+
+ <%= render :partial => 'student_work/work_attachments', :locals => {:attachments => homework_common.attachments} %>
+
+
+ <% if is_teacher%>
+ <%# if false%>
+
+
+ -
+
+ -
+ <%= link_to l(:button_edit),edit_homework_common_path(homework_common,:is_in_course => is_in_course), :class => "postOptionLink"%>
+
+ -
+ <%= link_to(l(:label_bid_respond_delete), homework_common_path(homework_common,:is_in_course => is_in_course),:method => 'delete', :confirm => l(:text_are_you_sure), :class => "postOptionLink") %>
+
+ -
+ <%= link_to("评分设置", score_rule_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) %>
+
+ -
+ <%= link_to("匿评设置", start_evaluation_set_homework_common_path(homework_common),:class => "postOptionLink", :remote => true) if homework_common.homework_detail_manual.comment_status == 1%>
+
+ -
+ <%= homework_anonymous_comment homework_common %>
+
+
+
+
+
+ <% end%>
+
+
+
+
+ <% count=homework_common.journals_for_messages.count %>
+
+
+
+
+ 回复(<%= count %>)
+
+
+ <%if count>3 %>
+
+ <% end %>
+
+
+ <% replies_all_i = 0 %>
+ <% if count > 0 %>
+
+
+ <% homework_common.journals_for_messages.reorder("created_on desc").each do |comment| %>
+
+ <% replies_all_i = replies_all_i + 1 %>
+ -
+
+ <%= link_to image_tag(url_to_avatar(comment.user), :width => "33", :height => "33", :class =>"mt8"), user_path(comment.user_id), :alt => "用户头像" %>
+
+
+
+ <% if comment.try(:user).try(:realname) == ' ' %>
+ <%= link_to comment.try(:user), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
+ <% else %>
+ <%= link_to comment.try(:user).try(:realname), user_path(comment.user_id), :class => "newsBlue mr10 f14" %>
+ <% end %>
+ <%= format_time(comment.created_on) %>
+
+
+
+
+
+ <% end %>
+
+
+ <% end %>
+
+
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), :alt => "用户头像" %>
+
+
+ <%= form_for('new_form',:url => {:controller => 'words', :action => 'leave_homework_message', :id => homework_common.id},:method => "post", :remote => true) do |f|%>
+ <%= hidden_field_tag 'homework_common_id',params[:homework_common_id],:value =>homework_common.id %>
+ <%= hidden_field_tag 'is_in_course',params[:is_in_course],:value =>is_in_course %>
+
+
+
发送
+
+
+ <% end%>
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/users/_user_homework_list.html.erb b/app/views/users/_user_homework_list.html.erb
index 44f992bb4..2e530d489 100644
--- a/app/views/users/_user_homework_list.html.erb
+++ b/app/views/users/_user_homework_list.html.erb
@@ -1,83 +1,56 @@
+<%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg',"init_activity_KindEditor" %>
+
<% homework_commons.each do |homework_common|%>
- <% is_teacher = User.current.allowed_to?(:as_teacher,homework_common.course) %>
-
-
-
- <%=link_to image_tag(url_to_avatar(homework_common.user),width:"50px", height: "50px"), user_activities_path(homework_common.user.id)%>
-
-
-
- <%= link_to homework_common.user.show_name, user_activities_path(homework_common.user_id), :class => "newsBlue mr15"%>
- TO
- <%= link_to homework_common.course.name, course_path(homework_common.course_id), :class => "newsBlue ml15"%>
-
-
- <%= link_to homework_common.name,student_work_index_path(:homework => homework_common.id),:class => "postGrey"%>
-
+
+ <%= render :partial => 'users/user_homework_detail', :locals => {:homework_common => homework_common,:is_in_course => is_in_course} %>
<% end%>
<% if homework_commons.count == 10%>
<% if is_in_course == 1%>
diff --git a/app/views/users/_user_message_course.html.erb b/app/views/users/_user_message_course.html.erb
index b98e3be53..d7042b6c2 100644
--- a/app/views/users/_user_message_course.html.erb
+++ b/app/views/users/_user_message_course.html.erb
@@ -37,7 +37,7 @@
<%= time_tag(ma.created_at).html_safe %>
<% end %>
- <% if ma.course_message_type == "HomeworkCommon" %>
+ <% if ma.course_message_type == "HomeworkCommon" && ma.status.nil?%>
- <%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
- <%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师", user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
@@ -45,12 +45,12 @@
-
<% if !User.current.allowed_to?(:as_teacher, ma.course_message.course) && cur_user_works_for_homework(ma.course_message).nil? %>
- <%= link_to ma.course_message.name, new_student_work_path(:homework => ma.course_message.id),
+ <%= link_to "作业题目:" + ma.course_message.name, new_student_work_path(:homework => ma.course_message.id),
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover =>"message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
<% else %>
- <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
+ <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
@@ -62,27 +62,33 @@
<%= User.current.lastname + User.current.firstname %>老师您好!
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.show_name + "老师")%>刚刚发布了一个作业:
-
课程名称:<%= ma.course_message.course.name %>
- (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
- 提交截止:<%= ma.course_message.end_time %> 24点
- 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
- 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
- 迟交扣分:<%= ma.course_message.late_penalty %>分
- 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+
+ - 课程名称:<%= ma.course_message.course.name %>
+ (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
+ - 作业标题:<%= ma.course_message.name %>
+ - 提交截止:<%= ma.course_message.end_time %> 24点
+ - 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
+ - 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+ - 迟交扣分:<%= ma.course_message.late_penalty %>分
+ - 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+
您可以修改作业内容、评分规则、匿评过程等,谢谢!
<% else %>
<%= User.current.lastname + User.current.firstname %>同学您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师刚刚发布了一个作业:
- 课程名称:<%= ma.course_message.course.name %>
- (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
- 提交截止:<%= ma.course_message.end_time %> 24点
- 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
- 迟交扣分:<%= ma.course_message.late_penalty %>分
+
+ - 课程名称:<%= ma.course_message.course.name %>
+ (<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
+ - 作业标题:<%= ma.course_message.name %>
+ - 提交截止:<%= ma.course_message.end_time %> 24点
+ - 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
+ - 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+ - 迟交扣分:<%= ma.course_message.late_penalty %>分
+ - 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+
- 请抓紧时间提交自己的作品,谢谢!
+ 请抓紧时间提交您的作品,谢谢!
<% end %>
@@ -96,7 +102,7 @@
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher", :title => "#{ma.course_message.user.lastname + ma.course_message.user.firstname}老师" %>
">发布的作业:
- <%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
+ <%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
@@ -107,22 +113,16 @@
<%= User.current.lastname + User.current.firstname %>同学您好!
<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师发布的作业截止日期快到了:
- 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
- 提交截止:<%= ma.course_message.end_time %> 24点
- 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
- 迟交扣分:<%= ma.course_message.late_penalty %>分
- 请同学们抓紧时间提交自己的作品,谢谢!
- <% else %>
- <%= User.current.lastname + User.current.firstname %>老师您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师发布的作业截止日期快到了:
- 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
- 作业标题:<%= ma.course_message.name %>
- 提交截止:<%= ma.course_message.end_time %> 24点
- 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
- 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
- 迟交扣分:<%= ma.course_message.late_penalty %>分
- 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
- 您可以修改作业内容、评分规则、匿评过程等,谢谢!
+
+ - 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
+ - 作业标题:<%= ma.course_message.name %>
+ - 提交截止:<%= ma.course_message.end_time %> 24点
+ - 匿评开始:<%= ma.course_message.homework_detail_manual.evaluation_start %> 24点
+ - 匿评关闭:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+ - 迟交扣分:<%= ma.course_message.late_penalty %>分
+ - 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+ 请抓紧时间提交您的作品,谢谢!
+
<% end %>
截止时间快到了!
@@ -150,14 +150,15 @@
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师' : '同学' %>您好!
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>开启了匿评,作业详情如下:
-
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
-
作业标题:<%= ma.course_message.name %>
-
缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
-
- 匿评截止:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
-
+
+ - 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
+ - 作业标题:<%= ma.course_message.name %>
+ - 缺评扣分:<%= ma.course_message.homework_detail_manual.absence_penalty %>分
+ - 匿评截止:<%= ma.course_message.homework_detail_manual.evaluation_end %> 24点
+
<% unless User.current.allowed_to?(:as_teacher, ma.course_message.course)%>
-
请您尽早完成匿评!如果您在规定时间内未完成匿评,一次将被扣<%= ma.course_message.homework_detail_manual.absence_penalty %>分。
+
请您尽早完成匿评!如果您在截止日期前未完成匿评,您的最终成绩将被扣除<%= ma.course_message.homework_detail_manual.absence_penalty %>分乘以缺评份数。
+
例如,您缺评了两份作品,则您的最终成绩将被扣除 <%= ma.course_message.homework_detail_manual.absence_penalty %> * 2 = <%= ma.course_message.homework_detail_manual.absence_penalty * 2 %>分
<% end%>
<%= time_tag(ma.created_at).html_safe %>
@@ -180,8 +181,10 @@
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher,ma.course_message.course) ? '老师':'同学'%>您好!
<%= User.current.eql?(ma.course_message.user)?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname+"老师") %>关闭了匿评,作业详情如下:
-
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
-
作业标题:<%= ma.course_message.name %>
+
+ - 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年'+ ma.course_message.course.term %>)
+ - 作业标题:<%= ma.course_message.name %>
+
<%= time_tag(ma.created_at).html_safe %>
@@ -206,14 +209,14 @@
<%= User.current.lastname + User.current.firstname %><%= User.current.allowed_to?(:as_teacher, ma.course_message.course) ? '老师':'同学'%>您好!
<%= User.current.eql?(ma.course_message.user) ?"您":(ma.course_message.user.lastname + ma.course_message.user.firstname + "老师") %>启动作业匿评失败!
-
失败原因:提交作品的人数低于2人
-
-
作业详情如下:
-
课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年' + ma.course_message.course.term %>)
-
作业标题:<%= ma.course_message.name %>
-
- 提交截止:<%= ma.course_message.end_time%> 24点
+
+
+ - 失败原因:提交作品的人数低于2人
+ - 课程名称:<%= ma.course_message.course.name %>(<%= ma.course_message.course.time.to_s + '年' + ma.course_message.course.term %>)
+ - 作业标题:<%= ma.course_message.name %>
+ - 提交截止:<%= ma.course_message.end_time%> 24点
+
<%= time_tag(ma.created_at).html_safe %>
@@ -300,21 +303,18 @@
<%= User.current.show_name %>同学您好!
<%= ma.course_message.reviewer_role == 3? "匿名用户" : (ma.course_message.user.show_name + "老师")%><%= ma.status == 0? "评阅了您的作品":"重新评阅了您的作品"%>。详情如下:
-
课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)
-
作业标题:<%=ma.course_message.student_work.homework_common.name %>
- <% content = ma.content.gsub("作业评分:","").split(" 评语:")%>
+
+ - 课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)
+ - 作业标题:<%=ma.course_message.student_work.homework_common.name %>
+ <% content = ma.content.gsub("作业评分:","").split(" 评语:")%>
+ - 作品评分:<%= content[0] %>分
+ <% if content.size > 1 %>
+ - 作品评语:
+ <%= content[1] %>
+ <% end %>
+
- 作品评分:<%= content[0] %>
-
- <% if content.size > 1 %>
-
作品评语:
-
<%= content[1] %>
- <% end %>
-
- 本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %> 24点结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。
-
-
- 期待您取得更大的进步!
+ 本次作业将在<%= ma.course_message.student_work.homework_common.homework_detail_manual.evaluation_end %> 24点结束匿评,到时您将可以看到所有其他同学的作品啦!大家可以进一步互相学习。 期待您取得更大的进步!
<% end %>
@@ -350,7 +350,7 @@
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname +
- "#{ma.course_message.user.members.where("course_id=?", ma.course.id).first.roles.first.name=='Student'?"同学":"老师"}",
+ "#{ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"}",
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
">回复了作品评论:
@@ -362,14 +362,14 @@
<%= User.current.show_name %>老师您好!
- <%= ma.course_message.user.show_name%><%= ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"学生"%>回复了您的作品评论。详情如下:
+ <%= ma.course_message.user.show_name%><%= ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"%>回复了您的作品评论。详情如下:
-
回复内容:
-
<%= ma.course_message.notes %>
-
您的评论:
-
<%= ma.course_message.jour.comment %>
-
课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)
-
作业标题:<%=ma.course_message.jour.student_work.homework_common.name %>
+
+ - 回复内容:<%= ma.course_message.notes %>
+ - 您的评论:<%= ma.course_message.jour.comment %>
+ - 课程名称:<%= ma.course.name %>(<%= ma.course.time.to_s + '年'+ ma.course.term %>)
+ - 作业标题:<%=ma.course_message.jour.student_work.homework_common.name %>
+
<%= time_tag(ma.created_at).html_safe %>
@@ -378,12 +378,13 @@
<% if ma.course_message_type == "StudentWork" && !ma.course_message.homework_common.nil? %>
-
+ - <%= link_to image_tag(url_to_avatar(ma.course_message.homework_common.user), :width => "30", :height => "30"), user_path(ma.course_message.homework_common.user) %>
-
- ">迟交作业,不能参与作业匿评!
+ <%=link_to ma.course_message.homework_common.user.show_name, user_path(ma.course_message.homework_common.user), :class => "newsBlue homepageNewsPublisher" %>
+ ">发布的作业:
- -
- <%= link_to "由于迟交作业,您及您的作品都不能参与作业的匿评", student_work_index_path(:homework => ma.course_message.homework_common_id),
+
-
+ <%= link_to "作业题目:" + ma.course_message.homework_common.name, student_work_index_path(:homework => ma.course_message.homework_common_id),
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
@@ -393,11 +394,16 @@
<%= User.current.lastname + User.current.firstname %>
<%= User.current.allowed_to?(:as_teacher,ma.course_message.homework_common.course) ? '老师':'同学'%>您好!由于迟交作业,您及您的作品都不能参与以下作业的匿评。作业详情如下:
-
课程名称:<%= ma.course_message.homework_common.course.name %>(<%= ma.course_message.homework_common.course.time.to_s + '年' + ma.course_message.homework_common.course.term %>)
- 作业标题:<%=ma.course_message.homework_common.name %>
- 提交截止:<%=ma.course_message.homework_common.end_time %> 24:00
- 提交时间:<%=format_time(ma.course_message.created_at) %>
+
+ - 课程名称:<%= ma.course_message.homework_common.course.name %>(<%= ma.course_message.homework_common.course.time.to_s + '年' + ma.course_message.homework_common.course.term %>)
+ - 作业标题:<%= ma.course_message.homework_common.name %>
+ - 提交截止:<%= ma.course_message.homework_common.end_time %> 24:00
+ - 提交时间:<%= format_time(ma.course_message.created_at) %>
+ - 迟交扣分:<%= ma.course_message.homework_common.late_penalty %>分
+
+ 如需获得最终成绩,请您联系主讲老师对您的作品进行单独评分!
+
您迟交了作品!
<%= time_tag(ma.created_at).html_safe %>
<% end %>
@@ -435,23 +441,12 @@
系统提示
">您有了新的课程成员申请:
-
+
<%= link_to User.find(ma.course_message_id).name+"申请成为课程\""+"#{Course.find(ma.course_id).name}"+"\"的"+"#{ma.content == '9' ? "教师" : "教辅"}", user_path(User.find(ma.course_message_id)),
:class => "#{ma.viewed==0 ? "newsBlack" : "newsGrey"}",
:onmouseover => "message_titile_show($(this),event)",
:onmouseout => "message_titile_hide($(this))" %>
-
- <% if ma.status == 0 || ma.status.nil?%>
- <%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true'%>
- |
- <%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true'%>
- <% elsif ma.status == 1%>
- 您已经同意了该申请
- <% elsif ma.status == 2%>
- 您已经拒绝了该申请
- <%end %>
-
-
+
<%= User.current.lastname + User.current.firstname %>老师您好!您有了新的课程成员申请,信息如下:
@@ -462,6 +457,19 @@
<%= Course.find(ma.course_id).description.html_safe %>
申请职位:<%= ma.content == '9' ? "教师" : "教辅"%>
+
+
+ <% if ma.status == 0 || ma.status.nil?%>
+ <%= link_to '同意',dealwith_apply_request_user_path(User.current,:agree=>'Y',:msg_id=>ma.id),:remote=>'true'%>
+ |
+ <%= link_to '拒绝',dealwith_apply_request_user_path(User.current,:agree=>'N',:msg_id=>ma.id),:remote=>'true'%>
+ <% elsif ma.status == 1%>
+ 您已经同意了该申请
+ <% elsif ma.status == 2%>
+ 您已经拒绝了该申请
+ <%end %>
+
+
<%= time_tag(ma.created_at).html_safe %>
<% end %>
diff --git a/app/views/users/import_resources_to_homework.js.erb b/app/views/users/import_resources_to_homework.js.erb
index 61fcd294d..c929f48e5 100644
--- a/app/views/users/import_resources_to_homework.js.erb
+++ b/app/views/users/import_resources_to_homework.js.erb
@@ -1,13 +1,13 @@
<% unless @attachments.empty?%>
- <% @attachments.each_with_index do |attachment, i| %>
+ <% @attachments.each do |attachment| %>
$("#attachments_fields").append(
- '
'+
- '<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => "filename link_file", :readonly=>"readonly")%>'+
- '<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => "description", :style=>"display: inline-block;") %>'+
+ ''+
+ '<%= text_field_tag("attachments[p#{attachment.id}][filename]", attachment.filename, :class => "filename link_file", :readonly=>"readonly")%>'+
+ '<%= text_field_tag("attachments[p#{attachment.id}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => "description", :style=>"display: inline-block;") %>'+
'<%= l(:field_is_public)%>:'+
- '<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => "is_public")%>'+
- '<%= link_to(" ".html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => "js"), :method => "delete", :remote => true, :class => "remove-upload") unless attachment.id.nil? %>'+
- '<%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>'+
+ '<%= check_box_tag("attachments[p#{attachment.id}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => "is_public")%>'+
+ '<%= link_to(" ".html_safe, attachment_path(attachment, :attachment_id => "p#{attachment.id}", :format => "js"), :method => "delete", :remote => true, :class => "remove-upload") unless attachment.id.nil? %>'+
+ '<%= hidden_field_tag "attachments[p#{attachment.id}][token]", "#{attachment.token}" %>'+
''+
'')
diff --git a/app/views/words/leave_homework_message.js.erb b/app/views/words/leave_homework_message.js.erb
new file mode 100644
index 000000000..91525c889
--- /dev/null
+++ b/app/views/words/leave_homework_message.js.erb
@@ -0,0 +1,7 @@
+<% if @user_activity_id %>
+ $("#user_activity_<%= @user_activity_id%>").replaceWith("<%= escape_javascript(render :partial => 'users/course_homework', :locals => {:activity => @homework_common,:user_activity_id =>@user_activity_id}) %>");
+ init_activity_KindEditor_data(<%= @user_activity_id%>,"","87%");
+<% elsif @homework_common_id && @is_in_course %>
+ $("#homework_common_<%= @homework_common_id %>").replaceWith("<%= escape_javascript(render :partial => 'users/user_homework_detail', :locals => {:homework_common => @homework_common,:is_in_course => @is_in_course}) %>");
+ init_activity_KindEditor_data(<%= @homework_common_id%>,"","87%");
+<% end %>
diff --git a/config/routes.rb b/config/routes.rb
index 10237da77..fbce06e02 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -102,6 +102,7 @@ RedmineApp::Application.routes.draw do
get 'stop_anonymous_comment'
get 'alert_anonymous_comment'
get 'start_evaluation_set'
+ get 'score_rule_set'
post 'set_evaluation_attr'
end
collection do
@@ -387,8 +388,8 @@ RedmineApp::Application.routes.draw do
get 'user_resource_type'
get 'user_ref_resource_search'
post 'import_resources_to_homework'
- get 'store_selected_resource'
get 'dealwith_apply_request'
+ get 'store_selected_resource'
# end
end
#resources :blogs
@@ -865,6 +866,7 @@ RedmineApp::Application.routes.draw do
match 'projects/:id/feedback', :to => 'projects#feedback', :via => :get, :as => 'project_feedback'
match 'project/:id/share', :to => 'projects#share', :as => 'share_show' #share
post 'words/:id/leave_user_message', :to => 'words#leave_user_message', :as => "leave_user_message"
+ post 'words/:id/leave_homework_message', :to => 'words#leave_homework_message', :as => "leave_homework_message"
post 'join_in/join', :to => 'courses#join', :as => 'join'
delete 'join_in/join', :to => 'courses#unjoin'
diff --git a/public/images/news_dot.png b/public/images/news_dot.png
new file mode 100644
index 000000000..7dea0bbe4
Binary files /dev/null and b/public/images/news_dot.png differ
diff --git a/public/images/news_dot2.png b/public/images/news_dot2.png
new file mode 100644
index 000000000..3b9f9e88d
Binary files /dev/null and b/public/images/news_dot2.png differ
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index db02a0292..23a1a95ac 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -84,6 +84,15 @@ a.hworkSearchIcon:hover {background:url(../images/nav_icon.png) -49px -1px no-re
.ml100{margin-left: 100px;}
.mt16{margin-top: 16px;}
.pr10{padding-right: 10px;}
+
+/*作业信息*/
+.mt-2 {margin-top:-2px;}
+.homeworkInfo {background:#F6F6F6; padding:10px; margin-bottom:10px;}
+.homeworkDetail {line-height:18px; font-size:12px; color:#484848; overflow:hidden;}
+.max_h54 {max-height:54px; }
+.homeworkState {padding:3px 5px; background-color:#28be6c; border-radius:3px; float:left; margin-left:15px; color:#ffffff;}
+.homeworkClose {padding:3px 5px; background-color:#b2b2b2; border-radius:3px; float:left; margin-left:15px; color:#ffffff;}
+
/*课程右侧动态 new_user.css*/
.resources {width:718px; background-color:#ffffff; padding:15px; border:1px solid #dddddd;float: right}
.homepageRight {width:750px; float:left; margin-top:10px; margin-bottom:10px;}
@@ -111,7 +120,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;}
.homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;}
.homepagePostSubmit:hover {background-color:#d8d8d8;}
-.homepagePostIntro {font-size:14px; color:#484848;}
+.homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
.homepagePostReply {width:710px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;}
@@ -149,7 +158,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
-.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -85px -150px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
+.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/public_icon.png) -27px -577px no-repeat; padding-left:25px; font-size:14px; margin-right:25px;}
.homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
.postAttSize {color:#888888; font-size:12px;}
a.postGrey {color:#484848;}
@@ -194,6 +203,9 @@ a.menuGrey:hover {color:#fe7d68;}
#navSearchAlert {display:none;}
.homepagePostReplyjournal{margin-left: 15px; float: left;}
+.lh18 {line-height: 18px;}
+.maxh360 {max-height: 360px;}
+
/*邮件邀请*/
.box_main{ width:345px; margin:0 auto;}
.box_h3{ color:#15bccf; text-align:center; font-size:16px;}
@@ -953,6 +965,7 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r
.W50{ width:50px;}
.W200{ width:200px;}
.m_w530{max-width: 530px;}
+.m_w500{max-width: 500px;}
.ProResultTable{ color:#888888;}
.T_C{ text-align:center;}
.SearchIcon{background:url(../images/homepage_icon2.png) 676px -393px no-repeat; }
@@ -1032,6 +1045,8 @@ a.pro_mes_w{ height:20px; display:block; color:#999999;}
.rside_work_con{ width:650px;}
a.c_grey{ color:#999999;}
a:hover.c_grey{ color:#333;}
+a.link_file_a{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
+a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
.link_file_a{ display:block; max-width:450px;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
.last_time{width:auto; text-align:right; margin-right:70px;}
.link_file_box{ width:360px;}
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 0a61e0676..c30e82eee 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -105,6 +105,7 @@ a.linkGrey6:hover {color:#ffffff !important;}
.mt12 { margin-top:12px;}
.mt15 {margin-top:15px;}
.mt19 {margin-top:19px !important;}
+.mb0 {margin-bottom: 0px !important;}
.mb4{ margin-bottom:4px;}
.mb5{ margin-bottom:5px;}
.mb8 {margin-bottom:8px !important;}
@@ -501,7 +502,7 @@ input.sendSourceText:hover {background-color:#297fb8;}
.popbox{/* width:300px; *//* height:100px; */position:fixed !important;/* z-index:100; */left:50%;top:50%;margin:-100px 0 0 -150px; /* background:#fff; */ -moz-border-radius:5px; /* -webkit-border-radius:5px; */ /* border-radius:5px; */ /* box-shadow:0px 0px 8px #194a81; */ /* overflow:auto; */}
/*上传资源弹窗*/
.resourceUploadPopup {width:400px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; top:50%; left:50%; margin-left:-200px; z-index:1000;}
-.uploadText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; width:140px; display:inline-block;}
+.uploadText {font-size:16px; color:#269ac9; line-height:16px; padding-top:15px; width:140px; display:inline-block;}
.uploadBoxContainer {height:33px; line-height:33px; margin-top:10px; position:relative;}
.uploadBox {width:100px; height:33px; line-height:33px; text-align:center; vertical-align:middle; background-color:#269ac9; border-radius:3px; float:left; margin-right:12px;}
.uploadBox:hover {background-color:#297fb8;}
@@ -646,7 +647,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;}
.homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;}
.homepagePostSubmit:hover {background-color:#d8d8d8;}
-.homepagePostIntro {font-size:14px; color:#484848;}
+.homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
.homepagePostReply {width:720px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;}
@@ -684,7 +685,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyContent {font-size:12px; color:#484848; margin-bottom:12px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
-.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -85px -150px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
+.homepagePostFileAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/public_icon.png) -27px -577px no-repeat; padding-left:25px; font-size:14px; margin-right:25px;}
.homepagePostImageAtt {height:22px; line-height:22px; vertical-align:middle; background:url(../images/homepage_icon.png) -86px -195px no-repeat; padding-left:35px; font-size:14px; margin-right:25px;}
.postAttSize {color:#888888; font-size:12px;}
a.postGrey {color:#484848;}
@@ -692,6 +693,8 @@ a.postGrey:hover {color:#000000;}
a.gz_btn{display:block; background:url(../images/pic_uersall.png) -318px -25px no-repeat; width:53px; height:18px; border:1px solid #cdcdcd; color:#333333; padding:0px 0 0 18px;margin-top: 2px;margin-right: 15px;}
a:hover.gz_btn{ color:#ff5722;}
.homepagePostReplyjournal{margin-left: 15px; float: left;}
+.lh18 {line-height: 18px;}
+.maxh360 {max-height: 360px;}
/*课程主页css*/
.homepageCoursesType {width:75px; background-color:#ffffff; float:left; list-style:none; position:absolute; border:1px solid #eaeaea; border-radius:5px; top:15px; padding:5px 10px; left:-65px; font-size:12px; color:#4b4b4b; line-height:2; z-index:9999; display:none;}
@@ -1266,7 +1269,7 @@ a:hover.tijiao{ background:#0f99a9;}
#cboxPrevious{position:absolute; bottom:0px; left:0; color:#444;}
#cboxNext{position:absolute; bottom:0px; left:63px; color:#444;}
#cboxClose{position:absolute; bottom:0; right:0; display:block; color:#444;}
-.system_message_style {line-height: 19.1px; max-width: 681px;overflow:hidden; work-wrap: break-word; word-break: break-all;}
+.system_message_style {line-height: 19.1px; max-width: 681px; work-wrap: break-word; word-break: break-all; text-overflow:clip; z-index:9999}
.system_message_style img {max-width: 100%;}
/*20150906关联项目LB*/
a.RalationIcon{ background: url(../images/homepage_icon.png) -183px -396px no-repeat; height:20px; display:block; padding-left:20px; color:#888888;}
@@ -1296,5 +1299,7 @@ a:hover.link_file_a{ background:url(../images/pic_file.png) 0 -25px no-repeat; c
.list_style ol li{list-style-type: decimal;margin-left: 20px;}
.list_style ul li{list-style-type: disc;margin-left: 20px;}
+.ul_grey li {color:#909090; list-style-position:inside; padding-left:1px;list-style-image:url('../images/news_dot2.png')}
+.ul_normal_color li {list-style-position:inside; padding-left:1px; list-style-image:url('../images/news_dot.png')}
.ReplyToMessageInputContainer {width: 582px;float: left;}
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 45580e95e..d45b6f94d 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -108,6 +108,7 @@ h4{ font-size:14px; color:#3b3b3b;}
.mt15 {margin-top:15px;}
.mt19 {margin-top:19px !important;}
.ml70{margin-left: 70px;}
+.mb0 {margin-bottom: 0px !important;}
.mb4{ margin-bottom:4px;}
.mb5{ margin-bottom:5px;}
.mb8 {margin-bottom:8px;}
@@ -536,7 +537,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostSubmitContainer {height:25px; margin-top: 8px; margin-bottom: 5px;}
.homepagePostSubmit {font-size:14px; color:#888888; border:1px solid #dddddd; background-color:#eaeaea; float:left; margin-right:20px; padding:0px 10px;}
.homepagePostSubmit:hover {background-color:#d8d8d8;}
-.homepagePostIntro {font-size:14px; color:#484848;}
+.homepagePostIntro {font-size:14px; color:#484848;overflow:hidden;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;}