-
+
@@ -65,7 +65,7 @@
\ No newline at end of file
diff --git a/app/views/users/new_user_commit_homework.html.erb b/app/views/users/new_user_commit_homework.html.erb
new file mode 100644
index 000000000..a150c39ba
--- /dev/null
+++ b/app/views/users/new_user_commit_homework.html.erb
@@ -0,0 +1,117 @@
+<% content_for :header_tags do %>
+ <%= javascript_include_tag "/assets/kindeditor/kindeditor",'/assets/kindeditor/pasteimg' %>
+ <%= javascript_include_tag 'homework','baiduTemplate' %>
+<% end %>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/views/users/user_commit_homework.html.erb b/app/views/users/user_commit_homework.html.erb
new file mode 100644
index 000000000..a7416cf40
--- /dev/null
+++ b/app/views/users/user_commit_homework.html.erb
@@ -0,0 +1,114 @@
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/config/routes.rb b/config/routes.rb
index c704bfdac..739c54136 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -310,8 +310,11 @@ RedmineApp::Application.routes.draw do
collection do
match "tag_saveEx" , :via => [:get, :post]
post "user_new_homework"
+ get 'new_user_commit_homework'
+ post "user_commit_homework"
post 'user_select_homework'
end
+
member do
match 'user_projects_index', :to => 'users#user_projects_index', :via => :get
match 'user_projects', :to => 'users#user_projects', :via => :get
diff --git a/public/javascripts/homework.js b/public/javascripts/homework.js
index ecf2183b1..67bfd59c3 100644
--- a/public/javascripts/homework.js
+++ b/public/javascripts/homework.js
@@ -38,7 +38,7 @@ $(function(){
tested = true;
console.log(data);
- if (cb) {cb(); return;}
+ if (typeof cb == 'function') {cb(); return;}
var html=bt('t:result-list',data);
@@ -85,7 +85,29 @@ $(function(){
//发布作业
+ var isProgramHomework = function(){
+ return !$(".advanced_option").is(":hidden");
+ }
+ var submit_comm_homework = function(id){
+ var valid = true;
+ if (isProgramHomework()) {
+ $.each($('.advanced_option textarea.InputBox'), function(i, val){
+ if ($(val).val().length<=0) {
+ $(val).focus();
+ valid = false;
+ return false;
+ }
+ });
+ if (valid) {
+ $('input[name=homework_type]').val(2);
+ };
+ }
+ if (valid) {
+ submit_homework(id);
+ }
+ }
+ window.submit_comm_homework = submit_comm_homework;
var datepickerOptions={dateFormat:'yy-mm-dd',firstDay:0,showWeek:true,showOtherMonths:true,selectOtherMonths:true};
@@ -97,7 +119,7 @@ $(function(){
$('a.DropBtn').on('click', function(){
- $(".advanced_option").toggle('slow');
+ $(".advanced_option").toggle();
});
$(".HomeWork").on('click', 'a.icon_add', function(){
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 1393431d7..03f80897a 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -719,3 +719,51 @@ a:hover.about_me{ color:#0781b4;}
+/*20150820课程作业 LB*/
+.HomeWork {width:708px; background-color:#ffffff; padding:10px 20px 20px 20px; border:1px solid #dddddd;}
+.RightBanner {width:708px; height:34px; border-bottom:1px solid #e9e9e9;}
+select.InputBox,input.InputBox,textarea.InputBox{ border:1px solid #d9d9d9; color:#888888; height:28px; line-height:28px; padding-left:5px; font-size:14px;}
+a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #15bccf; color:#15bccf; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
+a:hover.BlueCirBtn{ background:#15bccf; color:#fff;}
+.W440{ width:440px;}
+.W120{ width:110px;}
+.W700{ width:700px;max-width: 700px;min-width: 700px;}
+.w708{width: 708px;}
+a.AnnexBtn{ background: url(../images/homepage_icon2.png) 0px -343px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
+a:hover.AnnexBtn{background: url(../images/homepage_icon2.png) -90px -343px no-repeat; color:#15bccf;}
+a.FilesBtn{ background: url(../images/homepage_icon2.png) 0px -373px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
+a:hover.FilesBtn{background: url(../images/homepage_icon2.png) -89px -372px no-repeat; color:#15bccf;}
+a.BlueCirBtnMini{ display:block;width:40px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #15bccf; color:#15bccf; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
+a:hover.BlueCirBtnMini{ background:#15bccf; color:#fff;}
+a.DropBtn{background: url(../images/homepage_icon2.png) -125px -339px no-repeat; width:85px; height:20px; display:block; color:#888888; font-size:14px;}
+a:hover.DropBtn{background: url(../images/homepage_icon2.png) -125px -370px no-repeat;}
+.DropLine{border-top:1px solid #d9d9d9; float:left; width:623px; height:10px; margin-top:10px;}
+/*20150820编程作业 LB*/
+.W320{ width:320px;}
+.icon_add{ background:url(images/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;}
+a:hover.icon_add{background:url(images/icons.png) -20px -310px no-repeat;}
+.icon_remove{background:url(images/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;}
+a:hover.icon_remove{background:url(images/icons.png) -20px -338px no-repeat;}
+/*20150820提交作业 LB*/
+.HomeWorkBox{ background:#f6f6f6; padding:10px; margin:10px 0;}
+.c_grey{ color:#888888;}
+.c_dark_grey{color:#a9a9a9 !important;}
+.HomeWorkP{ width:690px; font-size:14px;}
+.H150{ height:150px;}
+.ProResult{width:748px; background-color:#fff; border:1px solid #dddddd;border-bottom:none; }
+.ProResultTop{ height:38px; line-height:38px; border-bottom:1px solid #dddddd; background:#f2f2f2; padding:0 10px;}
+.ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; }
+.W50{ width:50px;}
+.W200{ width:200px;}
+.ProResultTable{ color:#888888;}
+.T_C{ text-align:center;}
+.SearchIcon{background:url(../images/homepage_icon2.png) 676px -393px no-repeat; }
+.SearchIcon:hover{background:url(../images/homepage_icon2.png) 676px -419px no-repeat; }
+a.link_file{ background:url(../images/pic_file.png) 0 2px no-repeat; padding-left:20px; }
+a:hover.link_file{ background:url(../images/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
+a.remove-upload {background: url(../images/delete.png) no-repeat 1px 50%;width: 1px;display: inline-block;padding-left: 16px;}
+a.FilesName{ max-width:540px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;}
+a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;}
+.ProResultUl span { display:block; float:left;}
+.ProResultUl li{ line-height:35px; border-bottom:1px solid #dddddd; }
+.DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;}
\ No newline at end of file
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 357cfff6b..b9d079a7b 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -954,14 +954,3 @@ img.ui-datepicker-trigger {
.is_public{display: none !important;}
.ui-corner-left{background: #64bdd9;}
-
-
-
-
-
-
-
-
-
-
-
diff --git a/public/stylesheets/public.css b/public/stylesheets/public.css
index 0edf00efe..4cc859721 100644
--- a/public/stylesheets/public.css
+++ b/public/stylesheets/public.css
@@ -532,49 +532,3 @@ a.resourcesBlack:hover {font-size:12px; color:#000000;}
background-color: #64bdd9;
outline:none;
}
-
-/*20150820课程作业 LB*/
-.HomeWork {width:708px; background-color:#ffffff; padding:20px; border:1px solid #dddddd;}
-.RightBanner {width:708px; height:34px; border-bottom:1px solid #e9e9e9;}
-select.InputBox,input.InputBox,textarea.InputBox{ border:1px solid #d9d9d9; color:#888888; height:28px; line-height:28px; padding-left:5px; font-size:14px;}
-a.BlueCirBtn{ display:block;width:75px; height:28px; background-color:#ffffff; line-height:28px; vertical-align:middle; text-align:center; border:1px solid #15bccf; color:#15bccf; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
-a:hover.BlueCirBtn{ background:#15bccf; color:#fff;}
-.W440{ width:440px;}
-.W120{ width:110px;}
-.W700{ width:700px;}
-a.AnnexBtn{ background: url(../images/homepage_icon.png) 0px -343px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
-a:hover.AnnexBtn{background: url(../images/homepage_icon.png) -90px -343px no-repeat; color:#15bccf;}
-a.FilesBtn{ background: url(../images/homepage_icon.png) 0px -373px no-repeat; width:70px; height:20px; display:block; padding-left:20px; color:#888888;}
-a:hover.FilesBtn{background: url(../images/homepage_icon.png) -89px -372px no-repeat; color:#15bccf;}
-a.BlueCirBtnMini{ display:block;width:40px; height:22px; background-color:#ffffff; line-height:24px; vertical-align:middle; text-align:center; border:1px solid #15bccf; color:#15bccf; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
-a:hover.BlueCirBtnMini{ background:#15bccf; color:#fff;}
-a.DropBtn{background: url(../images/homepage_icon.png) -125px -339px no-repeat; width:85px; height:20px; display:block; color:#888888; font-size:14px;}
-a:hover.DropBtn{background: url(../images/homepage_icon.png) -125px -370px no-repeat;}
-.DropLine{border-top:1px solid #d9d9d9; float:left; width:623px; height:10px; margin-top:10px;}
-/*20150820编程作业 LB*/
-.W320{ width:320px;}
-.icon_add{ background:url(../images/courses/icons.png) 0px -310px no-repeat; width:16px; height:27px; display:block;float:left; margin-right:5px;}
-a:hover.icon_add{background:url(../images/courses/icons.png) -20px -310px no-repeat;}
-.icon_remove{background:url(../images/courses/icons.png) 0px -338px no-repeat; width:16px; height:27px; display:block;float:left;}
-a:hover.icon_remove{background:url(../images/courses/icons.png) -20px -338px no-repeat;}
-/*20150820提交作业 LB*/
-.HomeWorkBox{ background:#f6f6f6; padding:10px; margin:10px 0;}
-.c_grey{ color:#888888;}
-.HomeWorkP{ width:690px; font-size:14px;}
-.H150{ height:150px;}
-.ProResult{width:748px; background-color:#fff; border:1px solid #dddddd;border-bottom:none; }
-.ProResultTop{ height:38px; line-height:38px; border-bottom:1px solid #dddddd; background:#f2f2f2; padding:0 10px;}
-.ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; }
-.W50{ width:50px;}
-.W200{ width:200px;}
-.ProResultTable{ color:#888888;}
-.T_C{ text-align:center;}
-.SearchIcon{background:url(../images/homepage_icon.png) 676px -393px no-repeat; }
-.SearchIcon:hover{background:url(../images/homepage_icon.png) 676px -419px no-repeat; }
-a.link_file{ background:url(../images/courses/pic_file.png) 0 2px no-repeat; padding-left:20px; }
-a:hover.link_file{ background:url(../images/courses/pic_file.png) 0 -25px no-repeat; color:#3ca5c6;}
-a.FilesName{ max-width:540px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;}
-a.FilesName02{ max-width:665px;overflow:hidden; white-space:nowrap; text-overflow:ellipsis; display:block;}
-.ProResultUl span { display:block; float:left;}
-.ProResultUl li{ line-height:35px; border-bottom:1px solid #dddddd; }
-.DateBorder{border:1px solid #d9d9d9; border-left:none; padding:7px 6px 6px 6px;}