This commit is contained in:
huang 2015-09-30 11:24:31 +08:00
commit 326c05d0eb
10 changed files with 48 additions and 34 deletions

View File

@ -271,6 +271,7 @@ class StudentWorkController < ApplicationController
end end
@is_new = false @is_new = false
else else
@is_last_a = @work.student_works_scores.empty?
@score = StudentWorksScore.new @score = StudentWorksScore.new
@score.score = params[:score] if params[:score] @score.score = params[:score] if params[:score]
@score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" @score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != ""

View File

@ -26,10 +26,12 @@
</ul> </ul>
</li> </li>
<li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;"> <li class="hworkList130 c_grey" onclick="show_student_work('<%= student_work_path(student_work)%>');" style="cursor: pointer;">
<% if student_work.created_at && @homework.end_time%>
<%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp; <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>&nbsp;
<% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %> <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
<span class="c_red">[迟交]</span> <span class="c_red">[迟交]</span>
<% end %> <% end %>
<% end %>
</li> </li>
<li class="hworkList50 <%= score_color student_work.teacher_score%>"> <li class="hworkList50 <%= score_color student_work.teacher_score%>">
<%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%> <%= student_work.teacher_score.nil? ? "--" : format("%.1f",student_work.teacher_score)%>

View File

@ -2,8 +2,7 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti
$('#score_<%= @work.id%>').peSlider({range: 'min'}); $('#score_<%= @work.id%>').peSlider({range: 'min'});
<% if @is_new%> <% if @is_new%>
$("#score_list_<%= @work.id%>").find("div:last").find("ul").addClass("ping_line"); $("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last_a}) %></div>");
$("#score_list_<%= @work.id%>").prepend("<div id='work_score_<%= @score.id%>'><%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => true}) %></div>");
<% else %> <% else %>
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last}) %>"); $("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last}) %>");
<% end%> <% end%>

View File

@ -14,10 +14,10 @@
<%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %> <%= link_to course.name.to_s+" | 课程留言", course_feedback_path(course), :class => "newsBlue ml15" %>
</div> </div>
<div class="homepagePostTitle break_word list_style upload_img"> <div class="homepagePostTitle break_word list_style upload_img">
<% if activity.m_parent_id.nil? %> <% if activity.parent %>
<%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% else %>
<%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %> <%= link_to activity.parent.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% else %>
<%= link_to activity.notes.html_safe, course_feedback_path(course), :class => "postGrey" %>
<% end %> <% end %>
</div> </div>
<div class="homepagePostDate"> <div class="homepagePostDate">

View File

@ -105,7 +105,10 @@
<% @student_work.student_work_tests.each_with_index do |test, index| %> <% @student_work.student_work_tests.each_with_index do |test, index| %>
<div class="ProResultTop"> <div class="ProResultTop">
<p class="c_blue fl">第<%= @student_work.student_work_tests.count - index%>次测试</p><span class="fr c_grey"><%= test.created_at.to_s(:db) %></span> <p class="c_blue fl">
第<%= @student_work.student_work_tests.count - index%>次测试
</p>
<span class="fr c_grey"><%= format_time(test.created_at).to_s%></span>
<div class="cl"></div> <div class="cl"></div>
</div> </div>
<% if test.status.to_i == -2 %> <% if test.status.to_i == -2 %>

View File

@ -1,10 +1,10 @@
class AlterUserActivitiesNews < ActiveRecord::Migration class AlterUserActivitiesNews < ActiveRecord::Migration
def up def up
UserActivity.all.each do |activity| UserActivity.all.each do |activity|
if activity.act_type = 'News' if activity.act_type == 'News'
if activity.act if activity.act
activity.created_at = activity.act.created_on activity.created_at = activity.act.created_on
activity.updated_at = activity.act.updated_on ? activity.act.updated_on : activity.act.created_on activity.updated_at = activity.act.respond_to?("updated_on") ? activity.act.updated_on : activity.act.created_on
activity.save activity.save
else else
activity.destroy activity.destroy

View File

@ -476,6 +476,13 @@ ActiveRecord::Schema.define(:version => 20150930011457) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority" add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
create_table "discuss_demos", :force => true do |t|
t.string "title"
t.text "body"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "documents", :force => true do |t| create_table "documents", :force => true do |t|
t.integer "project_id", :default => 0, :null => false t.integer "project_id", :default => 0, :null => false
t.integer "category_id", :default => 0, :null => false t.integer "category_id", :default => 0, :null => false
@ -490,23 +497,26 @@ ActiveRecord::Schema.define(:version => 20150930011457) do
add_index "documents", ["created_on"], :name => "index_documents_on_created_on" add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
add_index "documents", ["project_id"], :name => "documents_project_id" add_index "documents", ["project_id"], :name => "documents_project_id"
create_table "dts", :force => true do |t| create_table "dts", :primary_key => "Num", :force => true do |t|
t.string "IPLineCode" t.string "Defect", :limit => 50
t.string "Description" t.string "Category", :limit => 50
t.string "Num"
t.string "Variable"
t.string "TraceInfo"
t.string "Method"
t.string "File" t.string "File"
t.string "IPLine" t.string "Method"
t.string "Review" t.string "Module", :limit => 20
t.string "Category" t.string "Variable", :limit => 50
t.string "Defect" t.integer "StartLine"
t.string "PreConditions" t.integer "IPLine"
t.string "StartLine" t.string "IPLineCode", :limit => 200
t.string "Judge", :limit => 15
t.integer "Review", :limit => 1
t.string "Description"
t.text "PreConditions", :limit => 2147483647
t.text "TraceInfo", :limit => 2147483647
t.text "Code", :limit => 2147483647
t.integer "project_id" t.integer "project_id"
t.datetime "created_at", :null => false t.datetime "created_at"
t.datetime "updated_at", :null => false t.datetime "updated_at"
t.integer "id", :null => false
end end
create_table "enabled_modules", :force => true do |t| create_table "enabled_modules", :force => true do |t|
@ -911,7 +921,6 @@ ActiveRecord::Schema.define(:version => 20150930011457) do
t.datetime "created_on" t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false t.integer "comments_count", :default => 0, :null => false
t.integer "course_id" t.integer "course_id"
t.datetime "updated_on"
end end
add_index "news", ["author_id"], :name => "index_news_on_author_id" add_index "news", ["author_id"], :name => "index_news_on_author_id"

View File

@ -873,7 +873,7 @@ a.work_list_tit{width:580px; display:block; overflow:hidden; font-size:14px; f
.filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;} .filename { background: url(../images/pic_file.png) 0 -25px no-repeat;color: #3ca5c6;max-width: 150px;border: none; padding-left: 20px;margin-right: 10px;margin-bottom: 5px; white-space: nowrap; text-overflow:ellipsis;}
.evaluation{position: relative;} .evaluation{position: relative;}
.evaluation_submit{position: absolute;right: 0px;bottom: 5px;} .evaluation_submit{position: absolute;right: 0px;bottom: 0px;}
.student_work_search{background-color: #64bdd9;color: white !important;padding: 2px 7px;margin-left: 10px;cursor: pointer; } .student_work_search{background-color: #64bdd9;color: white !important;padding: 2px 7px;margin-left: 10px;cursor: pointer; }
/* 与我相关 */ /* 与我相关 */

View File

@ -741,9 +741,9 @@ ul.list_watch{
.referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;} .referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;}
.referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} .referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
.searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;} .searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;}
.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -270px no-repeat; display:inline-block; float:left;} .referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon2.png) -180px -270px no-repeat; display:inline-block; float:left;}
.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -180px -311px no-repeat;} .referenceSearchIcon:hover {background:url(../images/homepage_icon2.png) -180px -311px no-repeat;}
.referenceResourceType {font-size:14px; width:475px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} .referenceResourceType {font-size:14px; width:460px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;}
.referenceTypeActive {background-color:#269ac9; color:#ffffff !important;} .referenceTypeActive {background-color:#269ac9; color:#ffffff !important;}
a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}

View File

@ -627,9 +627,9 @@ a.loginChooseTab {color:#484848; height:30px; display:block;}
.referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;} .referenceText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight:bold;}
.referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;} .referenceSearchBox {border:1px solid #e6e6e6; width:235px; height:32px; background-color:#ffffff; margin-top:12px; margin-bottom:15px;}
.searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;} .searchReferencePopup {border:none; outline:none; background-color:#ffffff; width:190px; height:32px; padding-left:10px; display:inline-block; float:left;}
.referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon.png) -180px -270px no-repeat; display:inline-block; float:left;} .referenceSearchIcon{width:31px; height:25px; background-color:#ffffff; background:url(../images/homepage_icon2.png) -180px -270px no-repeat; display:inline-block; float:left;}
.referenceSearchIcon:hover {background:url(../images/homepage_icon.png) -180px -311px no-repeat;} .referenceSearchIcon:hover {background:url(../images/homepage_icon2.png) -180px -311px no-repeat;}
.referenceResourceType {font-size:14px; width:475px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;} .referenceResourceType {font-size:14px; width:460px; height:34px; line-height:34px; vertical-align:middle; background-color:#f6f6f6; margin-top:15px;}
.referenceTypeActive {background-color:#269ac9; color:#ffffff !important;} .referenceTypeActive {background-color:#269ac9; color:#ffffff !important;}
a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;} a.referenceTypeBlock {color:#888888; display:inline-block; padding:0px 20px;}