Merge branch 'develop' of https://bdgit.trustie.net/hushasha/bigdata into develop

This commit is contained in:
XuCheng642 2017-09-17 11:20:26 +08:00
commit a4480cf2ce
15 changed files with 31 additions and 20 deletions

View File

@ -48,6 +48,7 @@ class GamesController < ApplicationController
@rev = @rev.nil? ? "master" : @rev
@type = params[:type]
challenge_path = @game_challenge.path
@discusses_count = @shixun.discusses.where(:parent_id => nil).count
# 用户选项
#@user_answer = @game.outputs.first.actual_output.split("") unless @st == 0 || @game.outputs.blank?
# 默认打开文件

View File

@ -162,6 +162,10 @@ module ApplicationHelper
end
end
def match_specific_symbol(str)
str.gsub(" ", "<span class=\"empty\"></span>").gsub(/\r\n$/, "<i class=\"fa fa-level-down font-16\" aria-hidden=\"true\"></i>").gsub("\r\n", "<br>").gsub(/\t/, "<span class=\"tab-key\"></span>").html_safe
end
# 积分表中建立记录行为,有过奖励则不重复奖励
def reward_grade(user, container_id, container_type, score)
grade = Grade.where(:user_id => user.id, :container_id => container_id, :container_type => container_type).first

View File

@ -48,8 +48,8 @@
<i class="fa fa-lock font-grey ml5" ></i>
<% end %>
</p>
<div class="clearfix"><span class="fl fb">输入:</span><p class="fl"><%= test.input.gsub(" ", "<span class=\"empty\"></span>").gsub(/\r\n$/, "<br/><i class=\"fa fa-level-down\" aria-hidden=\"true\"></i>").html_safe unless test.input.blank? %></p></div>
<div class="clearfix"><span class="fl fb">输出:</span><p class="fl"><%= test.output.gsub(" ", "<span class=\"empty\"></span>").gsub(/\r\n$/, "<br/><i class=\"fa fa-level-down\" aria-hidden=\"true\"></i>").html_safe unless test.output.blank? %></div>
<div class="clearfix"><span class="fl fb">输入:</span><p class="fl"><%= match_specific_symbol test.input unless test.input.blank? %></p></div>
<div class="clearfix"><span class="fl fb">输出:</span><p class="fl"><%= match_specific_symbol test.output unless test.output.blank? %></div>
</li>
<% end %>
<% else %>

View File

@ -7,7 +7,7 @@
<input id="choose_course_teacher_<%= user.id %>" type="checkbox" class="fl mt7 mr5 magic-checkbox" style="top:0px" name="membership[user_ids][]" value="<%= user.id %>">
<label for="choose_course_teacher_<%= user.id %>" style="top:0px">
<a href="<%= user_path(user) %>" target="_blank" class="task-hide fl span1 edu-txt-w100"><%= user.show_real_name %>(<%= user.login %>)</a>
<span class="fl color-grey span2 ml10"><%= user.user_extensions.user_technical_title %></span>
<span class="fl color-grey span2 ml10"><%= user.identity %></span>
<span class="span3 fl ml10 edu-txt-w140 task-hide" style="width: 189px"><%= user.user_extensions.school ? user.user_extensions.school.name : "" %></span>
</label>
</li>

View File

@ -33,7 +33,8 @@
</li>
<% end %>
<li id="tab_nav_4">
<%= link_to '评论', shixun_discuss_shixun_path(@myshixun.shixun), :class => "tab_type", :style => "font-size: 16px", :remote => true %>
<a href="<%= shixun_discuss_shixun_path(@myshixun.shixun) %>" class="tab_type" style="font-size: 16px" data-remote="true">评论<span id="discusses_count"><%= @discusses_count %></span></a>
<%#= link_to '', shixun_discuss_shixun_path(@myshixun.shixun), :class => "tab_type", :style => "font-size: 16px", :remote => true %>
</li>
<% if @st == 0 %>
<span class="btn-cir-big fr mt8 mr15" >经验值:<%= @game_challenge.score %></span>

View File

@ -6,7 +6,7 @@
<p class="mb10">
<i class="fa fa-map-marker mr5 color-grey"></i>
<%= link_to @course.name, course_path(@course) %>
> <%= link_to "#{@homework.homework_type_ch}作业", homework_common_index_path(:course => @course.id, :homework_type => @homework.homework_type) %> > #<%= link_to (get_hw_index(@homework, @is_teacher, @homework.homework_type) + 1), student_work_index_path(:homework => @homework.id) %>
> <%= link_to "#{@homework.homework_type_ch}作业", homework_common_index_path(:course => @course.id, :homework_type => @homework.homework_type) %> > #<%= link_to (get_hw_index(@homework, @is_teacher, @homework.homework_type).to_i + 1), student_work_index_path(:homework => @homework.id) %>
</p>
<div class="edu-con-top clearfix user_bg_shadow bor-grey-e">

View File

@ -25,10 +25,10 @@
<div class="edu-tab clearfix mb20 user_bg_shadow bor-grey-e">
<div class="panel-inner-fourm nobg">
<%= link_to image_tag(url_to_avatar(@topic.author), :width => 60, :height => 60, :alt => "用户头像", :class => "panel-list-img mr15"), user_path(@topic.author),:class => "fl" %>
<div class="panel-list-infobox fl" style="margin:0">
<div class="panel-list-infobox fl" style="margin:0;margin-left: 9px">
<p class="color-grey panel-lightgrey fl mt3">
<%= link_to @topic.author.show_real_name, user_path(@topic.author), :class => 'panel-name-small hide fl font-12 mt5 mr5 color-grey' %>
<span class="fl mr10">发表于<%= time_from_now(@topic.created_on) %></span>
<%= link_to @topic.author.show_real_name, user_path(@topic.author), :class => 'panel-name-small hide fl font-14 mr15 color-grey' %>
<span class="fl mr10 mt2">发表于<%= time_from_now(@topic.created_on) %></span>
</p>
<% if User.current.logged? %>

View File

@ -3,7 +3,7 @@ $(".-tab-nav li").removeClass("tab_hover");
$('#tab_nav_4').addClass("tab_hover");
$(".tab-info").hide();
$('#tab_con_4').show().html("<%= j(render :partial => "games/shixun_comment_list") %>");
$("#discusses_count").html("<%= @discusses_count %>");
// 评论区域的回复按钮
function reply_to_dis(id, name){
$("#comment_news").attr("placeholder", "回复"+name+":");

View File

@ -1,17 +1,17 @@
<div class="task-popup" style="width:450px;">
<div class="task-popup-title clearfix task-popup-bggrey">
<h3 class="fl">发送资源</h3>
<h3 class="fl">发送帖子</h3>
<a href="javascript:void(0);" class="pop_close"><i class="fa fa-times-circle font-18 link-color-grey fr mt5"></i></a>
</div>
<div class="task_popup_con">
<div class="">
<div class="alert alert-orange mb15 font-12">
<button data-dismiss="alert" class="task-close fr" type="button">×</button>
选择的资源将会发送到指定课堂
选择的帖子将会发送到指定课堂
</div>
<div class="mb10 edu-position">
<%= form_tag search_user_course_user_path(user, :send_message => 1),:method => 'get', :remote => true, :id => 'course_list_form', :class=> '' do %>
<%= form_tag search_user_course_user_path(user, :send_message => 1),:method => 'get', :remote => true, :id => '', :class=> '' do %>
<%= hidden_field_tag(:send_id, send_id) %>
<%= hidden_field_tag(@send_ids,send_ids) %>
<input type="text" id="search_course_input" value="<%= @search %>" name="search" placeholder="输入班级ID或者名称搜索" class="task-form-100 task-height-40 panel-box-sizing" />

View File

@ -1,5 +1,5 @@
<div class="clearfix mb15 fl">
<%= link_to "金币收入", user_grade_user_path(@user), :class => 'edu-filter-cir-grey fl active', :remote => true, :id => 'score_income' %>
<%= link_to "金币收入", user_grade_user_path(@user), :class => 'edu-filter-cir-grey fl active mr10', :remote => true, :id => 'score_income' %>
<%= link_to "金币支出", user_grade_user_path(@user, :type => 2), :class => 'edu-filter-cir-grey fl', :remote => true, :id => 'score_expand' %>
</div>
<p class="clearfix mb15 gold-count">当前金币:<span><%= @user.grade %></span>,您可以通过<%= link_to '完善基本资料', my_account_path(), :class => "color-orange03" %>

View File

@ -1,2 +1 @@
hideModal();
alert("发送成功!");
notice_box("发送成功!");

View File

@ -358,6 +358,12 @@ function setupAjaxIndicatorBase() {
}
});
}
function match_specific_symbol(str){
str = str.replace(/ /g, "<span class=\"empty\"></span>").replace(/\r\n$/, "<i class=\"fa fa-level-down color-grey font-16\" aria-hidden=\"true\"></i>").replace(/\r\n/g, "<br>").replace(/\t/g, "<span class=\"tab-key\"></span>")
return str
};
$(document).ready(setupAjaxIndicatorBase);
// test_sets测试集had_test_count输出集的个数test_sets_count测试集的个数had_passed_testsests_error_count测试集报错数test_sets_hidden_count隐藏测试集的个数
// test_sets_public_count公开测试集的个人had_passed_testsests_hidden_count通过的隐藏集个数had_passed_testsests_public_count通过的公开测试集个数
@ -437,13 +443,13 @@ function code_evaluation(test_sets,
"<li class=\"clearfix\">" +
"<div class=\"clearfix\">" +
" <span class=\"-task-ces-info-left color-blue fl fb\">预期输出:</span>" +
"<p class=\"fl\">" + ( test_sets[i].output == null ? "空" : test_sets[i].output.replace(/\r\n/g, "<br><i class=\"fa fa-level-down\" aria-hidden=\"true\"></i>").replace(/\t/g, "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;").replace(/ /g, "<span class=\"empty\"></span>") ) + "</p>" +
"<p class=\"fl\">" + ( test_sets[i].output == null ? "空" : match_specific_symbol(test_sets[i].output)) + "</p>" +
"</div>" +
"</li>" +
"<li class=\"clearfix\">" +
"<div class=\"clearfix\">" +
"<span class=\"-task-ces-info-left color-blue fl fb\">实际输出:</span>" +
"<p class=\"fl color-orange\">" + (test_sets[i].actual_output == null ? "空" : (test_sets[i].compile_success == "1" ? test_sets[i].actual_output.replace(/\r\n$/, "<br><i class=\"fa fa-level-down\" aria-hidden=\"true\"></i>").replace(/ /g, "<span class=\"empty\"></span>") : test_sets[i].actual_output.replace(/\r\n/g, "<br>"))) + "</p>" +
"<p class=\"fl color-orange\">" + (test_sets[i].actual_output == null ? "空" : (test_sets[i].compile_success == "1" ? match_specific_symbol(test_sets[i].actual_output) : test_sets[i].actual_output.replace(/\r\n/g, "<br>"))) + "</p>" +
"</div>" +
"</li>" +
"</ul>" +

View File

@ -96,7 +96,7 @@ a:hover.link-color-grey03{color:#3498db!important;}
.font-28{ font-size: 28px!important;}
.font-30{ font-size: 30px!important;}
/*通用内外边距*/
.mt-10{ margin-top:-10px;}.mt3{ margin-top:3px;}.mt5{ margin-top:5px;}.mt6{ margin-top:6px;}.mt7{ margin-top:7px;}.mt8{ margin-top:8px;}.mt10{ margin-top:10px;}.mt12{ margin-top:12px;}.mt15{ margin-top:15px;}.mt20{ margin-top:20px;}.mt25{ margin-top:25px;}.mt30{ margin-top:30px;}.mt50{ margin-top:50px;}
.mt-10{ margin-top:-10px;}.mt2{ margin-top:2px;}.mt3{ margin-top:3px;}.mt5{ margin-top:5px;}.mt6{ margin-top:6px;}.mt7{ margin-top:7px;}.mt8{ margin-top:8px;}.mt10{ margin-top:10px;}.mt12{ margin-top:12px;}.mt15{ margin-top:15px;}.mt20{ margin-top:20px;}.mt25{ margin-top:25px;}.mt30{ margin-top:30px;}.mt50{ margin-top:50px;}
.mb5{ margin-bottom: 5px;}.mb10{ margin-bottom: 10px;}.mb15{ margin-bottom: 15px;}.mb20{ margin-bottom: 20px;}.mb25{ margin-bottom: 25px;}.mb30{ margin-bottom: 30px;}.mb40{ margin-bottom: 40px;}.mb50{ margin-bottom: 50px;}
.ml-3{ margin-left: -3px;}.ml5{ margin-left: 5px;}.ml6{ margin-left: 6px;}.ml10{ margin-left: 10px;}.ml15{ margin-left: 15px;}.ml20{ margin-left: 20px;}.ml25{ margin-left: 25px;}.ml30{ margin-left: 30px;}.ml33{ margin-left: 33px;}.ml35{ margin-left:35px;}.ml40{margin-left:40px;}.ml42{margin-left:42px;}.ml50{ margin-left: 50px;}.ml75{ margin-left: 75px;}.ml95{ margin-left: 95px;}.ml115{margin-left: 115px}.ml230{ margin-left: 230px;}
.mr3{margin-right: 3px}.mr5{ margin-right: 5px;}.mr10{ margin-right: 10px;}.mr15{ margin-right: 15px;}.mr18{ margin-right: 18px;}.mr20{ margin-right: 20px;}.mr25{ margin-right: 25px;}.mr30{ margin-right:30px;}.mr40{margin-right:40px;}.mr50{ margin-right: 50px;}.mr60{ margin-right:60px;}

View File

@ -95,7 +95,7 @@ a:hover.panel-list-title{color:#FF7500;}
a.panel-name-small{ display: inline-block; max-width:100px; color:#29bd8b; font-size:12px; }
.panel-list-infobox{ width: 92%; margin-left:8%; margin-top:-70px;}
.panel-lightgrey,.panel-lightgrey span{ font-size:12px; color:#888;}
.panel-inner-info{ width: 92%; margin-left:8%;}
.panel-inner-info{ width: 93%; margin-left:7%;}
.panel-bg-grey{ padding:5px 0;background:#f6f6f6; width: 100%; color:#666;}
.panel-list-nodata{ width: 420px; margin:100px auto; text-align: center;}

View File

@ -415,5 +415,5 @@ html>body #ajax-indicator-base { position: fixed; }
.save-tip{display:none;position: fixed;top:0px;left: 0px;width: 100%;height: 100%;}
.save-tip-content{position: absolute;top:50%;left: 50%;margin-left: -36px;margin-top:-19px;background: rgba(0,0,0,0.7);color:#fff;padding:5px 15px;border-radius: 4px}
.empty{background: #494A4C;display: inline; margin: 0 2px; padding: 0 3px;}
.tab-key{background: #494A4C;display: inline; margin: 0 2px; padding: 0 12px;}
.nav_check_item li{padding: 0px 17px!important;}