From e6d4d7d0cbcb1624a14932bc63b4c425fae86acf Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 2 Feb 2016 17:16:50 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E6=A1=86=E7=9A=84?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E5=A2=9E=E9=AB=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/org_document_comments/_new.html.erb | 23 +++++++++++-------- app/views/org_document_comments/edit.html.erb | 2 +- app/views/org_document_comments/new.html.erb | 2 +- public/javascripts/des_kindEditor.js | 8 ++++++- 4 files changed, 22 insertions(+), 13 deletions(-) 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 b17ae0e75..71ab98764 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 30e397422..ba06e8589 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/public/javascripts/des_kindEditor.js b/public/javascripts/des_kindEditor.js index 1b952672a..f09568faa 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()); @@ -133,4 +135,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 From adf9465443f6b5ccf86a6186ecaf02ba723dbdb6 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 24 Feb 2016 10:49:48 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E6=A6=9C=E7=9A=84=E7=A7=AF=E5=88=86=E5=8F=AA=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=80=E4=BD=8D=E5=B0=8F=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_courses.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 %> From 72c3fa1166bf43c6a3893ec639f92d6a120024da Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 24 Feb 2016 16:05:16 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E6=9F=90=E4=B8=AA=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E5=88=86=E6=95=B0=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...20160224074034_update_one_student_score.rb | 38 +++++++++++++++++++ db/schema.rb | 3 +- 2 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20160224074034_update_one_student_score.rb 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 From e499be999f128d00740908444deb1c3b00402ca1 Mon Sep 17 00:00:00 2001 From: cxt Date: Wed, 24 Feb 2016 16:05:48 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=8B=B1=E9=9B=84?= =?UTF-8?q?=E6=A6=9C=E7=9A=84=E6=A0=B7=E5=BC=8F=E4=BF=AE=E6=94=B9?= 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 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;}