diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 138616fda..031bbda4a 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -176,7 +176,7 @@ <% if student_score.score.to_i != 0 %>
  • <%=link_to image_tag(url_to_avatar(student_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(student_score.user) %>

    <%=link_to student_score.user.show_name, user_path(student_score.user), :title => student_score.user.show_name %>

    -

    <%= student_score.score.to_i %>

    +

    "><%= student_score.score<0 ? 0 : student_score.score.to_i %>

  • <% end %> <% end %> diff --git a/app/views/org_document_comments/_new.html.erb b/app/views/org_document_comments/_new.html.erb index 3d8e8bc23..9d3fe2de8 100644 --- a/app/views/org_document_comments/_new.html.erb +++ b/app/views/org_document_comments/_new.html.erb @@ -1,8 +1,12 @@ <%= content_for(:header_tags) do %> <%= import_ke(enable_at: false, prettify: false, init_activity: false) %> + <%= javascript_include_tag "des_KindEditor" %> <% end %> -<%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %> -
    +
    + <%= form_tag organization_org_document_comments_path(:organization_id => @organization.id), :id => 'new_org_document_form' do |f| %>
    @@ -41,10 +45,10 @@
    + <% end %>
    -<% end %> \ No newline at end of file diff --git a/app/views/org_document_comments/edit.html.erb b/app/views/org_document_comments/edit.html.erb index a6681d047..ed7413850 100644 --- a/app/views/org_document_comments/edit.html.erb +++ b/app/views/org_document_comments/edit.html.erb @@ -31,7 +31,7 @@
    -
    +
    <%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %> diff --git a/app/views/org_document_comments/new.html.erb b/app/views/org_document_comments/new.html.erb index c95cfe805..2a261bd5f 100644 --- a/app/views/org_document_comments/new.html.erb +++ b/app/views/org_document_comments/new.html.erb @@ -39,7 +39,7 @@
    -
    +
    <%#= kindeditor_tag 'org_document_comment[content]','', :editor_id => 'org_document_description_editor', :height => "150px" %> diff --git a/db/migrate/20160224074034_update_one_student_score.rb b/db/migrate/20160224074034_update_one_student_score.rb new file mode 100644 index 000000000..6e1930652 --- /dev/null +++ b/db/migrate/20160224074034_update_one_student_score.rb @@ -0,0 +1,38 @@ +class UpdateOneStudentScore < ActiveRecord::Migration + def up + student_work_score = StudentWorksScore.where("user_id = 11688 AND student_work_id = 34414").first + student_work_score.score = 100 + student_work_score.save + student_works = StudentWork.where("user_id = 6456") + student_works.each do |work| + unless work.student_works_scores.empty? + if work.student_works_scores.where(:reviewer_role => 2).empty? + work.teaching_asistant_score = nil + else + work.teaching_asistant_score = work.student_works_scores.where(:reviewer_role => 2).average(:score).try(:round, 2).to_f + end + if work.student_works_scores.where(:reviewer_role => 3).empty? + work.student_score = nil + else + work.student_score = work.student_works_scores.where(:reviewer_role => 3).average(:score).try(:round, 2).to_f + end + end + if work.teaching_asistant_score.nil? + work.final_score = work.student_score + elsif work.student_score.nil? + work.final_score = work.teaching_asistant_score + else + homework = HomeworkCommon.find work.homework_common_id + ta_proportion = homework.homework_detail_manual.ta_proportion + final_ta_score = BigDecimal.new("#{work.teaching_asistant_score}") * BigDecimal.new("#{ta_proportion}") + final_s_score = BigDecimal.new("#{work.student_score}") * (BigDecimal.new('1.0') - BigDecimal.new("#{ta_proportion}")) + final_score = final_ta_score + final_s_score + work.final_score = format("%.2f",final_score.to_f) + end + work.save + end + end + + def down + end +end diff --git a/db/schema.rb b/db/schema.rb index db33479a5..ef1a1b538 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 => 20160223073859) do +ActiveRecord::Schema.define(:version => 20160224074034) do create_table "activities", :force => true do |t| t.integer "act_id", :null => false @@ -1269,7 +1269,6 @@ ActiveRecord::Schema.define(:version => 20160223073859) do t.text "description" t.integer "creator_id" t.integer "home_id" - t.string "domain" t.boolean "is_public" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false diff --git a/public/javascripts/des_kindEditor.js b/public/javascripts/des_kindEditor.js index 206448044..f8aff0be7 100644 --- a/public/javascripts/des_kindEditor.js +++ b/public/javascripts/des_kindEditor.js @@ -90,7 +90,9 @@ function init_form(params){ } function nh_reset_form(params){ params.form[0].reset(); - params.texttitle.empty(); + $("#document_title").val(""); + $('#org_document_editor').hide(); + $('#doc_title_hint').hide(); params.textarea.empty(); if(params.editor != undefined){ params.editor.html(params.textarea.html()); @@ -134,4 +136,8 @@ function init_des_data(){ } }); }); + + div_form = $("div[nhname='new_topic_form']"); + $(".ke-edit", div_form).css("height","150px"); + $(".ke-edit-iframe",div_form).css("height","150px"); } \ No newline at end of file diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css index 9dfa32ccf..3840fd892 100644 --- a/public/stylesheets/courses.css +++ b/public/stylesheets/courses.css @@ -1186,7 +1186,7 @@ a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;} .courseMenuSetting:hover {background:url(../images/homepage_icon2.png) -190px -407px no-repeat;} .rankList {width:220px; padding:10px; background-color:#ffffff; margin-top:10px;} .rankList li {width:73px; padding:8px 0px 0px 0px; text-align:center; float:left; position:relative;} -.rankList li p {width:100%; overflow:hidden; white-space:normal; text-overflow:ellipsis; color:#585858;word-wrap: normal; word-break: normal;} +.rankList li p {width:100%; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; color:#585858;word-wrap: normal; word-break: normal;} .rankPortrait {border-radius:50%; width:35px; height:35px;} .numIntro {position:absolute; text-align:left; z-index:999; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); border:1px solid #eaeaea; background-color:#ffffff; padding:3px 5px; left:15px; color:#585858; white-space: nowrap;} .font_cus {font-family: "微软雅黑","宋体"; font-size: 12px; line-height: 1.5;}