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/_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/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%> 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 %> 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" 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; } /* 与我相关 */