Merge branch 'develop' into 'develop'

本周上线任务



See merge request !165
This commit is contained in:
陈晓婷 2017-03-10 13:59:33 +08:00
commit 6477c9b71e
52 changed files with 3065 additions and 2823 deletions

View File

@ -483,6 +483,7 @@ class ExerciseController < ApplicationController
end
end
=end
@name,@select_group = params[:name].to_s.strip || "",params[:group]
@is_teacher = User.current.allowed_to?(:as_teacher,@course) || User.current.admin?
if @is_teacher
@all_exercises = @course.exercises.order("created_at desc")
@ -490,17 +491,53 @@ class ExerciseController < ApplicationController
@all_exercises = @course.exercises.where("exercise_status > 1").order("created_at desc")
end
student_id = @course.student.blank? ? "(-1)" : "(" + @course.student.map{|student| student.student_id}.join(",") + ")"
@exercise_count = @exercise.exercise_users.where("commit_status = 1 and user_id in #{student_id}").count
if @is_teacher || (!@exercise.exercise_users.where("user_id = #{User.current.id} and user_id in #{student_id}").empty? && @exercise.end_time <= Time.now)
@exercise_users_list = @exercise.exercise_users.where("user_id in #{student_id}")
@show_all = true;
elsif !@exercise.exercise_users.where("user_id = #{User.current.id} and user_id in #{student_id}").empty? && @exercise.end_time > Time.now
@exercise_users_list = @exercise.exercise_users.where("user_id = ? and user_id in #{student_id}",User.current.id)
if @select_group
if @select_group == "0"
none_group_students = @course.members.select{ |member| member.course_group_id == 0 }
if none_group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + none_group_students.map{ |member| member.user_id }.join(',') + ')'
end
elsif @select_group == "-1"
all_group_students = @course.members.select{ |member| member.course_group_id }
if all_group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + all_group_students.map{ |member| member.user_id }.join(',') + ')'
end
else
course_group = CourseGroup.find_by_id(@select_group)
group_students = course_group.users
if group_students.empty?
student_in_group = '(0)'
else
student_in_group = '(' + group_students.map{ |user| user.id }.join(',') + ')'
end
end
if @is_teacher || (!@exercise.exercise_users.where("user_id = #{User.current.id}").empty? && @exercise.end_time <= Time.now)
@exercise_users_list = search_exercise_member @exercise.exercise_users.where("user_id in #{student_id} and user_id in #{student_in_group}"), @name
@show_all = true;
elsif !@exercise.exercise_users.where("user_id = #{User.current.id}").empty? && @exercise.end_time > Time.now
@exercise_users_list = search_exercise_member @exercise.exercise_users.where("user_id = ? and user_id in #{student_id} and user_id in #{student_in_group}",User.current.id), @name
else
@exercise_users_list = []
end
else
@exercise_users_list = []
if @is_teacher || (!@exercise.exercise_users.where("user_id = #{User.current.id}").empty? && @exercise.end_time <= Time.now)
@exercise_users_list = search_exercise_member @exercise.exercise_users.where("user_id in #{student_id}"), @name
@show_all = true;
elsif !@exercise.exercise_users.where("user_id = #{User.current.id}").empty? && @exercise.end_time > Time.now
@exercise_users_list = search_exercise_member @exercise.exercise_users.where("user_id = ? and user_id in #{student_id}",User.current.id), @name
else
@exercise_users_list = []
end
end
@exercise_count = @exercise.exercise_users.where("commit_status = 1 and user_id in #{student_id}").count
@left_nav_type = 8
respond_to do |format|
format.js
format.html
format.xls {
filename = "#{@course.teacher.lastname.to_s + @course.teacher.firstname}_#{@course.name}_#{@course.time.to_s + @course.term}_#{@exercise.exercise_name}#{l(:excel_exercise_list)}.xls"
@ -654,6 +691,10 @@ class ExerciseController < ApplicationController
# 更新提交状态
cur_exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", User.current, @exercise.id).first
cur_exercise_user.update_attributes(:status => 1, :commit_status => 1)
if @exercise.time && @exercise.time != -1
score = calculate_student_score(@exercise, User.current)
cur_exercise_user.update_attributes(:score => score)
end
# 答题过程中需要统计完成量
#@uncomplete_question = get_uncomplete_question(@exercise, User.current)
# 获取改学生的考试得分
@ -889,6 +930,19 @@ class ExerciseController < ApplicationController
xls_report.string
end
#根据条件过滤作业结果
def search_exercise_member exercises,name
if name == ""
select_exercises = exercises
else
name = name.downcase
select_exercises = exercises.select{ |exercise|
exercise.user[:login].to_s.downcase.include?(name) || exercise.user.user_extensions[:student_id].to_s.downcase.include?(name) || (exercise.user[:lastname].to_s.downcase + exercise.user[:firstname].to_s.downcase).include?(name)
}
end
select_exercises
end
# ExerciseUser记录用户是否已提交问卷有对应的记录则已提交没有则新建一个
def get_exercise_user exercise_id,user_id
eu = ExerciseUser.find_by_exercise_id_and_user_id(exercise_id,user_id)

View File

@ -57,6 +57,9 @@ class MessagesController < ApplicationController
@replies = @replies[@page * @limit..@page * @limit + 9]
@reply = Message.new(:subject => "RE: #{@message.subject}")
if @course
#帖子消息状态更新
course_messages = CourseMessage.where("user_id =? and course_message_type =? and course_id =? and viewed =?", User.current.id, 'Message', @course.id, 0)
course_messages.update_all(:viewed => true)
#@replies = @topic.children.
#includes(:author, :attachments, :praise_tread_cache, {:board => :project}).
#reorder("#{Message.table_name}.created_on DESC").
@ -76,6 +79,9 @@ class MessagesController < ApplicationController
end
#render :action => "show", :layout => "base_courses"#by young
elsif @project
#帖子消息状态更新
project_messages = ForgeMessage.where("user_id =? and forge_message_type =? and project_id =? and viewed =?", User.current.id, 'Message', @project.id, 0)
project_messages.update_all(:viewed => true)
#@reply_pages = Paginator.new @reply_count, REPLIES_PER_PAGE, page
# @replies = @topic.children.
# includes(:author, :attachments, {:board => :project}).
@ -88,6 +94,9 @@ class MessagesController < ApplicationController
format.html {render :layout => 'base_projects'}
end
elsif @contest
#帖子消息状态更新
contest_messages = ContestMessage.where("user_id =? and contest_message_type =? and contest_id =? and viewed =?", User.current.id, 'Message', @contest.id, 0)
contest_messages.update_all(:viewed => true)
@left_nav_type = 4
respond_to do |format|
format.js

View File

@ -212,6 +212,12 @@ class ProjectsController < ApplicationController
@trackers = Tracker.sorted.all
@project = Project.new
@project.safe_attributes = params[:project]
if params[:course_id]
@course = Course.find params[:course_id]
elsif params[:contest_id]
@contest = Contest.find params[:contest_id]
end
render :layout => 'new_base'
else
redirect_to signin_url

View File

@ -954,6 +954,9 @@ class StudentWorkController < ApplicationController
render_attachment_warning_if_needed(@new_score)
if @new_score.save
if @work.re_commit && @new_score.reviewer_role != 3
@work.re_commit = 0
end
if @homework.homework_type == 3
@is_group_leader = !@work.student_work_projects.empty?
end
@ -1314,29 +1317,43 @@ class StudentWorkController < ApplicationController
end
def forbidden_anonymous_comment
@homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0)
homework_detail_manual = @homework.homework_detail_manual
homework_detail_programing = @homework.homework_detail_programing
if @homework.anonymous_comment == 1
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.4 : 1.0
else
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.3 : 0.6
end
if @homework.homework_type == 2 && homework_detail_programing
if homework_detail_manual.comment_status != 0
@homework.update_column('anonymous_comment', @homework.anonymous_comment == 0 ? 1 : 0)
homework_detail_programing = @homework.homework_detail_programing
if @homework.anonymous_comment == 1
homework_detail_programing.ta_proportion = 0.6
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.4 : 1.0
@status = 1
else
homework_detail_programing.ta_proportion = 0.5
if @homework.end_time < Time.now
homework_detail_manual.evaluation_start = (Time.now + 7*24*60*60).strftime("%Y-%m-%d")
homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
@status = 2
else
homework_detail_manual.evaluation_start = (@homework.end_time + 7*24*60*60).strftime("%Y-%m-%d")
homework_detail_manual.evaluation_end = homework_detail_manual.evaluation_start + 7
@status = 3
end
homework_detail_manual.ta_proportion = @homework.homework_type == 2 ? 0.3 : 0.6
end
if @homework.homework_type == 2 && homework_detail_programing
if @homework.anonymous_comment == 1
homework_detail_programing.ta_proportion = 0.6
else
homework_detail_programing.ta_proportion = 0.5
end
end
homework_detail_manual.save
homework_detail_programing.save if homework_detail_programing
@homework.student_works.each do |student_work|
set_final_score @homework,student_work
student_work.save
end
@user_activity_id = params[:user_activity_id].to_i
@hw_status = params[:hw_status].to_i
else
@status = 0
end
homework_detail_manual.save
homework_detail_programing.save if homework_detail_programing
@homework.student_works.each do |student_work|
set_final_score @homework,student_work
student_work.save
end
@user_activity_id = params[:user_activity_id].to_i
@hw_status = params[:hw_status].to_i
end
def revise_attachment
@ -1351,6 +1368,7 @@ class StudentWorkController < ApplicationController
student_work = StudentWork.find attachment.container_id
CourseMessage.create(:user_id => student_work.homework_common.user_id, :course_id => student_work.homework_common.course_id, :viewed => false,:course_message_id=>attachment.container_id,:course_message_type=>'StudentWork',:status=>2)
end
@work.update_attributes(:re_commit => 1)
respond_to do |format|
format.js
end

View File

@ -2566,7 +2566,8 @@ module ApplicationHelper
#如果学生作品被打分后修改,应该给老师提示
def send_message_to_teacher student_work
if StudentWork === student_work
if student_work.student_works_scores.any?
if student_work.student_works_scores.where("reviewer_role != 3").any?
student_work.update_column('re_commit', 1)
course = student_work.homework_common.course
course.members.map(&:user_id).uniq.each do|user_id|
if User.find(user_id).allowed_to?(:as_teacher, course)

View File

@ -56,15 +56,19 @@ module StudentWorkHelper
result
end
def get_status status
def get_status status, re_commit
str = ""
case status
when 0
str = "未提交"
when 1
str = "已提交"
when 2
str = "迟交"
if re_commit
str = "重新提交"
else
case status
when 0
str = "未提交"
when 1
str = "已提交"
when 2
str = "迟交"
end
end
str
end

View File

@ -69,7 +69,7 @@ class News < ActiveRecord::Base
:author_key => :author_id
acts_as_watchable
after_create :act_as_course_activity, :add_author_as_watcher, :add_news_count, :act_as_student_score,:delay_news_wechat_send, :delay_news_send, :act_as_contest_message
after_create :act_as_course_activity, :add_author_as_watcher, :add_news_count, :act_as_student_score,:delay_news_wechat_send, :delay_news_send
after_update :update_activity
after_destroy :delete_kindeditor_assets, :decrease_news_count, :delete_org_activities, :down_course_score
@ -230,13 +230,13 @@ class News < ActiveRecord::Base
end
def act_as_contest_message
if self.contest_id
self.contest.contest_members.each do | m|
if m.user_id != self.author_id
self.contest_messages << ContestMessage.new(:user_id => m.user_id, :contest_id => self.contest_id, :viewed => false)
end
end
end
# if self.contest_id
# self.contest.contest_members.each do | m|
# if m.user_id != self.author_id
# self.contest_messages << ContestMessage.new(:user_id => m.user_id, :contest_id => self.contest_id, :viewed => false)
# end
# end
# end
end
def delay_news_send
@ -265,7 +265,7 @@ class News < ActiveRecord::Base
vs = []
self.contest.contest_members.each do | m|
if m.user_id != self.author_id
vs << {contest_message_type:'Contest',contest_message_id:self.id, :user_id => m.user_id,
vs << {contest_message_type:'News',contest_message_id:self.id, :user_id => m.user_id,
:contest_id => self.contest_id, :viewed => false}
if vs.size >= 30

View File

@ -1,6 +1,6 @@
#学生提交作品表 #work_status :0 未提交 1 已提交 2 迟交 3 分组作品复制的组员作品
class StudentWork < ActiveRecord::Base
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time, :late_penalty, :absence_penalty
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id, :simi_value, :work_status, :commit_time, :late_penalty, :absence_penalty, :re_commit
belongs_to :homework_common
belongs_to :user

View File

@ -402,7 +402,8 @@ class User < Principal
end
user = User.current
onclick_time = user.onclick_time.onclick_time
course_count = CourseMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
delete_courses = Course.where(:is_delete => 1).blank? ? "(-1)" : "(" + Course.where(:is_delete => 1).map(&:id).join(",") + ")"
course_count = CourseMessage.where("user_id =? and viewed =? and created_at >? and course_id not in #{delete_courses}", user.id, 0, onclick_time).count
contest_count = ContestMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
forge_count = ForgeMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count
user_feedback_count = UserFeedbackMessage.where("user_id =? and viewed =? and created_at >?", user.id, 0, onclick_time).count

View File

@ -92,15 +92,7 @@
<% end%>
</td>
<td align="center">
<% unless user.user_extensions.nil? %>
<% if user.user_extensions.identity.to_i == 0 %>
<!--优先取school中校名如果校名不存在就取occupation-->
<% occupation = user.user_extensions.school_id.nil? ? "" : (School.where("id =?", user.user_extensions.school_id)).first.try(:name) %>
<%= occupation.blank? ? user.user_extensions.occupation : occupation %>
<% else %>
<%= user.user_extensions.occupation %>
<% end %>
<% end %>
<%= user.user_extensions.school_id.nil? ? "" : (School.find user.user_extensions.school_id).try(:name) %>
</td>
</tr>
<% end %>

View File

@ -126,14 +126,12 @@
<p id="subjectmsg"></p>
</div>
<div id="topic_editor" style="display: none;">
<%if User.current.member_of_contest?(contest) %>
<%if User.current.admin_of_contest?(contest) %>
<div class="mt10">
<% if User.current.id == contest.user_id %>
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<div class="cl"></div>
</div>
<% end %>

View File

@ -126,16 +126,14 @@
<p id="subjectmsg"></p>
</div>
<div id="topic_editor" style="display: none;">
<%if User.current.member_of_course?(course) %>
<div class="mt10">
<% if User.current.id == course.tea_id %>
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<% end %>
<div class="cl"></div>
</div>
<%if User.current.allowed_to?(:as_teacher, course) %>
<div class="mt10">
<%= f.check_box :sticky, :value => topic.sticky %>
<%= label_tag 'message_sticky', l(:label_board_sticky) %>
<%= f.check_box :locked, :value => topic.locked %>
<%= label_tag 'message_locked', l(:label_board_locked) %>
<div class="cl"></div>
</div>
<% end %>
<div class="mt10">
<div id="message_quote" class="wiki" style="width: 92%;word-break: break-all;word-wrap: break-word;margin-left: 40px;"></div>

View File

@ -6,8 +6,10 @@
function reset_topic(){
$("#message_subject").val("");
$("#subjectmsg").text("");
document.getElementById("message_sticky").checked=false;
document.getElementById("message_locked").checked=false;
if(document.getElementById("message_sticky") && document.getElementById("message_locked")){
document.getElementById("message_sticky").checked=false;
document.getElementById("message_locked").checked=false;
}
$("#topic_attachments").html("<%= escape_javascript(render :partial => 'attachments/form_course', :locals => {:container => Message.new, :isReply => @isReply})%>");
message_content_editor.html("");
$("#topic_editor").toggle();

View File

@ -4,7 +4,7 @@
<span class="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status %>
<%= get_status student_work.work_status %>
<%= get_status student_work.work_status, student_work.re_commit %>
<% end %>
</span>
</span>

View File

@ -4,7 +4,7 @@
<span class="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status %>
<%= get_status student_work.work_status %>
<%= get_status student_work.work_status, student_work.re_commit %>
<% end %>
</span>
</span>

View File

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

View File

@ -23,6 +23,7 @@
<li><a href="<%= edit_exercise_path(exercise.id) %>" class="postOptionLink" title="编辑试卷">编&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;辑</a></li>
<% end%>
<li><a href="<%= exercise_path(exercise.id) %>" class="postOptionLink" title="查看试卷">查&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;看</a></li>
<li><a href="javascript:void(0)" onclick="send_exercise_to_course();" class="postOptionLink" title="发送到班级">发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送</a></li>
<% if exercise.exercise_status == 1 %>
<% end_time_status = exercise.end_time.nil? ? 1 : (exercise.end_time <= Time.now ? 2 : 3) %>
<li><a href="javascript:" class="postOptionLink" onclick="exercise_submit(<%=end_time_status %>,<%= exercise.id%>,<%= exercise.exercise_name.length %>,<%=index.to_i %>);">发布试卷</a></li>
@ -101,4 +102,11 @@
</div>
<% end%>
<% end%>
<% end%>
<script>
function send_exercise_to_course(){
var htmlvalue = "<%= escape_javascript(render :partial => 'exercise/send_to_course', :locals => {:exercise => exercise}) %>";
pop_box_new(htmlvalue, 450, 325);
}
</script>

View File

@ -153,12 +153,14 @@
<%= render :partial => 'exercise/total_questions_score', :locals => {:exercise => exercise, :current_score => current_score} %>
</div>
<div class="ur_buttons" style="width: 220px;">
<div class="ur_buttons" style="width: 297px;">
<%= link_to "返回", exercise_index_path(:course_id => @course.id),:class => "btn_grey_64_width" %>
<a href="javascript:void(0)" onclick="send_exercise_to_course();" class="btn_green_64_width ml10 mr10">发送</a>
<% if exercise.exercise_status == 1 %>
<%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "btn_blue_64_width" %>
<a class="btn_green_64_width mr10" onclick="$.get('<%= publish_exercise_exercise_path(@exercise) %>');">立即发布</a>
<%= link_to l(:button_edit), edit_exercise_path(exercise.id), :class => "btn_blue_64_width" %>
<% else %>
<span class="btn_grey_64_width mr10" title="测验已发布">立即发布</span>
<span class="btn_grey_64_width" title="测验已发布,不可再编辑">编辑</span>
<% end %>
</div>

View File

@ -5,13 +5,13 @@
(<%= @exercise_count%>人已答)
</font>
</span>
<%#if @is_teacher || @exercise.exercise_status == 3%>
<!--<div class="hworkSearchBox">
<input type="text" id="course_student_name" value="<%#= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%#= student_work_index_path(:homework => @homework.id)%>',event);"/>
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%#= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
</div>-->
<%#= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
<%# end%>
<%if @is_teacher || @exercise.exercise_status == 3%>
<div class="hworkSearchBox">
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%= student_exercise_list_exercise_path(@exercise)%>',event);"/>
<a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%= student_exercise_list_exercise_path(@exercise)%>');" href="javascript:void(0)"></a>
</div>
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@select_group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
<% end %>
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" onclick="show_or_hide_info();" style="display: none">[ 显示测验信息 ]</a> </span>
<div class="group_work_tip_box fontGrey2">

View File

@ -47,7 +47,7 @@
<script type="text/javascript">
$(function(){
<% if Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
<% if (!@exercise.time.nil? && @exercise.time != -1) || Time.parse(h(@exercise.end_time)).strftime("%Y-%m-%d-%H-%M-%S") <= Time.now.strftime("%Y-%m-%d-%H-%M-%S") %>
$(".student_work_<%= exercise.id%>").mouseenter(function(){
$("#work_click_<%= exercise.id%>").show();
}).mouseleave(function(){

View File

@ -2,5 +2,5 @@
$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index =>@index}) %>");
notice_box("发布成功");
<% else %>
notice_box_redirect('<%= exercise_url(@exercise) %>', '发布成功');
notice_box_redirect('<%= exercise_index_path(:course_id => @course.id) %>', '发布成功');
<% end %>

View File

@ -1,5 +1,5 @@
$("#exercises_<%= @exercise.id %>").html("<%= escape_javascript(render :partial => 'exercise',:locals => {:exercise => @exercise,:index => @index}) %>");
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
var htmlvalue = '<div id="muban_popup_box" style="width:300px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="clear muban_popup_con"><div class="newupload_conbox newupload_tishi"><p>取消成功</p>' +
'<a href="javascript:void(0);" class="btn btn-blue mt10" onclick="hideModal();">知道了</a></div></div></div>';
pop_box_new(htmlvalue, 400, 152);
pop_box_new(htmlvalue, 300, 152);

View File

@ -114,7 +114,7 @@
<div class="hworkListContainer">
<div class="ctt2">
<div class="dis" id="homework_student_work_list">
<div class="dis" id="exercise_student_work_list">
<%= render :partial => "exercise/student_exercise"%>
</div>
</div>

View File

@ -0,0 +1,2 @@
$("#exercise_student_work_list").html("<%= escape_javascript(render :partial => 'exercise/student_exercise') %>");
$("#export_student_work").replaceWith("<%= escape_javascript( link_to "导出成绩", student_exercise_list_exercise_path(@exercise.id,:course_id => @course.id, :group => @select_group, :name => @name, :format => 'xls'),:class=>'linkBlue', :id => 'export_student_work') %>");

View File

@ -1,23 +1,24 @@
<script src="/javascripts/jquery.datetimepicker.js" type="text/javascript"></script>
<div id="muban_popup_box" style="width:300px;">
<div id="muban_popup_box" style="width:340px;">
<div class="muban_popup_top">
<h3 class="fl">发布设置</h3>
<a href="javascript:void(0);" class="muban_icons_close fr" onclick="$('#datetimepicker_mask').datetimepicker('destroy');"></a>
<div class="cl"></div>
</div>
<div class="muban_popup_con clear mt15" style="margin-left: 47px;">
<div class="muban_popup_con clear mt15" style="margin-left: 37px;">
<%= form_tag(republish_file_course_file_path(@course,@file), :multipart => true,:remote => !ie8?,:name=>"upload_form") do %>
<div class="mb10">
<label class="fl c_dark f14" style="margin-top: 4px;">延期发布:</label>
<div class="calendar_div fl">
<input type="text" name="publish_time" id="datetimepicker_mask" placeholder="发布时间" style="width: 130px;" class="InputBox fl calendar_input" value="<%=format_time(@file.publish_time) %>">
<input type="text" name="publish_time" id="datetimepicker_mask" readonly="readonly" placeholder="发布时间" style="width: 130px;" class="InputBox fl calendar_input" value="<%=format_time(@file.publish_time) %>">
<%#= calendar_for('attachment_publish_time')%>
</div>
<a href="javascript:void(0)" id="reset_time" class="fl sy_btn_grey ml10" style="display: none;" onclick="reset_publish_time();">清空</a>
<span class="fl c_red" style="margin-top: 4px;" id="publish_time_notice"></span>
<div class="cl"></div>
</div>
<a href="javascript:void(0);" class="fr sy_btn_blue" style="margin-right: 95px;" id="submit_file" onclick="submit_republish_file();">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_blue" style="margin-right: 115px;" id="submit_file" onclick="submit_republish_file();">确定</a>
<a href="javascript:void(0);" class="fr sy_btn_grey mr5" onclick="$('#datetimepicker_mask').datetimepicker('destroy');hideModal();">取消</a>
<% end %>
</div>
@ -51,6 +52,11 @@
$('#submit_file').parent().submit();
}
}
function reset_publish_time(){
$("#datetimepicker_mask").val('');
$("#reset_time").hide();
}
$(function(){
$('#datetimepicker_mask').datetimepicker({
allowBlank:true,
@ -58,7 +64,13 @@
format:'Y-m-d H:i',
formatTime:'H:i',
formatDate:'Y-m-d',
validateOnBlur:false
validateOnBlur:false,
onSelectDate:function() {
$("#reset_time").show();
},
onSelectTime:function() {
$("#reset_time").show();
}
});
});
</script>

View File

@ -52,6 +52,7 @@
<div class="calendar_div fl ml10">
<input type="text" name="publish_time" id="datetimepicker_mask" placeholder="发布时间(可选)" style="width: 130px;" class="InputBox fl calendar_input" readonly="readonly">
</div>
<a href="javascript:void(0)" id="reset_time" class="fl sy_btn_grey ml10" style="display: none;" onclick="reset_publish_time();">清空</a>
<div class="cl"></div>
<span class="c_red f12" style="margin-top: 4px;" id="publish_time_notice"></span>
<div class="cl"></div>
@ -109,6 +110,10 @@
$('#submit_resource').parent().submit();
<% end %>
}
function reset_publish_time(){
$("#datetimepicker_mask").val('');
$("#reset_time").hide();
}
$(function(){
$('#datetimepicker_mask').datetimepicker({
allowBlank:true,
@ -116,7 +121,13 @@
format:'Y-m-d H:i',
formatTime:'H:i',
formatDate:'Y-m-d',
validateOnBlur:false
validateOnBlur:false,
onSelectDate:function() {
$("#reset_time").show();
},
onSelectTime:function() {
$("#reset_time").show();
}
});
});
</script>

View File

@ -1,2 +1,2 @@
var htmlvalue = '<%= escape_javascript(render :partial => 'files/hidden_file',:locals => {:course => @course,:course_attachment_type => 1}) %>';
pop_box_new(htmlvalue, 300, 140);
pop_box_new(htmlvalue, 340, 140);

View File

@ -7,7 +7,7 @@
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
<div class="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<ul class="pro_newsetting_con fl" style="max-height: 440px; overflow: auto;">
<li class="mb10 fl">
<label class="pop_box_label fl">迟交扣分&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl w180" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>

View File

@ -7,7 +7,7 @@
<%= form_for('new_form',:url =>{:controller => 'student_work',:action => 'set_score_rule',:homework => homework.id,:student_path => student_path,:user_activity_id=>user_activity_id,:hw_status=>hw_status},:method => "post", :remote => !student_path) do |f|%>
<div class="muban_popup_con clear">
<div class="clear mt15 ml20">
<ul class="pro_newsetting_con fl">
<ul class="pro_newsetting_con fl" style="max-height: 440px; overflow: auto;">
<li class="mb10 fl">
<label class="pop_box_label fl">迟交扣分&nbsp;&nbsp;:&nbsp;</label>
<input type="text" name="late_penalty" id="late_penalty_num" placeholder="0-50" class="fl w180" value="<%= homework.late_penalty%>" onkeyup="check_late_penalty('late_penalty_num')"/>

View File

@ -1,7 +1,7 @@
<% if @homework.homework_type == 2 %>
<% if @homework.anonymous_comment == 0 %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 630, 772);
pop_box_new(htmlvalue, 630, 500);
<% else %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 530, 404);
@ -9,7 +9,7 @@
<% else %>
<% if @homework.anonymous_comment == 0 %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_non_pro',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 630, 742);
pop_box_new(htmlvalue, 630, 500);
<% else %>
var htmlvalue = "<%= escape_javascript(render :partial => 'homework_common/set_score_rule_none_pro_anon',:locals => {:homework => @homework, :student_path => false, :user_activity_id => @user_activity_id,:hw_status => @hw_status}) %>";
pop_box_new(htmlvalue, 530, 332);

View File

@ -59,7 +59,7 @@
<% if ma.course_message.jour_type == 'Course' %>
<li><a href="<%= course_feedback_path(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> 在班级中留言了:<%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span>在班级中留言了:<%= message_content(ma.course_message.notes)%></a></li>
<% elsif ma.course_message.jour_type == 'HomeworkCommon' %>
<li><a href="<%= homework_common_index_url_in_org(ma.course_id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%></a></li>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.id) %>" target="_blank" title="<%=ma.course_message.user.show_name %> <%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=ma.course_message.user.show_name %> </span><%=ma.course_message.m_parent_id.nil? ? '回复了您的作业:' : '在作业中回复了您:' %><%= message_content(ma.course_message.notes)%></a></li>
<% else %>
<% show_name = ma.course_message.jour.reviewer_role != 3 || ma.course_message.user.allowed_to?(:as_teacher, ma.course) %>
<li><a href="<%= student_work_index_path(:homework => ma.course_message.jour.student_work.homework_common_id,:show_work_id => ma.course_message.jour.student_work_id) %>" target="_blank" title="<%=show_name ? ma.course_message.user.show_name + "#{ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"}" : "匿名用户" %> 回复了作品评论:<%= message_content(ma.course_message.notes)%>"><span class="shadowbox_news_user"><%=show_name ? ma.course_message.user.show_name + "#{ma.course_message.user.allowed_to?(:as_teacher, ma.course)?"老师":"同学"}" : "匿名用户" %> </span>回复了作品评论:<%= message_content(ma.course_message.notes)%></a></li>
@ -106,6 +106,8 @@
<li><a href="<%= contestant_works_path(:work => ma.contest_message.id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> 发布的竞赛题:<%= ma.contest_message.name%>的截止日期快到了"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span>发布的竞赛题:<%= ma.contest_message.name%>的截止时间快到啦</a></li>
<% elsif ma.contest_message_type == "Work" && ma.status == 2 %>
<li><a href="<%= contestant_works_path(:work => ma.contest_message.id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> 启动了在线评审:<%= ma.contest_message.name%>"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span>启动了在线评审:<%= ma.contest_message.name%></a></li>
<% elsif ma.contest_message_type == "Work" && ma.status == 3 %>
<li><a href="<%= contestant_works_path(:work => ma.contest_message.id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> 关闭了在线评审:<%= ma.contest_message.name%>"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span>关闭了在线评审:<%= ma.contest_message.name%></a></li>
<% elsif ma.contest_message_type == "Work" && ma.status == 4 %>
<li><a href="<%= contestant_works_path(:work => ma.contest_message.id) %>" target="_blank" title="<%=ma.contest_message.user.show_name %> 在线评审启动失败(评委数为0或作品数为0)<%= ma.contest_message.name%>"><span class="shadowbox_news_user"><%=ma.contest_message.user.show_name %> </span>在线评审启动失败(评委数为0或作品数为0)<%= ma.contest_message.name%></a></li>
<% elsif ma.contest_message_type == "Work" && ma.status == 5 %>

View File

@ -1,10 +1,16 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
</div>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<div class="orig_right fl" style="width: 93%;" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content ">
<div class="orig_content" id="reply_content_<%= comment.id %>">
<% if comment.class == Journal %>
<% if comment.details.any? %>
<% details_to_strings(comment.details).each do |string| %>

View File

@ -1,10 +1,16 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
</div>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<div class="orig_right fl">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content ">
<div class="orig_content" id="reply_content_<%= comment.id %>">
<% if comment.class == Journal %>
<% if comment.details.any? %>
<% details_to_strings(comment.details).each do |string| %>

View File

@ -1,10 +1,16 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user.id), :alt => "用户头像" %>
</div>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<div class="orig_right fl" style="width: 93%;" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user.id), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content ">
<div class="orig_content" id="reply_content_<%= comment.id %>">
<% if comment.class == Journal %>
<% if comment.details.any? %>
<% details_to_strings(comment.details).each do |string| %>

View File

@ -57,7 +57,13 @@
</li>
<li class=" ml90" >
<a href="javascript:void(0)" class="blue_btn fl c_white" onclick="submit_new_project();" >提交</a>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<% if @course %>
<%= link_to "取消",homework_common_index_path(:course => @course.id),:class => "grey_btn fl c_white ml10"%>
<% elsif @contest %>
<%= link_to "取消",works_path(:contest => @contest.id),:class => "grey_btn fl c_white ml10"%>
<% else %>
<%= link_to "取消",user_activities_path(User.current.id),:class => "grey_btn fl c_white ml10"%>
<% end %>
<div class="cl"></div>
</li>
<% end%>

View File

@ -5,7 +5,7 @@
<span class="hidden fl" style="max-width:220px;"><%= student_work.name %></span>
<span class="fontGrey2 ml5 fl">
<% if student_work.work_status %>
<%= get_status student_work.work_status %>
<%= get_status student_work.work_status, student_work.re_commit %>
<% end %>
</span>
</span>

View File

@ -48,7 +48,7 @@
<% end %>
<td class="<%= @homework.homework_type ==2 ? 'hworkList110' : 'hworkList130' %> c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<% if student_work.work_status%>
<%=get_status student_work.work_status %>
<%= get_status student_work.work_status, student_work.re_commit %>
<% end %>
</td>
<td class="hworkList70 <%= score_color (!score_open || student_work.teacher_score.nil? ? nil : student_work.teacher_score)%>">

View File

@ -72,7 +72,7 @@
<% end%>
<td class="hworkList130 pl10 c_grey student_work_<%= student_work.id%>" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<% if student_work.work_status%>
<%=get_status student_work.work_status %>
<%= get_status student_work.work_status, student_work.re_commit %>
<% end %>
</td>

View File

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

View File

@ -4,11 +4,18 @@ sd_create_editor_from_data(<%= @user_activity_id%>,"","100%", "UserActivity");
<% else %>
sd_create_editor_from_data(<%= @homework.id%>,"","100%", "<%=@homework.class.to_s%>");
<% end %>
<% if @homework.anonymous_comment == 0 %>
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="muban_popup_con ml30 mr30 mt20 mb10 clear"><p class="mb10 f14 text_c">将于7天后自动启动该作业的匿评</p><p class="mb10 f14 text_c">您可以在匿评设置中进行修改</p>' +
'<a href="javascript:void(0);" class="btn btn-blue mt10" style="margin-left: 142px;" onclick="hideModal();">知道啦</a></div></div>';
pop_box_new(htmlvalue, 400, 178);
<% else %>
hideModal();
<% end %>
var str = "";
<% case @status %>
<% when 0 %>
str = "请于作业发布后再进行操作";
<% when 1 %>
str = "作业已禁用匿评";
<% when 2 %>
str = "将于7天后自动启动该作业的匿评<br/>您可以在匿评设置中进行修改";
<% when 3 %>
str = "将于作业截止7天后自动启动该作业的匿评<br/>您可以在匿评设置中进行修改";
<% end %>
var htmlvalue = '<div id="muban_popup_box" style="width:400px;"><div class="muban_popup_top"><h3 class="fl">提示</h3><a href="javascript:void(0);" class="muban_icons_close fr"></a></div>'+
'<div class="muban_popup_con ml30 mr30 mt20 mb10 clear"><p class="mb10 f14 text_c">' + str + '</p>' +
'<a href="javascript:void(0);" class="btn btn-blue mt10" style="margin-left: 142px;" onclick="hideModal();">知道啦</a></div></div>';
pop_box_new(htmlvalue, 400, 178);

View File

@ -1,10 +1,16 @@
<div class="orig_user fl">
<%= link_to image_tag(url_to_avatar(comment.creator_user), :width => "33", :height => "33"), user_path(comment.creator_user), :alt => "用户头像" %>
</div>
<script type="text/javascript">
$(function(){
showNormalImage('reply_content_<%= comment.id %>');
autoUrl('reply_content_<%= comment.id %>');
});
</script>
<div class="<%= type == 'TrainingTask' ? 'new_orig_right fl' : 'orig_right fl' %>" onmouseout="$(this).find('.reply-right').hide();" onmouseover="$(this).find('.reply-right').show();">
<%= link_to comment.creator_user.show_name, user_path(comment.creator_user), :class => "content-username" %>
<span class="orig_area"><%= time_from_now(comment.respond_to?(:created_on) ? comment.created_on : comment.created_at) %></span>
<div class="orig_content">
<div class="orig_content" id="reply_content_<%= comment.id %>">
<% if comment.class == Journal %>
<% if comment.details.any? %>
<% details_to_strings(comment.details).each do |string| %>

View File

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

View File

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

View File

@ -4,7 +4,7 @@
</div>
<% if activity.anonymous_comment == 0%>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_start_time_<%=user_activity_id %>">
匿评开启时间:<%= activity.homework_detail_manual.evaluation_start%>&nbsp;00:00
匿评开启时间:<%= activity.homework_detail_manual.evaluation_start.nil? ? '--' : (activity.homework_detail_manual.evaluation_start.to_s+" 00:00") %>
</div>
<% end %>
</div>
@ -15,7 +15,7 @@
缺评扣分:<%= activity.homework_detail_manual.absence_penalty%>分/作品
</div>
<div class="homepagePostDeadline" style="float: right; margin-right: 220px;" id="evaluation_end_time_<%=user_activity_id %>">
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end%>&nbsp;23:59
匿评关闭时间:<%= activity.homework_detail_manual.evaluation_end.nil? ? '--' : (activity.homework_detail_manual.evaluation_end.to_s+" 00:00") %>
</div>
<% end %>
</div>
@ -111,12 +111,12 @@
<%= homework_anonymous_comment activity,hw_status,user_activity_id %>
</li>
<% end %>
<% if activity.anonymous_comment == 0 && (comment_status == 0 || comment_status == 1)%>
<% if activity.anonymous_comment == 0 && comment_status == 1 %>
<li>
<%= link_to("禁用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "wpostOptionLink",
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%>
</li>
<% elsif activity.anonymous_comment == 1 %>
<% elsif activity.anonymous_comment == 1 && comment_status > 0 %>
<li>
<%= link_to("启用匿评", alert_forbidden_anonymous_comment_homework_common_path(activity,:user_activity_id => user_activity_id),:class => "wpostOptionLink",
:title => "匿评是同学之间的双盲互评过程:每个同学将评阅系统分配给他/她的若干个作品", :remote => true)%>

View File

@ -68,7 +68,15 @@
format:'Y-m-d H:i',
formatTime:'H:i',
formatDate:'Y-m-d',
validateOnBlur:false
validateOnBlur:false,
onSelectDate:function() {
$("#reset_time").show();
$("#homework_publish_time_div").show();
},
onSelectTime:function() {
$("#reset_time").show();
$("#homework_publish_time_div").show();
}
});
<% end %>
<% allow_edit = homework.student_works.has_committed.count == 0 && homework.student_work_projects.count ==0 %>
@ -94,6 +102,7 @@
function reset_end_time(){
$("#homework_end_time").val('');
$("#homework_publish_time").val('');
$("#reset_time").hide();
$("#homework_publish_time_div").hide();
}
@ -280,7 +289,7 @@
<%# end %>
</div>
<% if !edit_mode || (edit_mode && homework.homework_detail_manual.comment_status.to_i < 1) %>
<a href="javascript:void(0)" id="reset_time" class="fl sy_btn_grey ml10" onclick="reset_end_time();">清空</a>
<a href="javascript:void(0)" id="reset_time" class="fl sy_btn_grey ml10" style="display: none;" onclick="reset_end_time();">清空</a>
<% end %>
<div class="fl <%= homework.publish_time.nil? ? 'none' : '' %> ml50" id="homework_publish_time_div">
<label class="fl c_grey f14 mt5" style="margin-top: 4px;">发布时间(可选):</label>

View File

@ -176,6 +176,24 @@
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<!--关闭在线评审-->
<% elsif ma.contest_message_type == "Work" && ma.status == 3 && ma.contest_message %>
<ul class="homepageNewsList fl">
<div class="longMessageWidth">
<li class="homepageNewsPortrait fl">
<%= link_to image_tag(url_to_avatar(ma.contest_message.user), :width => "30", :height => "30"), user_path(ma.contest_message.user), :target => '_blank' %>
</li>
<li class="homepageNewsPubType fl">
<%= link_to ma.contest_message.user.show_name, user_path(ma.contest_message.user), :class => "newsBlue homepageNewsPublisher", :target => '_blank' %>
<span class="homepageNewsType fl">关闭了在线评审:</span>
</li>
<li class="messageInformationContents">
<%= link_to ma.contest_message.name, contestant_works_path(:work => ma.contest_message.id), :class => "#{!ma.viewed ? "newsBlack" : "newsGrey"}", :target => "_blank"%>
</li>
</div>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>
<!--在线评审启动失败-->
<% elsif ma.contest_message_type == "Work" && ma.status == 4 && ma.contest_message %>
<ul class="homepageNewsList fl">
@ -188,7 +206,7 @@
<span class="homepageNewsType fl">在线评审启动失败<font class="c_red">(评委数为0或作品数为0)</font></span>
</li>
<li class="messageInformationContents">
<%= link_to ma.contest_message.name, contestant_works_path(:work => ma.contest_message.id), :class => "#{!ma.viewed ? "newsBlack" : "newsGrey"}"%>
<%= link_to ma.contest_message.name, contestant_works_path(:work => ma.contest_message.id), :class => "#{!ma.viewed ? "newsBlack" : "newsGrey"}", :target => "_blank" %>
</li>
</div>
<li class="homepageNewsTime fr"><%= time_tag(ma.created_at).html_safe %> </li>

View File

@ -490,7 +490,7 @@
</span>
</li>
<li class="messageInformationContents">
<%= link_to message_content(ma.course_message.notes), homework_common_index_url_in_org( ma.course_id),
<%= link_to message_content(ma.course_message.notes), student_work_index_path(:homework => ma.course_message.jour.id),
:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}", :target => '_blank' %>
<!--:onmouseover => "message_titile_show($(this),event)",-->
<!--:onmouseout => "message_titile_hide($(this))" %>-->

View File

@ -0,0 +1,5 @@
class AddReCommitToStudentWorks < ActiveRecord::Migration
def change
add_column :student_works, :re_commit, :boolean, :default => false
end
end

View File

@ -0,0 +1,8 @@
class DeleteContestMessages < ActiveRecord::Migration
def up
ContestMessage.where("contest_message_type = 'Contest'").delete_all
end
def down
end
end

File diff suppressed because it is too large Load Diff

View File

@ -796,7 +796,7 @@ function regex_homework_end_publish_time()
var myDate = new Date();
if($.trim($("#homework_publish_time").val()) == "")
{
$("#homework_publish_time").val(formate_date(myDate));
$("#homework_publish_time").val(formate_time(myDate));
}
var publish_time = Date.parse($("#homework_publish_time").val());
var end_time = Date.parse($("#homework_end_time").val());
@ -836,7 +836,7 @@ function regex_work_end_publish_time()
var myDate = new Date();
if($.trim($("#homework_publish_time").val()) == "")
{
$("#homework_publish_time").val(formate_time(myDate));
$("#homework_publish_time").val(formate_date(myDate));
}
var publish_time = Date.parse($("#homework_publish_time").val());
var end_time = Date.parse($("#homework_end_time").val());

View File

@ -573,10 +573,12 @@
var _this = this;
_this.now = function() {
var d = new Date();
if( options.yearOffset )
d.setFullYear(d.getFullYear()+options.yearOffset);
d.setMinutes(0);
d.setSeconds(0);
d.setHours(d.getHours() + 1);
return d;
};