Merge remote-tracking branch 'origin/szzh' into szzh
This commit is contained in:
commit
f99ccf724c
|
@ -160,6 +160,7 @@ class MessagesController < ApplicationController
|
||||||
@reply.safe_attributes = params[:reply]
|
@reply.safe_attributes = params[:reply]
|
||||||
@reply.content = @quote + @reply.content
|
@reply.content = @quote + @reply.content
|
||||||
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
|
@reply.subject = "RE: #{@topic.subject}" unless params[:reply][:subject]
|
||||||
|
# @reply.reply_id = params[:id]
|
||||||
@topic.children << @reply
|
@topic.children << @reply
|
||||||
user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first
|
user_activity = UserActivity.where("act_type='Message' and act_id =#{@topic.id}").first
|
||||||
user_activity.updated_at = Time.now
|
user_activity.updated_at = Time.now
|
||||||
|
|
|
@ -189,6 +189,7 @@ class ProjectsController < ApplicationController
|
||||||
@project.organization_id = params[:organization_id]
|
@project.organization_id = params[:organization_id]
|
||||||
@project.user_id = User.current.id
|
@project.user_id = User.current.id
|
||||||
@project.project_new_type = params[:project_new_type]
|
@project.project_new_type = params[:project_new_type]
|
||||||
|
params[:project][:is_public] ? @project.is_public = 1 : @project.is_public = 0
|
||||||
if validate_parent_id && @project.save
|
if validate_parent_id && @project.save
|
||||||
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
@project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id')
|
||||||
# Add current user as a project member if he is not admin
|
# Add current user as a project member if he is not admin
|
||||||
|
|
|
@ -2356,8 +2356,8 @@ module ApplicationHelper
|
||||||
if work.nil?
|
if work.nil?
|
||||||
link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
link_to "提交作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
||||||
else
|
else
|
||||||
if homework.homework_type == 1 && homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
|
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status != 1 #匿评作业,且作业状态不是在开启匿评之前
|
||||||
link_to "作品已交", "", :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
link_to "作品已交", "javascript:void(0)", :class => 'c_blue', :title => "开启匿评后不可修改作品"
|
||||||
elsif homework.homework_type == 2 #编程作业不能修改作品
|
elsif homework.homework_type == 2 #编程作业不能修改作品
|
||||||
link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
link_to "修改作品", new_student_work_path(:homework => homework.id),:class => 'c_blue'
|
||||||
else
|
else
|
||||||
|
|
|
@ -4,6 +4,6 @@ class HomeworkDetailPrograming < ActiveRecord::Base
|
||||||
belongs_to :homework_common
|
belongs_to :homework_common
|
||||||
|
|
||||||
def language_name
|
def language_name
|
||||||
%W(C C++ Python).at(self.language.to_i - 1)
|
%W(C C++ Python Java).at(self.language.to_i - 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -86,7 +86,7 @@ class Message < ActiveRecord::Base
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
safe_attributes 'subject', 'content'
|
safe_attributes 'subject', 'content', 'reply_id'
|
||||||
safe_attributes 'board_id','locked', 'sticky',
|
safe_attributes 'board_id','locked', 'sticky',
|
||||||
:if => lambda {|message, user|
|
:if => lambda {|message, user|
|
||||||
if message.project
|
if message.project
|
||||||
|
|
|
@ -45,134 +45,13 @@
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
|
|
||||||
<!--属性-->
|
<!--属性-->
|
||||||
<<<<<<< .mine
|
|
||||||
<%= render :partial => 'attributes_show' %>
|
<%= render :partial => 'attributes_show' %>
|
||||||
<!--pro_info_box 属性 end-->
|
<!--pro_info_box 属性 end-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
<div class="pro_info_box mb10">
|
|
||||||
<%= issue_fields_rows do |rows| %>
|
|
||||||
<ul class="fl">
|
|
||||||
<li><p class="label03"> 状态 : </p>
|
|
||||||
|
|
||||||
<p class="pro_info_p"><%= @issue.status.name %></p>
|
|
||||||
</li>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<% unless @issue.disabled_core_fields.include?('assigned_to_id') %>
|
|
||||||
<li><p class="label03"> 指派给 : </p>
|
|
||||||
<span class="pro_info_p"><%= @issue.assigned_to ? link_to_isuue_user(@issue.assigned_to) : "--" %></span>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</ul>
|
|
||||||
<ul class="fl">
|
|
||||||
<li><p class="label03"> 优先级 : </p>
|
|
||||||
<span class="pro_info_p" style="width:50px;"><%= @issue.priority.name %></span>
|
|
||||||
</li>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<% unless @issue.disabled_core_fields.include?('done_ratio') %>
|
|
||||||
<li><p class="label03"> % 完成 : </p>
|
|
||||||
<span class="pro_info_p" style="width:50px;"><%= @issue.done_ratio %>%</span>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</ul>
|
|
||||||
>>>>>>> .theirs
|
|
||||||
|
|
||||||
<<<<<<< .mine
|
|
||||||
<%# 该应用是对issue主题内容的引用,对应:to => 'journals#new %>
|
<%# 该应用是对issue主题内容的引用,对应:to => 'journals#new %>
|
||||||
<!--<div class="cl"></div>-->
|
<!--<div class="cl"></div>-->
|
||||||
<!--<%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'talk_edit fr' if authorize_for('issues', 'edit') %>-->
|
<!--<%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'talk_edit fr' if authorize_for('issues', 'edit') %>-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<div class="cl"></div>
|
<div class="cl"></div>
|
||||||
=======
|
|
||||||
<ul class="fl ">
|
|
||||||
<% unless @issue.disabled_core_fields.include?('start_date') %>
|
|
||||||
<li><p class="label03" style="width:50px;"> 开始 : </p>
|
|
||||||
|
|
||||||
<p class="pro_info_p"><%= format_date(@issue.start_date) %></p>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
>>>>>>> .theirs
|
|
||||||
<<<<<<< .mine
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
=======
|
|
||||||
<% unless @issue.disabled_core_fields.include?('estimated_hours') %>
|
|
||||||
<li><p class="label03" style="width:50px;"> 周期 : </p>
|
|
||||||
<span class="pro_info_p"><%= l_hours(@issue.estimated_hours) %></span>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</ul>
|
|
||||||
<ul class="fl ">
|
|
||||||
<% unless @issue.disabled_core_fields.include?('due_date') %>
|
|
||||||
<li><p class="label03"> 计划完成 : </p>
|
|
||||||
<span class="pro_info_p" style="width:120px;"><%= format_date(@issue.due_date) ? format_date(@issue.due_date) : "--" %></span>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
<% unless @issue.disabled_core_fields.include?('fixed_version_id') %>
|
|
||||||
<li><p class="label03"> 目标版本 : </p>
|
|
||||||
<span class="pro_info_p" style="width:120px;"><%= (@issue.fixed_version ? link_to_version(@issue.fixed_version, :class => "pro_info_p") : "--") %></span>
|
|
||||||
</li>
|
|
||||||
<% end %>
|
|
||||||
<div class="cl"></div>
|
|
||||||
</ul>
|
|
||||||
<% end %><!--pro_info_box end-->
|
|
||||||
<%#= render_custom_fields_rows(@issue) %>
|
|
||||||
<%#= call_hook(:view_issues_show_details_bottom, :issue => @issue) %>
|
|
||||||
>>>>>>> .theirs
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--problem_main end-->
|
<!--problem_main end-->
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<li class="hworkList340 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
|
<li class="hworkList340 <%= @homework.homework_type == 2 ? '' : 'width385'%>">
|
||||||
<ul>
|
<ul>
|
||||||
<li class="hworkPortrait mt15 mr10">
|
<li class="hworkPortrait mt15 mr10">
|
||||||
<%= link_to(image_tag(url_to_avatar(User.current),:width =>"40",:height => "40"),user_activities_path(User.current.id))%>
|
<%= link_to(image_tag(url_to_avatar(student_work.user),:width =>"40",:height => "40"),user_activities_path(User.current.id))%>
|
||||||
</li>
|
</li>
|
||||||
<div onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
<div onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
|
||||||
<li class="hworkName mt15 mr15 <%= @homework.homework_type == 2 ? '' : 'width165'%>">
|
<li class="hworkName mt15 mr15 <%= @homework.homework_type == 2 ? '' : 'width165'%>">
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
<div class="HomeWorkCon">
|
<div class="HomeWorkCon">
|
||||||
<div class="mt15">
|
<div class="mt15">
|
||||||
<select class="InputBox W120 language_type" >
|
<select class="InputBox W120 language_type" >
|
||||||
<%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
|
<%= options_for_select({"C语言"=>1, "C++"=>2, "Python"=>3, "Java"=>4}, (edit_mode && homework.is_program_homework?) ? homework.language : 1) %>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<% if edit_mode && homework.is_program_homework? %>
|
<% if edit_mode && homework.is_program_homework? %>
|
||||||
|
|
|
@ -224,65 +224,89 @@
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!--作品开启匿评 待整合:时间紧-->
|
<!--作品开启匿评 待整合:时间紧-->
|
||||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
|
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 2 %>
|
||||||
<ul class="homepageNewsList fl">
|
<ul class="homepageNewsList fl">
|
||||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
<li class="homepageNewsPortrait fl">
|
||||||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
|
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a>
|
||||||
<% if ma.viewed == 0 %>
|
</li>
|
||||||
<li class="homepageHomeworkContent fl">
|
<li class="homepageNewsPubType fl">
|
||||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id),
|
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
||||||
:class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||||
:onmouseover =>"message_titile_show($(this),event)",
|
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">启动了作业匿评:</span>
|
||||||
:onmouseout => "message_titile_hide($(this))" %>
|
</li>
|
||||||
</li>
|
<li class="homepageNewsContent fl">
|
||||||
<div style="display: none" class="message_title_red system_message_style">
|
<%= link_to "作业题目:" + ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
||||||
<%= ma.course_message.name %>
|
:onmouseover => "message_titile_show($(this),event)",
|
||||||
</div>
|
:onmouseout => "message_titile_hide($(this))" %>
|
||||||
<li class="homepageHomeworkContentWarn fl"> 开启匿评了!</li>
|
</li>
|
||||||
<% else %>
|
<div style="display: none" class="message_title_red system_message_style">
|
||||||
<li class="homepageNewsContent fl">
|
<p>您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师开启了匿评,作业详情如下:</p>
|
||||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
<p><strong>课程:</strong><%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
|
||||||
:onmouseover =>"message_titile_show($(this),event)",
|
<p><strong>作业标题:</strong><%= ma.course_message.name %></p>
|
||||||
:onmouseout => "message_titile_hide($(this))"%>
|
<% unless ma.course_message.description.blank? %>
|
||||||
</li>
|
<div class="fl"><strong>作业内容:</strong></div>
|
||||||
<div style="display: none" class="message_title_red system_message_style">
|
<div class="ml60"><%= ma.course_message.description.html_safe %></div>
|
||||||
<%= ma.course_message.name %>
|
<% end %>
|
||||||
</div>
|
<p><strong>匿评自动关闭日期:</strong><%= ma.course_message.homework_detail_manual.evaluation_end %>
|
||||||
<% end %>
|
</p>
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
</div>
|
||||||
</ul>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
<% end %>
|
</ul>
|
||||||
|
<% end %>
|
||||||
<!--作品关闭匿评-->
|
<!--作品关闭匿评-->
|
||||||
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 3 %>
|
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 3 %>
|
||||||
<ul class="homepageNewsList fl">
|
<ul class="homepageNewsList fl">
|
||||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
||||||
<li class="homepageNewsPubType fl"><%=link_to ma.course_message.user, user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">发布的作业:</span></li>
|
<li class="homepageNewsPubType fl">
|
||||||
<% if ma.viewed == 0 %>
|
<%=link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
||||||
<li class="homepageHomeworkContent fl">
|
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %><span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>">关闭了作业匿评:</span></li>
|
||||||
<%= 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))" %>
|
|
||||||
</li>
|
|
||||||
<div style="display: none" class="message_title_red system_message_style">
|
|
||||||
<%= ma.course_message.name %>
|
|
||||||
</div>
|
|
||||||
<li class="homepageHomeworkContentWarn fl"> 匿评已经关闭!</li>
|
|
||||||
<% else %>
|
|
||||||
<li class="homepageNewsContent fl">
|
<li class="homepageNewsContent fl">
|
||||||
<%= link_to ma.course_message.name, student_work_index_path(:homework => ma.course_message.id), :class =>"#{ma.viewed == 0 ? "newsBlack" : "newsGrey"}",
|
<%= 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)",
|
:onmouseover =>"message_titile_show($(this),event)",
|
||||||
:onmouseout => "message_titile_hide($(this))"%>
|
:onmouseout => "message_titile_hide($(this))"%>
|
||||||
</li>
|
</li>
|
||||||
<div style="display: none" class="message_title_red system_message_style">
|
<div style="display: none" class="message_title_red system_message_style">
|
||||||
<%= ma.course_message.name %>
|
<p>您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师关闭了匿评,作业详情如下:</p>
|
||||||
|
<p><strong>课程:</strong><%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
|
||||||
|
<p><strong>作业标题:</strong><%= ma.course_message.name %></p>
|
||||||
|
<% unless ma.course_message.description.blank? %>
|
||||||
|
<div class="fl"><strong>作业内容:</strong></div>
|
||||||
|
<div class="ml60"><%= ma.course_message.description.html_safe %></div>
|
||||||
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
|
||||||
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
</ul>
|
</ul>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
<% if ma.course_message_type == "HomeworkCommon" && ma.status == 4 %>
|
||||||
|
<ul class="homepageNewsList fl">
|
||||||
|
<li class="homepageNewsPortrait fl">
|
||||||
|
<a href="javascript:void(0);"><%= link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsPubType fl">
|
||||||
|
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
||||||
|
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||||
|
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">启动作业匿评失败</span>
|
||||||
|
</li>
|
||||||
|
<li class="homepageNewsContent fl">
|
||||||
|
<%= 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))" %>
|
||||||
|
</li>
|
||||||
|
<div style="display: none" class="message_title_red system_message_style">
|
||||||
|
<p>您好!<%= ma.course_message.user.lastname + ma.course_message.user.firstname %>老师启动作业匿评失败,作业详情如下:</p>
|
||||||
|
<p><strong>课程:</strong><%= ma.course_message.course.name %>(<%= ma.course_message.course.term %>)</p>
|
||||||
|
<p><strong>作业标题:</strong><%= ma.course_message.name %></p>
|
||||||
|
<% unless ma.course_message.description.blank? %>
|
||||||
|
<div class="fl"><strong>作业内容:</strong></div>
|
||||||
|
<div class="ml60"><%= ma.course_message.description.html_safe %></div>
|
||||||
|
<% end %>
|
||||||
|
</div>
|
||||||
|
<li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
|
||||||
|
</ul>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<% if ma.course_message_type == "Poll" %>
|
<% if ma.course_message_type == "Poll" %>
|
||||||
<ul class="homepageNewsList fl">
|
<ul class="homepageNewsList fl">
|
||||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
||||||
|
@ -335,10 +359,20 @@
|
||||||
<% end %>
|
<% end %>
|
||||||
<% if ma.course_message_type == "StudentWorksScore" %>
|
<% if ma.course_message_type == "StudentWorksScore" %>
|
||||||
<ul class="homepageNewsList fl">
|
<ul class="homepageNewsList fl">
|
||||||
<li class="homepageNewsPortrait fl"><a href="javascript:void(0);"><%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %></a></li>
|
<li class="homepageNewsPortrait fl">
|
||||||
|
<% if ma.course_message.reviewer_role == 3 %>
|
||||||
|
<%=link_to image_tag(url_to_avatar(""), :width => "30", :height => "30") %>
|
||||||
|
<% else %>
|
||||||
|
<%=link_to image_tag(url_to_avatar(ma.course_message.user), :width => "30", :height => "30"), user_path(ma.course_message.user) %>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
<li class="homepageNewsPubType fl">
|
<li class="homepageNewsPubType fl">
|
||||||
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
<% if ma.course_message.reviewer_role == 3 %>
|
||||||
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
匿名用户
|
||||||
|
<% else %>
|
||||||
|
<%= link_to ma.course_message.user.lastname + ma.course_message.user.firstname + "老师",
|
||||||
|
user_path(ma.course_message.user), :class => "newsBlue homepageNewsPublisher" %>
|
||||||
|
<% end %>
|
||||||
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
|
<span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl" : "homepageNewsType fl" %>">
|
||||||
<%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %>
|
<%= ma.status == 0 ? "评阅了您的作品:" : "重新评阅了您的作品:" %>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
@ -0,0 +1,5 @@
|
||||||
|
class AddReplyIdToMessage < ActiveRecord::Migration
|
||||||
|
def change
|
||||||
|
add_column :messages, :reply_id, :integer
|
||||||
|
end
|
||||||
|
end
|
1722
db/schema.rb
1722
db/schema.rb
File diff suppressed because it is too large
Load Diff
|
@ -25,9 +25,25 @@ namespace :homework_evaluation do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
homework_detail_manual.update_column('comment_status', 2)
|
homework_detail_manual.update_column('comment_status', 2)
|
||||||
# 匿评开启消息邮件通知
|
# 匿评开启消息邮件通知,# 所有人
|
||||||
|
course = homework_common.course
|
||||||
|
course.members.each do |m|
|
||||||
|
homework_common.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 2)
|
||||||
|
end
|
||||||
|
# 邮件通知
|
||||||
|
Mailer.send_mail_anonymous_comment_close(homework_common).deliver
|
||||||
else
|
else
|
||||||
#作业数小于2,启动失败
|
#作业数小于2,启动失败, 只给老师发
|
||||||
|
# status==4 发送失败
|
||||||
|
# 匿评开启消息邮件通知,# 所有人
|
||||||
|
course = homework_common.course
|
||||||
|
course.members.each do |m|
|
||||||
|
if m.user.allowed_to?(:as_teacher,course)
|
||||||
|
homework_common.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 4)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
# 邮件通知
|
||||||
|
# Mailer.send_mail_anonymous_comment_close(homework_common).deliver
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -47,7 +63,13 @@ namespace :homework_evaluation do
|
||||||
student_work.save
|
student_work.save
|
||||||
end
|
end
|
||||||
homework_detail_manual.update_column('comment_status', 3)
|
homework_detail_manual.update_column('comment_status', 3)
|
||||||
# 匿评关闭消息邮件通知
|
# 匿评关闭消息通知 给所有人发
|
||||||
|
course = homework_common.course
|
||||||
|
course.members.each do |m|
|
||||||
|
homework_common.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => course.id, :viewed => false, :status => 3)
|
||||||
|
end
|
||||||
|
# 邮件通知
|
||||||
|
Mailer.send_mail_anonymous_comment_close(homework_common).deliver
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -153,6 +153,8 @@ $(function(){
|
||||||
language = 'C++';
|
language = 'C++';
|
||||||
}else if($('select.language_type').val() == 3){
|
}else if($('select.language_type').val() == 3){
|
||||||
language = 'Python';
|
language = 'Python';
|
||||||
|
}else if($('select.language_type').val() == 4){
|
||||||
|
language = 'Java';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (valid) {
|
if (valid) {
|
||||||
|
@ -199,8 +201,81 @@ $(function(){
|
||||||
program_name = 'text/x-c++src';
|
program_name = 'text/x-c++src';
|
||||||
}else if(language==3){
|
}else if(language==3){
|
||||||
program_name = 'text/x-cython';
|
program_name = 'text/x-cython';
|
||||||
|
} else if(language==4){
|
||||||
|
program_name = 'text/x-java';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($('#program-src').val().length<=0) {
|
||||||
|
var src = '';
|
||||||
|
if(language==4){
|
||||||
|
src = '\
|
||||||
|
import java.io.*;\n\
|
||||||
|
import java.util.*;\n\
|
||||||
|
\n\
|
||||||
|
//请一定不要修改类名\n\
|
||||||
|
class Main\n\
|
||||||
|
{\n\
|
||||||
|
public static void main (String args[])\n\
|
||||||
|
{\n\
|
||||||
|
//获取参数方式\n\
|
||||||
|
//Scanner in = new Scanner(System.in);\n\
|
||||||
|
//int a = in.nextInt();\n\
|
||||||
|
//int b = in.nextInt();\n\
|
||||||
|
\n\
|
||||||
|
//您的代码\n\
|
||||||
|
}\n\
|
||||||
|
}\n\
|
||||||
|
';
|
||||||
|
}
|
||||||
|
else if(language==1){
|
||||||
|
src = '#include <stdio.h>\n\
|
||||||
|
\n\
|
||||||
|
int main()\n\
|
||||||
|
{\n\
|
||||||
|
//获取参数方式 scanf\n\
|
||||||
|
//int x =0;\n\
|
||||||
|
//int y = 0;\n\
|
||||||
|
//scanf("%d", &x);\n\
|
||||||
|
\n\
|
||||||
|
//结果输出使用prinf\n\
|
||||||
|
//printf("%d",x);\n\
|
||||||
|
\n\
|
||||||
|
return 0;\n\
|
||||||
|
}\n\
|
||||||
|
';
|
||||||
|
} else if(language==2){
|
||||||
|
src = '\
|
||||||
|
#include <iostream>\n\
|
||||||
|
using namespace std;\n\
|
||||||
|
\n\
|
||||||
|
int main()\n\
|
||||||
|
{\n\
|
||||||
|
//获取参数方式 cin\n\
|
||||||
|
//int x =0;\n\
|
||||||
|
//cin >> x;\n\
|
||||||
|
\n\
|
||||||
|
//结果输出使用 cout\n\
|
||||||
|
//cout<<"1";\n\
|
||||||
|
\n\
|
||||||
|
return 0;\n\
|
||||||
|
}\n\
|
||||||
|
';
|
||||||
|
} else if(language==3){
|
||||||
|
src = '\
|
||||||
|
import sys \n\
|
||||||
|
\n\
|
||||||
|
#获取参数方式,使用raw_input\n\
|
||||||
|
#input = raw_input()\n\
|
||||||
|
#a, b = input.split()\n\
|
||||||
|
\n\
|
||||||
|
#结果输出使用 print \n\
|
||||||
|
#print (str(int(a)+int(b)))\n\
|
||||||
|
';
|
||||||
|
}
|
||||||
|
|
||||||
|
$('#program-src').val(src);
|
||||||
|
};
|
||||||
|
|
||||||
var editor = CodeMirror.fromTextArea(document.getElementById("program-src"), {
|
var editor = CodeMirror.fromTextArea(document.getElementById("program-src"), {
|
||||||
mode: {name: program_name,
|
mode: {name: program_name,
|
||||||
version: 2,
|
version: 2,
|
||||||
|
|
Loading…
Reference in New Issue