Merge branch 'dev_shixun_project' of https://git.trustie.net/jacknudt/trustieforge into dev_shixun_project

This commit is contained in:
huang 2017-03-24 16:00:38 +08:00
commit e1600e9daf
9 changed files with 38 additions and 40 deletions

View File

@ -119,14 +119,14 @@
<div class="fl task-bd-grey"> <div class="fl task-bd-grey">
<% if params[:action] == "edit" && @challenge_tags.count > 0 %> <% if params[:action] == "edit" && @challenge_tags.count > 0 %>
<% @challenge_tags.each do |tag| %> <% @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> <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)%>" /> <input class='knowledge_frame' name='knowledge[input][]' value="<%= tag.try(:name)%>" />
</div> </div>
<% end %> <% end %>
<% end %> <% end %>
<button class="close fl mt3 mr10" type="button" onclick="$('#add_shixun_skill').slideToggle();" id="add_knowledge">+</button> <button class="close fl mt8 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"> <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> <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="请输入知识/技能点" /> <input type="text" class="task-tag-input" onblur="add_tag();" placeholder="请输入知识/技能点" />
</div> </div>
@ -200,7 +200,7 @@
var val = $(".task-tag-input").val().trim(); var val = $(".task-tag-input").val().trim();
if (val != ""){ if (val != ""){
testLength = $(".task-tag-input").val().trim().length; 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>" + "<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 +"'>" + "<input style='width:"+ testLength*12 +"px' class='knowledge_frame' name='knowledge[input][]' value='" + val +"'>" +
" </div>"); " </div>");

View File

@ -95,34 +95,33 @@
var html = bt('t:exec_results',{status: <%= @game.status %>, output:"<%= @latest_output %>", results: <%= @results %>, had_done: "<%= @had_done %>"}); var html = bt('t:exec_results',{status: <%= @game.status %>, output:"<%= @latest_output %>", results: <%= @results %>, had_done: "<%= @had_done %>"});
$("#code_results").html(html); $("#code_results").html(html);
}); });
function training_task_submmit(){ function training_task_submmit(){
$("#ajax-indicator").show();
$("#game_commit").html("<a class='task-btn mb10'>评测中..</a>"); $("#game_commit").html("<a class='task-btn mb10'>评测中..</a>");
$.ajax({ $.ajax({
url: '<%= game_build_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', url: '<%= game_build_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
success: function (){ success: function (){
//移除载入
//循环等1分钟 var temp = $("#ajax-indicator");
$("#ajax-indicator").remove();
var intId = setInterval(function(){ var intId = setInterval(function(){
$.ajax({ $.ajax({
url: '<%= game_status_myshixun_game_path(@game, :myshixun_id => @myshixun) %>', url: '<%= game_status_myshixun_game_path(@game, :myshixun_id => @myshixun) %>',
data:'test', data:'test',
success:function(data){ success:function(data){
//如果查到了,就退出 //如果查到了,就退出
console.log(html);
if(data.status == 2 || data.status == 0){ if(data.status == 2 || data.status == 0){
alert("进来了");
clearInterval(intId); 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}); 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); $("#code_results").html(html);
} }
} }
}); });
}, 2000); }, 2000);
} }
}) });
} }
function extend_window(){ function extend_window(){
var web_h = window.innerHeight; var web_h = window.innerHeight;

View File

@ -48,9 +48,11 @@
<%= yield %> <%= yield %>
</div> </div>
</div> </div>
<div id="ajax-position">
<div id="ajax-indicator" style="display:none;"> <div id="ajax-indicator" style="display:none;">
<span><%= l(:label_loading) %></span> <span><%= l(:label_loading) %></span>
</div> </div>
</div>
<div id="ajax-modal" style="display:none;"></div> <div id="ajax-modal" style="display:none;"></div>
</body> </body>
<!-- MathJax的配置 --> <!-- MathJax的配置 -->

View File

@ -20,7 +20,7 @@
<%= render :partial => 'shixuns/shixun_top' %> <%= render :partial => 'shixuns/shixun_top' %>
<%= render_flash_messages %> <%#= render_flash_messages %>
<div class="task-pm-content"> <div class="task-pm-content">
<%= yield %> <%= yield %>
</div> </div>

View File

@ -13,7 +13,7 @@
<% end %> <% end %>
<li class="ml45 mb10"> <li class="ml45 mb10">
<label><span class="c_red">*</span>&nbsp;实训名称&nbsp;&nbsp;:</label> <label><span class="c_red">*</span>&nbsp;实训名称&nbsp;&nbsp;:</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> <p class="c_orange ml70" id="project_name_notice" style="display: none;">实训名称不能为空</p>
</li> </li>
<li class="ml45 mb10"> <li class="ml45 mb10">
@ -34,7 +34,7 @@
<li class="mb5 ml70"> <li class="mb5 ml70">
<label >&nbsp;公开&nbsp;</label> <label >&nbsp;公开&nbsp;</label>
<%= f.text_field :is_public, :id => "project_is_public", :name => "shixun[is_public]", :type => "checkbox", :value => "1", :checked => "checked" %> <%= 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> <div class="cl"></div>
</li> </li>
<li class=" ml90" > <li class=" ml90" >

View File

@ -14,7 +14,7 @@
<%= f.kindeditor :description, :editor_id => 'shixun_setting_editor', <%= f.kindeditor :description, :editor_id => 'shixun_setting_editor',
:owner_id => @shixun.nil? ? 0: @shixun.id, :owner_id => @shixun.nil? ? 0: @shixun.id,
:owner_type => OwnerTypeHelper::PROJECT, :owner_type => OwnerTypeHelper::PROJECT,
:width => '85%', :width => '700',
:height => 300, :height => 300,
:minHeight=> 300, :minHeight=> 300,
:class => 'fl ml5 w690', :class => 'fl ml5 w690',

View File

@ -2,8 +2,8 @@
<div class="task-header"> <div class="task-header">
<div class="task-header-info"> <div class="task-header-info">
<h2 class="fl"> <h2 class="fl">
<a href="<%= user_path(@shixun.owner) %>"><%= @shixun.owner.try(:show_name) %>导师</a> <a href="<%= user_path(@shixun.owner) %>" class="task-header-name fl"><%= @shixun.owner.try(:show_name) %>导师</a>
<span class="ml5 mr5">/ </span><a href="<%= shixun_path(@shixun.parent) %>"><%= @shixun.name %></a> <span class="ml5 mr5 fl">/ </span><p class="task-header-title fl" title="<%= @shixun.name %>"><%= @shixun.name %></p>
</h2> </h2>
<% if allow_shixun_exec(@shixun) %> <% if allow_shixun_exec(@shixun) %>
<%= link_to "开始挑战", shixun_monitor_shixun_path(@shixun), :class => "fr task-btn task-btn-orange", :remote => true %> <%= link_to "开始挑战", shixun_monitor_shixun_path(@shixun), :class => "fr task-btn task-btn-orange", :remote => true %>

View File

@ -1158,13 +1158,13 @@ ActiveRecord::Schema.define(:version => 20170324054735) do
t.string "name" t.string "name"
t.integer "user_id" t.integer "user_id"
t.text "description" t.text "description"
t.date "publish_time" t.datetime "publish_time"
t.date "end_time" t.datetime "end_time"
t.integer "homework_type", :default => 1 t.integer "homework_type", :default => 1
t.string "late_penalty" t.string "late_penalty"
t.integer "course_id" t.integer "course_id"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "teacher_priority", :default => 1 t.integer "teacher_priority", :default => 1
t.integer "anonymous_comment", :default => 0 t.integer "anonymous_comment", :default => 0
t.integer "quotes", :default => 0 t.integer "quotes", :default => 0
@ -1172,8 +1172,6 @@ ActiveRecord::Schema.define(:version => 20170324054735) do
t.datetime "simi_time" t.datetime "simi_time"
t.integer "score_open", :default => 1 t.integer "score_open", :default => 1
t.integer "anonymous_appeal", :default => 0 t.integer "anonymous_appeal", :default => 0
t.integer "homework_bank_id"
t.boolean "is_update", :default => false
end end
add_index "homework_commons", ["course_id", "id"], :name => "index_homework_commons_on_course_id_and_id" 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| create_table "shixun_tags", :force => true do |t|
t.string "name" t.string "name"
t.integer "challenge_id" t.integer "game_id"
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
end end
create_table "shixuns", :force => true do |t| create_table "shixuns", :force => true do |t|
t.string "name" t.string "name"
t.text "description" t.text "description"
t.text "script" t.text "script"
t.boolean "is_public", :default => true t.boolean "is_public", :default => true
t.integer "parent_id" t.integer "parent_id"
t.integer "user_id" t.integer "user_id"
t.integer "gpid" t.integer "gpid"
t.integer "forked_count", :default => 0 t.integer "forked_count", :default => 0
t.integer "visits", :default => 0 t.integer "visits", :default => 0
t.datetime "created_at", :null => false t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "changeset_num" t.integer "changeset_num"
t.integer "forked_form" 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 end
create_table "softapplications", :force => true do |t| create_table "softapplications", :force => true do |t|
@ -2444,7 +2438,7 @@ ActiveRecord::Schema.define(:version => 20170324054735) do
t.datetime "updated_at", :null => false t.datetime "updated_at", :null => false
t.integer "author_id" t.integer "author_id"
t.integer "status", :limit => 1, :default => 0 t.integer "status", :limit => 1, :default => 0
t.integer "position", :limit => 1 t.integer "position", :limit => 1, :default => 0
t.integer "result", :default => 0 t.integer "result", :default => 0
end end

View File

@ -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;} .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.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; } 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:hover{background:#fff;}
.btn-cir-grey{background: #e1e1e1;color: #333;} .btn-cir-grey{background: #e1e1e1;color: #333;}
.btn-cir-grey:hover{background: #c3c3c3;} .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{ 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{ width: 1000px; margin: 0 auto; color:#fff; padding:30px 0;}
.task-header-info h2 a,.task-header-info h2{ font-weight: normal;color:#fff;} .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-nav{ width: 100%; height:50px; background:#282c37;}
.task-header-navs{ width: 1000px; margin: 0 auto;} .task-header-navs{ width: 1000px; margin: 0 auto;}
.task-header-navs li{ float: left;} .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{ 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-content{ width: 1000px; margin: 0 auto; min-height:566px}
.task-pm-box{ width: 100%; background: #fff; border: 1px solid #e8e8e8;} .task-pm-box{ width: 100%; background: #fff; border: 1px solid #e8e8e8;}
.task-paner-con{ padding:15px; color:#666; line-height:2.0;} .task-paner-con{ padding:15px; color:#666; line-height:2.0;}