+ 迟交扣分:<%= homework_common.late_penalty%>分
+
+
匿评开启时间:<%= homework_common.homework_detail_manual.evaluation_start%> 00:00
-
+
+
+
+
+ 缺评扣分:<%= homework_common.homework_detail_manual.absence_penalty%>分/作品
+
+
匿评关闭时间:<%= homework_common.homework_detail_manual.evaluation_end%> 23:59
diff --git a/db/migrate/20151218022014_batch_delete_project_journal_activities.rb b/db/migrate/20151218022014_batch_delete_project_journal_activities.rb
index 95d6a39c5..6752b5b30 100644
--- a/db/migrate/20151218022014_batch_delete_project_journal_activities.rb
+++ b/db/migrate/20151218022014_batch_delete_project_journal_activities.rb
@@ -1,7 +1,15 @@
# encoding: utf-8
class BatchDeleteProjectJournalActivities < ActiveRecord::Migration
def up
- ForgeActivity.where('forge_act_type = \'Journal\'').destroy_all #需要触发回调
+ #ForgeActivity.where('forge_act_type = \'Journal\'').destroy_all #需要触发回调
+ count = ForgeActivity.where('forge_act_type = \'Journal\'').count / 30 + 2
+ transaction do
+ for i in 1 ... count do i
+ ForgeActivity.where('forge_act_type = \'Journal\'').page(i).per(30).each do |activity|
+ activity.destroy
+ end
+ end
+ end
end
def down
diff --git a/db/schema.rb b/db/schema.rb
index 9c7702aa2..eac8a81db 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -558,23 +558,26 @@ ActiveRecord::Schema.define(:version => 20151218022014) 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 "editor_of_documents", :force => true do |t|
@@ -923,16 +926,6 @@ ActiveRecord::Schema.define(:version => 20151218022014) do
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
- create_table "journal_details_copy", :force => true do |t|
- t.integer "journal_id", :default => 0, :null => false
- t.string "property", :limit => 30, :default => "", :null => false
- t.string "prop_key", :limit => 30, :default => "", :null => false
- t.text "old_value"
- t.text "value"
- end
-
- add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id"
-
create_table "journal_replies", :id => false, :force => true do |t|
t.integer "journal_id"
t.integer "user_id"
diff --git a/lib/tasks/exercise_publish.rake b/lib/tasks/exercise_publish.rake
index a27c6a6fb..13ae8c484 100644
--- a/lib/tasks/exercise_publish.rake
+++ b/lib/tasks/exercise_publish.rake
@@ -14,9 +14,21 @@ namespace :exercise_publish do
end
task :end => :environment do
+ include ExerciseHelper
exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now)
exercises.each do |exercise|
+ course = exercise.course
exercise.update_column('exercise_status', 3)
+ course.student.each do |student|
+ if ExerciseUser.where("user_id = ? && exercise_id = ?",student.student_id,exercise.id).empty?
+ ExerciseUser.create(:user_id => student.student_id, :exercise_id => exercise.id, :start_at => exercise.end_time, :status => true,:score=>0)
+ end
+=begin
+ s_score = calculate_student_score(exercise, student.student)
+ exercise_user = ExerciseUser.where("user_id =? and exercise_id=?", student.student_id, exercise.id).first
+ exercise_user.update_attributes(:score => s_score)
+=end
+ end
end
end
end
diff --git a/public/assets/kindeditor/kindeditor.js b/public/assets/kindeditor/kindeditor.js
index 6f8e489f8..930911e76 100644
--- a/public/assets/kindeditor/kindeditor.js
+++ b/public/assets/kindeditor/kindeditor.js
@@ -260,7 +260,7 @@ K.options = {
bodyClass : 'ke-content',
indentChar : '\t',
cssPath : K.basePath +'plugins/code/previewcode.css',
- cssData : '',
+ cssData : 'font{color:black;}',
minWidth : 650,
minHeight : 100,
minChangeSize : 1,
diff --git a/public/javascripts/create_kindeditor.js b/public/javascripts/create_kindeditor.js
index 3f555ac88..0eac4b01e 100644
--- a/public/javascripts/create_kindeditor.js
+++ b/public/javascripts/create_kindeditor.js
@@ -3,6 +3,7 @@ function sd_create_editor(params){
// var minHeight; //最小高度
var paramsHeight = params.height; //设定的高度
var id = arguments[1] ? arguments[1] : undefined;
+ var type = arguments[2] ? arguments[2] : '';
var paramsWidth = params.width == undefined ? "100%" : params.width;
var editor = params.kindutil.create(params.textarea, {
@@ -74,7 +75,9 @@ function sd_create_editor(params){
edit.html("
我要回复");
this.resize(null,paramsHeight);// Math.max((params.kindutil.IE ? body.scrollHeight : body.offsetHeight)+ paramsHeight , paramsHeight)
// params.toolbar_container.hide();
-
+ if(typeof enableAt === 'function'){
+ enableAt(this, id, type);
+ }
}
}).loadPlugin('paste');
return editor;
@@ -136,6 +139,7 @@ function sd_reset_editor_form(params){
function sd_create_editor_from_data(id){
var height = arguments[1] ? arguments[1] : undefined;
var width = arguments[2] ? arguments[2] : undefined;
+ var type = arguments[3] ? arguments[3] : undefined;
KindEditor.ready(function (K) {
$("div[nhname='new_message_" + id + "']").each(function () {
var params = {};
@@ -153,7 +157,7 @@ function sd_create_editor_from_data(id){
params.height = height;
params.width = width;
if (params.textarea.data('init') == undefined) {
- params.editor = sd_create_editor(params,id);
+ params.editor = sd_create_editor(params,id, type);
sd_create_form(params);
params.cancel_btn.click(function () {
sd_reset_editor_form(params);