diff --git a/app/views/student_work/new.html.erb b/app/views/student_work/new.html.erb
index c7f1d45c4..6cf168f8e 100644
--- a/app/views/student_work/new.html.erb
+++ b/app/views/student_work/new.html.erb
@@ -21,6 +21,20 @@
"");
$('#ajax-modal').parent().css("top","30%").css("left","20%").css("position","fixed");
}
+
+ // 点击 checkbox选中引用的资源的时候,保存该资源的id到session里去
+ function store_seleted_resource(dom){
+ console.log(dom.attr('checked'))
+ if(dom.attr('checked') == 'checked' ){
+ $.get(
+ '<%= store_selected_resource_user_path(User.current) %>'+'?save=y&res_id='+dom.val()
+ )
+ }else {
+ $.get(
+ '<%= store_selected_resource_user_path(User.current) %>'+'?save=n&res_id='+dom.val()
+ )
+ }
+ }