dev_bj
杨树明 6 years ago
commit 68f90aa272

@ -20,6 +20,8 @@ class CompetitionsController < ApplicationController
def show
@images = @competition.attachments
@user = current_user
@enrolled = @user && @user.logged? && @competition.team_members.exists?(user_id: @user.id)
end
def index

@ -1,7 +1,7 @@
class LibrariesController < ApplicationController
layout 'base_library'
before_filter :require_login
before_filter :require_login, :except => [:index]
def index
libraries = Library.where(nil)

@ -6490,7 +6490,7 @@ def visable_attachemnts_incourse course
member = course.members.where(:user_id => User.current.id).first
if member.try(:course_group_id).to_i == 0 && attachment.unified_setting
result << attachment
elsif attachment.attachment_group_settings.where("course_group_id = #{member.try(:course_group_id)} and publish_time > '#{Time.now}'").count == 0
elsif attachment.attachment_group_settings.where("course_group_id = #{member.try(:course_group_id).to_i} and publish_time > '#{Time.now}'").count == 0
result << attachment
end
end
@ -6602,7 +6602,7 @@ def update_shixun_work_status homework
myshixuns.each do |myshixun|
work = student_works.where(:user_id => myshixun.user_id).first
member = homework.course.members.find_by_user_id(work.user_id)
setting_time = homework_group_setting homework, member.try(:course_group_id)
setting_time = homework_group_setting homework, member.try(:course_group_id).to_i
games = myshixun.games.where(:challenge_id => challeng_ids)
myshixun_endtime = games.select{|game| game.status == 2}.size == games.size ? games.map(&:end_time).max : nil
compelete_status = 0
@ -6613,7 +6613,7 @@ def update_shixun_work_status homework
compelete_status = 1
end
end
if setting.publish_time && setting.publish_time < Time.now && setting_time.end_time
if setting_time.publish_time && setting_time.publish_time < Time.now && setting_time.end_time
if setting_time.end_time > Time.now
work.update_attributes(:work_status => 1, :late_penalty => 0, :commit_time => myshixun.updated_at, :update_time => myshixun.updated_at, :myshixun_id => myshixun.id, :compelete_status => compelete_status)
else
@ -7254,11 +7254,9 @@ end
# 作业的分班设置时间
def homework_group_setting homework, group_id
setting = nil
if homework.homework_group_settings.where(:course_group_id => group_id).first
setting = homework
if homework.homework_group_settings.where(:course_group_id => group_id).first.present?
setting = homework.homework_group_settings.where(:course_group_id => group_id).first
else
setting = homework
end
setting
end

@ -30,6 +30,6 @@ class Competition < ActiveRecord::Base
end
def member_count
self.team_members.count + 268
self.team_members.count == 0 ? 0 : self.team_members.count + 268
end
end

@ -5,6 +5,11 @@
<% index += 1 %>
<%
challenge_description_extra = [
"模拟赛选择了第一届标注大赛正式赛第一阶段的三个项目供大家体验熟悉平台、学习其他人的标注,模拟赛标注不计分。",
"第一阶段比赛得分占正赛总比分的30%。",
"第二阶段比赛得分占正赛总比分的70%。"
]
data = [
[
{
@ -12,21 +17,21 @@
description: "Weka是基于Java的机器学习与数据挖掘平台汇集了最前沿的机器学习算法包括处理标准数据挖掘问题的几乎所有方法回归、分类、聚类、关联规则以及属性选择等是Java机器学习入门的首选平台。<br/><br/>本项目的Clusters目录中包含了K-Means、层次聚类等多种聚类算法以及相应的聚类效果评估方法的java实现",
task: '标注../weka/clusterers/目录下的所有代码文件。',
link_name: 'CSDN经典聚类算法',
link_url: 'javascript:void(0)'
link_url: 'https://blog.csdn.net/qq_30262201/article/details/78799926'
},
{
name: 'C++项目',
description: "该项目是GitHub上最受欢迎的C++语言实现经典算法与数据结构的项目之一,内容涵盖排序、链表、树结构、图搜索、贪心算法等。学习这些算法的代码实现,可以深刻理解和掌握算法的核心思想,感受算法之美,代码之美,是人工智能时代的基础入门一课。<br/><br/>本项目的sort_search_problems目录涵盖了冒泡排序、快速排序等各类经典排序算法的C++实现。",
task: '标注../sort_search_problems目录下的所有代码文件及对应引用的../include目录中自定义的头文件。',
link_name: 'CSDN十大经典排序算法',
link_url: 'javascript:void(0)'
link_url: 'https://blog.csdn.net/wfq784967698/article/details/79551476'
},
{
name: 'Python项目',
description: "该项目是GitHub上最受欢迎的Python语言实现经典算法的项目之一包含了前沿的神经网络和经典数据结构及算法的Python实现。项目具有兼顾经典和前沿的特点。学习经典算法的源码实现感受经典算法的思想之美、代码之美。<br/><br/>本项目的Sorts目录中包含了冒泡排序、快速排序等各类经典排序算法的Python实现。",
task: '标注../sorts/目录下的所有代码文件。',
link_name: 'CSDN十大经典排序算法',
link_url: 'javascript:void(0)'
link_url: 'https://blog.csdn.net/wfq784967698/article/details/79551476'
},
],
[{},{},{}],
@ -56,7 +61,7 @@
</li>
</ul>
<p class="break_word font-18 challenge_describe">
标注说明:每个小组选择一种编程语言的题目,针对标注任务中指定的标注模块,要求对代码模块、模块中的代码文件, 以及文件中的函数必须进行标注,关键代码块、代码行及关键变量等由参赛者自由选择进行标注。 正式赛第一阶段的比赛在标注阶段就开放查看所有人的标注,请大家根据个人理解,写出自己的风格。我们将综合考虑标注的原创性、准确性、 完整性和多样性等不同的维度对标注质量进行评分。第一阶段比赛得分占正赛总比分的30%。
标注说明:每个小组选择一种编程语言的题目,针对标注任务中指定的标注模块,要求对代码模块、模块中的代码文件, 以及文件中的函数必须进行标注,关键代码块、代码行及关键变量等由参赛者自由选择进行标注。 正式赛第一阶段的比赛在标注阶段就开放查看所有人的标注,请大家根据个人理解,写出自己的风格。我们将综合考虑标注的原创性、准确性、 完整性和多样性等不同的维度对标注质量进行评分。<%= challenge_description_extra[i] %>
</p>
<ul class="mt30">
@ -70,8 +75,8 @@
btn_url = is_start ? "#{entry.url}" : "javascript:void(0);"
%>
<a class="setNewBnt <%= is_start ? 'active' : '' %>"
href="<%= btn_url %>"
<%= Time.now > first_section.start_time ? 'target="_blank"' : "" %> ><%= entry.name %></a>
href="javascript:void(0);"
data-url="<%= btn_url %>"><%= entry.name %></a>
</p>
<% if row_data.present? %>
@ -84,7 +89,9 @@
<a href="<%= row_data[:link_url] %>" target="_blank"><%= row_data[:link_name] %></a>
</ul>
<p class="enter_btn clearfix">
<a href="<%= btn_url %>" target="_blank" class="setNewBnt <%= is_start ? 'active' : '' %>">点击进入代标注模块</a>
<a href="javascript:void(0);"
data-url="<%= btn_url %>"
class="setNewBnt <%= is_start ? 'active' : '' %>">点击进入代标注模块</a>
</p>
<% end %>
</li>
@ -99,4 +106,28 @@
<% index += 1 %>
<p class="second_code_7" style="background: url(<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>) no-repeat top center;"></p>
<% index += 1 %>
<p class="second_code_8" style="background: url(<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>) no-repeat top center;"></p>
<p class="second_code_8" style="background: url(<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>) no-repeat top center;"></p>
<script>
$(function(){
var userLogged = <%= @user.present? && @user.logged? %>;
var userEnrolled = <%= @enrolled %>;
$(".enter_btn .setNewBnt.active").on("click", function(){
var url = $(this).data("url");
if (!userLogged) {
location.href = "<%= signin_url(back_url: competition_path(id: params[:id])) %>";
return;
}
if (!userEnrolled) {
sure_box_redirect_without_newtab_btn("<%= enroll_competition_path(id: params[:id]) %>", "完成报名后即可参赛", "我要报名");
return;
}
var newTab = window.open("_blank");
newTab.location = url;
})
})
</script>

@ -17,9 +17,9 @@
<% "@urls[i][j][k]表示: 第i个比赛的第j个对象的第k个url入口" %>
<% is_start = Time.now > section.start_time %>
<% section.competition_entries.each_with_index do |entry| %>
<a class="li-1 <%= is_start ? 'active' : '' %>"
href="<%= is_start ? "#{entry.url}" : "javascript:void(0);" %>"
<%= Time.now > section.start_time ? 'target="_blank"' : "" %> ><%= entry.name %></a>
<%= link_to entry.name, 'javascript:void(0);',
class: "li-1 #{ is_start ? 'active' : ''}",
data: { url: is_start ? entry.url : 'javascript:void(0);' } %>
<% end %>
</li>
</ul>
@ -34,3 +34,27 @@
<div class="second_7" style="background: url(<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>) no-repeat top center;"></div>
<% index += 1 %>
<div class="second_8" style="background: url(<%= named_attachment_path(@images[index], @images[index].try(:filename)) %>) no-repeat top center;"></div>
<script>
$(function(){
var userLogged = <%= @user.present? && @user.logged? %>;
var userEnrolled = <%= @enrolled %>;
$(".enter_btn a.active").on("click", function(){
var url = $(this).data("url");
if (!userLogged) {
location.href = "<%= signin_url(back_url: competition_path(id: params[:id])) %>";
return;
}
if (!userEnrolled) {
sure_box_redirect_without_newtab_btn("<%= enroll_competition_path(id: params[:id]) %>", "完成报名后即可参赛", "我要报名");
return;
}
var newTab = window.open("_blank");
newTab.location = url;
})
})
</script>

@ -18,7 +18,6 @@
</ul>
</li>
<% end %>
<li class="<%= params[:controller] == "libraries" ? "active" : "" %>"><%= link_to '教学案例', libraries_path %></li>
<li class="<%= params[:controller] == "competitions" ? " active" : "" %>"><%= link_to "竞赛", competitions_path %></li>
<li class="<%= params[:controller] == "forums" ? " active" : "" %>"><%= link_to "问答", forums_path %></li>
<% if User.current.ec_school.present? %>

@ -11,7 +11,7 @@
<%= favicon %>
<%= javascript_heads %>
<%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'educoder/edu-main', 'educoder/edu-all', 'educoder/magic-check' %>
<%= javascript_include_tag 'educoder/edu_application' %>
<%= javascript_include_tag 'educoder/edu_application', 'edu/application' %>
<script type="text/javascript"
src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">

@ -10,12 +10,9 @@
<%= f.text_field :title, placeholder: '例如:软件工程教学案例', class: 'greyInput winput-300-35 mr20 fl' %>
<p style="height:20px;line-height:20px;"><span class="color-red none" id="title_notice">请输入标题</span></p>
</li>
<span class="color-grey-c font-12 fl mt5">简明扼要介绍文档&视频所包含的主要的内容</span>
</div>
<div>
<%= render partial: 'attachments/from_libraries', locals: { container: @library } %>
<p style="height:22px;line-height:22px;"><span class="color-red none" id="file_notice">请上传附件</span></p>
<span class="color-grey-c font-12 fl mt6">简明扼要介绍文档/视频所包含的主要的内容</span>
</div>
</div>
<div class="padding30 bor-top-greyE">
<div class="clearfix df">
@ -27,6 +24,12 @@
<p style="height:22px;line-height:22px;"><span class="color-red none" id="des_notice">请输入描述内容</span></p>
</div>
</div>
<div>
<%= render partial: 'attachments/from_libraries', locals: { container: @library } %>
<p s
tyle="height:22px;line-height:22px;"><span class="color-red none" id="file_notice">请上传附件</span></p>
</div>
</div>
<div class="padding30 bor-top-greyE">
<li class="lineh-25 color-grey-6 font-18 mb20">审核说明</li>
@ -37,11 +40,10 @@
<div class="padding30 bor-top-greyE">
<li class="lineh-25 color-grey-6 font-18 mb20">温馨提示</li>
<ul class="font-16">
<li>1.请勿上传已设置加密或只读的文档资源</li>
<li>2.可以上传教学积累和撰写的文档资料如教学案例、总结、心得等上传支持的文件最大容量100MB</li>
<li>3.上传涉及侵权内容的文档将会被移除。</li>
<li>4.为营造绿色网络环境,严禁上传违反国家关于互联网相关规定的内容</li>
<li>5.ChromeFirefoxSafariIE11及以上版本浏览器上传</li>
<li>1.请勿上传已设置加密口令的文档资源;</li>
<li>2.可以上传符合教学案例标准的文档资料,如<a class="color-blue" target="_blank" href="https://www.educoder.net/boards/5909/topics/34799">案例入库标准</a>、<a target="_blank" class="color-blue" href="https://www.educoder.net/boards/5909/topics/34798">案例使用说明书</a>以及其他资料等上传支持的文件最大容量100MB</li>
<li>3.请确保上传内容无侵权或违反国家关于互联网政策的不良行为;</li>
<li>4.请使用ChromeFirefoxSafariIE11及以上版本浏览器</li>
</ul>
</div>
</div>

@ -53,7 +53,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
end
# library
resources :libraries do
resources :libraries, :path => "moop_cases" do
get :publish_success, on: :collection
end

@ -0,0 +1,26 @@
class TransferCompetitionPersonalEnrollData < ActiveRecord::Migration
CODES = %W(2 3 4 5 6 7 8 9 a b c f e f g h i j k l m n o p q r s t u v w x y z)
def change
gcc_task = Competition.find_by_identifier('gcc-task-2019')
transfer_personal_enroll_data(gcc_task)
gcc_annotation = Competition.find_by_identifier('gcc-annotation-2019')
transfer_personal_enroll_data(gcc_annotation)
end
def transfer_personal_enroll_data(competition)
return if competition.blank?
competition.competition_teams.where('invite_code IS NULL OR invite_code = ""').each do |team|
team.update_attributes!(invite_code: generate_team_code, name: "#{team.name}战队")
end
end
def generate_team_code
code = CODES.sample(6).join
while CompetitionTeam.exists?(invite_code: code)
code = CODES.sample(6).join
end
code
end
end

@ -103,7 +103,8 @@ em.vertical-line{display: inline-block;width: 2px;background: #999;height: 10px}
/*门户左侧导航栏*/
.user_navlist{position: absolute;left: 0px;width: 160px;top:0px;height: 100%;}
.user_navlist_black{position: relative;width: 100%;height: 100%;border-radius: 8px 0px 0px 8px;background: rgba(0,0,0,0.8);}
.user_navlist_white{position: absolute;left: 160px;background: #FFFFff;width: 622px;min-height: 345px;top: 0px;z-index: 1;display: none;padding:0px 30px;box-sizing: border-box;box-shadow: 0px 0px 10px rgba(76,76,76,0.2);z-index: 99}
.user_navlist_white{position: absolute;left: 160px;background: #FFFFff;width: 622px;min-height: 345px;top: 0px;z-index: 1;display: none;padding:0px 30px;
box-sizing: border-box;box-shadow: 0px 0px 10px rgba(76,76,76,0.2);z-index: 99;max-height: 345px;overflow-y: auto;}
.user_navlist_white a{color: #989898;margin-right: 15px;font-size: 14px;display: block;float: left;height: 30px;line-height: 30px;}
.user_navlist_white a:hover{color: #4cacff}
.headIcon{height: 100%;box-sizing: border-box;margin: 0px!important;}

Loading…
Cancel
Save