commit
e3c594a7ca
@ -0,0 +1,30 @@
|
||||
<div class="fl">
|
||||
<div class="cl"></div>
|
||||
<span style="font-weight:normal;">
|
||||
<a href="javascript:void(0);" class="blueCir ml5" onclick="$('#_file<%=work.id %>').click();">上传附件</a>
|
||||
<%#= button_tag "上传附件", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'blueCir ml5' %>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => "_file#{work.id}",
|
||||
:class => 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => "addReviseFiles(this, '#{work.id}');",
|
||||
:style => 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js'),
|
||||
:description_placeholder => l(:label_optional_description),
|
||||
:field_is_public => l(:field_is_public),
|
||||
:are_you_sure => l(:text_are_you_sure),
|
||||
:file_count => l(:label_file_count),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:delete_all_files => l(:text_are_you_sure_all),
|
||||
:containerid => "#{work.id}"
|
||||
} %>
|
||||
</span>
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
@ -0,0 +1,2 @@
|
||||
hideModal('#popbox02');
|
||||
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false})%>");
|
@ -0,0 +1,9 @@
|
||||
# encoding: utf-8
|
||||
class AddAttachmentType < ActiveRecord::Migration
|
||||
def up
|
||||
Attachmentstype.create(typeId:3,typeName:'修订附件')
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
@ -1,21 +0,0 @@
|
||||
namespace :delete_evalution do
|
||||
desc "delete evaluation"
|
||||
task :delete => :environment do
|
||||
homework = HomeworkCommon.where("id = 844").first
|
||||
homework_detail_manual = homework.homework_detail_manual
|
||||
homework_detail_manual.update_column('comment_status', 3)
|
||||
student_work_score = StudentWorksScore.where("student_work_id = 28088 and user_id = 9263").first
|
||||
student_work_score.destroy
|
||||
student_work_9203 = StudentWork.where("id = 28088").first
|
||||
student_work_9263 = StudentWork.where("homework_common_id = 844 and user_id = 9263").first
|
||||
student_work_9203.update_column("student_score",91)
|
||||
student_work_9203.update_column("final_score",91)
|
||||
student_work_9263.update_column("absence_penalty",student_work_9263.absence_penalty+homework_detail_manual.absence_penalty)
|
||||
work_ids = "(" + homework.student_works.map(&:id).join(",") + ")"
|
||||
homework.student_works.each do |student_work|
|
||||
absence_penalty_count = student_work.user.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count - student_work.user.student_works_scores.where("student_work_id IN #{work_ids}").count
|
||||
student_work.absence_penalty = absence_penalty_count > 0 ? absence_penalty_count * homework_detail_manual.absence_penalty : 0
|
||||
student_work.save
|
||||
end
|
||||
end
|
||||
end
|
@ -0,0 +1,18 @@
|
||||
#coding=utf-8
|
||||
|
||||
namespace :exercise_publish do
|
||||
desc "publish exercise and end exercise"
|
||||
task :publish => :environment do
|
||||
exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now)
|
||||
exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 2)
|
||||
end
|
||||
end
|
||||
|
||||
task :end => :environment do
|
||||
exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now)
|
||||
exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 3)
|
||||
end
|
||||
end
|
||||
end
|
After Width: | Height: | Size: 4.4 KiB |
After Width: | Height: | Size: 1.3 KiB |
Loading…
Reference in new issue