- <%= render :partial => 'add_score',:locals => {:work => @work,:score => @score}%>
+
+ <%= render :partial => 'add_score',:locals => {:work => work,:score => score}%>
- <%@student_work_scores.each do |score|%>
-
- <%= render :partial => 'student_work_score',:locals => {:score => score,:is_last => score == @student_work_scores.last}%>
+
+ <%student_work_scores.each do |student_score|%>
+
+ <%= render :partial => 'student_work_score',:locals => {:score => student_score,:is_last => student_score == student_work_scores.last}%>
<% end%>
-
收起
+
收起
\ No newline at end of file
diff --git a/app/views/student_work/_student_work_list.html.erb b/app/views/student_work/_student_work_list.html.erb
index e23fcceda..c8248d86a 100644
--- a/app/views/student_work/_student_work_list.html.erb
+++ b/app/views/student_work/_student_work_list.html.erb
@@ -35,6 +35,14 @@
<%= render :partial => "evaluation_un_work", :locals => {:student_work => student_work}%>
<% end%>
-
+
+ <% if student_work.user == User.current %>
+ <% if @homework.homework_type == 2%>
+ <%=render :partial => 'programing_work_show', :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
+ <% else %>
+ <%=render :partial => 'show' , :locals=> {:work => student_work, :score =>student_work_score(student_work,User.current),:student_work_scores => student_work.student_works_scores.order("updated_at desc")} %>
+ <% end %>
+ <% end %>
+
<% end%>
\ No newline at end of file
diff --git a/app/views/student_work/index.html.erb b/app/views/student_work/index.html.erb
index 78f11737b..8f1f0033e 100644
--- a/app/views/student_work/index.html.erb
+++ b/app/views/student_work/index.html.erb
@@ -120,14 +120,31 @@
diff --git a/lib/tasks/update_rep_if_fault.rake b/lib/tasks/gitlab_to_git.rake
similarity index 100%
rename from lib/tasks/update_rep_if_fault.rake
rename to lib/tasks/gitlab_to_git.rake
diff --git a/lib/tasks/sync_sigle_rep.rake b/lib/tasks/sync_sigle_rep.rake
new file mode 100644
index 000000000..b99221c83
--- /dev/null
+++ b/lib/tasks/sync_sigle_rep.rake
@@ -0,0 +1,22 @@
+#coding=utf-8
+
+namespace :sync_rep do
+ desc "sync some projects which just have sigle repository"
+ task :sigle => :environment do
+ projects = Project.all
+ projects.each do |project|
+ # 针对类型为Git并且只有一个版本库的项目
+ if project.repositories && project.repositories.count == 1 && project.repositories.first.type == "Repository::Git"
+ rep = project.repositories.first
+ s = Trustie::Gitlab::Sync.new
+ s.sync_project(project, path: rep.identifier, import_url: rep.url)
+ rep.type = 'Repository::Gitlab'
+ rep.save
+ puts "*************************************"
+ puts project.id
+ puts rep.id
+ puts rep.identifier
+ end
+ end
+ end
+end
\ No newline at end of file
diff --git a/lib/trustie/gitlab/sync.rb b/lib/trustie/gitlab/sync.rb
index 3a8e8380c..8c84984ee 100644
--- a/lib/trustie/gitlab/sync.rb
+++ b/lib/trustie/gitlab/sync.rb
@@ -66,7 +66,7 @@ module Trustie
if opt[:password]
import_url.sub('@', ":#{opt[:password]}@")
end
-
+
# import url http://xianbo_trustie2:1234@repository.trustie.net/xianbo/trustie2.git
# can use password
gproject = self.g.create_project(path,
@@ -76,6 +76,7 @@ module Trustie
wall_enabled: false,
issues_enabled: false,
snippets_enabled: false,
+ merge_requests_enabled: true,
public: false,
user_id: gid,
import_url: import_url
diff --git a/public/stylesheets/courses.css b/public/stylesheets/courses.css
index 317a21d02..7a3d43469 100644
--- a/public/stylesheets/courses.css
+++ b/public/stylesheets/courses.css
@@ -178,7 +178,9 @@ a.f_grey:hover {color:#000000;}
/*.upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;}*/
.red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
-.grey_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
+.green_homework_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
+.grey_btn_cir{ background:#b2b2b2; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
+.grey_homework_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
.blue_btn_cir{ background:#3498db; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
.sticky_btn_cir{ background:#269ac9; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
@@ -966,7 +968,8 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r
.ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; }
.W50{ width:50px;}
.W200{ width:200px;}
-.m_w480{max-width: 480px;}
+.m_w460{max-width: 460px;}
+.m_w505{max-width: 505px;}
.m_w500{max-width: 500px;}
.m_w530{max-width: 530px;}
.ProResultTable{ color:#888888;}
diff --git a/public/stylesheets/new_user.css b/public/stylesheets/new_user.css
index 6a296b941..0b45685ee 100644
--- a/public/stylesheets/new_user.css
+++ b/public/stylesheets/new_user.css
@@ -293,8 +293,10 @@ a:hover.bgreen_n_btn{background:#08a384;}
.more_btn{-moz-border-radius:3px; -webkit-border-radius:3px; border:1px solid #9DCEFF; color:#9DCEFF; border-radius:3px; padding:0px 3px;}
.upbtn{ margin:42px 0 0 10px; border:none; color:#999; width:150px;}
.red_btn_cir{ background:#e74c3c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
-.green_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
-.grey_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
+.green_btn_cir{ background:#28be6c; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
+.green_homework_btn_cir{ background:#28be6c; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
+.grey_btn_cir{ background:#b2b2b2; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
+.grey_homework_btn_cir{ background:#b2b2b2; padding:1px 3px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
.blue_btn_cir{ background:#3498db; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal;font-size:12px;}
.orange_btn_cir{ background:#e67e22; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
.sticky_btn_cir{ background:#269ac9; padding:1px 10px; -moz-border-radius:2px; -webkit-border-radius:2px; border-radius:2px; color:#fff; font-weight:normal; font-size:12px;}
@@ -1073,7 +1075,8 @@ a:hover.icon_remove{background:url(../images/course/icons.png) -20px -338px no-r
.ProResultCon{ padding:10px; color:#888888; line-height:24px; border-bottom:1px solid #dddddd; }
.W50{ width:50px;}
.W200{ width:200px;}
-.m_w480{max-width: 480px;}
+.m_w460{max-width: 460px;}
+.m_w505{max-width: 505px;}
.m_w530{max-width: 530px;}
.ProResultTable{ color:#888888;}
.T_C{ text-align:center;}