实训宽版tpi

This commit is contained in:
daiao 2017-03-30 16:35:37 +08:00
parent 09bb152fea
commit adf6ca742f
8 changed files with 94 additions and 118 deletions

View File

@ -1,6 +1,6 @@
<div class="col-width fl content-all-fix undis" style="margin-top:50px">
<div class="content-info col-width content-all-fix undis" id="game_left_contents">
<div class="panel-header clearfix">
<h3 class="fl">第1关Python的初始化</h3>
<h3 class="fl">第<%= @game_challenge.position %>关:<%= @game_challenge.subject %></h3>
<div class="fr mt5">
<a href="javascript:void(0);" onclick="close_game_descpition()"><i class="fa fa-compress font-14 fl color-grey"></i></a>
</div>
@ -29,50 +29,36 @@
</div>
</div>
<div id="big_tab_con_3" class="undis tab-info" >
<div class="big-tab-info-inner">
<%= h @game_challenge.answer.try(:html_safe) %>
</div>
<div class="big-tab-info-inner" id="extend_game_answer_show"></div>
<div class="undis" id="hidden_extend_game_answer"><%= h @game_challenge.answer.try(:html_safe) %></div>
</div>
</div>
</div>
<script type="text/javascript" language="javascript">
var web_h = window.innerHeight;
$(document).ready(function(){
if($.browser.msie) {
$(".content-all-fix").css("height", web_h - 225 + "px");
$(".content-all-fix").css("width", "87%");
$(".big-tab-info-inner").css("height", web_h - 185 + "px");
}
else if($.browser.safari)
{
$(".content-all-fix").css("height", web_h - 225 + "px");
$(".big-tab-info-inner").css("height", web_h - 195 + "px");
$(".content-all-fix").css("width", "87%");
}
else if($.browser.mozilla)
{
$(".content-all-fix").css("height", web_h - 225 + "px");
$(".big-tab-info-inner").css("height", web_h - 185 + "px");
$(".content-all-fix").css("width", "87%");
}
else if($.browser.opera) {
$(".content-all-fix").css("height", web_h - 225 + "px");
$(".big-tab-info-inner").css("height", web_h - 185 + "px");
$(".content-all-fix").css("width", "87%");
}else if($.browser.chrome){
if(window.navigator.userAgent.indexOf("MetaSr") == -1){
$(".content-all-fix").css("height", web_h - 225 + "px");
$(".big-tab-info-inner").css("height", web_h - 185 + "px");
$(".content-all-fix").css("width", "87.5%");
}else{
$(".content-all-fix").css("height", web_h - 225 + "px");
$(".big-tab-info-inner").css("height", web_h - 185 + "px");
$(".content-all-fix").css("width", "87.5%");
}
}
var ExtendMirror = $("#extend_game_answer_show")[0];
var ExtendCodeMirror = CodeMirror(ExtendMirror, {
value: $("#hidden_extend_game_answer").text(),
mode: "text/x-java",
readOnly: "nocursor", //只读
//cursorBlinkRate: -1, //隐藏光标
autofocus: true,
border: 0
});
// 设置参考答案的line-height
$("#extend_game_answer_show" ).children(".CodeMirror").css("line-height", 1.2);
$(document).ready(function(){
var web_h = window.innerHeight;
// codemirror的高度
var Cm_h = web_h - 185;
// 设置版本库codemirror的高度
ExtendCodeMirror.setSize('auto', Cm_h+'px');
// 设置codemirror无边框
$("#extend_game_answer_show").children().css("border", 0);
});
function close_game_descpition(){
$(".content-all-fix").hide();
$("#game_left_contents").hide();
}
function HoverLi_new(n){
for(var i=1;i<=3;i++){
@ -81,5 +67,8 @@
}
g('big_tab_con_'+n).className='dis';
g('big_tab_nav_'+n).className='tab_hover';
if(n==3){
ExtendCodeMirror.refresh();
}
}
</script>

View File

@ -4,31 +4,6 @@
<div id="code_results" class="panel-footer CELL COLS mt15 ml15">
</div>
<script id="t:exec_results" type="text/html">
<div class="col-width fl mt15 content-half-fix undis" style="margin-top:125px;">
<div class="panel-header clearfix">
<h3 class="fl">测评历史</h3>
<div class="fr mt5">
<a href="javascript:void(0)" onclick="hide_windows();"><i class="fa fa-compress font-14 fl color-grey"></i></a>
</div>
</div>
<div class="content-history-inner" style="height: 100px;">
<! for(var i=0;i< results.length; i++) { !>
<! if(results[i][0] == 0){ !>
<div class="clearfix history-success mb10">
<span class="icon-success fl mr5"><!= i+1 !></span>
<p class="fl">恭喜,您已经完成了本任务!</p>
<a href="/myshixuns/<%= @myshixun.id %>/games/<%= @game.id %>/outputs_show?game_output_id=<!= results[i][1] !>" class="fr mr10" data-remote="true">详情</a>
</div>
<! }else{ !>
<div class="clearfix history-fail mb10">
<span class="icon-fail fl mr5"><!= i+1 !></span>
<p class="fl">错误结果!</p>
<a href="/myshixuns/<%= @myshixun.id %>/games/<%= @game.id %>/outputs_show?game_output_id=<!= results[i][1] !>" class="fr mr10" data-remote="true" >详情</a>
</div>
<! } !>
<! } !>
</div>
</div>
<div class="col-width content-history CELL mb15" >
<div class="panel-header clearfix">
<h3 class="fl">测评历史</h3>
@ -77,7 +52,7 @@
<! }else if(status == 1){ !>
<a class="task-btn mb10">评测中..</a>
<! }else if(status == 2 && had_done != 1){ !>
<%= link_to "下 一 ", {:controller => 'games', :action => "next_step", :id => @game, :myshixun_id => @myshixun}, :class => "task-btn task-btn-green", :remote => true %>
<%= link_to "下 一 ", {:controller => 'games', :action => "next_step", :id => @game, :myshixun_id => @myshixun}, :class => "task-btn task-btn-green", :remote => true %>
<! } !>
<! if(had_done == 1) { !>
<a href="javascript:void(0)" class="task-btn mb10" >已通关</a>
@ -119,6 +94,8 @@
$("#ajax-indicator").hide();
var html = bt('t:exec_results',{status: data.status, output: data.output, results: data.results, had_done: data.had_done});
$("#code_results").html(html);
var html = bt('t:extend_exec_results',{status: data.status, output: data.output, results: data.results, had_done: data.had_done});
$("#extend_exec_results").html(html);
if(data.status == 2){
if( data.had_done == 0 ) {
var htmlvalue = "<%= j (render :partial => 'games/pass_game_show', :locals => { :game=> @game, :myshixun => @myshixun, :had_done => 0}) %>";
@ -151,13 +128,8 @@
});
}
function extend_window(){
$(".content-half-fix").show();
$("#extend_code_results").show();
}
function hide_windows(){
$(".content-half-fix").hide();
}
function file_edit_submit1(){
$('#file_update_id').submit();
$("#bottom_save_edit").hide();

View File

@ -0,0 +1,41 @@
<div id="extend_code_results" class="undis">
</div>
<script id="t:extend_exec_results" type="text/html">
<div class="col-width content-history content-half-fix" id="game_text_results">
<div class="panel-header clearfix">
<h3 class="fl">测评历史</h3>
<div class="fr mt5">
<a href="javascript:void(0)" onclick="hide_windows();"><i class="fa fa-compress font-14 fl color-grey"></i></a>
</div>
</div>
<div class="content-history-inner" style="height: 100px;">
<! for(var i=0;i< results.length; i++) { !>
<! if(results[i][0] == 0){ !>
<div class="clearfix history-success mb10">
<span class="icon-success fl mr5"><!= i+1 !></span>
<p class="fl">恭喜,您已经完成了本任务!</p>
<a href="/myshixuns/<%= @myshixun.id %>/games/<%= @game.id %>/outputs_show?game_output_id=<!= results[i][1] !>" class="fr mr10" data-remote="true">详情</a>
</div>
<! }else{ !>
<div class="clearfix history-fail mb10">
<span class="icon-fail fl mr5"><!= i+1 !></span>
<p class="fl">错误结果!</p>
<a href="/myshixuns/<%= @myshixun.id %>/games/<%= @game.id %>/outputs_show?game_output_id=<!= results[i][1] !>" class="fr mr10" data-remote="true" >详情</a>
</div>
<! } !>
<! } !>
</div>
</div>
</script>
<script>
var bt = baidu.template;
bt.LEFT_DELIMITER = '<!';
bt.RIGHT_DELIMITER = '!>';
$(function(){
var html = bt('t:extend_exec_results',{status: <%= @game.status %>, output:"<%= @latest_output %>", results: <%= @results %>, had_done: "<%= @had_done %>"});
$("#extend_code_results").html(html);
});
function hide_windows(){
$("#extend_code_results").hide();
}
</script>

View File

@ -46,6 +46,7 @@
<%= render :partial => 'games/exec_results' %>
<%#= render :partial => 'games/desc_full_show' %>
<script type="text/javascript" language="javascript">
var myMirror = $("#game_answer_show")[0];
var myCodeMirror = CodeMirror(myMirror, {
@ -58,6 +59,7 @@
});
$(document).ready(function(){
myCodeMirror.setSize('auto','auto');//设置版本库codemirror的高度
$("#game_answer_show" ).children(".CodeMirror").css("line-height", 1.2);
$("#game_answer_show").children().css("border", 0);
});
//课程大纲tab
@ -65,6 +67,6 @@
$("#myshixun_tip").hide();
});
function extend_game_description(){
$(".content-all-fix").show();
$("#game_left_contents").show();
}
</script>

View File

@ -19,28 +19,3 @@
<% end %>
<% end %>
</div>
<script>
var web_h = window.innerHeight;
$(document).ready(function(){
if($.browser.msie) {
$(".content-history-extend").css("height", web_h * 0.825 + "px");
}
else if($.browser.safari)
{
$(".content-history-extend").css("height", web_h * 0.825 + "px");
}
else if($.browser.mozilla)
{
$(".content-history-extend").css("height", web_h * 0.825 + "px");
}
else if($.browser.opera) {
$(".content-history-extend").css("height", web_h * 0.825 + "px");
}else if($.browser.chrome){
if(window.navigator.userAgent.indexOf("MetaSr") == -1){
$(".content-history-extend").css("height", web_h * 0.835 + "px");
}else{
$(".content-history-extend").css("height", web_h * 0.825 + "px");
}
}
});
</script>

View File

@ -1,23 +1,16 @@
<div class="content-editor col-width2 CELL" id="myshixun_repository">
<%= render :partial => 'myshixun_repository' %>
</div>
<!--
<div class="col-width fl ml15 mt15 content-half-fix02 undis" style="border: none" id="myshixun_extend_repository">
<%#= render :partial => 'myshixun_extend_repository' %>
</div>
-->
<div class="cl"></div>
<script>
var web_h = window.innerHeight;
$(document).ready(function(){
});
function close_big_repository(){
$(".content-half-fix02").hide()
}
function extend_repository(){
$(".content-half-fix").hide();
$(".content-half-fix02").show();
// $(".content-half-fix").hide();
$("#myshixun_extend_repository").show();
editor.refresh();
}
</script>

View File

@ -4,6 +4,11 @@
<div id="content_list" class="CELL _FLEX ROWS">
<%= render :partial => "game_show" %>
</div>
<%= render :partial => 'desc_full_show'%>
<div class="col-width content-all-fix undis" style="border: none" id="myshixun_extend_repository">
<%= render :partial => 'myshixun_extend_repository' %>
</div>
<%= render :partial => 'extend_test_output' %>
<script type="text/javascript" language="javascript">
// contents_h 是中间左侧内容页的高度,不同浏览器的得到高度不一致
@ -35,7 +40,7 @@
$("#close_myshixun_tip").click(function(){
$("#myshixun_tip").hide();
});
function extend_game_description(){
$(".content-all-fix").show();
function close_big_repository(){
$("#myshixun_extend_repository").hide()
}
</script>

View File

@ -73,7 +73,7 @@ a:hover.task-btn-blue{ background:#5f7cab;}
.tag-grey{ background-color: #f3f5f7; color: #4d555d;}
.tag-border-grey{ background-color: #fff;border-color: #e2e2e2; color: #888;}
/****************************/
.task-container{ min-width:1300px; margin:0 auto; background: #f5f9fc;}
.task-container{ min-width:1300px; margin:0 auto; background: #f5f9fc; position: relative;}
/*左侧导航*/
.leftbar{ height: 100%; background: #1f212d; width: 210px;}
.user-info{ width: 210px; height:180px; background:#29bd8b; padding-top:30px;}
@ -93,7 +93,7 @@ a:hover.leftnav-box-inner,a.leftnav-active{border-left:3px solid #29bd8b;color:
.rightbar-score{ margin-top: 17px; font-size: 14px; margin-right:20px;}
.rightbar-score li{ float: left; color:#fff; margin-right: 20px;}
.rightbar-score li a{ color:#fff;}
a.rightbar-pause{ color:#29bd8b; font-size: 18px; margin-right:245px; margin-top: 12px;}
a.rightbar-pause{ color:#29bd8b; font-size: 18px; margin-right:15px; margin-top: 12px;}
.rightbar-h2{ color:#fff; margin:12px 0 0 20px; font-weight: normal;}
.rightbar{background:#f5f9fc; color:#333; position: relative;}
/*右侧内容*/
@ -165,10 +165,9 @@ textarea.task-textarea-pd{ padding-bottom: 0px; padding-top:0px;}
.mb20{margin-bottom: 20px;}
input.knowledge_frame{height:30px;line-height:30px;border:none;background:#f3f5f7;}
/* TPi全屏展示css */
.content-all-fix{ margin:0; position: absolute; top:15px; z-index:99; }
.content-all-fix .tab-info-inner{ overflow:auto; margin:0 0 0px 15px;padding-left: 15px }
.content-half-fix{ min-width:450px; margin:0; position: absolute; top:15px; z-index:99;}
.content-all-fix{ position: absolute; top:75px; left:15px; right:15px; z-index:99; height: 91%; width: 98.5%;}
.content-all-fix .big-tab-info-inner{ display: block; height:50%; overflow:auto; margin:15px 0 0px 15px; }
.content-half-fix{ min-width:450px; margin:0; position: absolute; top:140px; left:15px; z-index:99; height:84%;}
.content-half-fix .content-history-inner{height:100%; overflow:auto; }
.content-half-fix02{margin:0; position: absolute; top:65px; z-index:99; right:45px;}
.autoscroll_new{ overflow:auto; }
.autoscroll_extend{ overflow:auto; }
.content-history-extend{ height: 95%;overflow:auto;}