diff --git a/app/views/users/_user_group_attr.html.erb b/app/views/users/_user_group_attr.html.erb
new file mode 100644
index 000000000..42d35c5d7
--- /dev/null
+++ b/app/views/users/_user_group_attr.html.erb
@@ -0,0 +1,24 @@
+分组设置
+
+
-
上传附件
- <%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mt3 mr20",:remote => true%>
+
上传附件
+ <%= link_to "资源库",{:controller => 'users',:action=>'user_import_resource',:id=>User.current.id,:homework_id=>container.id},:class => "FilesBtn fl mt3 mr15",:title=>"请从资源库中选择文件作为作品的附件",:remote => true%>
<% if defined?(has_program) && has_program %>
-
编程
-
+
编程
+
+
分组
<% end %>
diff --git a/app/views/users/_user_homework_form.html.erb b/app/views/users/_user_homework_form.html.erb
index efaed2d9d..5c4cd1734 100644
--- a/app/views/users/_user_homework_form.html.erb
+++ b/app/views/users/_user_homework_form.html.erb
@@ -97,7 +97,18 @@
+
+
+
\ No newline at end of file
diff --git a/public/images/course/hwork_icon.png b/public/images/course/hwork_icon.png
new file mode 100644
index 000000000..82c78ac60
Binary files /dev/null and b/public/images/course/hwork_icon.png differ
diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js
index f1b6e1814..39351cc6b 100644
--- a/public/javascripts/homework.js
+++ b/public/javascripts/homework.js
@@ -124,7 +124,6 @@ $(function(){
$('#textarea_input_test').focus();
});
-
var saveProgramAnswers = function() {
var test_numbers = 0;
var valid = true;
@@ -171,7 +170,7 @@ $(function(){
$("input[name=homework_type]").after(html);
}
return valid;
- }
+ };
$("#BluePopupBox a.BlueCirBtn").live('click', function(){
if(saveProgramAnswers()){
@@ -198,6 +197,68 @@ $(function(){
$(this).parent('.mt10').remove();
});
+ //分组作业
+ $("#GroupPopupBox").dialog({
+ modal: true,
+ autoOpen: false,
+ dialogClass: 'BluePopupBox',
+ minWidth: 290
+ });
+
+ $('a.groupBtn').live('click', function(){
+ $("#GroupPopupBox").dialog("open");
+ $(".ui-dialog-titlebar").hide();
+ $("a.popClose").on('click', function(){
+ $("#GroupPopupBox" ).dialog("close");
+ });
+ $("#cancel_group").on('click', function(){
+ $("#GroupPopupBox" ).dialog("close");
+ });
+ $('#min_num').focus();
+ });
+
+ var saveGroupAttr = function() {
+ var valid = true;
+ var base_on_project = 0;
+ var min = $.trim($("#min_num").val());
+ var max = $.trim($("#max_num").val());
+ if(min.length <= 0) {
+ $("#min_num").focus();
+ valid = false;
+ return false;
+ }
+ if(max.length <= 0) {
+ $("#max_num").focus();
+ valid = false;
+ return false;
+ }
+ if ($("#base_on_project").is(":checked")) {
+ base_on_project = 1;
+ }
+ if (valid) {
+ $("input[name=homework_type]").val(3);
+ $('span.group_detail_info').text('分组人数:'+min+'-'+max+' 人');
+ //保存js值
+ var data = {
+ base_on_project: base_on_project,
+ min_num: min,
+ max_num: max
+ };
+ //构建到form中
+ $('.group-input').remove();
+ var html=bt('t:group-input-list',data);
+ $("input[name=homework_type]").after(html);
+ }
+ return valid;
+ };
+
+ $("#GroupPopupBox a.group_btn").live('click', function(){
+ if(saveGroupAttr()){
+ if($( "#GroupPopupBox" ).dialog( "isOpen" )){
+ $("#GroupPopupBox").dialog( "close" );
+ }
+ }
+ });
//代码编辑器
if (typeof CodeMirror != "undefined") {
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 2fb32e2d0..93594794e 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -1175,4 +1175,14 @@ a:hover.testEdit{ background:url(images/icons.png) -21px -272px no-repeat;}
.rankList li p {width:100%; overflow:hidden; white-space:normal; text-overflow:ellipsis; color:#585858;word-wrap: normal; word-break: normal;}
.rankPortrait {border-radius:50%; width:35px; height:35px;}
.numIntro {position:absolute; text-align:left; z-index:999; box-shadow:0px 2px 8px rgba(146, 153, 169, 0.5); border:1px solid #eaeaea; background-color:#ffffff; padding:3px 5px; left:15px; color:#585858; white-space: nowrap;}
-.font_cus {font-family: "微软雅黑","宋体"; font-size: 12px; line-height: 1.5;}
+.font_cus {font-family: "微软雅黑","宋体"; font-size: 12px; line-height: 1.5;}
+/*20151130课程项目集成Tim*/
+a.testBtn{background: url(/images/course/hwork_icon.png) -2px -5px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+a:hover.testBtn{background: url(/images/course/hwork_icon.png) -81px -5px no-repeat !important; color:#3598db; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+a.groupBtn{ background: url(/images/course/hwork_icon.png) -2px -61px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+a:hover.groupBtn{background: url(/images/course/hwork_icon.png) -80px -61px no-repeat !important; color:#3598db; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+.markInput { outline:none; border:1px solid #e6e6e6; height:30px; width:50px; color:#3d3c3c; margin-right:5px; text-align:center; padding-left:0px;}
+.groupPopUp {width:290px; height:auto; padding:15px; background-color:#ffffff; z-index:1000; position:relative;}
+.popClose {background:url(/images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:2px; top:3px;}
+a.memberBtn{ background: url(/images/course/hwork_icon.png) -7px -90px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+a:hover.memberBtn{background: url(/images/course/hwork_icon.png) -80px -90px no-repeat !important; color:#3598db; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index a08fd6f33..90ac82f2b 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -1349,3 +1349,14 @@ span.author { font-size: 0.9em; color: #888; }
.pageCell:hover {border:1px solid #3498db; z-index:10;}
.pageCellActive {background-color:#3498db; border:1px solid #3498db !important; position:relative; color:#ffffff;}
+/*20151130课程项目集成Tim*/
+a.testBtn{background: url(/images/course/hwork_icon.png) -2px -5px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+a:hover.testBtn{background: url(/images/course/hwork_icon.png) -81px -5px no-repeat !important; color:#3598db; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+a.groupBtn{ background: url(/images/course/hwork_icon.png) -2px -61px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+a:hover.groupBtn{background: url(/images/course/hwork_icon.png) -80px -61px no-repeat !important; color:#3598db; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+.markInput { outline:none; border:1px solid #e6e6e6; height:30px; width:50px; color:#3d3c3c; margin-right:5px; text-align:center; padding-left:0px;}
+.groupPopUp {width:290px; height:auto; padding:15px; background-color:#ffffff; z-index:1000; position:relative;}
+.popClose {background:url(/images/resource_icon_list.png) 0px -40px no-repeat; width:20px; height:20px; display:inline-block; position: absolute; z-index: 1000; right:2px; top:3px;}
+a.memberBtn{ background: url(/images/course/hwork_icon.png) -7px -90px no-repeat !important; height:20px; display:block; padding-left:20px; color:#888888; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+a:hover.memberBtn{background: url(/images/course/hwork_icon.png) -80px -90px no-repeat !important; color:#3598db; -moz-transition :all 0s linear 0s; -webkit-transition :all 0s linear 0s; -o-transition:all 0s linear 0s; transition:all 0s linear 0s;}
+