解决冲突

This commit is contained in:
txz 2016-04-21 10:41:54 +08:00
commit 39c64c9198
34 changed files with 456 additions and 378 deletions

View File

@ -595,11 +595,33 @@ class AdminController < ApplicationController
#代码测试列表 #代码测试列表
def code_work_tests def code_work_tests
@code_work_tests = StudentWorkTest.find_by_sql("select status,results,created_at, student_work_id from student_work_tests order by id desc ") #求出所有条数
#@code_work_tests = StudentWorkTest.find_by_sql("select a.status,a.results,a.created_at ,b.id as homeworkid,d.language from student_work_tests as a , homework_commons as b ,student_works as c, homework_detail_programings as d where a.student_work_id = c.id and b.id = c.homework_common_id and c.homework_common_id = d.homework_common_id order by a.id desc ") tCount = CodeTests.count()
#@code_work_tests = StudentWorkTest.order('created_at desc')
#设置个空的数组 以便paginateHelper来分页
@code_work_tests = []
if tCount >= 1
@code_work_tests[tCount-1] = {}
end
@code_work_tests = paginateHelper @code_work_tests,30 @code_work_tests = paginateHelper @code_work_tests,30
@page = (params['page'] || 1).to_i - 1 @page = (params['page'] || 1).to_i - 1
#取出需要的那一页数据
tStart = @page*30
@code_work_tests = CodeTests.find_by_sql("select * from code_tests order by id desc limit #{tStart},30 ")
#取出各个作业是否是模拟答题的
is_test = {}
@code_work_tests.each do |test|
if is_test[test['student_work_id']] != nil
test['is_test'] = is_test[test['student_work_id']]
else
test['is_test'] = StudentWork.find(test['student_work_id']).is_test
#test['is_test'] = CodeTests.find_by_sql("select is_test from student_works where id = #{test['student_work_id']}").first['is_test']
is_test[test['student_work_id']] = test['is_test']
end
end
respond_to do |format| respond_to do |format|
format.html format.html
end end

View File

@ -660,8 +660,8 @@ class AttachmentsController < ApplicationController
end end
def has_login def has_login
unless @attachment && @attachment.container_type == "Organization" unless (@attachment && @attachment.container_type == "Organization").nil?
unless @attachment && @attachment.container_type == "PhoneAppVersion" unless (@attachment && @attachment.container_type == "PhoneAppVersion").nil?
render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download) render_403 if !User.current.logged? && !(@attachment.container_type == 'OrgSubfield' && @attachment.container.organization.allow_guest_download) && !(@attachment.container_type == 'OrgDocumentComment' && @attachment.container.organization.allow_guest_download)
end end
end end

View File

@ -100,8 +100,17 @@ class StudentWorkController < ApplicationController
test = @homework.homework_tests[index - 1] test = @homework.homework_tests[index - 1]
#请求测试 #请求测试
result = test_realtime_ex(test, params[:src]) begin
result = test_realtime_ex(test, params[:src])
rescue Timeout::Error
tEndtime = Time.now
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
#status 0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>-3,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
end
if result["status"].to_i != -2 if result["status"].to_i != -2
#result["results"].first['output'] = result["results"].first['output'].gsub(" ","□") #result["results"].first['output'] = result["results"].first['output'].gsub(" ","□")
#result["results"].first['result'] = result["results"].first['result'].gsub(" ","□") #result["results"].first['result'] = result["results"].first['result'].gsub(" ","□")
@ -116,11 +125,19 @@ class StudentWorkController < ApplicationController
resultObj[:results] = result["results"].first #本次测试结果 resultObj[:results] = result["results"].first #本次测试结果
resultObj[:error_msg] = result["error_msg"] #编译错误时的信息 resultObj[:error_msg] = result["error_msg"] #编译错误时的信息
#该状态用于存入CodeTests
tmpstatus = -1
if result["status"].to_i == -2 #编译错误 if result["status"].to_i == -2 #编译错误
resultObj[:results] = result["error_msg"] resultObj[:results] = result["error_msg"]
resultObj[:status] = -2 resultObj[:status] = -2
tmpstatus = -2
elsif result["results"][0]["status"].to_i == 2 elsif result["results"][0]["status"].to_i == 2
resultObj[:status] = 2 resultObj[:status] = 2
tmpstatus = 2
end
if result["status"] == 0
tmpstatus = 0
end end
unless student_work.save unless student_work.save
@ -136,9 +153,6 @@ class StudentWorkController < ApplicationController
end end
#每次从数据库取出上次的结果加上本次的结果再存入数据库 #每次从数据库取出上次的结果加上本次的结果再存入数据库
tEndtime = Time.now
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
if result["status"].to_i != -2 if result["status"].to_i != -2
result["results"].first['user_wait'] = tUsedtime result["results"].first['user_wait'] = tUsedtime
@ -175,11 +189,19 @@ class StudentWorkController < ApplicationController
resultObj[:index] = student_work.student_work_tests.count resultObj[:index] = student_work.student_work_tests.count
end end
#将每次用户等待时间都存起来以便管理界面显示用
tEndtime = Time.now tEndtime = Time.now
tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000 tUsedtime = (tEndtime.to_i-tStarttime.to_i)*1000+(tEndtime.usec - tStarttime.usec)/1000
logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒" logger.debug "program_test_ex user wait time = #{tUsedtime} 毫秒"
time_used = 0
if result["status"].to_i != -2
#至少一毫秒
time_used = result["results"].first['time_used'] == 0 ? 1:result["results"].first['time_used']
end
#0:答案正确 -3http超时 -2:编译错误 -1:答案错误 2:程序运行超时
CodeTests.create(:homework_id=>@homework.id,:language=>@homework.homework_detail_programing.language,:status=>tmpstatus,:time_used=>time_used,:wait_time=>tUsedtime,:student_work_id=>student_work.id)
#渲染返回结果 #渲染返回结果
render :json => resultObj render :json => resultObj
end end
@ -223,6 +245,7 @@ class StudentWorkController < ApplicationController
JSON.parse(res.body) JSON.parse(res.body)
end end
#点击代码查重按钮
def work_canrepeat def work_canrepeat
@homework_id = params[:homework] @homework_id = params[:homework]
@course_id = params[:course_id] @course_id = params[:course_id]
@ -280,13 +303,14 @@ class StudentWorkController < ApplicationController
render :json => resultObj render :json => resultObj
end end
#上次代码查重时间
def last_codecomparetime def last_codecomparetime
resultObj = {status: 0} resultObj = {status: 0}
@homework = HomeworkCommon.find params[:homework] @homework = HomeworkCommon.find params[:homework]
#转换一下 #转换一下
if @homework.simi_time != nil if @homework.simi_time != nil
resultObj[:comparetime] = Time.parse(@homework.simi_time.to_s).strftime("%Y-%m-%d %H:%M") resultObj[:comparetime] = Time.parse(@homework.simi_time.to_s).strftime("%Y-%m-%d %H:%M:%S")
else else
resultObj[:comparetime] = 0 resultObj[:comparetime] = 0
end end
@ -1277,7 +1301,6 @@ class StudentWorkController < ApplicationController
request["Content-Type"] = "application/json" request["Content-Type"] = "application/json"
client.request(request) client.request(request)
end end
JSON.parse(res.body) JSON.parse(res.body)
end end

View File

@ -120,59 +120,52 @@ module ApplicationHelper
case type case type
when "HomeworkCommon" when "HomeworkCommon"
if course_contributor_score.nil? if course_contributor_score.nil?
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0, CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :homework_journal_num => 1)
:news_reply_num => 0, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0, :homework_journal_num => 1)
else else
score = course_contributor_score.homework_journal_num + 1 score = course_contributor_score.homework_journal_num.to_i + 1
course_contributor_score.update_attributes(:homework_journal_num => score) course_contributor_score.update_attributes(:homework_journal_num => score)
end end
# 课程留言 # 课程留言
when "Course" when "Course"
if course_contributor_score.nil? if course_contributor_score.nil?
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0, CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :journal_num => 1)
:news_reply_num => 0, :resource_num => 0, :journal_num => 1, :journal_reply_num => 0)
else else
score = course_contributor_score.journal_num + 1 score = course_contributor_score.journal_num.to_i + 1
course_contributor_score.update_attributes(:journal_num => score) course_contributor_score.update_attributes(:journal_num => score)
end end
when "Message" when "Message"
if course_contributor_score.nil? if course_contributor_score.nil?
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 1, :message_reply_num => 0, CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 1)
:news_reply_num => 0, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0)
else else
score = course_contributor_score.message_num + 1 score = course_contributor_score.message_num.to_i + 1
course_contributor_score.update_attributes(:message_num => score) course_contributor_score.update_attributes(:message_num => score)
end end
when "MessageReply" when "MessageReply"
if course_contributor_score.nil? if course_contributor_score.nil?
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 1, CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_reply_num => 1)
:news_reply_num => 0, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0)
else else
score = course_contributor_score.message_reply_num + 1 score = course_contributor_score.message_reply_num.to_i + 1
course_contributor_score.update_attributes(:message_reply_num => score) course_contributor_score.update_attributes(:message_reply_num => score)
end end
when "NewReply" when "NewReply"
if course_contributor_score.nil? if course_contributor_score.nil?
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0, CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :news_reply_num => 1)
:news_reply_num => 1, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0)
else else
score = course_contributor_score.news_reply_num + 1 score = course_contributor_score.news_reply_num.to_i + 1
course_contributor_score.update_attributes(:news_reply_num => score) course_contributor_score.update_attributes(:news_reply_num => score)
end end
when "News" when "News"
if course_contributor_score.nil? if course_contributor_score.nil?
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0, CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :news_num => 1)
:news_reply_num => 0, :news_num => 1, :resource_num => 0, :journal_num => 0, :journal_reply_num => 0)
else else
score = course_contributor_score.news_num + 1 score = course_contributor_score.news_num.to_i + 1
course_contributor_score.update_attributes(:news_num => score) course_contributor_score.update_attributes(:news_num => score)
end end
when "Attachment" when "Attachment"
if course_contributor_score.nil? if course_contributor_score.nil?
CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :message_num => 0, :message_reply_num => 0, CourseContributorScore.create(:course_id => course_id, :user_id => user_id, :resource_num => 1)
:news_reply_num => 0, :news_num => 0, :resource_num => 1, :journal_num => 0, :journal_reply_num => 0)
else else
score = course_contributor_score.resource_num + 1 score = course_contributor_score.resource_num.to_i + 1
course_contributor_score.update_attributes(:resource_num => score) course_contributor_score.update_attributes(:resource_num => score)
end end
end end
@ -184,38 +177,38 @@ module ApplicationHelper
case type case type
when "HomeworkCommon" when "HomeworkCommon"
unless course_contributor_score.nil? unless course_contributor_score.nil?
score = course_contributor_score.homework_journal_num - 1 score = course_contributor_score.homework_journal_num.to_i - 1
course_contributor_score.update_attribute(:homework_journal_num, score < 0 ? 0 : score) course_contributor_score.update_attribute(:homework_journal_num, score < 0 ? 0 : score)
end end
# 课程留言 # 课程留言
when "Course" when "Course"
unless course_contributor_score.nil? unless course_contributor_score.nil?
score = course_contributor_score.journal_num - 1 score = course_contributor_score.journal_num.to_i - 1
course_contributor_score.update_attribute(:journal_num, score < 0 ? 0 : score) course_contributor_score.update_attribute(:journal_num, score < 0 ? 0 : score)
end end
when "Message" when "Message"
unless course_contributor_score.nil? unless course_contributor_score.nil?
score = course_contributor_score.message_num - 1 score = course_contributor_score.message_num.to_i - 1
course_contributor_score.update_attribute(:message_num, score < 0 ? 0 : score) course_contributor_score.update_attribute(:message_num, score < 0 ? 0 : score)
end end
when "MessageReply" when "MessageReply"
unless course_contributor_score.nil? unless course_contributor_score.nil?
score = course_contributor_score.message_reply_num - 1 score = course_contributor_score.message_reply_num.to_i - 1
course_contributor_score.update_attribute(:message_reply_num, score < 0 ? 0 : score) course_contributor_score.update_attribute(:message_reply_num, score < 0 ? 0 : score)
end end
when "NewReply" when "NewReply"
unless course_contributor_score.nil? unless course_contributor_score.nil?
score = course_contributor_score.news_reply_num - 1 score = course_contributor_score.news_reply_num.to_i - 1
course_contributor_score.update_attribute(:news_reply_num, score < 0 ? 0 : score) course_contributor_score.update_attribute(:news_reply_num, score < 0 ? 0 : score)
end end
when "News" when "News"
unless course_contributor_score.nil? unless course_contributor_score.nil?
score = course_contributor_score.news_num - 1 score = course_contributor_score.news_num.to_i - 1
course_contributor_score.update_attribute(:news_num, score < 0 ? 0 : score) course_contributor_score.update_attribute(:news_num, score < 0 ? 0 : score)
end end
when "Attachment" when "Attachment"
unless course_contributor_score.nil? unless course_contributor_score.nil?
score = course_contributor_score.resource_num - 1 score = course_contributor_score.resource_num.to_i - 1
course_contributor_score.update_attribute(:resource_num, score < 0 ? 0 : score) course_contributor_score.update_attribute(:resource_num, score < 0 ? 0 : score)
end end
end end

3
app/models/code_tests.rb Normal file
View File

@ -0,0 +1,3 @@
class CodeTests < ActiveRecord::Base
attr_accessible :homework_id, :language, :status, :time_used, :wait_time, :student_work_id
end

View File

@ -80,12 +80,10 @@ class Message < ActiveRecord::Base
validates_length_of :subject, :maximum => 255 validates_length_of :subject, :maximum => 255
validate :cannot_reply_to_locked_topic, :on => :create validate :cannot_reply_to_locked_topic, :on => :create
after_create :add_author_as_watcher, :reset_counters!, :add_boards_count # after_create :add_author_as_watcher, :reset_counters!, :add_boards_count
after_update :update_messages_board, :update_activity after_update :update_messages_board, :update_activity
after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets, :decrease_boards_count, :down_course_score after_destroy :reset_counters!,:down_user_score,:delete_kindeditor_assets, :decrease_boards_count, :down_course_score
after_create :act_as_course_activity, :act_as_forge_activity, :act_as_student_score, act_as_at_message(:content, :author_id), :add_author_as_watcher, :reset_counters!, :add_boards_count
after_create :act_as_activity,:act_as_course_activity,:be_user_score,:act_as_forge_activity,
:act_as_system_message, :send_mail, :act_as_student_score, act_as_at_message(:content, :author_id)
#before_save :be_user_score #before_save :be_user_score
scope :visible, lambda {|*args| scope :visible, lambda {|*args|
@ -137,11 +135,11 @@ class Message < ActiveRecord::Base
if self.project && !project.project_score.nil? if self.project && !project.project_score.nil?
# 讨论区 # 讨论区
if self.parent_id.nil? if self.parent_id.nil?
count = self.project.project_score.board_num + 1 count = self.project.project_score.board_num.to_i + 1
self.project.project_score.update_attribute(:board_num, count) self.project.project_score.update_column(:board_num, count)
else # 回复 else # 回复
count = self.project.project_score.board_message_num + 1 count = self.project.project_score.board_message_num.to_i + 1
self.project.project_score.update_attribute(:board_message_num, count) self.project.project_score.update_column(:board_message_num, count)
end end
end end
end end

View File

@ -1,6 +1,6 @@
# encoding: utf-8 # encoding: utf-8
class StudentWorkTest < ActiveRecord::Base class StudentWorkTest < ActiveRecord::Base
attr_accessible :student_work_id, :results, :status, :src attr_accessible :student_work_id, :results, :status, :src, :uwait_time
belongs_to :student_work belongs_to :student_work
serialize :results, Array serialize :results, Array

View File

@ -10,51 +10,51 @@
<thead> <thead>
<tr> <tr>
<th style="width: 50px;"> <th style="width: 50px;">
作业id <span style="float:left; margin-left:20px;">作业id</span>
</th>
<th style="width: 50px;">
<span style="float:left; margin-left:20px;">作品id</span>
</th> </th>
<th style="width: 60px;"> <th style="width: 60px;">
平均等待时间 用户等待时间
</th> </th>
<th style="width: 50px;"> <th style="width: 50px;">
语言 <span style="float:left; margin-left:20px;">语言</span>
</th> </th>
<th style="width: 120px;"> <th style="width: 100px;">
提交测试时间 测试完成时间
</th>
<th style="width: 60px;">
<span style="float:left; margin-left:20px;">答题状态</span>
</th> </th>
<th style="width: 50px;"> <th style="width: 50px;">
答题状态 <span style="float:left; margin-left:20px;">耗时</span>
</th>
<th style="width: 50px;">
测试集数
</th>
<th style="width: 50px;">
最小耗时
</th>
<th style="width: 50px;">
最大耗时
</th> </th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<% @code_work_tests.each do |test| %> <% @code_work_tests.each do |test| %>
<% infos = StudentWorkTest.find_by_sql("select a.homework_common_id as homeworkid,b.language from student_works as a, homework_detail_programings as b where a.id = #{test.student_work_id} and a.homework_common_id = b.homework_common_id <% if test['homework_id'] != nil %>
").first %>
<% if infos != nil %>
<tr class="<%= cycle("odd", "even") %>"> <tr class="<%= cycle("odd", "even") %>">
<td style="text-align: center; " title='<%=infos.homeworkid%>'> <td style="text-align: center; " title='<%=test['homework_id']%>'>
<%=link_to(infos.homeworkid, student_work_index_path(:homework => infos.homeworkid))%> <%=link_to(test['homework_id'], student_work_index_path(:homework => test['homework_id']))%>
</td>
<td style="text-align: center; " title='<%=test['student_work_id']%>'>
<% if !test['is_test'] %>
<%=link_to(test['student_work_id'], student_work_index_path(:homework => test['homework_id'],:student_work_id=>test['student_work_id']))%>
<% else %>
<%=link_to(test['student_work_id'], new_user_commit_homework_users_path(homework_id: test['homework_id'], is_test: true))%>
<% end %>
</td> </td>
<td style="text-align: center;"> <td style="text-align: center;">
<% if test.status != -2 && test.results.first['user_wait'] %> <% if test.wait_time != 0 %>
<% wait_time = 0 %> <%=test.wait_time.to_s+"毫秒" %>
<% test.results.each do |result| wait_time = wait_time + result['user_wait'] end %>
<%=(wait_time/test.results.count).to_s+"毫秒" %>
<% else %> <% else %>
<%="未记录"%> <%="未记录"%>
<% end %> <% end %>
</td> </td>
<td align="center"> <td align="center">
<%=%W(C C++ Python Java).at(infos.language.to_i - 1)%> <%=%W(C C++ Python Java).at(test['language'].to_i - 1)%>
</td> </td>
<td align="center"> <td align="center">
<%=Time.parse(test.created_at.to_s).strftime("%Y-%m-%d %H:%M:%S")%> <%=Time.parse(test.created_at.to_s).strftime("%Y-%m-%d %H:%M:%S")%>
@ -64,26 +64,17 @@
<%= "答题正确" %> <%= "答题正确" %>
<% elsif test.status == -2 %> <% elsif test.status == -2 %>
<%= "编译错误" %> <%= "编译错误" %>
<% elsif test.status == 2 || test.results.last['status'] == 2 %> <% elsif test.status == 2 %>
<%= "超时" %> <%= "代码超时" %>
<% elsif test.status == -3 %>
<%= "请求超时" %>
<% else %> <% else %>
<%= "答题错误" %> <%= "答题错误" %>
<% end %> <% end %>
</td> </td>
<td class="center"> <td class="center">
<% if test.status != -2 %> <% if test.time_used > 0 %>
<%=test.results.count%> <%=test.time_used.to_s+"毫秒"%>
<% end %>
</td>
<td class="center">
<% if test.status != -2 %>
<%test.results = test.results.sort_by {|result| result['time_used'] }%>
<%=test.results.first['time_used'] == 0 ? "1毫秒":test.results.first['time_used'].to_s+"毫秒"%>
<% end %>
</td>
<td class="center">
<% if test.status != -2 %>
<%=test.results.last['time_used'] == 0 ? "1毫秒":test.results.last['time_used'].to_s+"毫秒"%>
<% end %> <% end %>
</td> </td>
</tr> </tr>

View File

@ -2,8 +2,8 @@
<h2 class="conbox-h2">查重结果</h2> <h2 class="conbox-h2">查重结果</h2>
<div class="chabox"> <div class="chabox">
<ul class="chabox-header"> <ul class="chabox-header">
<li class="chabox-w-500" style = "width:438px" >被查作品</li> <li class="chabox-w-500" style = "width:437px" >被查作品</li>
<li class="chabox-w-500" style = "width:560px" >疑被抄袭作品</li> <li class="chabox-w-500" style = "width:561px" >疑被抄袭作品</li>
<div class="cl"></div> <div class="cl"></div>
</ul> </ul>
<ul class="chabox-top"> <ul class="chabox-top">

View File

@ -43,8 +43,8 @@
</div> </div>
<div class="homepagePostSetting"> <div class="homepagePostSetting">
<ul> <ul>
<% if User.current.logged? %>
<li class="homepagePostSettingIcon"> <li class="homepagePostSettingIcon">
<% if User.current.logged? %>
<% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %> <% if (delete_allowed || User.current.id == file.author_id) && file.container_id == org_subfield.id && file.container_type == "OrgSubfield" %>
<ul class="homepagePostSettiongText"> <ul class="homepagePostSettiongText">
<li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li> <li><%= link_to("发&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
@ -66,8 +66,8 @@
<li><%= link_to("发&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li> <li><%= link_to("发&nbsp;&nbsp;送".html_safe, 'javascript:void(0)',:class => "postOptionLink2",:onclick=>"show_send('#{file.id}','#{User.current.id}','file')") %></li>
</ul> </ul>
<% end %> <% end %>
<% end %>
</li> </li>
<% end %>
</ul> </ul>
</div> </div>

View File

@ -69,7 +69,7 @@
<span class="width120"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["result"].force_encoding("UTF-8")%> </pre></span> <span class="width120"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["result"].force_encoding("UTF-8")%> </pre></span>
<span class="w60">正确输出:</span> <span class="w60">正确输出:</span>
<span class="width120"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["output"]%></pre></span> <span class="width120"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["output"].force_encoding("UTF-8")%></pre></span>
<span class="w50">耗时:</span> <span class="w50">耗时:</span>
<span class="w80"><pre><%=x["time_used"]==0?1:x["time_used"]%>毫秒</pre></span> <span class="w80"><pre><%=x["time_used"]==0?1:x["time_used"]%>毫秒</pre></span>
<div class="cl"></div> <div class="cl"></div>

View File

@ -14,14 +14,14 @@
<% end %> <% end %>
</span> </span>
<%if @is_teacher || @homework.homework_detail_manual.comment_status == 3 || @homework.is_open == 1%> <%if @is_teacher || @homework.homework_detail_manual.comment_status == 3 || @homework.is_open == 1%>
<div class="hworkSearchBox"> <div class="hworkSearchBox mr15">
<input type="text" id="course_student_name" value="<%= @name%>" placeholder="姓名、学号、邮箱" class="hworkSearchInput" onkeypress="SearchByName('<%= student_work_index_path(:homework => @homework.id)%>',event);"/> <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> <a class="hworkSearchIcon" id="search_in_student_work" onclick="SearchByName_1('<%= student_work_index_path(:homework => @homework.id)%>');" href="javascript:void(0)"></a>
</div> </div>
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit fl mr20"}) unless course_group_list(@course).empty? %>
<%if @homework.homework_type == 2 && @is_teacher %> <%if @homework.homework_type == 2 && @is_teacher %>
<%= link_to "代码查重", work_canrepeat_student_work_index_path(homework:@homework.id, course_id:@course.id), class: 'BlueCirBtn fr',:remote => true %> <%= link_to "代码查重", work_canrepeat_student_work_index_path(homework:@homework.id, course_id:@course.id), class: 'BlueCirBtn fl',:remote => true %>
<% end %> <% end %>
<%= select_tag(:student_work_in_group,options_for_select(course_group_list(@course),@group), {:class => "classSplit"}) unless course_group_list(@course).empty? %>
<% end%> <% end%>
<span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" style="display: none">[ 显示作业信息 ]</a> </span> <span class="fr c_grey"> <a href="javascript:void(0);" class="linkGrey2" id="homework_info_show" style="display: none">[ 显示作业信息 ]</a> </span>
</div> </div>
@ -50,8 +50,12 @@
<script type="text/javascript"> <script type="text/javascript">
$(function(){ $(function(){
<% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) %> <% if !@is_evaluation && (!@is_teacher || params[:show_work_id].present?) || @message_student_work_id %>
<% work= params[:show_work_id].nil? ? @homework.student_works.where("user_id = ?",User.current.id).first : StudentWork.find(params[:show_work_id]) %> <% if @message_student_work_id %>
<% work = @homework.student_works.where("id =?", @message_student_work_id).first %>
<% else %>
<% work= params[:show_work_id].nil? ? @homework.student_works.where("user_id = ?",User.current.id).first : StudentWork.find(params[:show_work_id]) %>
<% end %>
<% unless work.nil? %> <% unless work.nil? %>
<% if @homework.homework_type == 2 %> <% if @homework.homework_type == 2 %>
$("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>"); $("#about_hwork_<%= work.id%>").html("<%= escape_javascript(render :partial => 'programing_work_show',:locals => {:work =>work,:score =>student_work_score(work,User.current),:student_work_scores => work.student_works_scores.order("updated_at desc")}) %>");
@ -89,146 +93,5 @@
<% end %> <% end %>
<% end %> <% end %>
}); });
//代码查重
function code_repeat(){
var homework_id = <%=@homework.id%>;
var course_id = <%=@course.id%>;
console.log("course_id=",course_id);
console.log("homework_id=",homework_id);
if(<%= @stundet_works.count <=1 %>)
{
//弹框
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_2',:locals => {:des=>"对不起该作业的作品过少不能查重!",:status=>0, :homework=> @homework,:courseid=> @course.id})%>');
showModal('ajax-modal', '580px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 560px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
function closeModal(){
hideModal($(".blue-border-box"));
}
return;
}
//先请求下上次查询的时间
$.post(
'/student_work/last_codecomparetime',
{homework: homework_id},
function(data,status){
if (data.status == 0) {
var homework_simi_time = data.comparetime;
if (homework_simi_time == 0){
//没进行过代码查重则直接查重
test_repeat();
}
else{
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_1',:locals => {:homework=> @homework,:courseid=> @course.id })%>');
$('#compare-tips-1').html('您上次查重的时间为'+homework_simi_time);
showModal('ajax-modal', '580px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 560px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
console.log(homework_simi_time);
function closeModal(){
hideModal($(".blue-border-box"));
}
}
}
}
).fail(function(xhr, status){
// confirm("对不起,服务器繁忙请稍后再试!");
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_2',:locals => {:des=>"对不起,服务器繁忙请稍后再试!",:status=>0, :homework=> @homework,:courseid=> @course.id})%>');
showModal('ajax-modal', '580px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 560px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
function closeModal(){
hideModal($(".blue-border-box"));
}
return;
});
//请求查重
var test_repeat = function(){
$.post(
'/student_work/code_repeattest',
{homework: homework_id},
function(data,status){
console.log("result = ");
console.log(data);
if (data.status == 0) {
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_2',:locals => {:des=>"查重完成是否立即查看结果?",:status=>1, :homework=> @homework,:courseid=> @course.id})%>');
showModal('ajax-modal', '580px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 560px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
function closeModal(){
hideModal($(".blue-border-box"));
}
}
else if (data.status == -1){
// confirm("对不起只支持java/c/c++的代码查重!");
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_2',:locals => {:des=>"对不起目前只支持java/c/c++的代码查重!",:status=>0, :homework=> @homework,:courseid=> @course.id})%>');
showModal('ajax-modal', '580px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 560px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
function closeModal(){
hideModal($(".blue-border-box"));
}
}
else if (data.status == -2){
// confirm("对不起该作业的作品过少不能查重!");
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_2',:locals => {:des=>"对不起该作业的作品过少不能查重!",:status=>0, :homework=> @homework,:courseid=> @course.id})%>');
showModal('ajax-modal', '580px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 560px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
function closeModal(){
hideModal($(".blue-border-box"));
}
}
return;
}
).fail(function(xhr, status){
// confirm("对不起,服务器繁忙请稍后再试!");
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_2',:locals => {:des=>"对不起,服务器繁忙请稍后再试!",:status=>0, :homework=> @homework,:courseid=> @course.id})%>');
showModal('ajax-modal', '580px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 560px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
function closeModal(){
hideModal($(".blue-border-box"));
}
return;
});
};
}
</script> </script>

View File

@ -81,7 +81,7 @@
test_repeat(); test_repeat();
<% else%> <% else%>
$("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_1',:locals => {:homework=> @homework,:courseid=>@course_id })%>'); $("#ajax-modal").html('<%= escape_javascript( render :partial => 'courses/compare_code_tips_1',:locals => {:homework=> @homework,:courseid=>@course_id })%>');
$('#compare-tips-1').html('您上次查重的时间为<%= Time.parse(@homework.simi_time.to_s).strftime("%Y-%m-%d %H-%M-%S")%>'); $('#compare-tips-1').html('您上次查重的时间为<%= Time.parse(@homework.simi_time.to_s).strftime("%Y-%m-%d %H:%M:%S")%>');
showModal('ajax-modal', '580px'); showModal('ajax-modal', '580px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 565px; margin-top:-10px;' class='resourceClose'></a>"); $('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 565px; margin-top:-10px;' class='resourceClose'></a>");

View File

@ -143,9 +143,9 @@
<span class="w60 c_red">测试错误!</span> <span class="w60 c_red">测试错误!</span>
<% end %> <% end %>
<span class="w60">您的输出:</span> <span class="w60">您的输出:</span>
<span class="w180"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["result"]%> </pre></span> <span class="w180"><pre style="white-space: pre-wrap; margin-right: 15px;"><%=x["result"].force_encoding("UTF-8")%> </pre></span>
<span class="w60">正确输出:</span> <span class="w60">正确输出:</span>
<span class="w180"><pre style="white-space: pre-wrap; margin-right: 15px;"><%= x["output"] %></pre></span> <span class="w180"><pre style="white-space: pre-wrap; margin-right: 15px;"><%= x["output"].force_encoding("UTF-8") %></pre></span>
<span class="w50"> 耗时:</span> <span class="w50"> 耗时:</span>
<span class="w80"><pre><%=x["time_used"]==0?1:x["time_used"]%>毫秒</pre></span> <span class="w80"><pre><%=x["time_used"]==0?1:x["time_used"]%>毫秒</pre></span>

View File

@ -0,0 +1,11 @@
class DeleteOtherWorks < ActiveRecord::Migration
def up
works = StudentWork.where("homework_common_id = 3253 and user_id = 10740 and final_score = 0")
unless works.empty?
works.destroy_all
end
end
def down
end
end

View File

@ -0,0 +1,13 @@
class CreateCodeTests < ActiveRecord::Migration
def change
create_table :code_tests do |t|
t.integer :homework_id
t.integer :wait_time, default: 0
t.integer :language
t.integer :status
t.integer :time_used, default: 0
t.timestamps
end
end
end

View File

@ -0,0 +1,5 @@
class AddStudentWorkIdToCodeTests < ActiveRecord::Migration
def change
add_column :code_tests, :student_work_id, :integer,:default=>0
end
end

View File

@ -11,7 +11,11 @@
# #
# It's strongly recommended to check this file into your version control system. # It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20160408074854) do
ActiveRecord::Schema.define(:version => 20160405021915) do
ActiveRecord::Schema.define(:version => 20160419074016) do
create_table "activities", :force => true do |t| create_table "activities", :force => true do |t|
t.integer "act_id", :null => false t.integer "act_id", :null => false
@ -334,6 +338,17 @@ ActiveRecord::Schema.define(:version => 20160408074854) do
t.boolean "diff_all" t.boolean "diff_all"
end end
create_table "code_tests", :force => true do |t|
t.integer "homework_id"
t.integer "wait_time", :default => 0
t.integer "language"
t.integer "status"
t.integer "time_used", :default => 0
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "student_work_id", :default => 0
end
create_table "comments", :force => true do |t| create_table "comments", :force => true do |t|
t.string "commented_type", :limit => 30, :default => "", :null => false t.string "commented_type", :limit => 30, :default => "", :null => false
t.integer "commented_id", :default => 0, :null => false t.integer "commented_id", :default => 0, :null => false
@ -809,6 +824,7 @@ ActiveRecord::Schema.define(:version => 20160408074854) do
t.integer "anonymous_comment", :default => 0 t.integer "anonymous_comment", :default => 0
t.integer "quotes", :default => 0 t.integer "quotes", :default => 0
t.integer "is_open", :default => 0 t.integer "is_open", :default => 0
t.datetime "simi_time"
end end
add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id"
@ -1520,6 +1536,18 @@ ActiveRecord::Schema.define(:version => 20160408074854) do
t.string "topic_resource" t.string "topic_resource"
end end
create_table "rep_statics", :force => true do |t|
t.integer "project_id"
t.integer "commits_num"
t.string "uname"
t.string "email"
t.integer "add"
t.integer "del"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "changeset"
end
create_table "repositories", :force => true do |t| create_table "repositories", :force => true do |t|
t.integer "project_id", :default => 0, :null => false t.integer "project_id", :default => 0, :null => false
t.string "url", :default => "", :null => false t.string "url", :default => "", :null => false
@ -1667,6 +1695,7 @@ ActiveRecord::Schema.define(:version => 20160408074854) do
t.integer "status", :default => 9 t.integer "status", :default => 9
t.text "results" t.text "results"
t.text "src" t.text "src"
t.integer "uwait_time", :default => 0
end end
create_table "student_works", :force => true do |t| create_table "student_works", :force => true do |t|
@ -1685,6 +1714,8 @@ ActiveRecord::Schema.define(:version => 20160408074854) do
t.integer "absence_penalty", :default => 0 t.integer "absence_penalty", :default => 0
t.float "system_score", :default => 0.0 t.float "system_score", :default => 0.0
t.boolean "is_test", :default => false t.boolean "is_test", :default => false
t.integer "simi_id"
t.integer "simi_value"
end end
add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id" add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"

38
lib/tasks/sync_files.rake Normal file
View File

@ -0,0 +1,38 @@
require 'trustie/gitlab/sync'
namespace :trustie do
namespace :files do
desc "sync course'file"
task :course => :environment do
# Course.all.each do |course|
# unless course.attachments.count.to_i == 0
# attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{course.id} and container_type ='Course'").count
# project_score = ProjectScore.where("project_id=?", project.id).first
# if project_score.nil?
# ProjectScore.create(:project_id => project.id, :attach_num => 0)
# else
# project_score.attach_num = attachment_count
# project_score.save
# end
# end
# end
end
desc "sync project'file"
task :project => :environment do
Project.all.each do |project|
unless project.attachments.count.to_i == 0
attachment_count = Attachment.find_by_sql("SELECT * FROM `attachments` where container_id = #{project.id} and container_type ='Project'").count
project_score = ProjectScore.where("project_id=?", project.id).first
if project_score.nil?
ProjectScore.create(:project_id => project.id, :attach_num => 0)
else
project_score.attach_num = attachment_count
project_score.save
end
end
end
end
end
end

View File

@ -14,6 +14,57 @@
<script src="/javascripts/wechat/react.js"></script> <script src="/javascripts/wechat/react.js"></script>
<script src="/javascripts/wechat/JSXTransformer.js"></script> <script src="/javascripts/wechat/JSXTransformer.js"></script>
<script src="/javascripts/wechat/ReactRouter.js"></script> <script src="/javascripts/wechat/ReactRouter.js"></script>
<script> //
var _PageHeight = document.documentElement.clientHeight,
_PageWidth = document.documentElement.clientWidth;
//计算loading框距离顶部和左部的距离loading框的宽度为215px高度为61px
var _LoadingTop = _PageHeight > 61 ? (_PageHeight - 61) / 2 : 0,
_LoadingLeft = _PageWidth > 215 ? (_PageWidth - 215) / 2 : 0;
//在页面未加载完毕之前显示的loading Html自定义内容
var _LoadingHtml = '<div id="loadingDiv" style="position:absolute;left:0;width:100%;height:' + _PageHeight + 'px;top:0;background:#f3f8ff;opacity:0.8;filter:alpha(opacity=80);z-index:10000;"><div style="position: absolute; cursor1: wait; left: ' + _LoadingLeft + 'px; top:' + _LoadingTop + 'px; width: auto; height: 57px; line-height: 57px; padding-left: 50px; padding-right: 5px; background: #fff url(/Content/loading.gif) no-repeat scroll 5px 10px; border: 2px solid #95B8E7; color: #696969; font-family:\'Microsoft YaHei\';">页面加载中,请等待...</div></div>';
//呈现loading效果
document.write(_LoadingHtml);
//window.onload = function () {
// var loadingMask = document.getElementById('loadingDiv');
// loadingMask.parentNode.removeChild(loadingMask);
//};
//监听加载状态改变
document.onreadystatechange = completeLoading;
//加载状态为complete时移除loading效果
function completeLoading() {
if (document.readyState == "complete") {
var loadingMask = document.getElementById('loadingDiv');
loadingMask.parentNode.removeChild(loadingMask);
}
}</script>
</head> </head>
<body> <body>
<div id="container"></div> <div id="container"></div>

View File

@ -7,29 +7,32 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-title hidden mb5">
<div class="post-title hidden"> <a herf="javascript:void(0);">
<a herf="javascript:void(0);" class="mr10">
<span ng-if="act.author.realname != ' '">{{act.author.realname}}</span> <span ng-if="act.author.realname != ' '">{{act.author.realname}}</span>
<span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span> <span ng-if="act.author.realname == ' '">{{act.author.nickname}}</span>
</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div> </a></div>
<div class="post-title hidden">
<a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-content c-grey2 mt10"> <div class="post-title mt5 hidden"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey2">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> 匿评开启时间:{{act.homework_common_detail.evaluation_start}}<br /> <span class="mr15">迟交扣分:{{act.homework_common_detail.late_penalty}}分</span> 匿评开启时间:{{act.homework_common_detail.evaluation_start}}<br />
<span class="mr15">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> 匿评关闭时间:{{act.homework_common_detail.evaluation_end}} <span class="mr15">缺评扣分:{{act.homework_common_detail.absence_penalty}}分/作品</span> 匿评关闭时间:{{act.homework_common_detail.evaluation_end}}
</div> </div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis underline" text-auto-height>点击展开</a> <a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{act.latest_update}}</span> <span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
<span class="c-grey f12 fl">{{act.latest_update}}</span>
<a href="javascript:void(0);" ng-if="!act.reply_count" ng-href="#/homework/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a href="javascript:void(0);" ng-if="act.reply_count" ng-href="#/homework/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" ng-href="#/homework/{{act.act_id}}" class="c-grey">回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2" ng-if="!act.has_praise" ng-click="addPraise(act);">赞 ({{act.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="act.has_praise" ng-click="decreasePraise(act);">已赞 ({{act.praise_count}})</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -38,23 +41,25 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div> <div class="post-title hidden"><a herf="javascript:void(0);" class="f13 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-title hidden mt5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey2 mt10"> <div class="post-content c-grey2 mt10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div> </div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis underline" text-auto-height>点击展开</a> <a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{act.latest_update}}</span> <span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a href="javascript:void(0);" ng-if="!act.reply_count" ng-href="#/course_notice/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a href="javascript:void(0);" ng-if="act.reply_count" ng-href="#/course_notice/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" ng-href="#/course_notice/{{act.act_id}}" class="c-grey">回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2" ng-if="!act.has_praise" ng-click="addPraise(act);">赞 ({{act.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="act.has_praise" ng-click="decreasePraise(act);">已赞 ({{act.praise_count}})</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -63,23 +68,25 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-title hidden mb5"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a></div>
<div class="post-title fl mb10 hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div> <div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-title hidden mt5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey2 mt10"> <div class="post-content c-grey2 mt10">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div> </div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis underline" text-auto-height>点击展开</a> <a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{act.latest_update}}</span> <span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a href="javascript:void(0);" ng-if="!act.reply_count" ng-href="#/course_discussion/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a href="javascript:void(0);" ng-if="act.reply_count" ng-href="#/course_discussion/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" ng-href="#/course_discussion/{{act.act_id}}" class="c-grey">回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2" ng-if="!act.has_praise" ng-click="addPraise(act);">赞 ({{act.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="act.has_praise" ng-click="decreasePraise(act);">已赞 ({{act.praise_count}})</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -89,7 +96,7 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}}</span></div> <div class="post-title hidden mb5"><span class="c-grey3 f13 fb mr10">{{act.author.realname}}</span>创建了<span class="c-grey3 f13 fb ml10">{{act.course_project_name}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.latest_update}}</a></div> <div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.latest_update}}</a></div>
<div class="cl"></div> <div class="cl"></div>
@ -104,25 +111,27 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div> <div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-content c-grey2 mt10"> <div class="post-title hidden mt5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey2">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
<span class="mr15">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15">优先级:{{act.issue_detail.issue_priority}}</span> <br /> <span class="mr15">状态:{{act.issue_detail.issue_status}}</span> <span class="mr15">优先级:{{act.issue_detail.issue_priority}}</span> <br />
<span class="mr15">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15">完成度:{{act.issue_detail.done_ratio}}%</span> <span class="mr15">指派给:{{act.issue_detail.issue_assigned_to}}</span> <span class="mr15">完成度:{{act.issue_detail.done_ratio}}%</span>
</div> </div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis underline" text-auto-height>点击展开</a> <a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{act.latest_update}}</span> <span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a href="javascript:void(0);" ng-if="!act.reply_count" ng-href="#/issues/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a href="javascript:void(0);" ng-if="act.reply_count" ng-href="#/issues/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" ng-href="#/issues/{{act.act_id}}" class="c-grey"> 回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2" ng-if="!act.has_praise" ng-click="addPraise(act);">赞 ({{act.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="act.has_praise" ng-click="decreasePraise(act);">已赞 ({{act.praise_count}})</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -132,23 +141,25 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a>to<a herf="javascript:void(0);" class="ml10">{{act.course_project_name}}&nbsp;&nbsp;|&nbsp;&nbsp;{{act.activity_type_name}}</a></div> <div class="post-title hidden"><a herf="javascript:void(0);" class="f12 c-grey2">{{act.course_project_name}}</a></div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-content c-grey2 mt10"> <div class="post-title hidden mt5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey2">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div> </div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis underline" text-auto-height>点击展开</a> <a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{act.latest_update}}</span> <span class="c-grey f12 fl mr15">{{act.activity_type_name}}</span>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a href="javascript:void(0);" ng-if="!act.reply_count" ng-href="#/project_discussion/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a href="javascript:void(0);" ng-if="act.reply_count" ng-href="#/project_discussion/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" ng-href="#/project_discussion/{{act.act_id}}" class="c-grey"> 回复 ({{act.reply_count}}) </a></div>
<div class="post-interactive-column c-grey2" ng-if="!act.has_praise" ng-click="addPraise(act);">赞 ({{act.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="act.has_praise" ng-click="decreasePraise(act);">已赞 ({{act.praise_count}})</div>
</div>
</div> </div>
</div> </div>
</div> </div>
@ -157,7 +168,7 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.author.realname}}</span>创建了<span class="c-grey3 f15 fb">{{act.course_project_name}}</span></div> <div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.author.realname}}</span>创建了<span class="c-grey3 f15 fb">{{act.course_project_name}}</span></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.latest_update}}</a></div> <div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.latest_update}}</a></div>
<div class="cl"></div> <div class="cl"></div>
@ -172,20 +183,23 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title mb5 hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a> <span style="vertical-align:top;">给您留言了</span></div> <div class="post-title mb5 hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a></div>
<div class="post-title hidden">{{act.latest_update}}</div> <div class="post-title hidden"><span class="f12 c-grey">留言</span></div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-content c-grey2 mt10"> <div class="cl"></div>
<div class="post-content c-grey2 mt5">
<p class="post-all-content" ng-bind-html="act.description|safeHtml"></p> <p class="post-all-content" ng-bind-html="act.description|safeHtml"></p>
</div> </div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis underline" text-auto-height>点击展开</a> <a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div>
<span class="c-grey f13 fl">{{act.latest_update}}</span>
<a href="javascript:void(0);" ng-if="!act.reply_count" ng-href="#/journal_for_message/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a href="javascript:void(0);" ng-if="act.reply_count" ng-href="#/journal_for_message/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<div class="cl"></div> <div class="cl"></div>
</div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" ng-href="#/journal_for_message/{{act.act_id}}" class="c-grey"> 回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2" ng-if="!act.has_praise" ng-click="addPraise(act);">赞 ({{act.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="act.has_praise" ng-click="decreasePraise(act);">已赞 ({{act.praise_count}})</div>
</div> </div>
</div> </div>
</div> </div>
@ -196,23 +210,24 @@
<div class="post-container"> <div class="post-container">
<div class="post-wrapper"> <div class="post-wrapper">
<div class="post-main"> <div class="post-main">
<div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="45" height="45" class="border-radius" /></div> <div class="post-avatar fl"><img ng-src="{{replaceUrl(act.author.img_url)}}" width="40" height="40" class="border-radius" /></div>
<div class="post-title hidden mb5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div> <div class="post-title hidden mb5"><a herf="javascript:void(0);">{{act.author.realname}}</a></div>
<div class="post-title hidden"><a herf="javascript:void(0);" class="mr10">{{act.author.realname}}</a>发表博客</div> <div class="post-title hidden"><span class="f12 c-grey">博客</span></div>
<div class="cl"></div> <div class="cl"></div>
<div class="post-content c-grey2 mt10"> <div class="post-title hidden mt5"><span class="c-grey3 f15 fb">{{act.subject|safeHtml}}</span></div>
<div class="post-content c-grey2">
<div class="post-all-content" ng-bind-html="act.description|safeHtml"></div> <div class="post-all-content" ng-bind-html="act.description|safeHtml"></div>
</div> </div>
<a herf="javascript:void(0);" class="link-blue f13 fl mt5 post-more undis underline" text-auto-height>点击展开</a> <a herf="javascript:void(0);" class="c-grey2 f13 fr mt5 mb10 post-more undis" text-auto-height>点击展开</a>
<div class="cl"></div> <div class="cl"></div>
<span class="c-grey f13 mt10 fl">{{act.latest_update}}</span> <span class="c-grey f13 fl">{{act.latest_update}}</span>
<a href="javascript:void(0);" ng-if="!act.reply_count" ng-href="#/blog_comment/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span></a>
<a href="javascript:void(0);" ng-if="act.reply_count" ng-href="#/blog_comment/{{act.act_id}}" class="c-grey2 fr f12 w36"><span class="reply-icon"></span>{{act.reply_count}}</a>
<div class="c-grey fr f12 mr15 w36" ng-if="!act.praise_count" ng-click="addPraise(act);"><span class="praise-icon"></span></div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.praise_count && !act.has_praise" ng-click="addPraise(act);"><span class="praise-icon"></span>{{act.praise_count}}</div>
<div class="c-grey fr f12 mr15 w36" ng-if="act.has_praise" ng-click="decreasePraise(act);"><span class="praised-icon"></span>{{act.praise_count}}</div>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive">
<div class="post-interactive-column c-grey2"><a href="javascript:void(0);" ng-href="#/blog_comment/{{act.act_id}}" class="c-grey"> 回复 ({{act.reply_count}})</a></div>
<div class="post-interactive-column c-grey2" ng-if="!act.has_praise" ng-click="addPraise(act);">赞 ({{act.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="act.has_praise" ng-click="decreasePraise(act);">已赞 ({{act.praise_count}})</div>
</div>
</div> </div>
</div> </div>
</div> </div>

View File

@ -14,9 +14,9 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom"> <div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">({{blog.comment_count}})</span></div> <div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{blog.comment_count}})</span></div>
<div class="post-interactive-column c-grey2" ng-if="blog.has_praise" ng-click="decreasePraise(blog);">已赞 ({{blog.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="blog.has_praise" ng-click="decreasePraise(blog);">已赞 ({{blog.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="!blog.has_praise" ng-click="addPraise(blog);">赞 ({{blog.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="!blog.has_praise" ng-click="addPraise(blog);">赞 ({{blog.praise_count}})</div>
</div> </div>
<div id="all_blog_reply"> <div id="all_blog_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in blog.blog_comment_children"> <div class="post-reply-wrap border-bottom" ng-repeat="journal in blog.blog_comment_children">

View File

@ -20,9 +20,9 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom"> <div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">({{discussion.replies_count}})</span></div> <div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{discussion.replies_count}})</span></div>
<div class="post-interactive-column c-grey2" ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);">已赞 ({{discussion.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);">已赞 ({{discussion.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="!discussion.has_praise" ng-click="addPraise(discussion);">赞 ({{discussion.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="!discussion.has_praise" ng-click="addPraise(discussion);">赞 ({{discussion.praise_count}})</div>
</div> </div>
<div id="all_course_message_reply"> <div id="all_course_message_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in discussion.message_children"> <div class="post-reply-wrap border-bottom" ng-repeat="journal in discussion.message_children">

View File

@ -20,9 +20,9 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom"> <div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">({{news.comments_count}})</span></div> <div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{news.comments_count}})</span></div>
<div class="post-interactive-column c-grey2" ng-if="news.has_praise" ng-click="decreasePraise(news);">已赞 ({{news.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="news.has_praise" ng-click="decreasePraise(news);">已赞 ({{news.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="!news.has_praise" ng-click="addPraise(news);">赞 ({{news.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="!news.has_praise" ng-click="addPraise(news);">赞 ({{news.praise_count}})</div>
</div> </div>
<div id="all_news_reply"> <div id="all_news_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="comments in news.comments"> <div class="post-reply-wrap border-bottom" ng-repeat="comments in news.comments">

View File

@ -26,9 +26,9 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom"> <div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">({{homework.whomework_journal_count}})</span></div> <div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{homework.whomework_journal_count}})</span></div>
<div class="post-interactive-column c-grey2" ng-if="homework.has_praise" ng-click="decreasePraise(homework);">已赞 ({{homework.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="homework.has_praise" ng-click="decreasePraise(homework);">已赞 ({{homework.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="!homework.has_praise" ng-click="addPraise(homework);">赞 ({{homework.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="!homework.has_praise" ng-click="addPraise(homework);">赞 ({{homework.praise_count}})</div>
</div> </div>
<div id="all_homework_reply"> <div id="all_homework_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in homework.journals_for_messages"> <div class="post-reply-wrap border-bottom" ng-repeat="journal in homework.journals_for_messages">

View File

@ -24,9 +24,9 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom"> <div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">({{issue.journals_count}})</span></div> <div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{issue.journals_count}})</span></div>
<div class="post-interactive-column c-grey2" ng-if="issue.has_praise" ng-click="decreasePraise(issue);">已赞 ({{issue.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="issue.has_praise" ng-click="decreasePraise(issue);">已赞 ({{issue.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="!issue.has_praise" ng-click="addPraise(issue);">赞 ({{issue.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="!issue.has_praise" ng-click="addPraise(issue);">赞 ({{issue.praise_count}})</div>
</div> </div>
<div id="all_issue_reply"> <div id="all_issue_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in issue.issue_journals"> <div class="post-reply-wrap border-bottom" ng-repeat="journal in issue.issue_journals">

View File

@ -11,9 +11,9 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom"> <div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">({{message.reply_count}})</span></div> <div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{message.reply_count}})</span></div>
<div class="post-interactive-column c-grey2" ng-if="message.has_praise" ng-click="decreasePraise(message);">已赞 ({{message.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="message.has_praise" ng-click="decreasePraise(message);">已赞 ({{message.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="!message.has_praise" ng-click="addPraise(message);">赞 ({{message.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="!message.has_praise" ng-click="addPraise(message);">赞 ({{message.praise_count}})</div>
</div> </div>
<div id="all_message_reply"> <div id="all_message_reply">

View File

@ -20,9 +20,9 @@
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<div class="post-interactive border-bottom"> <div class="post-interactive border-bottom">
<div class="post-interactive-reply c-grey2">回复 <span class="reply-num">({{discussion.replies_count}})</span></div> <div class="post-interactive-reply c-grey">回复 <span class="reply-num">({{discussion.replies_count}})</span></div>
<div class="post-interactive-column c-grey2" ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);">已赞 ({{discussion.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="discussion.has_praise" ng-click="decreasePraise(discussion);">已赞 ({{discussion.praise_count}})</div>
<div class="post-interactive-column c-grey2" ng-if="!discussion.has_praise" ng-click="addPraise(discussion);">赞 ({{discussion.praise_count}})</div> <div class="post-interactive-column c-grey" ng-if="!discussion.has_praise" ng-click="addPraise(discussion);">赞 ({{discussion.praise_count}})</div>
</div> </div>
<div id="all_course_message_reply"> <div id="all_course_message_reply">
<div class="post-reply-wrap border-bottom" ng-repeat="journal in discussion.message_children"> <div class="post-reply-wrap border-bottom" ng-repeat="journal in discussion.message_children">

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -2848,28 +2848,3 @@ img.school_avatar {
.admin_message_warn{font-size: 12px;color: red;} .admin_message_warn{font-size: 12px;color: red;}
a.btn_message_free{ background:#15BCCF; display:block; text-align:center; color:#fff; padding:3px 0; width:60px; margin-bottom:10px;margin-left: 58px;} a.btn_message_free{ background:#15BCCF; display:block; text-align:center; color:#fff; padding:3px 0; width:60px; margin-bottom:10px;margin-left: 58px;}
/*20160401袁可------------------ 查重结果样式*/
.conbox{ width:1000px; margin:0 auto; border:3px solid #f0f0f0; background:#fff;}
.conbox-h2{ font-size:16px; padding:10px 0; padding-left:25px;}
.chabox{ width:1000px;}
.chabox ul li{ float:left; width:82px; text-align:center; display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.chabox ul li.chabox-w-401{ width:151px; display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.chabox ul li.chabox-r-line{ border-right:1px solid #D1D1D1;}
.chabox-top{ width:1000px; }
.chabox-top li{ font-size:14px; font-weight:bold; line-height:40px; height:40px; background:#E4E4E4; color:#000;}
.chabox-con li{font-size:12px; line-height:35px; height:35px; color:#888; border-bottom:1px solid #DFDFDF;}
a.cha-btn{ display:block; width:50px; height:20px; line-height:20px; margin:0 auto; border:1px solid #269ac9; color:#269ac9;-webkit-border-radius: 3px;border-radius:3px; margin-top:8px;}
a:hover.cha-btn{ background:#269ac9; color:#fff;}
.chabox-header li{ font-size:14px; font-weight:bold; line-height:40px; height:40px; border-top:1px solid #E4E4E4; border-right:1px solid #E4E4E4; color:#000;}
.chabox ul li.chabox-w-500{ width:499px;}
.chabox ul li.chabox-w-40{ width:39px; border-right:1px solid #D1D1D1;}
.chabox ul li.chabox-txt-left{ text-align:left;text-indent:1em; }
.contrast-box{ width:1200px;box-shadow: 0 0 5px #6B6B6B; background:#fff; margin:0 auto; }
.contrast-con{ width:599px; border-right:1px solid #D1D1D1; float:left;}
.contrast-con h3{font-size:14px; font-weight:bold; line-height:40px; height:40px; background:#E4E4E4; color:#000; text-align:center; display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.contrast-txt{ padding:10px;}
.showCodeC{ width:580px; float:left;}
.resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000;}

View File

@ -1452,3 +1452,28 @@ ul.contest-notification-list li span{
color: #136b3b !important; color: #136b3b !important;
font-weight:normal !important; font-weight:normal !important;
} }
/*20160401袁可------------------ 查重结果样式*/
.conbox{ width:1000px; margin:0 auto; border:3px solid #f0f0f0; background:#fff;}
.conbox-h2{ font-size:16px; padding:10px 0; padding-left:25px;}
.chabox{ width:1000px;}
.chabox ul li{ float:left; width:82px; text-align:center; display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.chabox ul li.chabox-w-401{ width:151px; display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.chabox ul li.chabox-r-line{ border-right:1px solid #D1D1D1;}
.chabox-top{ width:1000px; }
.chabox-top li{ font-size:14px; font-weight:bold; line-height:40px; height:40px; background:#E4E4E4; color:#000;}
.chabox-con li{font-size:12px; line-height:35px; height:35px; color:#888; border-bottom:1px solid #DFDFDF;}
a.cha-btn{ display:block; width:50px; height:20px; line-height:20px; margin:0 auto; border:1px solid #269ac9; color:#269ac9;-webkit-border-radius: 3px;border-radius:3px; margin-top:8px;}
a:hover.cha-btn{ background:#269ac9; color:#fff;}
.chabox-header li{ font-size:14px; font-weight:bold; line-height:40px; height:40px; border-top:1px solid #E4E4E4; border-right:1px solid #E4E4E4; color:#000;}
.chabox ul li.chabox-w-500{ width:499px;}
.chabox ul li.chabox-w-40{ width:39px; border-right:1px solid #D1D1D1;}
.chabox ul li.chabox-txt-left{ text-align:left;text-indent:1em; }
.contrast-box{ width:1200px;box-shadow: 0 0 5px #6B6B6B; background:#fff; margin:0 auto; }
.contrast-con{ width:599px; border-right:1px solid #D1D1D1; float:left;}
.contrast-con h3{font-size:14px; font-weight:bold; line-height:40px; height:40px; background:#E4E4E4; color:#000; text-align:center; display:block;white-space:nowrap; overflow:hidden; text-overflow:ellipsis;}
.contrast-txt{ padding:10px;}
.showCodeC{ width:580px; float:left;}
.resourceClose {background:url(images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000;}

View File

@ -4,6 +4,7 @@
/*基本样式*/ /*基本样式*/
body,table,input,textarea,select,button { font-family: "微软雅黑","宋体";} body,table,input,textarea,select,button { font-family: "微软雅黑","宋体";}
h1,h2,h3,h4,h5,p {padding:0px; margin:0px;} h1,h2,h3,h4,h5,p {padding:0px; margin:0px;}
.f12 {font-size:12px;}
.f13 {font-size:13px;} .f13 {font-size:13px;}
.f15 {font-size:15px;} .f15 {font-size:15px;}
.fb {font-weight:bold;} .fb {font-weight:bold;}
@ -23,11 +24,13 @@ h1,h2,h3,h4,h5,p {padding:0px; margin:0px;}
.c-grey3 {color:#555555;} .c-grey3 {color:#555555;}
a {color:#707070;} a {color:#707070;}
a.c-grey {color:#707070;} a.c-grey {color:#707070;}
a.c-grey2 {color:#9a9a9a;}
a:link,a:visited{text-decoration:none;} a:link,a:visited{text-decoration:none;}
a:hover,a:active{cursor:pointer;} a:hover,a:active{cursor:pointer;}
a.link-blue {color:#269ac9;} a.link-blue {color:#269ac9;}
a.underline {text-decoration:underline;} a.underline {text-decoration:underline;}
.border-radius {border-radius:5px;} .border-radius {border-radius:5px;}
.w36 {width:36px;}
.max-width-60 {max-width:60px;} .max-width-60 {max-width:60px;}
.max-width-130 {max-width:130px;} .max-width-130 {max-width:130px;}
.hidden {overflow:hidden; white-space:nowrap; text-overflow:ellipsis;} .hidden {overflow:hidden; white-space:nowrap; text-overflow:ellipsis;}
@ -38,33 +41,36 @@ a.underline {text-decoration:underline;}
/*动态样式*/ /*动态样式*/
.post-container {width:100%;} .post-container {width:100%;}
.post-wrapper {width:98%; border:1px solid #e6e6e6; border-radius:3px; background-color:#ffffff; margin:15px auto;} .post-wrapper {width:98%; border-radius:3px; box-shadow:0px 0px 8px rgba(146, 153, 169, 0.5); background-color:#ffffff; margin:10px auto;}
.post-main {padding:10px; color:#9a9a9a;} .post-main {padding:10px; color:#9a9a9a;}
.post-avatar {width:45px; height:45px; margin-right:10px;} .post-avatar {width:40px; height:40px; margin-right:5px;}
.post-title {font-size:13px; text-align:left;} .post-title {font-size:13px; text-align:left;}
.post-detail-info {font-size:13px; text-align:left; color:#9a9a9a;} .post-detail-info {font-size:13px; text-align:left; color:#9a9a9a;}
.fl {float:left;} .fl {float:left;}
.fr {float:right;} .fr {float:right;}
.cl {clear:both; overflow:hidden;} .cl {clear:both; overflow:hidden;}
.post-content {width:100%; font-size:13px; line-height:18px; height:90px; overflow:hidden; word-break:break-all; word-wrap:break-word;} .post-content {width:100%; font-size:13px; line-height:18px; height:90px; overflow:hidden; word-break:break-all; word-wrap:break-word;}
.post-content img {max-width:100%;}
.post-interactive {width:100%; height:35px; line-height:35px; vertical-align:middle; border-top:1px solid #e6e6e6; background-color:#f8f9fb;} .post-interactive {width:100%; height:35px; line-height:35px; vertical-align:middle; border-top:1px solid #e6e6e6; background-color:#f8f9fb;}
.post-interactive-column {width:50%; text-align:center; float:left; font-size:13px;} .post-interactive-column,
.post-interactive-reply {width:50%; text-align:center; float:left; font-size:13px;} .post-interactive-reply,
.post-interactive-praise {width:50%; text-align:center; float:left; font-size:13px;} .post-interactive-praise {width:50%; text-align:center; float:left; font-size:13px;}
.more-wrap {width:100%;} .more-wrap {width:100%;}
.more-events {width:98%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; } .more-events {width:98%; font-size:13px; text-align:center; margin:0 auto; padding: 5px 0; border:1px solid #e6e6e6; border-radius:3px; background-color:#f8f9fb; }
.border-bottom {border-bottom:1px solid #e6e6e6;} .border-bottom {border-bottom:1px solid #e6e6e6;}
.post-reply-wrap {width:100%; line-height:18px; background-color:#f8f9fb;} .post-reply-wrap, .post-input-wrap {width:100%; line-height:18px; background-color:#f8f9fb;}
.post-input-wrap {width:100%; line-height:18px; background-color:#f8f9fb;}
.post-reply-row {padding:10px; color:#9a9a9a;} .post-reply-row {padding:10px; color:#9a9a9a;}
.post-reply-avatar {width:45px; height:30px; text-align:center; margin-right:10px;} .post-reply-avatar {width:45px; height:30px; text-align:center; margin-right:10px;}
.post-reply-user {font-size:13px; text-align:left; margin-bottom:10px;} .post-reply-user {font-size:13px; text-align:left; margin-bottom:10px;}
.post-reply-content {font-size:13px; text-align:left; word-break:break-all; word-wrap:break-word; overflow:hidden;} .post-reply-content {font-size:13px; text-align:left; word-break:break-all; word-wrap:break-word; overflow:hidden;}
.post-reply-date {font-size:13px;} .post-reply-content img {max-width:100%;}
.post-reply-trigger {font-size:13px;} .post-reply-date, .post-reply-trigger {font-size:13px;}
.post-input-container {padding-right:2px;} .post-input-container {padding-right:2px;}
.post-reply-input {width:100%; height:28px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px;} .post-reply-input {width:100%; height:28px; line-height:28px; border:1px solid #e6e6e6; outline:none; padding:0; margin:0; border-radius:3px;}
.post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;} .post-reply-submit {font-size:13px; padding:3px 8px; color:#fff; background-color:#269ac9; outline:none; border:none; display:inline-block;}
.reply-icon {background:url(/images/wechat/wechat_icon.png) -100px 1px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;}
.praise-icon {background:url(/images/wechat/wechat_icon.png) -100px -38px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;}
.praised-icon {background:url(/images/wechat/wechat_icon.png) -100px -76px no-repeat; width:20px; height:18px; display:inline-block; vertical-align:middle;}
/* loading 弹框*/ /* loading 弹框*/
.loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(0, 0, 0, 0.3); overflow:hidden;} .loading-bg {position:fixed; width:100%; height:100%; left:0; top:0; z-index:99; background:rgba(0, 0, 0, 0.3); overflow:hidden;}

View File

@ -0,0 +1,10 @@
FactoryGirl.define do
factory :code_test, :class => 'CodeTests' do
homework_id 1
wait_time 1
language 1
status 1
time_used "MyString"
end
end

View File

@ -0,0 +1,5 @@
require 'rails_helper'
RSpec.describe CodeTests, :type => :model do
pending "add some examples to (or delete) #{__FILE__}"
end