Merge branch 'gitlab_guange' into szzh
This commit is contained in:
commit
a5c7cecc2e
|
@ -374,6 +374,7 @@ class CoursesController < ApplicationController
|
|||
|
||||
def settings
|
||||
if User.current.allowed_to?(:as_teacher,@course)
|
||||
@select_tab = params[:tab]
|
||||
@issue_custom_fields = IssueCustomField.sorted.all
|
||||
@issue_category ||= IssueCategory.new
|
||||
@member ||= @course.members.new
|
||||
|
|
|
@ -6,6 +6,14 @@ class ExerciseController < ApplicationController
|
|||
include ExerciseHelper
|
||||
|
||||
def index
|
||||
publish_exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now)
|
||||
publish_exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 2)
|
||||
end
|
||||
end_exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now)
|
||||
end_exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 3)
|
||||
end
|
||||
if @course.is_public == 0 && !User.current.member_of_course?(@course)
|
||||
render_403
|
||||
return
|
||||
|
@ -24,6 +32,14 @@ class ExerciseController < ApplicationController
|
|||
end
|
||||
|
||||
def show
|
||||
publish_exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now)
|
||||
publish_exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 2)
|
||||
end
|
||||
end_exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now)
|
||||
end_exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 3)
|
||||
end
|
||||
unless User.current.member_of_course?(@course)
|
||||
render_403
|
||||
return
|
||||
|
|
|
@ -64,32 +64,53 @@ class RepositoriesController < ApplicationController
|
|||
end
|
||||
|
||||
def forked
|
||||
# 被forked的标识如果不满足单个用户唯一性,则不执行fork
|
||||
if is_sigle_identifier?(User.current, @repository.identifier)
|
||||
# REDO: 那些人有权限forked项目
|
||||
g = Gitlab.client
|
||||
gproject = g.post ("/projects/fork/#{@project.gpid}?user_id=#{User.current.gid}")
|
||||
if gproject
|
||||
copy_project(@project, gproject)
|
||||
end
|
||||
# 如果当前用户已经fork过该项目,不会新fork项目,则跳至已fork的项
|
||||
unless has_forked?(@project, User.current)
|
||||
project = project_from_current_project(@project.id, User.current.id)
|
||||
redirect_to project_path(project)
|
||||
else
|
||||
flash[:notice] = l(:project_gitlab_fork_double_message)
|
||||
redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||
# 单个用户只能拥有一个名字一样的版本库,否则不能fork
|
||||
# if is_sigle_identifier?(User.current, @repository.identifier)
|
||||
# REDO: 那些人有权限forked项目
|
||||
g = Gitlab.client
|
||||
gproject = g.fork(@project.gpid, User.current.gid)
|
||||
if gproject
|
||||
copy_project(@project, gproject)
|
||||
forked_count = @project.forked_count.to_i + 1
|
||||
@project.update_attributes(:forked_count => forked_count)
|
||||
end
|
||||
# else
|
||||
# flash[:notice] = l(:project_gitlab_fork_double_message)
|
||||
# redirect_to settings_project_url(@project, :tab => 'repositories')
|
||||
# end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# 判断用户是否已经fork过该项目
|
||||
def has_forked?(project, user)
|
||||
projects = Project.where("user_id =?", user)
|
||||
projects.map(&:forked_from_project_id).detect{|s| s == @project.id}.nil? ? true : false
|
||||
end
|
||||
|
||||
# 获取当前用户fork过的项目
|
||||
def project_from_current_project(project, user)
|
||||
project = Project.where("user_id =? and forked_from_project_id =?",user, project).first
|
||||
end
|
||||
|
||||
# copy a project for fork
|
||||
def copy_project(project, gproject)
|
||||
def copy_project(tproject, gproject)
|
||||
project = Project.new
|
||||
project.name = @project.name
|
||||
project.is_public = @project.is_public
|
||||
project.status = @project.status
|
||||
project.description = @project.description
|
||||
project.hidden_repo = @project.hidden_repo
|
||||
project.name = tproject.name
|
||||
project.is_public = tproject.is_public
|
||||
project.status = tproject.status
|
||||
project.description = tproject.description
|
||||
project.hidden_repo = tproject.hidden_repo
|
||||
project.user_id = User.current.id
|
||||
project.project_type = 0
|
||||
project.project_new_type = @project.project_new_type
|
||||
project.project_new_type = tproject.project_new_type
|
||||
project.gpid = gproject.id
|
||||
project.forked_from_project_id = tproject.id
|
||||
if project.save
|
||||
r = Role.givable.find_by_id(Setting.new_project_user_role_id.to_i) || Role.givable.first
|
||||
m = Member.new(:user => User.current, :roles => [r])
|
||||
|
@ -124,16 +145,16 @@ class RepositoriesController < ApplicationController
|
|||
|
||||
def copy_repository(project, gproject)
|
||||
# 避免
|
||||
if is_sigle_identifier?(project.user_id, gproject.name)
|
||||
# if is_sigle_identifier?(project.user_id, gproject.name)
|
||||
repository = Repository.factory('Git')
|
||||
repository.project_id = project.id
|
||||
repository.type = 'Repository::Gitlab'
|
||||
repository.url = gproject.name
|
||||
repository.identifier = gproject.name
|
||||
repository = repository.save
|
||||
else
|
||||
flash[:notice] = l(:project_gitlab_create_double_message)
|
||||
end
|
||||
# else
|
||||
# flash[:notice] = l(:project_gitlab_create_double_message)
|
||||
# end
|
||||
end
|
||||
|
||||
def newrepo
|
||||
|
|
|
@ -3,8 +3,8 @@ class StudentWorkController < ApplicationController
|
|||
include StudentWorkHelper
|
||||
require 'bigdecimal'
|
||||
require "base64"
|
||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:set_score_rule,:forbidden_anonymous_comment]
|
||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work]
|
||||
before_filter :find_homework, :only => [:new, :index, :create, :student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :program_test,:set_score_rule,:forbidden_anonymous_comment,:delete_work]
|
||||
before_filter :find_work, :only => [:edit, :update, :show, :destroy, :add_score, :praise_student_work,:retry_work]
|
||||
before_filter :member_of_course, :only => [:index, :new, :create, :show, :add_score, :praise_student_work]
|
||||
before_filter :author_of_work, :only => [:edit, :update, :destroy]
|
||||
before_filter :teacher_of_course, :only => [:student_work_absence_penalty, :absence_penalty_list, :evaluation_list, :set_score_rule, :forbidden_anonymous_comment]
|
||||
|
@ -222,7 +222,7 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
def edit
|
||||
@user = User.current
|
||||
if !User.current.admin? && @homework.homework_type == 2 #编程作业不能修改作业
|
||||
if (!User.current.admin? && @homework.homework_type == 2) || Time.parse(@homework.end_time.to_s).strftime("%Y-%m-%d") < Time.now.strftime("%Y-%m-%d") #编程作业不能修改作业|| 截止日期已到不能修改作业
|
||||
render_403
|
||||
else
|
||||
respond_to do |format|
|
||||
|
@ -284,6 +284,23 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
end
|
||||
|
||||
def delete_work
|
||||
@work = StudentWork.where("user_id =? and homework_common_id =?", User.current.id, @homework.id).first
|
||||
if @work
|
||||
@work.destroy
|
||||
end
|
||||
redirect_to user_homeworks_user_path(User.current.id)
|
||||
end
|
||||
|
||||
def retry_work
|
||||
if @work.destroy
|
||||
@student_work = StudentWork.new
|
||||
respond_to do |format|
|
||||
format.js
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#添加评分,已评分则为修改评分
|
||||
def add_score
|
||||
@is_last = params[:is_last] == "true"
|
||||
|
|
|
@ -1,9 +1,14 @@
|
|||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= @subPage_title%></h2>
|
||||
</div>
|
||||
<% if @subPage_title == l(:label_student_list)%>
|
||||
<%= render :partial => 'course_student', :locals => {:members => @members} %>
|
||||
<% else%>
|
||||
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
||||
<% end%>
|
||||
|
||||
<div class="project_r_h">
|
||||
<h2 class="project_h2 fl"><%= @subPage_title%></h2>
|
||||
<% if User.current.allowed_to?(:as_teacher,@course) %>
|
||||
<span class="fr f14 fontGrey2" style="height: 40px; line-height: 40px; margin-right: 15px;">
|
||||
<%=link_to "修改角色", :controller => 'courses', :action => 'settings', :id => @course.id, :tab=>'member' %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% if @subPage_title == l(:label_student_list)%>
|
||||
<%= render :partial => 'course_student', :locals => {:members => @members} %>
|
||||
<% else%>
|
||||
<%= render :partial => 'course_teacher', :locals => {:members => @members} %>
|
||||
<% end%>
|
||||
|
||||
|
|
|
@ -1,6 +1,13 @@
|
|||
<div class="project_r_h">
|
||||
<h2 class="project_h2"><%= l(:label_course_modify_settings)%></h2>
|
||||
</div>
|
||||
<script>
|
||||
$(function(){
|
||||
<% if @select_tab == 'member'%>
|
||||
$("#tb_2").click();
|
||||
<% end %>
|
||||
})
|
||||
</script>
|
||||
<div class="hwork_new">
|
||||
<div id="tb_" class="hwork_tb_">
|
||||
<ul>
|
||||
|
@ -118,4 +125,4 @@
|
|||
}
|
||||
$("#time_selected").click(select);
|
||||
$("#term_selected").click(select);
|
||||
</script>
|
||||
</script>
|
||||
|
|
|
@ -35,6 +35,5 @@
|
|||
$("#exercise_time").val("<%=exercise.time if exercise.time!= -1 %>");
|
||||
$("#exercise_publish_time").val("<%= Time.parse(format_time(exercise.publish_time)).strftime("%Y-%m-%d") if !exercise.publish_time.nil?%>");
|
||||
/*$("#exercise_description").text("<%#=exercise.exercise_description.html_safe %>");*/
|
||||
document.getElementById("exercise_description").innerHTML = <%=exercise.exercise_description.html_safe %>;
|
||||
}
|
||||
</script>
|
|
@ -208,7 +208,7 @@
|
|||
<div class="cl"></div>
|
||||
<% unless contributor_course_scor(@course.id).count == 0 %>
|
||||
<ul class="rankList">
|
||||
<h4>课程贡献榜</h4>
|
||||
<h4>课程活跃度</h4>
|
||||
<% contributor_course_scor(@course.id).each do |contributor_score| %>
|
||||
<% unless contributor_score.total_score ==0 %>
|
||||
<li> <a href="javascript:void:(0);"><%=link_to image_tag(url_to_avatar(contributor_score.user), :width => "35", :height => "35", :class=> "rankPortrait"),user_path(contributor_score.user) %></a>
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
版本库地址:<%= @repos_url %>
|
||||
<% else %>
|
||||
版本库地址:<%= h @repository.url %>
|
||||
<% end %>
|
||||
<% end %>-
|
||||
<!-- added by bai -->
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
|
@ -25,8 +25,10 @@
|
|||
<textarea id="copy_rep_content" class="cloneUrl mt5 fl" type="input" placeholder="http://xianbo_trustie2@repository.trustie.net/xianbo/trustie2.git"><%=@repository.type.to_s=="Repository::Gitlab" ? @repos_url.to_s.lstrip : @repository.url %></textarea>
|
||||
<a href="javascript:void(0);" class="clone_btn mt5" onclick="jsCopy()"><span class="vl_copy" title="点击复制版本库地址"></span></a>
|
||||
<div class="fl mt5 ml15"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_zip"></span>ZIP</a> </div>
|
||||
<div class="fr mt5"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_fork"></span>Fork</a> <span href="javascript:void(0);" class="vl_btn_2 fb">0</span> </div>
|
||||
<!--<div class="fr mt5"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_fork"></span><%= link_to "Fork", :controller => 'repositories', :action => 'forked' %></a> <span href="javascript:void(0);" class="vl_btn_2 fb">0</span> </div>-->
|
||||
<!--<div class="fr mt5"><a href="javascript:void(0);" class="vl_btn fb" onclick="zip()"><span class="vl_fork"></span>Fork</a> <span href="javascript:void(0);" class="vl_btn_2 fb">0</span> </div>-->
|
||||
|
||||
<div class="fr mt5"><span class="vl_fork"></span><%= link_to "Fork", :controller => 'repositories', :action => 'forked'%>
|
||||
<span href="javascript:void(0);" class="vl_btn_2 fb"><%= @project.forked_count.to_i %></span> </div>
|
||||
<div class="cl"></div>
|
||||
<div class="recordBanner mt10">
|
||||
<% if @changesets && !@changesets.empty? %>
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<div class="fl">
|
||||
<div class="cl"></div>
|
||||
<span style="font-weight:normal;">
|
||||
<a href="javascript:void(0);" class="blueCir ml5" onclick="$('#_file<%=work.id %>').click();">上传附件</a>
|
||||
<%#= button_tag "上传附件", :type=>"button", :onclick=>"$('#_file#{work.id}').click();",:onmouseover => 'this.focus()',:class => 'blueCir ml5' %>
|
||||
<%= file_field_tag 'attachments[dummy][file]',
|
||||
:id => "_file#{work.id}",
|
||||
:class => 'file_selector',
|
||||
:multiple => true,
|
||||
:onchange => "addReviseFiles(this, '#{work.id}');",
|
||||
:style => 'display:none',
|
||||
:data => {
|
||||
:max_file_size => Setting.attachment_max_size.to_i.kilobytes,
|
||||
:max_file_size_message => l(:error_attachment_too_big, :max_size => number_to_human_size(Setting.attachment_max_size.to_i.kilobytes)),
|
||||
:max_concurrent_uploads => Redmine::Configuration['max_concurrent_ajax_uploads'].to_i,
|
||||
:upload_path => uploads_path(:format => 'js'),
|
||||
:description_placeholder => l(:label_optional_description),
|
||||
:field_is_public => l(:field_is_public),
|
||||
:are_you_sure => l(:text_are_you_sure),
|
||||
:file_count => l(:label_file_count),
|
||||
:lebel_file_uploding => l(:lebel_file_uploding),
|
||||
:delete_all_files => l(:text_are_you_sure_all),
|
||||
:containerid => "#{work.id}"
|
||||
} %>
|
||||
</span>
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'attachments' %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
|
@ -61,6 +61,31 @@
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<!--<div class="resubAtt">
|
||||
<span class="resubTitle">追加修订附件</span>
|
||||
</div>
|
||||
<div class="mt15">
|
||||
<span class="tit_fb"> 追加附件:</span>
|
||||
<a href="javascript:void(0);" class="link_file fl" >socket实验-123456-王强revise.zip</a>
|
||||
<span id="attachments_fields<%= work.id%>" xmlns="http://www.w3.org/1999/html">
|
||||
<span id="attachments_p<%= work.id %>">-->
|
||||
<%#= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'filename link_file', :readonly=>'readonly')%>
|
||||
<%#= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
|
||||
<!--<span class="ispublic-label"><%#= l(:field_is_public)%>:</span>-->
|
||||
<%#= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>
|
||||
<%#= link_to(' '.html_safe, attachment_path(attachment, :attachment_id => "p#{i}", :format => 'js'), :method => 'delete', :remote => true, :class => 'remove-upload') unless attachment.id.nil? %>
|
||||
<%#= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %>
|
||||
<!--</span>
|
||||
</span>
|
||||
<span class="ml5">(123KB)</span><br />
|
||||
<span class="tit_fb">追加时间:</span>2015-12-03 11:00 (此时其他同学作品尚未公开)
|
||||
</div>
|
||||
<div class="mt5">
|
||||
<%#= render :partial => 'student_work/revise_attachments', :locals => {:work => work } %>
|
||||
<a href="javascript:void(0);" class="blueCir ml5" title="请选择文件上传">上传附件</a>
|
||||
</div>
|
||||
<div class="cl"></div>-->
|
||||
|
||||
<div class="ping_box fl" id="score_list_<%= work.id%>" style="<%= work.student_works_scores.empty? ? 'padding:0px;' : ''%>">
|
||||
<%student_work_scores.each do |student_score|%>
|
||||
<div id="work_score_<%= student_score.id%>">
|
||||
|
|
|
@ -19,9 +19,10 @@
|
|||
</p>
|
||||
<div class="cl"></div>
|
||||
<div class="ni_btn mt10">
|
||||
<a href="javascript:" class="tijiao" onclick="clickOK();" style="margin-bottom: 15px; margin-left: 55px;" >
|
||||
<a href="javascript:" class="tijiao" onclick="clickOK();" style="margin-bottom: 15px;margin-top:15px;" >
|
||||
确 定
|
||||
</a>
|
||||
<%= link_to("重试", retry_work_student_work_path(@student_work.id),:class => "tijiao",:style =>"margin-bottom: 15px;margin-top:15px;",:remote => true)%>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
showModal('ajax-modal', '500px');
|
||||
$('#ajax-modal').siblings().remove();
|
||||
$('#ajax-modal').before("<span style='float: right;cursor:pointer;'>" +
|
||||
"<a href='javascript:' onclick='clickCanel();'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
"<a href='/student_work/"+ <%=@student_work.id%> +"/retry_work' class='upload_btn' data-remote='true'><img src='/images/bid/close.png' width='26px' height='26px' /></a></span>");
|
||||
$('#ajax-modal').parent().css("top","").css("left","");
|
||||
$('#ajax-modal').parent().addClass("anonymos");
|
||||
<% else %>
|
||||
|
|
|
@ -99,7 +99,7 @@
|
|||
</div>
|
||||
|
||||
<div class="mt5 fl">
|
||||
<a href="javascript:void(0);" class="RalationIcon fl mt3" onclick="show_project();">关联项目</a>
|
||||
<a href="javascript:void(0);" class="RalationIcon fl mt3" onclick="show_project();">关联项目</a>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
|
||||
|
@ -111,9 +111,9 @@
|
|||
</div>
|
||||
|
||||
<div class="mt5">
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();new_student_work();">确定</a>
|
||||
<a href="javascript:void(0);" class="BlueCirBtnMini fr" onclick="popupRegex();new_student_work();">提交</a>
|
||||
<span class="fr mr10 mt3">或</span>
|
||||
<%= link_to "取消", user_homeworks_user_path(User.current.id), :class => "fr mr10 mt3"%>
|
||||
<%= link_to "取消", delete_work_student_work_index_path(:homework =>@homework.id), :class => "fr mr10 mt3"%>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<% end%>
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
hideModal('#popbox02');
|
||||
$("#homework_attachments").html("<%= escape_javascript(render :partial => 'users/user_homework_attachment', :locals => {:container => @student_work, :has_program=>false})%>");
|
|
@ -97,7 +97,7 @@
|
|||
</div>
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<div class="BluePopupBox" id="BluePopupBox" style="display:none">
|
||||
<%= render :partial => 'users/user_programing_attr', :locals => {:edit_mode => edit_mode, :homework=>homework} %>
|
||||
</div><!----BluePopupBox end-->
|
||||
|
|
|
@ -206,11 +206,13 @@ RedmineApp::Application.routes.draw do
|
|||
resources :student_work do
|
||||
member do
|
||||
post 'add_score'
|
||||
get 'retry_work'
|
||||
get 'praise_student_work'
|
||||
get 'forbidden_anonymous_comment'
|
||||
end
|
||||
collection do
|
||||
post 'add_score_reply'
|
||||
get 'delete_work'
|
||||
get 'destroy_score_reply'
|
||||
get 'student_work_absence_penalty'
|
||||
get 'absence_penalty_list'
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
# encoding: utf-8
|
||||
class AddAttachmentType < ActiveRecord::Migration
|
||||
def up
|
||||
Attachmentstype.create(typeId:3,typeName:'修订附件')
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddForkedFromProjectIdToProjects < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :forked_from_project_id, :integer
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddForkedCountToProjects < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :projects, :forked_count, :integer
|
||||
end
|
||||
end
|
64
db/schema.rb
64
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20151130033906) do
|
||||
ActiveRecord::Schema.define(:version => 20151204062220) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -543,23 +543,26 @@ ActiveRecord::Schema.define(:version => 20151130033906) do
|
|||
add_index "documents", ["created_on"], :name => "index_documents_on_created_on"
|
||||
add_index "documents", ["project_id"], :name => "documents_project_id"
|
||||
|
||||
create_table "dts", :force => true do |t|
|
||||
t.string "IPLineCode"
|
||||
t.string "Description"
|
||||
t.string "Num"
|
||||
t.string "Variable"
|
||||
t.string "TraceInfo"
|
||||
t.string "Method"
|
||||
create_table "dts", :primary_key => "Num", :force => true do |t|
|
||||
t.string "Defect", :limit => 50
|
||||
t.string "Category", :limit => 50
|
||||
t.string "File"
|
||||
t.string "IPLine"
|
||||
t.string "Review"
|
||||
t.string "Category"
|
||||
t.string "Defect"
|
||||
t.string "PreConditions"
|
||||
t.string "StartLine"
|
||||
t.string "Method"
|
||||
t.string "Module", :limit => 20
|
||||
t.string "Variable", :limit => 50
|
||||
t.integer "StartLine"
|
||||
t.integer "IPLine"
|
||||
t.string "IPLineCode", :limit => 200
|
||||
t.string "Judge", :limit => 15
|
||||
t.integer "Review", :limit => 1
|
||||
t.string "Description"
|
||||
t.text "PreConditions", :limit => 2147483647
|
||||
t.text "TraceInfo", :limit => 2147483647
|
||||
t.text "Code", :limit => 2147483647
|
||||
t.integer "project_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "created_at"
|
||||
t.datetime "updated_at"
|
||||
t.integer "id", :null => false
|
||||
end
|
||||
|
||||
create_table "enabled_modules", :force => true do |t|
|
||||
|
@ -891,16 +894,6 @@ ActiveRecord::Schema.define(:version => 20151130033906) do
|
|||
|
||||
add_index "journal_details", ["journal_id"], :name => "journal_details_journal_id"
|
||||
|
||||
create_table "journal_details_copy", :force => true do |t|
|
||||
t.integer "journal_id", :default => 0, :null => false
|
||||
t.string "property", :limit => 30, :default => "", :null => false
|
||||
t.string "prop_key", :limit => 30, :default => "", :null => false
|
||||
t.text "old_value"
|
||||
t.text "value"
|
||||
end
|
||||
|
||||
add_index "journal_details_copy", ["journal_id"], :name => "journal_details_journal_id"
|
||||
|
||||
create_table "journal_replies", :id => false, :force => true do |t|
|
||||
t.integer "journal_id"
|
||||
t.integer "user_id"
|
||||
|
@ -970,6 +963,7 @@ ActiveRecord::Schema.define(:version => 20151130033906) do
|
|||
t.integer "course_group_id", :default => 0
|
||||
end
|
||||
|
||||
add_index "members", ["course_id"], :name => "index_members_on_course_id"
|
||||
add_index "members", ["project_id"], :name => "index_members_on_project_id"
|
||||
add_index "members", ["user_id", "project_id", "course_id"], :name => "index_members_on_user_id_and_project_id", :unique => true
|
||||
add_index "members", ["user_id"], :name => "index_members_on_user_id"
|
||||
|
@ -1303,27 +1297,29 @@ ActiveRecord::Schema.define(:version => 20151130033906) do
|
|||
end
|
||||
|
||||
create_table "projects", :force => true do |t|
|
||||
t.string "name", :default => "", :null => false
|
||||
t.string "name", :default => "", :null => false
|
||||
t.text "description"
|
||||
t.string "homepage", :default => ""
|
||||
t.boolean "is_public", :default => true, :null => false
|
||||
t.string "homepage", :default => ""
|
||||
t.boolean "is_public", :default => true, :null => false
|
||||
t.integer "parent_id"
|
||||
t.datetime "created_on"
|
||||
t.datetime "updated_on"
|
||||
t.string "identifier"
|
||||
t.integer "status", :default => 1, :null => false
|
||||
t.integer "status", :default => 1, :null => false
|
||||
t.integer "lft"
|
||||
t.integer "rgt"
|
||||
t.boolean "inherit_members", :default => false, :null => false
|
||||
t.boolean "inherit_members", :default => false, :null => false
|
||||
t.integer "project_type"
|
||||
t.boolean "hidden_repo", :default => false, :null => false
|
||||
t.integer "attachmenttype", :default => 1
|
||||
t.boolean "hidden_repo", :default => false, :null => false
|
||||
t.integer "attachmenttype", :default => 1
|
||||
t.integer "user_id"
|
||||
t.integer "dts_test", :default => 0
|
||||
t.integer "dts_test", :default => 0
|
||||
t.string "enterprise_name"
|
||||
t.integer "organization_id"
|
||||
t.integer "project_new_type"
|
||||
t.integer "gpid"
|
||||
t.integer "forked_from_project_id"
|
||||
t.integer "forked_count"
|
||||
end
|
||||
|
||||
add_index "projects", ["lft"], :name => "index_projects_on_lft"
|
||||
|
|
|
@ -241,8 +241,9 @@ class Gitlab::Client
|
|||
|
||||
# Forks a project into the user namespace of the authenticated user.
|
||||
# @param [Integer] - The ID of the project to be forked
|
||||
def fork(id)
|
||||
post("/projects/fork/#{id}")
|
||||
def fork(gpid, gid)
|
||||
post ("/projects/fork/#{gpid}?user_id=#{gid}")
|
||||
# post("/projects/fork/#{id}")
|
||||
end
|
||||
|
||||
# Mark this project as forked from the other
|
||||
|
|
|
@ -0,0 +1,18 @@
|
|||
#coding=utf-8
|
||||
|
||||
namespace :exercise_publish do
|
||||
desc "publish exercise and end exercise"
|
||||
task :publish => :environment do
|
||||
exercises = Exercise.where("publish_time is not null and exercise_status = 1 and publish_time <=?",Time.now)
|
||||
exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 2)
|
||||
end
|
||||
end
|
||||
|
||||
task :end => :environment do
|
||||
exercises = Exercise.where("end_time <=? and exercise_status = 2",Time.now)
|
||||
exercises.each do |exercise|
|
||||
exercise.update_column('exercise_status', 3)
|
||||
end
|
||||
end
|
||||
end
|
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.3 KiB |
|
@ -19,7 +19,7 @@ $(function(){
|
|||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
var test_program = function(cb){
|
||||
var homework_id = $('#test-program-btn').attr('data-homework-id');
|
||||
|
@ -171,7 +171,7 @@ $(function(){
|
|||
$("input[name=homework_type]").after(html);
|
||||
}
|
||||
return valid;
|
||||
}
|
||||
};
|
||||
|
||||
$("#BluePopupBox a.BlueCirBtn").live('click', function(){
|
||||
if(saveProgramAnswers()){
|
||||
|
|
|
@ -1175,4 +1175,25 @@ 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;}
|
||||
.addMemberC {float:left; max-height:150px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:227px; background-color:#f1f1f1; min-height:150px; padding-top:10px;}
|
||||
.addMemberC li {padding-left:10px; line-height:18px;}
|
||||
.addMemberC li:hover {cursor:pointer; background-color:#cccccc;}
|
||||
.addMemberCP {width:514px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; z-index:1000;}
|
||||
.rightArrow {margin:50px 15px 0px 15px; float:left;}
|
||||
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}
|
||||
|
||||
.resubAtt {border-top:1px solid #dddddd; position:relative; margin-top:15px;}
|
||||
.resubTitle {position:absolute; top:-10px; left:5px; background-color:#ffffff; display:block; font-weight:bold; padding:0px 2px;}
|
||||
a.blueCir{ display:inline-block; padding:2px 5px; background-color:#ffffff;border:1px solid #3598db; color:#3598db; -moz-border-radius:5px; -webkit-border-radius:5px; border-radius:5px;}
|
||||
a:hover.blueCir{ background:#3598db; color:#fff;}
|
||||
|
|
|
@ -1349,3 +1349,19 @@ 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;}
|
||||
.addMemberC {float:left; max-height:150px; margin-bottom:10px; overflow:auto; overflow-x:hidden; width:227px; background-color:#f1f1f1; min-height:150px; padding-top:10px;}
|
||||
.addMemberC li {padding-left:10px; line-height:18px;}
|
||||
.addMemberC li:hover {cursor:pointer; background-color:#cccccc;}
|
||||
.addMemberCP {width:514px; height:auto; border:3px solid #269ac9; padding-left:16px; padding-bottom:16px; background-color:#ffffff; position:absolute; z-index:1000;}
|
||||
.rightArrow {margin:50px 15px 0px 15px; float:left;}
|
||||
.relateText {font-size:16px; color:#269ac9; line-height:16px; padding-top:20px; display:inline-block; font-weight: bold;}
|
||||
|
|
Loading…
Reference in New Issue