diff --git a/app/controllers/student_work_controller.rb b/app/controllers/student_work_controller.rb index 1696259bf..4c3a608de 100644 --- a/app/controllers/student_work_controller.rb +++ b/app/controllers/student_work_controller.rb @@ -803,6 +803,9 @@ class StudentWorkController < ApplicationController @new_score.comment = params[:new_form][:user_message] if params[:new_form] && params[:new_form][:user_message] && params[:new_form][:user_message] != "" @new_score.user_id = User.current.id @new_score.student_work_id = @work.id + if @is_teacher && @work.work_status == 0 + @work.update_column('work_status', 1) + end if User.current.admin? @new_score.reviewer_role = 1 else @@ -813,7 +816,6 @@ class StudentWorkController < ApplicationController if @is_teacher @is_new = true @is_last_a = false - @work.update_column('work_status', 1) else @is_new = false end @@ -1229,7 +1231,7 @@ class StudentWorkController < ApplicationController sheet1[count_row,3] = homework.user.user_extensions.student_id sheet1[count_row,4] = homework.user.mail sheet1[count_row,5] = homework.name - sheet1[count_row,6] = strip_html homework.description + sheet1[count_row,6] = strip_html homework.description if !homework.description.nil? sheet1[count_row,7] = homework.teacher_score.nil? ? l(:label_without_score) : homework.teacher_score.round(2) sheet1[count_row,8] = homework.teaching_asistant_score.nil? ? l(:label_without_score) : homework.teaching_asistant_score.round(2) if @homework.anonymous_comment ==0 diff --git a/app/views/layouts/_project_info.html.erb b/app/views/layouts/_project_info.html.erb index de37841a0..abfebd828 100644 --- a/app/views/layouts/_project_info.html.erb +++ b/app/views/layouts/_project_info.html.erb @@ -27,7 +27,7 @@ 邀请码: <%=@course.generate_invite_code %> <% unless is_teacher %> -
<%= join_in_course_header(@course, User.current) %>
+
<%= join_in_course_header(@course, User.current) %>
<% end %> diff --git a/app/views/layouts/_syllabus_title.html.erb b/app/views/layouts/_syllabus_title.html.erb index b67e6ab9d..5180da82d 100644 --- a/app/views/layouts/_syllabus_title.html.erb +++ b/app/views/layouts/_syllabus_title.html.erb @@ -1,4 +1,4 @@ -<%=@syllabus.title %> +<%=@syllabus.title %> <% if User.current == syllabus.user %> <%= link_to image_tag("../images/signature_edit.png",width:"12px", height: "12px"), "javascript:void(0);",:id => "syllabus_edit_title_png", :class => "none", :onclick => "show_edit_title();"%> diff --git a/db/schema.rb b/db/schema.rb index 93dbba8a4..04b289d2b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20160707031248) do +ActiveRecord::Schema.define(:version => 20160708005533) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1803,6 +1803,7 @@ ActiveRecord::Schema.define(:version => 20160707031248) do t.integer "simi_id" t.integer "simi_value" t.float "work_score" + t.integer "work_status", :default => 0 end add_index "student_works", ["homework_common_id", "user_id"], :name => "index_student_works_on_homework_common_id_and_user_id"