作业设置的相关修改

This commit is contained in:
cxt 2017-08-28 15:02:54 +08:00
parent 9927481c4a
commit baa512e4d7
3 changed files with 17 additions and 17 deletions

View File

@ -190,7 +190,7 @@ class HomeworkCommonController < ApplicationController
# homework_bank.save
# homework.update_attributes(:homework_bank_id => homework_bank.id)
# end
redirect_to student_work_index_path(:homework => homework.id, :host=> Setting.host_course)
redirect_to setting_homework_common_path(homework, :is_new => 1)
end
end
end
@ -340,7 +340,7 @@ class HomeworkCommonController < ApplicationController
end
@homework.save
@homework_detail_manual.save
redirect_to setting_homework_common_path(@homework)
redirect_to student_work_index_path(:homework => @homework.id, :host=> Setting.host_course)
end
def edit

View File

@ -94,7 +94,7 @@
</div>
<div class="clearfix mt15 <%= edit_mode ? '' : 'none' %>" id="homework_setting_submit_block">
<a href="javascript:void(0);" id="homework_setting_form_submit" class="task-btn task-btn-blue fr">提交</a>
<a href="javascript:void(0);" id="homework_setting_form_submit" class="task-btn task-btn-blue fr">确定</a>
<a href="javascript:void(0);" onclick="s_op_confirm_box('<%= student_work_index_path(:homework => @homework.id) %>', '修改的内容将全部丢失<br/>是否确认取消保存')" class="task-btn fr mr10">取消</a>
</div>
<% end %>

View File

@ -180,26 +180,26 @@ $(function(){
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false,
onSelectDate:function() {
if($.trim($("input[name='homework_archive_time']").val()) == ""){
var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/")));
$("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1))));
}
},
onSelectTime:function() {
if($.trim($("input[name='homework_archive_time']").val()) == ""){
var date = new Date(Date.parse($("input[name='homework_publish_time']").val().replace(/-/g, "/")));
$("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1))));
}
}
validateOnBlur:false
});
$("input[name='homework_end_time']").datetimepicker({
allowBlank:true,
lang:'ch',
format:'Y-m-d H:i',
validateOnBlur:false
validateOnBlur:false,
onSelectDate:function() {
if($.trim($("input[name='homework_archive_time']").val()) == ""){
var date = new Date(Date.parse($("input[name='homework_end_time']").val().replace(/-/g, "/")));
$("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1))));
}
},
onSelectTime:function() {
if($.trim($("input[name='homework_archive_time']").val()) == ""){
var date = new Date(Date.parse($("input[name='homework_end_time']").val().replace(/-/g, "/")));
$("input[name='homework_archive_time']").val(formate_time(new Date(date.setMonth(date.getMonth()+1))));
}
}
});
$("input[name='homework_archive_time']").datetimepicker({