Merge remote-tracking branch 'origin/szzh' into szzh

This commit is contained in:
lizanle 2015-09-11 14:44:59 +08:00
commit dc32bba5fd
15 changed files with 167 additions and 207 deletions

View File

@ -3,6 +3,7 @@ class HomeworkCommonController < ApplicationController
require 'json'
require "base64"
layout "base_courses"
include StudentWorkHelper
before_filter :find_course, :only => [:index,:new,:create,:next_step]
before_filter :find_homework, :only => [:edit,:update,:alert_anonymous_comment,:start_anonymous_comment,:stop_anonymous_comment,:destroy]
@ -142,116 +143,24 @@ class HomeworkCommonController < ApplicationController
end
def update
@homework.name = params[:homework_common][:name]
@homework.description = params[:homework_common][:description]
@homework.end_time = params[:homework_common][:end_time]
@homework.publish_time = params[:homework_common][:publish_time]
@homework.homework_type = params[:homework_common][:homework_type] if params[:homework_common][:homework_type]
unless @homework.late_penalty == params[:late_penalty]
@homework.student_works.where("created_at > '#{@homework.end_time} 23:59:59'").each do |student_work|
student_work.late_penalty = params[:late_penalty]
student_work.save
end
@homework.late_penalty = params[:late_penalty]
end
# @homework.course_id = @course.id
if params[:homework_common]
@homework.name = params[:homework_common][:name]
@homework.description = params[:homework_common][:description]
@homework.end_time = params[:homework_common][:end_time] || Time.now
@homework.course_id = params[:course_id]
#匿评作业相关属性
if @homework.homework_type == 1 && @homework_detail_manual
@homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6
@homework_detail_manual.evaluation_start = params[:evaluation_start]
@homework_detail_manual.evaluation_end = params[:evaluation_end]
@homework_detail_manual.evaluation_num = params[:evaluation_num]
unless @homework_detail_manual.absence_penalty == params[:absence_penalty]
if @homework_detail_manual.comment_status == 3 #当前作业处于匿评结束状态,修改缺评扣分才会修改每个作品应扣分的值
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
@homework_detail_manual.absence_penalty = params[:absence_penalty]
end
elsif @homework.homework_type == 0 #普通作业缺评扣分为0分每个作品的缺评扣分改为0分防止某些作业在结束匿评之后改为普通作业
@homework.student_works.where("absence_penalty != 0").each do |student_work|
student_work.late_penalty = 0
student_work.save
end
@homework_detail_manual.absence_penalty = 0 if @homework_detail_manual
end
@homework.save_attachments(params[:attachments])
render_attachment_warning_if_needed(@homework)
#编程作业相关属性
if @homework.homework_type == 2
if @homework.homework_type == 2 && @homework_detail_programing #编程作业
@homework_detail_programing.language = params[:language]
@homework_detail_programing.standard_code = params[:standard_code]
@homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6
homework_tests = @homework.homework_tests
#需要删除的测试
ids = homework_tests.map(&:id) - params[:input].keys.map(&:to_i)
ids.each do |id|
homework_test = HomeworkTest.find id
homework_test.destroy if homework_test
end
if params[:input] && params[:output] && params[:result]
params[:input].each do |k,v|
if params[:output].include? k
homework_test = HomeworkTest.find_by_id k
if homework_test #已存在的测试,修改
homework_test.input = v
homework_test.output = params[:output][k]
homework_test.result = params[:result][k]
homework_test.error_msg = params[:error_msg]
else #不存在的测试,增加
homework_test = HomeworkTest.new
homework_test.input = v
homework_test.output = params[:output][k]
homework_test.result = params[:result][k]
homework_test.error_msg = params[:error_msg]
homework_test.homework_common = @homework
end
homework_test.save
end
end
end
#发送修改作业的请求
question = {title:@homework.name,content:@homework.description}
question[:input] = []
question[:output] = []
@homework.homework_tests.each do |test|
question[:input] << test.input
question[:output] << test.output
end
# uri = URI("http://192.168.80.21:8080/api/questions/#{@homework_detail_programing.question_id}.json")
# body = question.to_json
# res = Net::HTTP.new(uri.host, uri.port).start do |client|
# request = Net::HTTP::Put.new(uri.path)
# request.body = body
# request["Content-Type"] = "application/json"
# client.request(request)
# end
# result = JSON.parse(res.body)
end
@homework.save_attachments(params[:attachments])
render_attachment_warning_if_needed(@homework)
if @homework.save
@homework_detail_manual.save if @homework_detail_manual
@homework_detail_programing.save if @homework_detail_programing
respond_to do |format|
format.html {
flash[:notice] = l(:notice_successful_edit)
redirect_to homework_common_index_path(:course => @course.id)
}
end
return
else
respond_to do |format|
format.html {
flash[:notice] = l(:notice_failed_edit)
redirect_to edit_homework_common_path(@homework)
}
if @homework.save
@homework_detail_manual.save if @homework_detail_manual
@homework_detail_programing.save if @homework_detail_programing
redirect_to user_homeworks_user_path(User.current.id)
end
end
end

View File

@ -408,17 +408,17 @@ class UsersController < ApplicationController
homework.save_attachments(params[:attachments])
render_attachment_warning_if_needed(homework)
#匿评作业相关属性
if homework.homework_type == 1
homework_detail_manual = HomeworkDetailManual.new
homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6
homework_detail_manual.comment_status = 1
homework_detail_manual.evaluation_start = Time.now
homework_detail_manual.evaluation_end = Time.now
homework_detail_manual.evaluation_num = params[:evaluation_num] || 3
homework_detail_manual.absence_penalty = 2
homework.homework_detail_manual = homework_detail_manual
else
homework_detail_manual = HomeworkDetailManual.new
homework_detail_manual.ta_proportion = params[:ta_proportion] || 0.6
homework_detail_manual.comment_status = 1
homework_detail_manual.evaluation_start = Time.now
homework_detail_manual.evaluation_end = Time.now
homework_detail_manual.evaluation_num = params[:evaluation_num] || 3
homework_detail_manual.absence_penalty = 2
homework.homework_detail_manual = homework_detail_manual
#编程作业相关属性
if homework.homework_type == 2
homework_detail_programing = HomeworkDetailPrograming.new
homework.homework_detail_programing = homework_detail_programing
homework_detail_programing.ta_proportion = params[:ta_proportion] || 0.6

View File

@ -2297,25 +2297,27 @@ module ApplicationHelper
#获取匿评相关连接代码
def homework_anonymous_comment homework
if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
link = "<span class='fr mr10 pr_join_span ' title='作业截止日期之前不可以启动匿评'>启动匿评</span>".html_safe
elsif homework.student_works.count >= 2 #作业份数大于2
case homework.homework_detail_manual.comment_status
when 1
link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit'
when 2
link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit'
when 3
link = "<span class='fr pr_join_span mr10' title='匿评结束'>匿评结束</span>".html_safe
end
else
link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe
# if homework.homework_type == 1 && homework.homework_detail_manual #匿评作业
#
# elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业作业
# link = "<span class='fr mr10 pr_join_span ' title='编程作业'>编程作业</span>".html_safe
# else
# link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe
# end
if Time.parse(homework.end_time.to_s).strftime("%Y-%m-%d") >= Time.now.strftime("%Y-%m-%d")
link = "<span class='fr mr10 pr_join_span ' title='作业截止日期之前不可以启动匿评'>启动匿评</span>".html_safe
elsif homework.student_works.count >= 2 #作业份数大于2
case homework.homework_detail_manual.comment_status
when 1
link = link_to '启动匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_start_anonymous_comment", remote: true, disable_with: '加载中...',:class => 'fr mr10 work_edit'
when 2
link = link_to '关闭匿评', alert_anonymous_comment_homework_common_path(homework), id: "#{homework.id}_stop_anonymous_comment", remote: true,:class => 'fr mr10 work_edit'
when 3
link = "<span class='fr pr_join_span mr10' title='匿评结束'>匿评结束</span>".html_safe
end
elsif homework.homework_type == 2 && homework.homework_detail_programing #编程作业作业
link = "<span class='fr mr10 pr_join_span ' title='编程作业'>编程作业</span>".html_safe
else
link = "<span class='fr mr10 pr_join_span ' title='未开启匿评作业不可以启动匿评'>启动匿评</span>".html_safe
link = "<span class='fr mr10 pr_join_span ' title='学生提交作业数大于2时才可以启动匿评'>启动匿评</span>".html_safe
end
link
end

View File

@ -1,4 +1,5 @@
# encoding: utf-8
include UsersHelper
module HomeworkCommonHelper
#迟交扣分下拉框
def late_penalty_option

View File

@ -98,17 +98,17 @@
<div class="cl"></div>
<% end%>
<div class="mt5">
<!--div class="mt5">
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>
<div class="fl mb5 c_red">
<% if homework.homework_type == 1%>
<%= scoring_rules homework.late_penalty,homework.id,@is_teacher,homework.homework_detail_manual.absence_penalty%>
<% else%>
<%= scoring_rules homework.late_penalty,homework.id,@is_teacher%>
<% end%>
<%# if homework.homework_type == 1%>
<%#= scoring_rules homework.late_penalty,homework.id,@is_teacher,homework.homework_detail_manual.absence_penalty%>
<%# else%>
<%#= scoring_rules homework.late_penalty,homework.id,@is_teacher%>
<%# end%>
</div>
</div>
<div class="cl"></div>
<div class="cl"></div-->
<span class="fl"><%= l(:label_end_time)%><%= homework.end_time%></span>
<% if betweentime(homework.end_time) < 0 %>

View File

@ -27,7 +27,7 @@
</div>
<div class="homepageContentContainer">
<div class="homepageRightBannerImg"></div>
<!--div class="homepageRightBannerImg"></div-->
<div class="cl"></div>
<div class="homepageContent">
<div class="homepageLeft" id="LSide">

View File

@ -185,18 +185,18 @@
</div>
<div class="cl"></div>
<div class="mt5">
<!--div class="mt5">
<span class="tit_fb" style="width: auto;"> 扣分标准:</span>
<div class="fl mb5 c_red">
<% if @homework.homework_type == 1%>
<%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher,@homework.homework_detail_manual.absence_penalty%>
<% else%>
<%= scoring_rules @homework.late_penalty,@homework.id,@is_teacher%>
<% end%>
<%# if @homework.homework_type == 1%>
<%#= scoring_rules @homework.late_penalty,@homework.id,@is_teacher,@homework.homework_detail_manual.absence_penalty%>
<%# else%>
<%#= scoring_rules @homework.late_penalty,@homework.id,@is_teacher%>
<%# end%>
</div>
</div>
<div class="cl"></div>
<div class="cl"></div-->
<span class="fl">截止时间:<%= @homework.end_time%></span>
<div >
<% if betweentime(@homework.end_time) < 0 %>

View File

@ -1,17 +1,20 @@
<!-- 此界面只用来新建匿评作业作品 -->
<script type="text/javascript">
<%if @homework.homework_type == 1 && @homework.homework_detail_manual.comment_status != 1%>
<%if @homework.homework_detail_manual.comment_status != 1%>
$(function(){
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'student_work/new_student_work_alert') %>');
showModal('ajax-modal', '360px');
$('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
$('#ajax-modal').parent().css("top","").css("left","");
$('#ajax-modal').parent().css("top","30%").css("left","40%");
$('#ajax-modal').parent().addClass("anonymos_work");
// alert("当前作业已开启匿评,您提交作品后将不会收到任何匿评作品,您的作品也不会被其他用户匿评,如需获得最终成绩,请您联系主讲老师对您的作品单独进行评分");
});
<% end%>
//匿评弹框取消按钮
function clickCanel(){hideModal("#popbox02");}
</script>
<div class="homepageRightBanner mb10">

View File

@ -45,11 +45,13 @@
<div class="mt5">
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_homework('new_homework_common');">发送</a>
<span class="fr mr10 mt3">或</span>
<% if edit_mode %>
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_homework('edit_homework_common_<%= homework.id%>');">确定</a>
<span class="fr mr10 mt3">或</span>
<%= link_to "取消",user_homeworks_user_path(User.current.id),:class => "fr mr10 mt3"%>
<% else %>
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="submit_homework('new_homework_common');">发送</a>
<span class="fr mr10 mt3">或</span>
<a href="javascript:void(0);" class=" fr mr10 mt3" onclick="reset_homework();">取消</a>
<% end %>
<div class="cl"></div>

View File

@ -3,7 +3,7 @@
$("#homework_name").val("");
$("#homework_end_time").val("");
$("#course_id").val($("#option_select").val());
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new })%>");
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => HomeworkCommon.new,:has_program => true })%>");
homework_description_editor.html("");
$("#homework_editor").toggle();
}

View File

@ -3,6 +3,6 @@ hideModal('#coursesChoosePopup');
$("#homework_name").val("<%= @homework.name%>");
$("#homework_end_time").val("<%= @homework.end_time%>");
$("#course_id").val("<%= @homework.course_id%>");
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework })%>");
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => { :container => @homework,:has_program => true })%>");
homework_description_editor.html("<%= escape_javascript(@homework.description.html_safe)%>");
$("#homework_editor").show();

View File

@ -0,0 +1,25 @@
class AboutProgramingHomework < ActiveRecord::Migration
def up
HomeworkCommon.where(:homework_type => 2).each do |homework|
unless homework.homework_detail_manual
homework_detail_manual = HomeworkDetailManual.new
homework_detail_manual.ta_proportion = 0.6
homework_detail_manual.comment_status = 1
homework_detail_manual.evaluation_start = homework.created_at
homework_detail_manual.evaluation_end = homework.created_at
homework_detail_manual.evaluation_num = 3
homework_detail_manual.absence_penalty = 2
homework_detail_manual.homework_common_id = homework.id
homework_detail_manual.save
end
end
end
def down
HomeworkCommon.where(:homework_type => 2).each do |homework|
if homework.homework_detail_manual
homework.homework_detail_manual.destroy
end
end
end
end

View File

@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.
ActiveRecord::Schema.define(:version => 20150907152238) do
ActiveRecord::Schema.define(:version => 20150911031029) do
create_table "activities", :force => true do |t|
t.integer "act_id", :null => false
@ -236,6 +236,13 @@ ActiveRecord::Schema.define(:version => 20150907152238) do
t.boolean "tracker_in_review_dialog", :default => false
end
create_table "code_review_user_settings", :force => true do |t|
t.integer "user_id", :default => 0, :null => false
t.integer "mail_notification", :default => 0, :null => false
t.datetime "created_at"
t.datetime "updated_at"
end
create_table "code_reviews", :force => true do |t|
t.integer "project_id"
t.integer "change_id"
@ -469,6 +476,13 @@ ActiveRecord::Schema.define(:version => 20150907152238) do
add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
create_table "discuss_demos", :force => true do |t|
t.string "title"
t.text "body"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
end
create_table "documents", :force => true do |t|
t.integer "project_id", :default => 0, :null => false
t.integer "category_id", :default => 0, :null => false
@ -483,23 +497,26 @@ ActiveRecord::Schema.define(:version => 20150907152238) 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 "enabled_modules", :force => true do |t|
@ -764,16 +781,6 @@ ActiveRecord::Schema.define(:version => 20150907152238) 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"
@ -909,7 +916,6 @@ ActiveRecord::Schema.define(:version => 20150907152238) do
t.datetime "created_on"
t.integer "comments_count", :default => 0, :null => false
t.integer "course_id"
t.datetime "updated_on"
end
add_index "news", ["author_id"], :name => "index_news_on_author_id"
@ -1166,18 +1172,18 @@ ActiveRecord::Schema.define(:version => 20150907152238) do
create_table "relative_memos", :force => true do |t|
t.integer "osp_id"
t.integer "parent_id"
t.string "subject", :null => false
t.text "content", :null => false
t.string "subject", :null => false
t.text "content", :limit => 16777215, :null => false
t.integer "author_id"
t.integer "replies_count", :default => 0
t.integer "replies_count", :default => 0
t.integer "last_reply_id"
t.boolean "lock", :default => false
t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0
t.boolean "lock", :default => false
t.boolean "sticky", :default => false
t.boolean "is_quote", :default => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "viewed_count_crawl", :default => 0
t.integer "viewed_count_local", :default => 0
t.string "url"
t.string "username"
t.string "userhomeurl"
@ -1202,6 +1208,19 @@ ActiveRecord::Schema.define(:version => 20150907152238) do
add_index "repositories", ["project_id"], :name => "index_repositories_on_project_id"
create_table "rich_rich_files", :force => true do |t|
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "rich_file_file_name"
t.string "rich_file_content_type"
t.integer "rich_file_file_size"
t.datetime "rich_file_updated_at"
t.string "owner_type"
t.integer "owner_id"
t.text "uri_cache"
t.string "simplified_type", :default => "file"
end
create_table "roles", :force => true do |t|
t.string "name", :limit => 30, :default => "", :null => false
t.integer "position", :default => 1
@ -1253,10 +1272,11 @@ ActiveRecord::Schema.define(:version => 20150907152238) do
t.string "url"
t.string "title"
t.integer "share_type"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "project_id"
t.integer "user_id"
t.string "description"
end
create_table "softapplications", :force => true do |t|
@ -1419,8 +1439,8 @@ ActiveRecord::Schema.define(:version => 20150907152238) do
t.integer "zip_code"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "identity"
t.string "technical_title"
t.integer "identity"
t.string "student_id"
t.string "teacher_realname"
t.string "student_realname"
@ -1488,9 +1508,6 @@ ActiveRecord::Schema.define(:version => 20150907152238) do
t.integer "active"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.integer "level"
t.integer "file"
t.integer "issue"
end
create_table "user_statuses", :force => true do |t|

View File

@ -58,10 +58,10 @@ $(function(){
);
};
$('#test-program-btn').on('click', test_program);
$('#test-program-btn').live('click', test_program);
$('#commit-program-work-btn').on('click', function(){
$('#commit-program-work-btn').live('click', function(){
if(!valid_form()){
return;
}
@ -89,7 +89,7 @@ $(function(){
$(".HomeWorkCon form").submit();
});
$('form.edit_student_work').on('keydown', '#program-src', function(){
$('form.edit_student_work').live('keydown', '#program-src', function(){
tested = false;
});
@ -104,12 +104,12 @@ $(function(){
$('input.date-input').datepicker(datepickerOptions);
$('a.pic_date').on('click', function(){
$('a.pic_date').live('click', function(){
$(this).parent().prev().first().focus();
})
$('a.ProBtn').on('click', function(){
$('a.ProBtn').live('click', function(){
$("#BluePopupBox").dialog({
modal: true,
dialogClass: 'BluePopupBox',
@ -117,12 +117,12 @@ $(function(){
});
$(".ui-dialog-titlebar").hide();
$("a.CloseBtn").on('click', function(){
$("a.CloseBtn").live('click', function(){
$("#BluePopupBox" ).dialog("close");
});
$('#textarea_input_test').focus();
$("#BluePopupBox a.BlueCirBtn").on('click', function(){
$("#BluePopupBox a.BlueCirBtn").live('click', function(){
var test_numbers = 0;
var valid = true;
var input = null;
@ -162,12 +162,12 @@ $(function(){
});
});
$("#BluePopupBox").on('click', 'a.icon_add', function(){
$("#BluePopupBox").live('click', 'a.icon_add', function(){
var html = bt('t:test-answer-list', null);
$(this).parent('.mt10').after(html);
});
$("#BluePopupBox").on('click', 'a.icon_remove', function(){
$("#BluePopupBox").live('click', 'a.icon_remove', function(){
$(this).parent('.mt10').remove();
});
});

View File

@ -71,6 +71,7 @@ function submit_homework(id)
$("#course_id").focus();
}
else{
homework_description_editor.sync();
$("#"+id).submit();
}