From 1acadd1edf4c1314ad91c4ad155637822db91803 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 30 Sep 2015 09:50:14 +0800
Subject: [PATCH 1/4] =?UTF-8?q?1=E3=80=81=E6=B5=8B=E8=AF=95=E6=97=B6?=
=?UTF-8?q?=E9=97=B4=E6=98=BE=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=202?=
=?UTF-8?q?=E3=80=81=E4=BD=9C=E5=93=81=E5=88=97=E8=A1=A8=E6=97=B6=E9=97=B4?=
=?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/student_work/_evaluation_un_work.html.erb | 8 +++++---
app/views/users/new_user_commit_homework.html.erb | 5 ++++-
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/app/views/student_work/_evaluation_un_work.html.erb b/app/views/student_work/_evaluation_un_work.html.erb
index da2723636..94fcfcee2 100644
--- a/app/views/student_work/_evaluation_un_work.html.erb
+++ b/app/views/student_work/_evaluation_un_work.html.erb
@@ -26,9 +26,11 @@
- <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
- <% 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 student_work.created_at && @homework.end_time%>
+ <%= Time.parse(format_time(student_work.created_at)).strftime("%m-%d %H:%M")%>
+ <% if Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.parse(student_work.created_at.to_s).strftime("%Y-%m-%d") %>
+ [迟交]
+ <% end %>
<% end %>
diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb
index c8998fd55..c3a736058 100644
--- a/app/views/users/new_user_commit_homework.html.erb
+++ b/app/views/users/new_user_commit_homework.html.erb
@@ -105,7 +105,10 @@
<% @student_work.student_work_tests.each_with_index do |test, index| %>
-
第<%= @student_work.student_work_tests.count - index%>次测试
<%= test.created_at.to_s(:db) %>
+
+ 第<%= @student_work.student_work_tests.count - index%>次测试
+
+
<%= format_time(test.created_at).to_s%>
<% if test.status.to_i == -2 %>
From 11736eb2663c0329de9d1431e501c6acf13bc33a Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 30 Sep 2015 10:16:55 +0800
Subject: [PATCH 2/4] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E6=9C=89=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
...150930011457_alter_user_activities_news.rb | 4 +-
db/schema.rb | 41 +++++++++++--------
2 files changed, 27 insertions(+), 18 deletions(-)
diff --git a/db/migrate/20150930011457_alter_user_activities_news.rb b/db/migrate/20150930011457_alter_user_activities_news.rb
index 169ac6795..f91cbb791 100644
--- a/db/migrate/20150930011457_alter_user_activities_news.rb
+++ b/db/migrate/20150930011457_alter_user_activities_news.rb
@@ -1,10 +1,10 @@
class AlterUserActivitiesNews < ActiveRecord::Migration
def up
UserActivity.all.each do |activity|
- if activity.act_type = 'News'
+ if activity.act_type == 'News'
if activity.act
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
else
activity.destroy
diff --git a/db/schema.rb b/db/schema.rb
index 9da8cdd66..6edcdcc42 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -476,6 +476,13 @@ ActiveRecord::Schema.define(:version => 20150930011457) do
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|
t.integer "project_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", ["project_id"], :name => "documents_project_id"
- create_table "dts", :force => true do |t|
- t.string "IPLineCode"
- t.string "Description"
- t.string "Num"
- t.string "Variable"
- t.string "TraceInfo"
- t.string "Method"
+ create_table "dts", :primary_key => "Num", :force => true do |t|
+ t.string "Defect", :limit => 50
+ t.string "Category", :limit => 50
t.string "File"
- t.string "IPLine"
- t.string "Review"
- t.string "Category"
- t.string "Defect"
- t.string "PreConditions"
- t.string "StartLine"
+ t.string "Method"
+ t.string "Module", :limit => 20
+ t.string "Variable", :limit => 50
+ t.integer "StartLine"
+ t.integer "IPLine"
+ 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.datetime "created_at", :null => false
- t.datetime "updated_at", :null => false
+ t.datetime "created_at"
+ t.datetime "updated_at"
+ t.integer "id", :null => false
end
create_table "enabled_modules", :force => true do |t|
@@ -911,7 +921,6 @@ ActiveRecord::Schema.define(:version => 20150930011457) do
t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false
t.integer "course_id"
- t.datetime "updated_on"
end
add_index "news", ["author_id"], :name => "index_news_on_author_id"
From d1bb76cfcb14cbacfe42319aa1582eecafef2d35 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 30 Sep 2015 10:24:20 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=AD=A6=E7=94=9F?=
=?UTF-8?q?=E5=8C=BF=E8=AF=84=E7=95=8C=E9=9D=A2=E6=8F=90=E4=BA=A4=E6=8C=89?=
=?UTF-8?q?=E9=92=AE=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
public/stylesheets/courses.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 403febc23..328570345 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -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;}
.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; }
/* 与我相关 */
From 11314a536687e5eb38192896da3672838da06db0 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 30 Sep 2015 10:43:40 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E7=AC=AC=E4=BA=8C=E4=B8=AA=E4=BA=BA?=
=?UTF-8?q?=E6=89=93=E5=88=86=E4=B9=8B=E5=90=8E=EF=BC=8C=E8=AF=84=E5=88=86?=
=?UTF-8?q?=E7=BB=93=E6=9E=9C=E7=9A=84=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/student_work_controller.rb | 1 +
app/views/student_work/add_score.js.erb | 3 +--
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb
index f2858d097..17f179492 100644
--- a/app/controllers/student_work_controller.rb
+++ b/app/controllers/student_work_controller.rb
@@ -271,6 +271,7 @@ class StudentWorkController < ApplicationController
end
@is_new = false
else
+ @is_last_a = @work.student_works_scores.empty?
@score = StudentWorksScore.new
@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] != ""
diff --git a/app/views/student_work/add_score.js.erb b/app/views/student_work/add_score.js.erb
index 6cb5bd6d8..762aa4a8a 100644
--- a/app/views/student_work/add_score.js.erb
+++ b/app/views/student_work/add_score.js.erb
@@ -2,8 +2,7 @@ $("#add_student_score_<%= @work.id%>").html("<%= escape_javascript(render :parti
$('#score_<%= @work.id%>').peSlider({range: 'min'});
<% if @is_new%>
- $("#score_list_<%= @work.id%>").find("div:last").find("ul").addClass("ping_line");
- $("#score_list_<%= @work.id%>").prepend("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => true}) %>
");
+ $("#score_list_<%= @work.id%>").prepend("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last_a}) %>
");
<% else %>
$("#work_score_<%= @score.id%>").html("<%= escape_javascript(render :partial => 'student_work_score', :locals => {:score => @score,:is_last => @is_last}) %>");
<% end%>