Merge branch 'dev_shixun_project' of https://git.trustie.net/jacknudt/trustieforge into dev_shixun_project
This commit is contained in:
commit
e1600e9daf
|
@ -119,14 +119,14 @@
|
|||
<div class="fl task-bd-grey">
|
||||
<% if params[:action] == "edit" && @challenge_tags.count > 0 %>
|
||||
<% @challenge_tags.each do |tag| %>
|
||||
<div class="task-tag tag-grey mb10 mr10 fl">
|
||||
<div class="task-tag tag-grey mt5 mr10 fl">
|
||||
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="close_tag(this)">×</button>
|
||||
<input class='knowledge_frame' name='knowledge[input][]' value="<%= tag.try(:name)%>" />
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<button class="close fl mt3 mr10" type="button" onclick="$('#add_shixun_skill').slideToggle();" id="add_knowledge">+</button>
|
||||
<div class="task-tag tag-grey mb10 mr10 fl undis" id="add_shixun_skill">
|
||||
<button class="close fl mt8 mr10" type="button" onclick="$('#add_shixun_skill').slideToggle();" id="add_knowledge">+</button>
|
||||
<div class="task-tag tag-grey mt5 mr10 fl undis" id="add_shixun_skill">
|
||||
<button data-dismiss="alert" class="close fr mt3 ml5" type="button" onclick="$('#add_shixun_skill').slideToggle();">×</button>
|
||||
<input type="text" class="task-tag-input" onblur="add_tag();" placeholder="请输入知识/技能点" />
|
||||
</div>
|
||||
|
@ -200,7 +200,7 @@
|
|||
var val = $(".task-tag-input").val().trim();
|
||||
if (val != ""){
|
||||
testLength = $(".task-tag-input").val().trim().length;
|
||||
$("#add_knowledge").before("<div class='task-tag tag-grey mb10 mr10 fl' id='knowledge_" + num + "'>" +
|
||||
$("#add_knowledge").before("<div class='task-tag tag-grey mt5 mr10 fl' id='knowledge_" + num + "'>" +
|
||||
"<button data-dismiss='alert' class='close fr mt3 ml5' type='button' onclick='close_tag(this)'>×</button>" +
|
||||
"<input style='width:"+ testLength*12 +"px' class='knowledge_frame' name='knowledge[input][]' value='" + val +"'>" +
|
||||
" </div>");
|
||||
|
|
|
@ -95,34 +95,33 @@
|
|||
var html = bt('t:exec_results',{status: <%= @game.status %>, output:"<%= @latest_output %>", results: <%= @results %>, had_done: "<%= @had_done %>"});
|
||||
$("#code_results").html(html);
|
||||
});
|
||||
|
||||
function training_task_submmit(){
|
||||
$("#ajax-indicator").show();
|
||||
$("#game_commit").html("<a class='task-btn mb10'>评测中..</a>");
|
||||
$.ajax({
|
||||
url: '<%= game_build_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
|
||||
success: function (){
|
||||
|
||||
//循环等1分钟
|
||||
//移除载入
|
||||
var temp = $("#ajax-indicator");
|
||||
$("#ajax-indicator").remove();
|
||||
var intId = setInterval(function(){
|
||||
$.ajax({
|
||||
url: '<%= game_status_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
|
||||
data:'test',
|
||||
success:function(data){
|
||||
//如果查到了,就退出
|
||||
console.log(html);
|
||||
if(data.status == 2 || data.status == 0){
|
||||
alert("进来了");
|
||||
clearInterval(intId);
|
||||
$("#ajax-position").html(temp);
|
||||
$("#ajax-indicator").hide();
|
||||
var html = bt('t:exec_results',{status: data.status, output: data.output, results: data.results, had_done: data.had_done});
|
||||
console.log(html);
|
||||
$("#code_results").html(html);
|
||||
}
|
||||
}
|
||||
});
|
||||
}, 2000);
|
||||
}
|
||||
})
|
||||
|
||||
});
|
||||
}
|
||||
function extend_window(){
|
||||
var web_h = window.innerHeight;
|
||||
|
|
|
@ -48,9 +48,11 @@
|
|||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ajax-position">
|
||||
<div id="ajax-indicator" style="display:none;">
|
||||
<span><%= l(:label_loading) %></span>
|
||||
</div>
|
||||
</div>
|
||||
<div id="ajax-modal" style="display:none;"></div>
|
||||
</body>
|
||||
<!-- MathJax的配置 -->
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
|
||||
<%= render :partial => 'shixuns/shixun_top' %>
|
||||
|
||||
<%= render_flash_messages %>
|
||||
<%#= render_flash_messages %>
|
||||
<div class="task-pm-content">
|
||||
<%= yield %>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
<% end %>
|
||||
<li class="ml45 mb10">
|
||||
<label><span class="c_red">*</span> 实训名称 :</label>
|
||||
<%= f.text_field :name, :class => "project_new_input project_new_input_project_new", :placeholder => "例如:团队协作方法与机制研究", :onkeyup => "regex_project_name();" %>
|
||||
<%= f.text_field :name, :class => "project_new_input project_new_input_project_new", :placeholder => "请输入实训名称", :onkeyup => "regex_project_name();" %>
|
||||
<p class="c_orange ml70" id="project_name_notice" style="display: none;">实训名称不能为空</p>
|
||||
</li>
|
||||
<li class="ml45 mb10">
|
||||
|
@ -34,7 +34,7 @@
|
|||
<li class="mb5 ml70">
|
||||
<label > 公开 :</label>
|
||||
<%= f.text_field :is_public, :id => "project_is_public", :name => "shixun[is_public]", :type => "checkbox", :value => "1", :checked => "checked" %>
|
||||
<span class="c_grey">(打钩为公开实训,不打钩为私有项目;私有项目仅项目成员可见。)</span>
|
||||
<span class="c_grey">(选中为公开实训,不选中为私有实训;私有实训仅自己可见。)</span>
|
||||
<div class="cl"></div>
|
||||
</li>
|
||||
<li class=" ml90" >
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
<%= f.kindeditor :description, :editor_id => 'shixun_setting_editor',
|
||||
:owner_id => @shixun.nil? ? 0: @shixun.id,
|
||||
:owner_type => OwnerTypeHelper::PROJECT,
|
||||
:width => '85%',
|
||||
:width => '700',
|
||||
:height => 300,
|
||||
:minHeight=> 300,
|
||||
:class => 'fl ml5 w690',
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<div class="task-header">
|
||||
<div class="task-header-info">
|
||||
<h2 class="fl">
|
||||
<a href="<%= user_path(@shixun.owner) %>"><%= @shixun.owner.try(:show_name) %>导师</a>
|
||||
<span class="ml5 mr5">/ </span><a href="<%= shixun_path(@shixun.parent) %>"><%= @shixun.name %></a>
|
||||
<a href="<%= user_path(@shixun.owner) %>" class="task-header-name fl"><%= @shixun.owner.try(:show_name) %>导师</a>
|
||||
<span class="ml5 mr5 fl">/ </span><p class="task-header-title fl" title="<%= @shixun.name %>"><%= @shixun.name %></p>
|
||||
</h2>
|
||||
<% if allow_shixun_exec(@shixun) %>
|
||||
<%= link_to "开始挑战", shixun_monitor_shixun_path(@shixun), :class => "fr task-btn task-btn-orange", :remote => true %>
|
||||
|
|
34
db/schema.rb
34
db/schema.rb
|
@ -1158,13 +1158,13 @@ ActiveRecord::Schema.define(:version => 20170324054735) do
|
|||
t.string "name"
|
||||
t.integer "user_id"
|
||||
t.text "description"
|
||||
t.date "publish_time"
|
||||
t.date "end_time"
|
||||
t.datetime "publish_time"
|
||||
t.datetime "end_time"
|
||||
t.integer "homework_type", :default => 1
|
||||
t.string "late_penalty"
|
||||
t.integer "course_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "teacher_priority", :default => 1
|
||||
t.integer "anonymous_comment", :default => 0
|
||||
t.integer "quotes", :default => 0
|
||||
|
@ -1172,8 +1172,6 @@ ActiveRecord::Schema.define(:version => 20170324054735) do
|
|||
t.datetime "simi_time"
|
||||
t.integer "score_open", :default => 1
|
||||
t.integer "anonymous_appeal", :default => 0
|
||||
t.integer "homework_bank_id"
|
||||
t.boolean "is_update", :default => false
|
||||
end
|
||||
|
||||
add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id"
|
||||
|
@ -2125,30 +2123,26 @@ ActiveRecord::Schema.define(:version => 20170324054735) do
|
|||
|
||||
create_table "shixun_tags", :force => true do |t|
|
||||
t.string "name"
|
||||
t.integer "challenge_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
t.integer "game_id"
|
||||
t.datetime "created_at", :null => false
|
||||
t.datetime "updated_at", :null => false
|
||||
end
|
||||
|
||||
create_table "shixuns", :force => true do |t|
|
||||
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.text "ready_knowledge"
|
||||
t.text "task_pass"
|
||||
t.text "answer"
|
||||
t.integer "score"
|
||||
t.integer "status", :default => 0
|
||||
end
|
||||
|
||||
create_table "softapplications", :force => true do |t|
|
||||
|
@ -2444,7 +2438,7 @@ ActiveRecord::Schema.define(:version => 20170324054735) do
|
|||
t.datetime "updated_at", :null => false
|
||||
t.integer "author_id"
|
||||
t.integer "status", :limit => 1, :default => 0
|
||||
t.integer "position", :limit => 1
|
||||
t.integer "position", :limit => 1, :default => 0
|
||||
t.integer "result", :default => 0
|
||||
end
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ a.user-info-name{ display: block; font-size: 16px; color: #fff; max-width:100px;
|
|||
.leftnav-box{ width: 210px; height: 100px; background:#292b3a; padding:10px 0; margin-bottom:2px;}
|
||||
a.leftnav-box-inner{ display: block; width: 207px; height:80px; border-left:3px solid #292b3a; background:#292b3a; text-align: center; padding-top:20px; color:#575f6c;}
|
||||
a:hover.leftnav-box-inner,a.leftnav-active{border-left:3px solid #29bd8b;color: #fff; }
|
||||
.btn-cir{ background:#575f6c; color:#292b3a;display: inline-block; padding:0px 5px; border-radius:15px;}
|
||||
.btn-cir{ background:#575f6c; color:#292b3a;display: inline-block; padding:0px 5px; border-radius:25px; border-radius:15px; line-height:20px; font-size:12px;}
|
||||
.btn-cir:hover{background:#fff;}
|
||||
.btn-cir-grey{background: #e1e1e1;color: #333;}
|
||||
.btn-cir-grey:hover{background: #c3c3c3;}
|
||||
|
@ -138,11 +138,14 @@ a.rightbar-pause{ color:#29bd8b; font-size: 18px; margin-right:245px; margin-top
|
|||
.task-header{ width: 100%; background:url("/images/task/task-bg-header.png") 0 0 repeat-x; height: 100px;}
|
||||
.task-header-info{ width: 1000px; margin: 0 auto; color:#fff; padding:30px 0;}
|
||||
.task-header-info h2 a,.task-header-info h2{ font-weight: normal;color:#fff;}
|
||||
a.task-header-name{ max-width:200px;}
|
||||
.task-header-title{ display: block; max-width:750px;word-wrap: break-word;overflow:hidden; white-space: nowrap; text-overflow:ellipsis;}
|
||||
.task-header-nav{ width: 100%; height:50px; background:#282c37;}
|
||||
.task-header-navs{ width: 1000px; margin: 0 auto;}
|
||||
.task-header-navs li{ float: left;}
|
||||
.task-header-navs li a{ display: block; height: 50px; padding:0 50px; color:#fff; text-align: center; font-size: 16px; line-height: 50px;}
|
||||
.task-header-navs li a:hover,.task-header-navs li a.active{ background:#29bd8b;}
|
||||
.task-header-navs li a:hover{ color:#29bd8b;}
|
||||
.task-header-navs li a.active{ background:#29bd8b;color:#fff;}
|
||||
.task-pm-content{ width: 1000px; margin: 0 auto; min-height:566px}
|
||||
.task-pm-box{ width: 100%; background: #fff; border: 1px solid #e8e8e8;}
|
||||
.task-paner-con{ padding:15px; color:#666; line-height:2.0;}
|
||||
|
|
Loading…
Reference in New Issue