Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/pgfqe6ch8 into dev_aliyun

dev_aliyun
daiao 5 years ago
commit 2cdf78664e

@ -2360,6 +2360,14 @@ end
end
end
# 实践课程的金课设置
def excellent_subject_setting
if params[:subject_id]
subject = Subject.find params[:subject_id]
subject.update_attributes(:excellent => !subject.excellent)
end
end
# 已发布实训路径首页显示
def subject_homepage_show
if params[:subject_id]

@ -10,7 +10,7 @@ class Subject < ActiveRecord::Base
belongs_to :major
# score_count 只能适合在首页使用
attr_accessible :description, :name, :status, :visits, :user_id, :course_list_id, :major_id, :learning_notes, :introduction,
:homepage_show, :score_count, :publish_time, :updated_at
:homepage_show, :score_count, :publish_time, :updated_at, :excellent
has_many :stages, :dependent => :destroy, :order => "stages.position ASC"
has_many :stage_shixuns, :dependent => :destroy

@ -73,6 +73,21 @@
link_url: 'https://keras.io/layers/about-keras-layers/'
}]
]
extra_data = [
{
name: 'C++项目',
description: "本项目的paddle/fluid/operators/optimizers目录中包含了常见的优化器MomentumAdam等等的c++实现。",
task: '标注../fluid/operators/optimizers/目录下的所有代码文件',
link_name: '官方,优化器',
link_url: 'https://www.paddlepaddle.org.cn/documentation/docs/zh/1.5/api_guides/low_level/optimizer.html'
},{
name: 'Python项目',
description: "本项目的python/paddle/fluid/layers/nn.py中包含了神经网络中大量常见层和操作符的python实现如fc、conv、gru等等。",
task: '标注../paddle/fluid/layers/nn.py代码文件',
link_name: '官方nn',
link_url: 'https://www.paddlepaddle.org.cn/documentation/docs/zh/1.5/api_cn/layers_cn/nn_cn.html'
}
]
%>
<% @competition.competition_stages.includes(:competition_stage_sections).each_with_index do |stage, i| %>
@ -97,9 +112,9 @@
标注说明:每个小组选择一种编程语言的题目,针对标注任务中指定的标注模块,要求对代码模块、模块中的代码文件, 以及文件中的函数必须进行标注,关键代码块、代码行及关键变量等由参赛者自由选择进行标注。 正式赛第一阶段的比赛在标注阶段就开放查看所有人的标注,请大家根据个人理解,写出自己的风格。我们将综合考虑标注的原创性、准确性、 完整性和多样性等不同的维度对标注质量进行评分。<%= challenge_description_extra[i] %>
</p>
<ul class="mt30">
<% first_section.competition_entries.each_with_index do |entry, j| %>
<% row_data = data[i][j] %>
<ul class="mt30 clearfix">
<% first_section.competition_entries.limit(3).each_with_index do |entry, j| %>
<% row_data = data.dig(i, j) %>
<li class="challenge_box">
<p class="challenge_b_t"><%= row_data[:name] || entry.name %></p>
<p class="enter_btn mb40 clearfix">
@ -135,6 +150,51 @@
</li>
<% end %>
</ul>
<% if index == 4 %>
<p class="break_word font-18 challenge_describe" style="margin-top: 20px;">
飞桨PaddlePaddle由百度公司开发是目前国内唯一功能完备的端到端开源深度学习平台集深度学习训练和预测框架、模型库、工具组件、服务平台为一体其兼具灵活和效率的开发机制、工业级应用效果的模型、超大规模并行深度学习能力、推理引擎一体化设计以及系统化的服务支持致力于让深度学习技术的创新与应用更简单。
</p>
<ul class="mt30 clearfix">
<% first_section.competition_entries.offset(3).each_with_index do |entry, j| %>
<% row_data = extra_data[j] %>
<li class="challenge_box">
<p class="challenge_b_t"><%= row_data[:name] || entry.name %></p>
<p class="enter_btn mb40 clearfix">
<%
is_start = Time.now > first_section.start_time
competition_url = User.current.logged? ? "#{entry.url}?eid=#{User.current.id}" : "#{entry.url}"
btn_url = is_start ? "#{competition_url}" : "javascript:void(0);"
%>
<a class="setNewBnt <%= is_start ? 'active' : '' %>"
href="javascript:void(0);"
data-url="<%= btn_url %>"><%= entry.name %></a>
</p>
<% if row_data.present? %>
<p class="challenge_b_d">项目简介</p>
<p class="break-word challenge_b_des" style="min-height: 80px;"><%= raw row_data[:description] %></p>
<p class="challenge_b_d">标注任务</p>
<% if index ==2 %>
<p class="break-word challenge_b_des" style="color: #FC2F78;min-height: 60px"><%= row_data[:task] %></p>
<% else %>
<p class="break-word challenge_b_des" style="color: #FC2F78;min-height: 80px"><%= row_data[:task] %></p>
<% end %>
<p class="challenge_b_d">经典算法解读:</p>
<ul class="clearfix algorithm">
<a href="<%= row_data[:link_url] %>" target="_blank"><%= row_data[:link_name] %></a>
</ul>
<p class="enter_btn clearfix">
<a href="javascript:void(0);"
data-url="<%= btn_url %>"
class="setNewBnt <%= is_start ? 'active' : '' %>">点击进入代标注模块</a>
</p>
<% end %>
</li>
<% end %>
</ul>
<% end %>
</div>
</div>
<% index += 1 %>

@ -3,7 +3,7 @@
<thead>
<tr>
<th width="9%">ID</th>
<th width="20%" class="edu-txt-left">实训套件名称</th>
<th width="18%" class="edu-txt-left">实训套件名称</th>
<th width="6%">阶段</th>
<th width="10%">技术体系</th>
<th width="10%">等级体系</th>
@ -75,6 +75,10 @@
<input type="checkbox" name="homepage_show" <%= c_shixun.status == 2 ? "" : "disabled" %> value="<%= c_shixun.id %>" <%= c_shixun.homepage_show ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="homepage_show_<%= c_shixun.id %>">
<label style="top:0px;padding-left: 19px;" for="homepage_show_<%= c_shixun.id %>">首页</label>
</span>
<span class="fl ml5">
<input type="checkbox" name="excellent" <%= c_shixun.status == 2 ? "" : "disabled" %> value="<%= c_shixun.id %>" <%= c_shixun.excellent ? "checked" : "" %> class="ml-3 mr5 magic-checkbox" id="excellent_<%= c_shixun.id %>">
<label style="top:0px;padding-left: 19px;" for="excellent_<%= c_shixun.id %>">金课</label>
</span>
</td>
</tr>
<% end %>
@ -131,7 +135,16 @@
type: 'post',
dateType: "script"
});
})
});
$("input[name='excellent']").click(function(){
var subject_id = $(this).val();
$.ajax({
url:"<%= excellent_subject_setting_managements_path %>",
data: {subject_id: subject_id},
type: 'post',
dateType: "script"
});
});
});
function select_repertoire(subject_id, rep_id){
$.ajax({

@ -626,6 +626,7 @@ RedmineApp::Application.routes.draw do ## oauth相关
post 'update_shixun_code_hidden'
get 'update_shixun_excute_time'
post 'subject_homepage_show'
post 'excellent_subject_setting'
post 'support_shixun'
post 'add_course'
match 'add_major',:via=>[:get,:post]

@ -0,0 +1,5 @@
class AddExcellentToSubject < ActiveRecord::Migration
def change
add_column :subjects, :excellent, :boolean, :default => false
end
end

@ -669,7 +669,7 @@ a.enterLink{cursor: pointer;color: #418CCD!important;background: none!important;
.second_code_2{min-height: 436px;}
.second_code_3{min-height: 1460px;padding-top: 190px;box-sizing: border-box;position: relative}
.second_code_4{min-height: 1459px;padding-top: 190px;box-sizing: border-box;position: relative}
.second_code_5{min-height: 1464px;padding-top: 190px;box-sizing: border-box;position: relative}
.second_code_5{min-height: 2314px;padding-top: 190px;box-sizing: border-box;position: relative}
.second_code_6{min-height: 1060px;}
.second_code_7{min-height: 1116px;}
.second_code_8{min-height: 711px;}

Loading…
Cancel
Save