Merge branch 'dev_shixun_project' of https://git.trustie.net/jacknudt/trustieforge into dev_shixun_project
This commit is contained in:
commit
28aeff673b
|
@ -81,13 +81,17 @@ class ChallengesController < ApplicationController
|
|||
|
||||
def index_down
|
||||
@challenges = @shixun.challenges
|
||||
next_challenge = @challenge.next_challenge
|
||||
position = @challenge.position
|
||||
@challenge.update_attribute(:position, (position + 1))
|
||||
|
||||
next_challenge.update_attribute(:position, position - 1)
|
||||
end
|
||||
|
||||
def index_up
|
||||
@challenges = @shixun.challenges
|
||||
position = @challenge.position
|
||||
@challenge.update_attribute(:position, (position - 1))
|
||||
@challenge.last_challenge.update_attribute(:position, position + 1)
|
||||
end
|
||||
|
||||
# build job 只负责发送请求
|
||||
|
|
|
@ -8,6 +8,10 @@ class GamesController < ApplicationController
|
|||
|
||||
def index
|
||||
@games = @myshixun.games
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.js
|
||||
end
|
||||
end
|
||||
|
||||
# mushixun的版本库必须创建时就创建
|
||||
|
|
|
@ -39,10 +39,10 @@ class ShixunsController < ApplicationController
|
|||
myshixun = copy_myshixun(@shixun, gshixun)
|
||||
first_challenge = Challenge.where(:shixun_id => @shixun.id, :position => 1).first
|
||||
render_404 if first_challenge.blank?
|
||||
publish_games(first_challenge, myshixun.id, position = 1)
|
||||
game = publish_games(first_challenge, myshixun.id)
|
||||
|
||||
respond_to do |format|
|
||||
format.html{redirect_to myshixun_games_path(myshixun)}
|
||||
format.html{redirect_to myshixun_path(myshixun)}
|
||||
end
|
||||
rescue Exception => e
|
||||
respond_to do |format|
|
||||
|
|
|
@ -36,9 +36,26 @@ module ApplicationHelper
|
|||
# def user_blogs_path(resource,parameters={})
|
||||
# super
|
||||
# end
|
||||
def publish_games challenge, myshixun_id, position
|
||||
challenge = Game.create(:subject => challenge.subject, :description => challenge.description,
|
||||
:stage => position, :myshixun_id => myshixun_id, :user_id => User.current.id)
|
||||
# 复制一个任务
|
||||
def publish_games challenge, myshixun_id
|
||||
game = Game.new
|
||||
game.attributes = challenge.attributes.dup.except("id","shixun_id","user_id","visits")
|
||||
game.myshixun_id = myshixun_id
|
||||
game.user_id = User.current.id
|
||||
challenge_samples = challenge.challenge_samples
|
||||
test_sets = challenge.test_sets
|
||||
if game.save
|
||||
unless challenge_samples.blank?
|
||||
challenge_samples.each do |cs|
|
||||
ChallengeSample.create(:game_id => game.id, :input => cs.input, :output => cs.output, :challenge_id => -1)
|
||||
end
|
||||
end
|
||||
unless test_sets.blank?
|
||||
test_sets.each do |ts|
|
||||
TestSet.create(:game_id => game.id, :input => ts.input, :output => ts.output, :challenge_id => -1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def git_repository_url project, type
|
||||
|
|
|
@ -10,11 +10,14 @@ class Challenge < ActiveRecord::Base
|
|||
validates_length_of :subject, :maximum => 255
|
||||
|
||||
def next_challenge
|
||||
|
||||
challenge_count = Challenge.where(:shixun_id => self.shixun_id).count
|
||||
render_404 if self.position ==challenge_count
|
||||
Challenge.where(:position => (self.position + 1), :shixun_id => self.shixun).first
|
||||
end
|
||||
|
||||
def last_challenge
|
||||
|
||||
render_404 if self.position < 2
|
||||
Challenge.where(:position => (self.position -1), :shixun_id => self.shixun).first
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class ChallengeSample < ActiveRecord::Base
|
||||
attr_accessible :challenge_id, :input, :output
|
||||
attr_accessible :challenge_id, :input, :output, :game_id
|
||||
belongs_to :challenge
|
||||
end
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
class Game < ActiveRecord::Base
|
||||
# stauts 0: can exe 1:failed 2:successed
|
||||
attr_accessible :description, :myshixun_id, :stage, :subject, :user_id, :status
|
||||
attr_accessible :description, :myshixun_id, :stage, :subject, :user_id, :status, :ready_knowledge, :task_pass, :answer, :score
|
||||
belongs_to :myshixun,:touch=> true
|
||||
belongs_to :user
|
||||
has_many :game_comments
|
||||
has_many :outputs
|
||||
has_many :game_comments, :dependent => :destroy
|
||||
has_many :outputs, :dependent => :destroy
|
||||
has_many :test_sets, :dependent => :destroy
|
||||
has_many :challenge_samples, :dependent => :destroy
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class TestSet < ActiveRecord::Base
|
||||
attr_accessible :challenge_id, :input, :output
|
||||
attr_accessible :challenge_id, :input, :output, :game_id
|
||||
belongs_to :challenge
|
||||
end
|
||||
|
|
|
@ -8,8 +8,12 @@
|
|||
<div class=" clearfix panel-inner" id="shixun_index_<%= index %>">
|
||||
<h4 class="fl panel-inner-title "><i class="fa fa-dot-circle-o font-18 color-green mr5"></i><span class="color-red mr10">第<%= challenge.position %>关</span><%= challenge.subject %></h4>
|
||||
<p class="fr" style="display: none" id="shixun_icon_<%= index %>">
|
||||
<a href="<%= index_up_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" title="上移" data-remote="true"><i class="fa fa-long-arrow-up color-grey font-16 mr5" ></i></a>
|
||||
<a href="<%= index_down_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" title="下移" data-remote="true"><i class="fa fa-long-arrow-down color-grey font-16 mr5" ></i></a>
|
||||
<% unless challenge.position < 2 %>
|
||||
<a href="<%= index_up_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" title="上移" data-remote="true"><i class="fa fa-long-arrow-up color-grey font-16 mr5" ></i></a>
|
||||
<% end %>
|
||||
<% if @shixun.challenges.count != challenge.position %>
|
||||
<a href="<%= index_down_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" title="下移" data-remote="true"><i class="fa fa-long-arrow-down color-grey font-16 mr5" ></i></a>
|
||||
<% end %>
|
||||
<a href="<%= edit_shixun_challenge_path(challenge, :shixun_id => @shixun) %>" title="编辑" ><i class="fa fa-pencil-square-o color-grey font-16 mr5" ></i></a>
|
||||
<a href="#" title="删除" ><i class="fa fa-trash-o color-grey font-16 mr5" ></i></a>
|
||||
<!--<a href="#" title="排名" ><i class="fa fa-signal color-grey font-16 mr5 " ></i></a>-->
|
||||
|
|
|
@ -1 +1 @@
|
|||
$("#challenge_list").html('<%= escape_javascript( render :partial => 'resource_search_form', :locals => {:user => @user, :type => @type} ) %>');
|
||||
$("#challenge_list").html('<%= escape_javascript( render :partial => 'content_list') %>');
|
|
@ -0,0 +1 @@
|
|||
$("#challenge_list").html('<%= escape_javascript( render :partial => 'content_list') %>');
|
|
@ -0,0 +1,70 @@
|
|||
<div class="content clearfix" >
|
||||
<div class="alert alert-blue mr15 mt15 ml15" id="myshixun_tip">
|
||||
<button data-dismiss="alert" class="task-close fr" type="button" id="close_myshixun_tip">×</button>
|
||||
完成任务后,请点击“提交评测”按钮,若通过系统评测,将为你解锁下一关,祝你早日通关,加油!
|
||||
</div>
|
||||
<div class="content-row mr15">
|
||||
<div class="content-info col-width fl ">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="fl">第1关:Python的初始化</h3>
|
||||
<div class="fr mt5">
|
||||
<a href="#"><i class="fa fa-minus font-14 mr10 fl color-grey"></i></a>
|
||||
<a href="#"><i class="fa fa-minus-square font-14 fl color-grey"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab_content clearfix" >
|
||||
<ul id="tab_nav">
|
||||
<li id="tab_nav_1" class="tab_hover " onclick="HoverLi(1);">
|
||||
<a href="javascript:void(0);" class="tab_type">过关任务</a>
|
||||
</li>
|
||||
<li id="tab_nav_2" onclick="HoverLi(2);">
|
||||
<a href="javascript:void(0);" class="tab_type" >预备知识</a>
|
||||
</li>
|
||||
<li id="tab_nav_3" onclick="HoverLi(3);">
|
||||
<a href="javascript:void(0);" class="tab_type" >参考答案</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div id="tab_con_1" class="tab-info" >
|
||||
<p class="tab-info-inner">
|
||||
<%= h @game.task_pass.try(:html_safe) %>
|
||||
</p>
|
||||
</div>
|
||||
<div id="tab_con_2" class="undis tab-info" >
|
||||
<p class="tab-info-inner"><%= h @game.ready_knowledge.try(:html_safe) %></p>
|
||||
</div>
|
||||
<div id="tab_con_3" class="undis tab-info" >
|
||||
<p class="tab-info-inner"><%= h @game.answer.try(:html_safe) %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="code_content">
|
||||
<%= render :partial => 'repository' %>
|
||||
</div>
|
||||
<div id="code_results">
|
||||
<%= render :partial => 'exec_results' %>
|
||||
</div>
|
||||
<div id="code_outpus">
|
||||
<%= render :partial => 'code_outputs' %>
|
||||
</div>
|
||||
<div id="code_actions">
|
||||
<%= render :partial => 'code_actions' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
//课程大纲tab
|
||||
function g(o){return document.getElementById(o);}
|
||||
function HoverLi(n){
|
||||
for(var i=1;i<=3;i++){
|
||||
g('tab_nav_'+i).className='tab_nomal';
|
||||
g('tab_con_'+i).className='undis';
|
||||
}
|
||||
g('tab_con_'+n).className='dis';
|
||||
g('tab_nav_'+n).className='tab_hover';
|
||||
}
|
||||
$("#close_myshixun_tip").click(function(){
|
||||
$("#myshixun_tip").hide();
|
||||
});
|
||||
</script>
|
|
@ -0,0 +1,75 @@
|
|||
<div class="content clearfix" >
|
||||
<div class="col-width-10 ml15 mt15 mr15">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="fl">全部任务</h3><span class="btn-cir btn-cir-grey ml5 mt3 fl"><%= @myshixun.games.count %></span>
|
||||
</div>
|
||||
<div class="panel-list">
|
||||
<div class=" clearfix panel-inner">
|
||||
<h4 class="fl panel-inner-title "><i class="fa fa-check-circle font-18 color-green mr5"></i><span class="color-red">第1关</span> Python基础入门</h4>
|
||||
<p class="fr "><i class="fa fa-trophy color-yellow font-16 mr5 "></i><span class=" color-grey">NO.120</span></p>
|
||||
<div class="cl"></div>
|
||||
<p class="ml15 mt15 color-grey">
|
||||
<span class=" mr10">开始时间:2017-02-28 15:08</span>
|
||||
<span class=" mr10">完成时间:2017-02-28 15:28</span>
|
||||
<span class=" mr10">耗时:00小时20分</span>
|
||||
<span class=" mr10">测评次数:3次</span>
|
||||
<span class=" mr10">得分:108分</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-list">
|
||||
<div class=" clearfix panel-inner">
|
||||
<div class="fl">
|
||||
<h4 class=" panel-inner-title "><i class="fa fa-dot-circle-o font-18 color-green mr5"></i><span class="color-red">第2关</span> 用Python语言写程序</h4>
|
||||
<p class="ml15 mt15 color-grey">
|
||||
<span class=" mr10">已闯关:2489人</span>
|
||||
<span class=" mr10">平均耗时:0小时28分</span>
|
||||
</p>
|
||||
</div>
|
||||
<a href="#" class=" task-btn task-btn-green fr">马上开启</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-list">
|
||||
<div class=" clearfix panel-inner">
|
||||
<div class="fl">
|
||||
<h4 class=" panel-inner-title "><i class="fa fa-dot-circle-o font-18 color-green mr5"></i><span class="color-red">第2关</span> 用Python语言写程序</h4>
|
||||
<p class="ml15 mt15 color-grey">
|
||||
<span class=" mr10">已闯关:2489人</span>
|
||||
<span class=" mr10">平均耗时:0小时28分</span>
|
||||
</p>
|
||||
</div>
|
||||
<a href="#" class=" fr link-color-green">正在解决中</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-list">
|
||||
<div class=" clearfix panel-inner">
|
||||
<div class="fl">
|
||||
<h4 class=" panel-inner-title "><i class="fa fa-lock font-18 color-grey mr5"></i><span class="color-red">第3关</span> Python的字符串使用</h4>
|
||||
<p class="ml15 mt15 color-grey">
|
||||
<span class=" mr10">已闯关:2489人</span>
|
||||
<span class=" mr10">平均耗时:0小时28分</span>
|
||||
</p>
|
||||
</div>
|
||||
<a href="#" class=" task-btn fr"> 已锁定 </a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-list">
|
||||
<div class=" clearfix panel-inner">
|
||||
<div class="fl">
|
||||
<h4 class=" panel-inner-title "><i class="fa fa-lock font-18 color-grey mr5"></i><span class="color-red">第4关</span>关 Python的简单结构</h4>
|
||||
<p class="ml15 mt15 color-grey">
|
||||
<span class=" mr10">已闯关:2489人</span>
|
||||
<span class=" mr10">平均耗时:0小时28分</span>
|
||||
</p>
|
||||
</div>
|
||||
<a href="#" class=" task-btn fr"> 已锁定 </a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -1,83 +1,3 @@
|
|||
<div class="content clearfix" >
|
||||
<div class="col-width-10 ml15 mt15 mr15">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="fl">全部任务</h3><span class="btn-cir btn-cir-grey ml5 mt3 fl"><%= @myshixun.games.count %></span>
|
||||
</div>
|
||||
<div class="panel-list">
|
||||
<div class=" clearfix panel-inner">
|
||||
<h4 class="fl panel-inner-title "><i class="fa fa-check-circle font-18 color-green mr5"></i><span class="color-red">第1关</span> Python基础入门</h4>
|
||||
<p class="fr "><i class="fa fa-trophy color-yellow font-16 mr5 "></i><span class=" color-grey">NO.120</span></p>
|
||||
<div class="cl"></div>
|
||||
<p class="ml15 mt15 color-grey">
|
||||
<span class=" mr10">开始时间:2017-02-28 15:08</span>
|
||||
<span class=" mr10">完成时间:2017-02-28 15:28</span>
|
||||
<span class=" mr10">耗时:00小时20分</span>
|
||||
<span class=" mr10">测评次数:3次</span>
|
||||
<span class=" mr10">得分:108分</span>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-list">
|
||||
<div class=" clearfix panel-inner">
|
||||
<div class="fl">
|
||||
<h4 class=" panel-inner-title "><i class="fa fa-dot-circle-o font-18 color-green mr5"></i><span class="color-red">第2关</span> 用Python语言写程序</h4>
|
||||
<p class="ml15 mt15 color-grey">
|
||||
<span class=" mr10">已闯关:2489人</span>
|
||||
<span class=" mr10">平均耗时:0小时28分</span>
|
||||
</p>
|
||||
</div>
|
||||
<a href="#" class=" task-btn task-btn-green fr">马上开启</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-list">
|
||||
<div class=" clearfix panel-inner">
|
||||
<div class="fl">
|
||||
<h4 class=" panel-inner-title "><i class="fa fa-dot-circle-o font-18 color-green mr5"></i><span class="color-red">第2关</span> 用Python语言写程序</h4>
|
||||
<p class="ml15 mt15 color-grey">
|
||||
<span class=" mr10">已闯关:2489人</span>
|
||||
<span class=" mr10">平均耗时:0小时28分</span>
|
||||
</p>
|
||||
</div>
|
||||
<a href="#" class=" fr link-color-green">正在解决中</a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-list">
|
||||
<div class=" clearfix panel-inner">
|
||||
<div class="fl">
|
||||
<h4 class=" panel-inner-title "><i class="fa fa-lock font-18 color-grey mr5"></i><span class="color-red">第3关</span> Python的字符串使用</h4>
|
||||
<p class="ml15 mt15 color-grey">
|
||||
<span class=" mr10">已闯关:2489人</span>
|
||||
<span class=" mr10">平均耗时:0小时28分</span>
|
||||
</p>
|
||||
</div>
|
||||
<a href="#" class=" task-btn fr"> 已锁定 </a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-list">
|
||||
<div class=" clearfix panel-inner">
|
||||
<div class="fl">
|
||||
<h4 class=" panel-inner-title "><i class="fa fa-lock font-18 color-grey mr5"></i><span class="color-red">第4关</span>关 Python的简单结构</h4>
|
||||
<p class="ml15 mt15 color-grey">
|
||||
<span class=" mr10">已闯关:2489人</span>
|
||||
<span class=" mr10">平均耗时:0小时28分</span>
|
||||
</p>
|
||||
</div>
|
||||
<a href="#" class=" task-btn fr"> 已锁定 </a>
|
||||
<div class="cl"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<% if false %>
|
||||
<%= link_to "返回", shixun_path(@myshixun.parent_id), :target => "_blank" %>
|
||||
|
||||
<% @games.each do |game| %>
|
||||
<%= link_to game.subject, myshixun_game_path(game, :myshixun_id => @myshixun) %>
|
||||
</br>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div id="content_list">
|
||||
<%= render :partial => "games_list" %>
|
||||
</div>
|
|
@ -0,0 +1 @@
|
|||
$("#content_list").html('<%= escape_javascript(render :partial => 'games/games_list') %>');
|
|
@ -1,103 +1,3 @@
|
|||
<div class="content clearfix" >
|
||||
<div class="alert alert-blue mr15 mt15 ml15" id="myshixun_tip">
|
||||
<button data-dismiss="alert" class="task-close fr" type="button" id="close_myshixun_tip">×</button>
|
||||
完成任务后,请点击“提交评测”按钮,若通过系统评测,将为你解锁下一关,祝你早日通关,加油!
|
||||
</div>
|
||||
<div class="content-row mr15">
|
||||
<div class="content-info col-width fl ">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="fl">第1关:Python的初始化</h3>
|
||||
<div class="fr mt5">
|
||||
<a href="#"><i class="fa fa-minus font-14 mr10 fl color-grey"></i></a>
|
||||
<a href="#"><i class="fa fa-minus-square font-14 fl color-grey"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab_content clearfix" >
|
||||
<ul id="tab_nav">
|
||||
<li id="tab_nav_1" class="tab_hover " onclick="HoverLi(1);">
|
||||
<a href="javascript:void(0);" class="tab_type">过关任务</a>
|
||||
</li>
|
||||
<li id="tab_nav_2" onclick="HoverLi(2);">
|
||||
<a href="javascript:void(0);" class="tab_type" >预备知识</a>
|
||||
</li>
|
||||
<li id="tab_nav_3" onclick="HoverLi(3);">
|
||||
<a href="javascript:void(0);" class="tab_type" >参考答案</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="cl"></div>
|
||||
<div id="tab_con_1" class="tab-info" >
|
||||
<p class="tab-info-inner">Python3 代码风格建议<br/>
|
||||
Python3 中使用注释<br/>
|
||||
认识 Python3 模块<br/>
|
||||
实验步骤<br/>
|
||||
1. 解释器<br/>
|
||||
Python 是一个脚本语言,你可以在 Python <br/>解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。<br/>
|
||||
首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。<br/>
|
||||
Python3 中使用注释<br/>
|
||||
认识 Python3 模块<br/>
|
||||
实验步骤<br/>
|
||||
1. 解释器<br/>
|
||||
Python 是一个脚本语言,你可以在 Python <br/>解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。<br/>
|
||||
首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。<br/>
|
||||
Python3 中使用注释<br/>
|
||||
认识 Python3 模块<br/>
|
||||
实验步骤<br/>
|
||||
1. 解释器<br/>
|
||||
Python 是一个脚本语言,你可以在 Python <br/>解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。<br/>
|
||||
首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。<br/>
|
||||
Python3 中使用注释<br/>
|
||||
认识 Python3 模块<br/>
|
||||
实验步骤<br/>
|
||||
1. 解释器<br/>
|
||||
Python 是一个脚本语言,你可以在 Python <br/>解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。<br/>
|
||||
首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。<br/>
|
||||
1. 解释器<br/>
|
||||
Python 是一个脚本语言,你可以在 Python <br/>解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。<br/>
|
||||
首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。<br/>
|
||||
Python3 中使用注释<br/>
|
||||
认识 Python3 模块<br/>
|
||||
实验步骤<br/>
|
||||
1. 解释器<br/>
|
||||
Python 是一个脚本语言,你可以在 Python <br/>解释器中直接写代码或者将代码写到一个文件里,然后执行这个文件(即脚本文件)。<br/>
|
||||
首先,我们从使用解释器开始,打开终端,键入Python3 并回车。这个时候解释器便工作于交互模式。<br/>
|
||||
|
||||
</p>
|
||||
</div>
|
||||
<div id="tab_con_2" class="undis tab-info" >
|
||||
<p class="tab-info-inner">dfdf</p>
|
||||
</div>
|
||||
<div id="tab_con_3" class="undis tab-info" >
|
||||
<p class="tab-info-inner">dfdfdfdfdf</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="code_content">
|
||||
<%= render :partial => 'repository' %>
|
||||
</div>
|
||||
<div id="code_results">
|
||||
<%= render :partial => 'exec_results' %>
|
||||
</div>
|
||||
<div id="code_outpus">
|
||||
<%= render :partial => 'code_outputs' %>
|
||||
</div>
|
||||
<div id="code_actions">
|
||||
<%= render :partial => 'code_actions' %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="content_list">
|
||||
<%= render :partial => "game_show" %>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" language="javascript">
|
||||
//课程大纲tab
|
||||
function g(o){return document.getElementById(o);}
|
||||
function HoverLi(n){
|
||||
for(var i=1;i<=3;i++){
|
||||
g('tab_nav_'+i).className='tab_nomal';
|
||||
g('tab_con_'+i).className='undis';
|
||||
}
|
||||
g('tab_con_'+n).className='dis';
|
||||
g('tab_nav_'+n).className='tab_hover';
|
||||
}
|
||||
$("#close_myshixun_tip").click(function(){
|
||||
$("#myshixun_tip").hide();
|
||||
});
|
||||
</script>
|
|
@ -1 +1 @@
|
|||
$("#code_content").html('<%= escape_javascript(render :partial => 'games/repository') %>');
|
||||
$("#content_list").html('<%= escape_javascript(render :partial => 'games/game_show') %>');
|
|
@ -30,12 +30,12 @@
|
|||
<div class="leftnav">
|
||||
<ul>
|
||||
<li class="leftnav-box">
|
||||
<a href="<%= myshixun_game_path(@myshixun.current_task, :myshixun_id => @myshixun) %>" class="leftnav-box-inner leftnav-active" id="current_task_tab">
|
||||
<a href="<%= myshixun_game_path(@myshixun.current_task, :myshixun_id => @myshixun) %>" class="leftnav-box-inner leftnav-active" id="current_task_tab" data-remote="true">
|
||||
<i class="fa fa-gamepad font-28"></i><br/><span class="font-16">当前任务</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="leftnav-box">
|
||||
<a href="<%= myshixun_games_path(@myshixun) %>" class="leftnav-box-inner" id="all_task_tab">
|
||||
<a href="<%= myshixun_games_path(@myshixun) %>" class="leftnav-box-inner" id="all_task_tab" data-remote="true">
|
||||
<i class="fa fa-qrcode font-28"></i><br/><span class="font-16">全部任务</span><span class="btn-cir ml5"><%= @myshixun.games.count %></span>
|
||||
</a>
|
||||
</li>
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
class AddAnswerToGames < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :games, :ready_knowledge, :text
|
||||
add_column :games, :task_pass, :text
|
||||
add_column :games, :answer, :text
|
||||
add_column :games, :score, :integer
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddGameIdToTestSets < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :test_sets, :game_id, :integer
|
||||
end
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
class AddGameIdToChallengeSamples < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :challenge_samples, :game_id, :integer
|
||||
end
|
||||
end
|
49
db/schema.rb
49
db/schema.rb
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20170316032420) do
|
||||
ActiveRecord::Schema.define(:version => 20170317022557) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -335,6 +335,7 @@ ActiveRecord::Schema.define(:version => 20170316032420) do
|
|||
t.integer "challenge_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "game_id"
|
||||
end
|
||||
|
||||
create_table "challenges", :force => true do |t|
|
||||
|
@ -1075,9 +1076,13 @@ ActiveRecord::Schema.define(:version => 20170316032420) do
|
|||
t.string "subject"
|
||||
t.text "description"
|
||||
t.integer "stage"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "status", :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "status", :default => 0
|
||||
t.text "ready_knowledge"
|
||||
t.text "task_pass"
|
||||
t.text "answer"
|
||||
t.integer "score"
|
||||
end
|
||||
|
||||
create_table "groups_users", :id => false, :force => true do |t|
|
||||
|
@ -1144,8 +1149,8 @@ ActiveRecord::Schema.define(:version => 20170316032420) do
|
|||
t.string "name"
|
||||
t.integer "user_id"
|
||||
t.text "description"
|
||||
t.datetime "publish_time"
|
||||
t.datetime "end_time"
|
||||
t.date "publish_time"
|
||||
t.date "end_time"
|
||||
t.integer "homework_type", :default => 1
|
||||
t.string "late_penalty"
|
||||
t.integer "course_id"
|
||||
|
@ -1242,19 +1247,6 @@ ActiveRecord::Schema.define(:version => 20170316032420) do
|
|||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "ii", :force => true do |t|
|
||||
t.integer "project_id"
|
||||
t.string "author_login"
|
||||
t.string "rep_identifier"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "sonar_version", :default => 0
|
||||
t.string "path"
|
||||
t.string "branch"
|
||||
t.string "language"
|
||||
t.string "sonar_name"
|
||||
end
|
||||
|
||||
create_table "innodb_monitor", :id => false, :force => true do |t|
|
||||
t.integer "a"
|
||||
end
|
||||
|
@ -2132,17 +2124,21 @@ ActiveRecord::Schema.define(:version => 20170316032420) do
|
|||
t.string "name"
|
||||
t.text "description"
|
||||
t.text "script"
|
||||
t.boolean "is_public", :default => true
|
||||
t.boolean "is_public", :default => true
|
||||
t.integer "parent_id"
|
||||
t.integer "user_id"
|
||||
t.integer "gpid"
|
||||
t.integer "forked_count", :default => 0
|
||||
t.integer "visits", :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "forked_count", :default => 0
|
||||
t.integer "visits", :default => 0
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "changeset_num"
|
||||
t.integer "forked_form"
|
||||
t.integer "status", :default => 0
|
||||
t.integer "status", :default => 0
|
||||
t.text "ready_knowledge"
|
||||
t.text "task_pass"
|
||||
t.text "answer"
|
||||
t.integer "score"
|
||||
end
|
||||
|
||||
create_table "softapplications", :force => true do |t|
|
||||
|
@ -2387,6 +2383,7 @@ ActiveRecord::Schema.define(:version => 20170316032420) do
|
|||
t.integer "challenge_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "game_id"
|
||||
end
|
||||
|
||||
create_table "time_entries", :force => true do |t|
|
||||
|
@ -2437,7 +2434,7 @@ ActiveRecord::Schema.define(:version => 20170316032420) do
|
|||
t.datetime "updated_at", :null => false
|
||||
t.integer "author_id"
|
||||
t.integer "status", :limit => 1, :default => 0
|
||||
t.integer "position", :limit => 1, :default => 0
|
||||
t.integer "position", :limit => 1
|
||||
t.integer "result", :default => 0
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue