Merge branch 'develop' into dev_aliyun

dev_static
cxt 5 years ago
commit 6e7c80ac77

@ -23,23 +23,23 @@ class ApplicationController < ActionController::Base
# 所有请求必须合法签名
def check_sign
unless Rails.env.development?
Rails.logger.info("66666 #{params}")
suffix = request.url.split(".").last.split("?").first
suffix_arr = ["xls", "xlsx", "pdf", "zip"] # excel文件先注释
unless suffix_arr.include?(suffix)
if params[:client_key].present?
randomcode = params[:randomcode]
# tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
Rails.logger.info("2222 #{sign}")
tip_exception(501, "请求不合理") if sign != params[:client_key]
else
tip_exception(501, "请求不合理")
end
end
end
# unless Rails.env.development?
# Rails.logger.info("66666 #{params}")
# suffix = request.url.split(".").last.split("?").first
# suffix_arr = ["xls", "xlsx", "pdf"] # excel文件先注释
# unless suffix_arr.include?(suffix)
# if params[:client_key].present?
# randomcode = params[:randomcode]
# # tip_exception(501, "请求不合理") unless (Time.now.to_i - randomcode.to_i).between?(0,5)
#
# sign = Digest::MD5.hexdigest("#{OPENKEY}#{randomcode}")
# Rails.logger.info("2222 #{sign}")
# tip_exception(501, "请求不合理") if sign != params[:client_key]
# else
# tip_exception(501, "请求不合理")
# end
# end
# end
end
# 全局配置参数

@ -101,85 +101,86 @@
</table>
</div>
<div class="bor-grey-e mt20">
<p class="pt10 pb10 pl15 pr15 clearfix bor-bottom-greyE">
<span class="fl font-bd">图形统计</span>
</p>
<div class="clearfix padding15 edu-back-white">
<div class="fl with65">
<!--echarts_dev:开发板包含了常见的警告和错误提示上线版echarts.min.js -->
<div class="fl" style="width: 750px;height: 580px" id="shixun_skill_chart">
</div>
<div class="fl" style="width: 750px;height: 580px" id="shixun_overall_ablility_chart">
</div>
</div>
<% if @work.myshixun.present? %>
<div class="bor-grey-e mt20">
<p class="pt10 pb10 pl15 pr15 clearfix bor-bottom-greyE">
<span class="fl font-bd">图形统计</span>
</p>
<div class="clearfix padding15 edu-back-white">
<div class="fr with25">
<div class="bor-grey-e bor-radius4 clearfix mt100">
<div class="fl with25 back-f6-grey" style="text-align: right;padding-right: 5%;">
<li class="mt5 mb5">姓名</li>
<li class="mt5 mb5">学号</li>
<li class="mt5 mb5">工作效率</li>
<div class="fl with65">
<!--echarts_dev:开发板包含了常见的警告和错误提示上线版echarts.min.js -->
<div class="fl" style="width: 750px;height: 580px" id="shixun_skill_chart">
</div>
<div class="fr with65" style="padding-left: 5%;">
<li class="color-orange03 mt5 mb5"><%= @user.real_name %></li>
<li class="color-orange03 mt5 mb5"><%= @user.student_id %></li>
<li class="mt5 mb5"><span class="color-orange03"><%= @myself_eff[1] %></li>
<div class="fl" style="width: 750px;height: 580px" id="shixun_overall_ablility_chart">
</div>
</div>
<div class="pr mt20 with100">
<div class="popup_tip_box fontGrey2 with100 disc" style="position: relative;box-sizing: border-box;right: 0px;">
<em></em>
<span></span>
<ol>
<li>1个小圆点代表1个学生</li>
<li>红色水滴表示当前学生的计算结果值</li>
<li>中位值是整个课堂学生表现的平均值</li>
<li>小圆点越高,工作效率越大</li>
<li>横坐标:学生序号</li>
<li>纵坐标:工作效率</li>
<li>红色横向箭头:中位值</li>
</ol>
</div>
<div style="height: 350px"></div>
<div class="bor-grey-e bor-radius4 clearfix">
<div class="fr with25">
<div class="bor-grey-e bor-radius4 clearfix mt100">
<div class="fl with25 back-f6-grey" style="text-align: right;padding-right: 5%;">
<li class="mt5 mb5">姓名</li>
<li class="mt5 mb5">学号</li>
<li class="mt5 mb5">能力</li>
<li class="mt5 mb5">工作效率</li>
</div>
<div class="fr with65" style="padding-left: 5%;">
<li class="color-orange03 mt5 mb5"><%= @user.real_name %></li>
<li class="color-orange03 mt5 mb5"><%= @user.real_name %></li>
<li class="color-orange03 mt5 mb5"><%= @user.student_id %></li>
<li class="mt5 mb5"><span class="color-orange03"><%= @myself_consume[1] %></li>
<li class="mt5 mb5"><span class="color-orange03"><%= @myself_eff[1] %></li>
</div>
</div>
<div class="popup_tip_box fontGrey2 with100 disc mt20" style="position: relative;box-sizing: border-box;right: 0px;">
<em></em>
<span></span>
<ol>
<li>1个小圆点代表1个学生</li>
<li>红色水滴表示当前学生的计算结果值</li>
<li>小圆圈越大,评测次数越少</li>
<li>横坐标对完成实训的总时间取log</li>
<li>纵坐标:实训总分数/评测次数</li>
</ol>
<div class="pr mt20 with100">
<div class="popup_tip_box fontGrey2 with100 disc" style="position: relative;box-sizing: border-box;right: 0px;">
<em></em>
<span></span>
<ol>
<li>1个小圆点代表1个学生</li>
<li>红色水滴表示当前学生的计算结果值</li>
<li>中位值是整个课堂学生表现的平均值</li>
<li>小圆点越高,工作效率越大</li>
<li>横坐标:学生序号</li>
<li>纵坐标:工作效率</li>
<li>红色横向箭头:中位值</li>
</ol>
</div>
<div style="height: 350px"></div>
<div class="bor-grey-e bor-radius4 clearfix">
<div class="fl with25 back-f6-grey" style="text-align: right;padding-right: 5%;">
<li class="mt5 mb5">姓名</li>
<li class="mt5 mb5">学号</li>
<li class="mt5 mb5">能力</li>
</div>
<div class="fr with65" style="padding-left: 5%;">
<li class="color-orange03 mt5 mb5"><%= @user.real_name %></li>
<li class="color-orange03 mt5 mb5"><%= @user.student_id %></li>
<li class="mt5 mb5"><span class="color-orange03"><%= @myself_consume[1] %></li>
</div>
</div>
<div class="popup_tip_box fontGrey2 with100 disc mt20" style="position: relative;box-sizing: border-box;right: 0px;">
<em></em>
<span></span>
<ol>
<li>1个小圆点代表1个学生</li>
<li>红色水滴表示当前学生的计算结果值</li>
<li>小圆圈越大,评测次数越少</li>
<li>横坐标对完成实训的总时间取log</li>
<li>纵坐标:实训总分数/评测次数</li>
</ol>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="bor-grey-e mt20">
<p class="pt10 pb10 pl15 pr15 clearfix">
<span class="fl font-bd">实训详情</span>
</p>
<%#= ApplicationController.helpers.javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/hint/show-hint", "/codemirror/addon/hint/javascript-hint", "/codemirror/addon/selection/active-line", "/codemirror/addon/lint/javascript-lint", "/codemirror/addon/lint/css-lint", "/codemirror/addon/lint/lint", "/codemirror/addon/lint/json-lint", "/editormd/lib/codemirror/addon/lint/css-lint" %>
<% @games.each_with_index do |game, index| %>
<div class="shixun_detail_con padding15 bor-top-greyE">
<p class="clearfix">
<div class="bor-grey-e mt20">
<p class="pt10 pb10 pl15 pr15 clearfix">
<span class="fl font-bd">实训详情</span>
</p>
<%#= ApplicationController.helpers.javascript_include_tag "/codemirror/lib/codemirror", "/codemirror/mode/javascript/javascript", "/codemirror/addon/hint/show-hint", "/codemirror/addon/hint/javascript-hint", "/codemirror/addon/selection/active-line", "/codemirror/addon/lint/javascript-lint", "/codemirror/addon/lint/css-lint", "/codemirror/addon/lint/lint", "/codemirror/addon/lint/json-lint", "/editormd/lib/codemirror/addon/lint/css-lint" %>
<% @games.each_with_index do |game, index| %>
<div class="shixun_detail_con padding15 bor-top-greyE">
<p class="clearfix">
<span class="panel-inner-icon mr15 fl mt5">
<% if game.challenge.st == 1 %>
<i class="fa fa-th-list font-16 color_white" data-tip-down="选择题任务"></i>
@ -187,43 +188,44 @@
<i class="fa fa-code font-16 color_white" data-tip-down="编程题任务"></i>
<% end %>
</span>
<span class="fl mt3"><span class="font-bd mr15">第<%= index+1 %>关</span><%= game.challenge.subject %></span>
</p>
<div style="margin-left: 32px;" class="mt15">
<% if game.outputs.present? %>
<table class="edu-pop-table edu-txt-center table-line thback" cellpadding="0" cellspacing="0">
<thead>
<th width="10%">评测次数</th>
<th>评测信息</th>
</thead>
<tbody>
<% outputs = game.outputs.group("query_index") %>
<% max_query = outputs.map(&:query_index).max %>
<% outputs.reverse.try(:each) do |output| %>
<tr>
<td><%= max_query == output.query_index ? "最后一次" : "第#{output.query_index}次" %></td>
<td align="left" style="padding-left: 5px"><%= output_detail(game, output) %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<% if game.try(:lastest_code).present? && game.challenge.st == 0 %>
<div class="bor-grey-e mt15">
<p class="clearfix pt5 pb5 pl15 pr15 back-f6-grey">
<span class="fl">最近通过的代码</span>
</p>
<div class="test-code bor-top-greyE">
<li class="clearfix" xmlns="http://www.w3.org/1999/html">
<textarea class="" id="content_show_<%= game.id %>" name="content" style="display: none"><%= game&.lastest_code %></textarea>
</li>
<span class="fl mt3"><span class="font-bd mr15">第<%= index+1 %>关</span><%= game.challenge.subject %></span>
</p>
<div style="margin-left: 32px;" class="mt15">
<% if game.outputs.present? %>
<table class="edu-pop-table edu-txt-center table-line thback" cellpadding="0" cellspacing="0">
<thead>
<th width="10%">评测次数</th>
<th>评测信息</th>
</thead>
<tbody>
<% outputs = game.outputs.group("query_index") %>
<% max_query = outputs.map(&:query_index).max %>
<% outputs.reverse.try(:each) do |output| %>
<tr>
<td><%= max_query == output.query_index ? "最后一次" : "第#{output.query_index}次" %></td>
<td align="left" style="padding-left: 5px"><%= output_detail(game, output) %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>
<% if game.try(:lastest_code).present? && game.challenge.st == 0 %>
<div class="bor-grey-e mt15">
<p class="clearfix pt5 pb5 pl15 pr15 back-f6-grey">
<span class="fl">最近通过的代码</span>
</p>
<div class="test-code bor-top-greyE">
<li class="clearfix" xmlns="http://www.w3.org/1999/html">
<textarea class="" id="content_show_<%= game.id %>" name="content" style="display: none"><%= game&.lastest_code %></textarea>
</li>
</div>
</div>
</div>
<% end %>
<% end %>
</div>
</div>
</div>
<% end %>
</div>
<% end %>
</div>
<% end %>
</div>
</body>
@ -261,215 +263,220 @@
// 基于准备好的dom初始化echarts实例
var effChart = echarts.init(document.getElementById('shixun_skill_chart'));
// 指定图表的配置项和数据
var option = {
grid: {
left: '3%',
right: '9%',
bottom: '3%',
containLabel: true
},
tooltip : {},
xAxis : [
{
type : 'value',
name: '学生序号',
scale:true,
axisLabel : {
formatter: ' '
},
axisTick:{
show:false
},
splitLine: {
show: false
}
}
],
yAxis : [
{
type : 'value',
name : '工作效率',
scale:true,
axisLabel : {
formatter: '{value} '
},
splitLine: {
show: false
}
}
],
series : [
{
name:'',
type:'scatter',
data: <%= @echart_data[:efficiency_list] %>,
itemStyle:{
normal:{color:'#2e65ad'}
},
markArea: {
silent: true,
itemStyle: {
normal: {
color: 'transparent',
borderWidth: 1,
borderType: 'dashed'
}
}
},
markPoint : {
data : [
{
name: 'daiao',
xAxis:<%= @myself_eff[0] %>,
yAxis:<%= @myself_eff[1] %>
}
],
itemStyle: {
normal:{
color:'#c23531'
}
}
},
markLine : {
lineStyle: {
normal: {
type: 'solid',
color:'#c23531'
}
if(document.getElementById('shixun_skill_chart')){
var effChart = echarts.init(document.getElementById('shixun_skill_chart'));
// 指定图表的配置项和数据
var option = {
grid: {
left: '3%',
right: '9%',
bottom: '3%',
containLabel: true
},
data : [
{type : 'average', name: '中位值'}
tooltip : {},
xAxis : [
{
type : 'value',
name: '学生序号',
scale:true,
axisLabel : {
formatter: ' '
},
axisTick:{
show:false
},
splitLine: {
show: false
}
}
],
yAxis : [
{
type : 'value',
name : '工作效率',
scale:true,
axisLabel : {
formatter: '{value} '
},
splitLine: {
show: false
}
}
],
series : [
{
name:'',
type:'scatter',
data: <%= @echart_data[:efficiency_list] %>,
itemStyle:{
normal:{color:'#2e65ad'}
},
markArea: {
silent: true,
itemStyle: {
normal: {
color: 'transparent',
borderWidth: 1,
borderType: 'dashed'
}
}
},
markPoint : {
data : [
{
name: 'daiao',
xAxis:<%= @myself_eff[0] %>,
yAxis:<%= @myself_eff[1] %>
}
],
itemStyle: {
normal:{
color:'#c23531'
}
}
},
markLine : {
lineStyle: {
normal: {
type: 'solid',
color:'#c23531'
}
},
data : [
{type : 'average', name: '中位值'}
]
}
},
{
name:'二班',
type:'scatter',
data: [<%= @myself_eff %>],
itemStyle:{
color:'#c23531'
}
}
]
}
},
{
name:'二班',
type:'scatter',
data: [<%= @myself_eff %>],
itemStyle:{
color:'#c23531'
}
}
]
};
// 使用刚指定的配置项和数据显示图表
effChart.setOption(option);
console.debug(<%= @myself_consume %>);
var ablChart = echarts.init(document.getElementById('shixun_overall_ablility_chart'));
var dataBJ = <%= @echart_data[:consume_list] %>;
var schema = [
{name: 'date', index: 0, text: '日'},
{name: 'AQIindex', index: 1, text: 'AQI指数'},
{name: 'PM25', index: 2, text: 'PM2.5'}
];
};
// 使用刚指定的配置项和数据显示图表
effChart.setOption(option);
console.debug(<%= @myself_consume %>);
}
var itemStyle = {
normal: {
opacity: 0.8,
shadowBlur: 10,
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowColor: 'rgba(0, 0, 0, 0)',
color:'#2e65ad'
}
};
var itemStyle1 = {
normal: {
opacity: 0.8,
shadowBlur: 10,
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowColor: 'rgba(0, 0, 0, 0)',
color:'#c23531'
}
};
if(document.getElementById('shixun_skill_chart')) {
var ablChart = echarts.init(document.getElementById('shixun_overall_ablility_chart'));
var dataBJ = <%= @echart_data[:consume_list] %>;
var schema = [
{name: 'date', index: 0, text: '日'},
{name: 'AQIindex', index: 1, text: 'AQI指数'},
{name: 'PM25', index: 2, text: 'PM2.5'}
];
var option1 = {
backgroundColor: '#fff',
color: [
'#dd4444', '#fec42c', '#80F1BE'
],
grid: {
x: '10%',
x2: 150,
y: '18%',
y2: '10%'
},
tooltip: {},
xAxis: {
type: 'value',
name: 'log(实训的总时间)',
nameGap: 16,
nameTextStyle: {
color: '#000',
fontSize: 14
},
splitLine: {
show: false
},
axisLine: {
lineStyle: {
color: '#000'
}
}
},
yAxis: {
type: 'value',
name: '总分数/评测次数',
nameLocation: 'end',
nameGap: 20,
nameTextStyle: {
color: '#000',
fontSize: 16
},
axisLine: {
lineStyle: {
color: '#000'
}
},
splitLine: {
show: false
}
},
series: [
{
name: '能力',
type: 'scatter',
itemStyle: itemStyle,
data: dataBJ,
symbolSize: function (value){
return Math.round(value[2]);
},
markPoint : {
data : [
{
name: 'daiao',
xAxis:<%= @myself_consume[0] %>,
yAxis:<%= @myself_consume[1] %>
var itemStyle = {
normal: {
opacity: 0.8,
shadowBlur: 10,
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowColor: 'rgba(0, 0, 0, 0)',
color:'#2e65ad'
}
],
itemStyle: {
normal:{
color:'#c23531'
};
var itemStyle1 = {
normal: {
opacity: 0.8,
shadowBlur: 10,
shadowOffsetX: 0,
shadowOffsetY: 0,
shadowColor: 'rgba(0, 0, 0, 0)',
color:'#c23531'
}
}
}
},
{
name: '能力1',
type: 'scatter',
data:[<%= @myself_consume %>],
itemStyle:itemStyle1,
symbolSize: function (val){
return Math.round(val[2]);
}
}
]
};
// 使用刚指定的配置项和数据显示图表。
ablChart.setOption(option1);
};
var option1 = {
backgroundColor: '#fff',
color: [
'#dd4444', '#fec42c', '#80F1BE'
],
grid: {
x: '10%',
x2: 150,
y: '18%',
y2: '10%'
},
tooltip: {},
xAxis: {
type: 'value',
name: 'log(实训的总时间)',
nameGap: 16,
nameTextStyle: {
color: '#000',
fontSize: 14
},
splitLine: {
show: false
},
axisLine: {
lineStyle: {
color: '#000'
}
}
},
yAxis: {
type: 'value',
name: '总分数/评测次数',
nameLocation: 'end',
nameGap: 20,
nameTextStyle: {
color: '#000',
fontSize: 16
},
axisLine: {
lineStyle: {
color: '#000'
}
},
splitLine: {
show: false
}
},
series: [
{
name: '能力',
type: 'scatter',
itemStyle: itemStyle,
data: dataBJ,
symbolSize: function (value){
return Math.round(value[2]);
},
markPoint : {
data : [
{
name: 'daiao',
xAxis:<%= @myself_consume[0] %>,
yAxis:<%= @myself_consume[1] %>
}
],
itemStyle: {
normal:{
color:'#c23531'
}
}
}
},
{
name: '能力1',
type: 'scatter',
data:[<%= @myself_consume %>],
itemStyle:itemStyle1,
symbolSize: function (val){
return Math.round(val[2]);
}
}
]
};
// 使用刚指定的配置项和数据显示图表。
ablChart.setOption(option1);
}
}
</script>
</html>

@ -1,7 +1,7 @@
# 执行示例 bundle exec rake zip_pack:shixun_pack args=123,2323
namespace :zip_pack do
desc "手工打包作品"
OUTPUT_FOLDER = "#{Rails.root}/files/archiveZip"
OUTPUT_FOLDER = "/tmp"
task :shixun_pack => :environment do
@ -23,7 +23,7 @@ namespace :zip_pack do
student_works.find_each.map do |student_work|
export = ExportShixunReportService.new(homework, student_work)
pdf = export.to_pdf
# pdfs << pdf
pdfs << pdf
begin
zip.add(export.filename, pdf.path)
rescue => ex

@ -30,7 +30,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
devtool: "cheap-module-eval-source-map",
//devtool: "cheap-module-eval-source-map",
// 开启调试
//devtool: "source-map", // 开启调试
// These are the "entry points" to our application.

@ -326,8 +326,8 @@ module.exports = {
comments: false
},
compress: {
drop_debugger: false,
drop_console: false
drop_debugger: true,
drop_console: true
}
}
}),

@ -40,7 +40,7 @@ if (isDev) {
// 超管
// debugType="admin";
// 老师
//ebugType="teacher";
//debugType="teacher";
// 学生
//debugType="student";
@ -126,7 +126,7 @@ export function initAxiosInterceptors(props) {
let timestamp = Date.parse(new Date())/1000;
if (window.location.port === "3007") {
// let timestamp=railsgettimes(proxy);
console.log(timestamp)
// console.log(timestamp)
railsgettimes(`${proxy}/api/main/first_stamp.json`);
let newopens=md5(opens+timestamp)
config.url = `${proxy}${url}`;

@ -297,7 +297,7 @@ class CommonWorkAppraiseReply extends Component{
<style>{`
.course-message .panel-comment_item .comment_orig_content {
width: 1074px;
width: 1040px;
}
.course-message .childrenCommentsView .comment_orig_content {
width: 1000px;

@ -734,7 +734,7 @@ background:rgba(204,204,204,0.2) !important;
}
`}
</style>
<Breadcrumb separator="|" className={"mt5"}>
{ excellent===true&&this.props.isAdminOrStudent()===false?"":<Breadcrumb separator="|" className={"mt5"}>
<Breadcrumb.Item className={"pointer"}>
<Tooltip getPopupContainer={trigger => trigger.parentNode} visible={coursedata.teacher_applies_count===undefined?false:coursedata.teacher_applies_count>0?true:false}
@ -766,7 +766,7 @@ background:rgba(204,204,204,0.2) !important;
<span className="color-grey-c font-16"><span className={"mr10 ml10"}>学分</span> <span className={"mr10"}>{coursedata.credit}</span></span>
}</Breadcrumb.Item>
</Breadcrumb>
</Breadcrumb>}
{/*<li className={"mt7 teachersbox"} >*/}
{/*<Link to={"/courses/"+this.props.match.params.coursesId+"/teachers"}>*/}

@ -55,7 +55,7 @@ class MemoDetail extends Component {
}
}
componentDidMount() {
window.$("html,body").animate({"scrollTop":0})
// window.$("html,body").animate({"scrollTop":0})
const { match } = this.props

@ -200,13 +200,13 @@ class ShixunsHome extends Component {
item.sub_repertoires.map((i,k)=>{
return(
<div className="clearfix mt20 mb5 pb10 navlistpanel-line" key={k}>
<p className="little-title clearfix welcome_shixun_index little-titles"
<div className="little-title clearfix welcome_shixun_index little-titles"
data-id="1" data-rep-id="1" data-type="sub"
>
<Link to={"/shixuns?id="+i.id+"&type=sub&palce="+item.id}>
{i.name}
</Link>
</p>
</div>
{
i.tags.map((t,e)=>{
return(

@ -21,8 +21,16 @@ import './tpiPageForMobile.css';
import actions from '../../redux/actions';
const $ = window.$;
class MainContent extends Component {
constructor(props) {
super(props)
this.chooseQ = React.createRef();
}
chooseQfun = (Ref) => {
this.chooseQ = Ref;
}
componentDidMount() {
// ios下图标位置有问题
this.props.mainContentfun(this)
setTimeout(()=>{
if (window.$('.b-label>.resize-helper').position().top < 100) {
window.$('.b-label>.resize-helper').css('top', '200px')
@ -162,7 +170,7 @@ class MainContent extends Component {
<CodeRepositoryViewContainer { ...this.props } ></CodeRepositoryViewContainer>
</div>
</React.Fragment>
: <ChooseRepositoryView ref="chooseQ" { ...this.props }></ChooseRepositoryView>
: <ChooseRepositoryView ref="chooseQ" chooseQfun={(ref)=>this.chooseQfun(ref)}{ ...this.props }></ChooseRepositoryView>
}
{/* */}

@ -158,7 +158,7 @@ class MainContentContainer extends Component {
this.showResetCodeDialog = this.showResetCodeDialog.bind(this)
this.showResetPassedCodeDialog = this.showResetPassedCodeDialog.bind(this)
this.mainContent = React.createRef();
this.oldRepositoryCode = '';
@ -177,7 +177,9 @@ class MainContentContainer extends Component {
isEditablePath: true
}
}
mainContentfun = (Ref) => {
this.mainContent = Ref;
}
// ------------------------------------------------
// static childContextTypes = {
// muiTheme: PropTypes.object
@ -589,7 +591,9 @@ class MainContentContainer extends Component {
onRunChooseTest() {
const { st, game, onRunChooseTestFinish, showSnackbar } = this.props;
// 获取form表单值
var value = this.refs.mainContent.refs.chooseQ.getForm().getFieldsValue();
// console.log(this.mainContent.chooseQ.props.form.getFieldsValue())
var value = this.mainContent.chooseQ.props.form.getFieldsValue();
// this.refs.mainContent.refs.chooseQ.getForm().getFieldsValue();
var valueArray = []; // map转array
var unSelectOptionIndexArray = [] // 自己做未选提示
@ -984,7 +988,7 @@ class MainContentContainer extends Component {
</Dialog>
<UpdateDrawer {...this.props} fetchRepositoryCode={this.fetchRepositoryCode}></UpdateDrawer>
<MainContent ref="mainContent" {...this.props} output_sets={output_sets} {...this.state}
<MainContent ref="mainContent" mainContentfun={(ref)=>this.mainContentfun(ref)} {...this.props} output_sets={output_sets} {...this.state}
onRepositoryCodeUpdate={this.onRepositoryCodeUpdate} onRunCodeTest={this.onRunCodeTest}
codemirrorDidMount={this.codemirrorDidMount} fetchRepositoryCode={this.fetchRepositoryCode}
showResetCodeDialog={this.showResetCodeDialog} showResetPassedCodeDialog={this.showResetPassedCodeDialog}

@ -1,10 +1,10 @@
import React, { Component } from 'react';
import IconButton from 'material-ui/IconButton';
import Tooltip from 'material-ui/Tooltip';
import { CircularProgress } from 'material-ui/Progress';
import './ChooseEvaluateViewnew.css';
class ChooseEvaluateView extends Component {
@ -128,7 +128,7 @@ class ChooseEvaluateView extends Component {
</div>
<div id="blacktab_con_2" className=" ">
<div className="fit -scroll">
<div className="-layout-v -fit">
<div className="-layout-v -fit paddingbottom60tpm">
<div className="-flex -scroll task-padding16 loading-center undis" id="evaluating_ajax_loading"></div>
<div className="-flex -scroll task-padding16" id="evaluating_contents">
{/*

@ -0,0 +1,3 @@
.paddingbottom60tpm{
padding-bottom: 60px;
}

@ -70,6 +70,9 @@ subject:"计算机中的应用软件是指:"
option_name:"所有计算机上都应使用的软件"
positon:0
*/
componentDidMount() {
this.props.chooseQfun(this)
}
renderChooseQuestions() {
const { getFieldDecorator } = this.props.form;
const { choose, choose_test_cases } = this.props;

@ -134,4 +134,8 @@
}
.-task-ces-info .inputTitle .input{
white-space: pre-wrap;
}
.paddingbottom60tpm{
padding-bottom: 60px;
}

@ -1,11 +1,10 @@
import '../VNC.css';
import React, { Component } from 'react';
import IconButton from 'material-ui/IconButton';
import Tooltip from 'material-ui/Tooltip';
import Button from 'material-ui/Button';
import { connect } from 'react-redux';
import './CodeEvaluateView.css'
import './CodeEvaluateView.css';
import { CircularProgress } from 'material-ui/Progress';
import { on, off } from 'educoder'
import actions from '../../../redux/actions';
@ -386,7 +385,7 @@ class CodeEvaluateView extends Component {
</div>
<div id="blacktab_con_2" className=" " style={ tabIndex === 1 ? {display: 'block'} : {display: 'none'} }>
<div className="fit -scroll">
<div className="-layout-v -fit">
<div className="-layout-v -fit paddingbottom60tpm">
<div className="-flex -scroll task-padding16 loading-center undis" id="evaluating_ajax_loading"></div>
<div className="-flex -scroll task-padding16" id="evaluating_contents">
{/*

@ -510,9 +510,10 @@ class DetailCards extends Component{
{this.props.current_user&&this.props.current_user.admin===true||this.props.current_user&&this.props.current_user.business===true?
item.shixuns_list && item.shixuns_list.map((line,index)=>{
return(
<div className="clearfix paragraph lineh-30" onMouseEnter>
<div className="clearfix paragraph lineh-30" onMouseEnter={()=>this.showparagraph(key,index)} onMouseLeave={this.hideparagraph}>
<li className="fl li-width63">
<li className="fl li-width63">
<span className="progressRing mr10">
{
@ -531,7 +532,8 @@ class DetailCards extends Component{
{
showparagraphkey===key&&showparagraphindex===index?<div>
<Link to={'/shixuns/'+line.identifier+'/challenges'} className="mr30 color-blue_4C shixun_detail pointer fl" target="_blank">查看详情</Link>
</div>:""
{line.shixun_status==="暂未公开"?"":<a onClick={()=>this.startgameid(line.identifier)} className="btn_auto user_bluebg_btn fl" id="shixun_operation" >开始实战</a>}
</div>:""
}
</li>

@ -135,6 +135,13 @@ class TPMBanner extends Component {
this.setState({
openknow:true
})
setTimeout(()=>{
this.openknow()
this.setState({
openknow:false
})
}, 10000);
}else{
this.setState({
openknow:false
@ -158,6 +165,12 @@ class TPMBanner extends Component {
this.setState({
openshowpublictype: true
})
setTimeout(()=>{
this.openshowpublic()
this.setState({
openshowpublictype:false
})
}, 10000);
} else {
this.setState({
openshowpublictype: false

@ -163,7 +163,7 @@ class TPMIndex extends Component {
openknows:false
})
let newTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'
storage.setItem(newTPMsettings,true);
storage.setItem(newTPMsettings,false);
}
@ -174,7 +174,7 @@ class TPMIndex extends Component {
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings)
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){
this.setState({
openknows:true
openknows:false
})
}else{
this.setState({
@ -453,20 +453,20 @@ class TPMIndex extends Component {
{ this.state.is_jupyter===false? <Menu.Item key="8" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>排行榜</span>
</Menu.Item>:""}
{this.state.identity >4||this.state.identity===undefined ? "":this.state.openknows===true?<span>
<Popover
content={
<pre className={"bannerpd201"}>
<div>更多设置在这里点击配置看一看~</div>
<div className={"wechatcenter mt15"}><Button type="primary" onClick={this.openknow} >我知道了</Button></div>
</pre>
}
trigger="click"
placement="top"
visible={this.state.openknows}
>
</Popover>
</span>:""}
{/*{this.state.identity >4||this.state.identity===undefined ? "":this.state.openknows===true?<span>*/}
{/* <Popover*/}
{/* content={*/}
{/* <pre className={"bannerpd201"}>*/}
{/* <div>更多设置在这里,点击“配置”看一看~</div>*/}
{/* <div className={"wechatcenter mt15"}><Button type="primary" onClick={this.openknow} >我知道了</Button></div>*/}
{/* </pre>*/}
{/* }*/}
{/* trigger="click"*/}
{/* placement="top"*/}
{/* visible={this.state.openknows}*/}
{/* >*/}
{/* </Popover>*/}
{/*</span>:""}*/}
{this.state.identity >4||this.state.identity===undefined ? "":
<Menu.Item key="9" className={"competitionmr50"}>

@ -375,9 +375,7 @@ export function TPMIndexHOC(WrappedComponent) {
});
}
/**
课堂权限相关方法暂时写这里了 ----------------------------------------END
*/
fetchUser = () => {
let url = `/users/get_user_info.json`
let courseId;

@ -69,6 +69,7 @@ function JupyterTPI (props) {
drawervisible,
reset_with_tpi,
jupytertime,
endjupytertime,
active_with_tpi,
spinning,
updataspinning,
@ -303,7 +304,7 @@ function JupyterTPI (props) {
>
<div className="sortinxdirection">
<Icon type="file-text" className="jupyter_icon fl lineheighttaj filestyles" />
<a className="jupyter_name ml10 maxnamewidth181 lineheighttaj colorlineheighttaj" title={item.title}>{item.title}</a>
<a className="jupyter_name ml10 maxnamewidth152 lineheighttaj colorlineheighttaj" title={item.title}>{item.title}</a>
<a className={"fr color-blue lineheighttaj"}
onClick={() => {
jsCopy("file_path"+i)
@ -326,6 +327,7 @@ function JupyterTPI (props) {
}, [props]);
const onFinish= () =>{
Modal.destroyAll();
Modal.confirm({
title: '倒计时截止',
content: (
@ -337,11 +339,24 @@ function JupyterTPI (props) {
cancelText: '取消',
onOk () {
reset_with_tpi(myIdentifier, '重置成功');
// active_with_tpi(myIdentifier, '重置成功');
}
})
}
const endonFinish= () =>{
Modal.confirm({
title: '服务中断提醒',
content: (
<p style={{ lineHeight: '24px' }}>
jupyter将于<span className={"Countdownfonttpi"}><Countdown value={jupytertime} format="HH:mm:ss"/></span>使
</p>
),
okText: '立即延长',
cancelText: '不需要',
onOk () {
active_with_tpi(myIdentifier, '延长成功');
}
})
}
return (
<Spin tip="加载中..." spinning={spinning}>
<div className="jupyter_area">
@ -351,6 +366,9 @@ function JupyterTPI (props) {
<span className="title_desc" style={{ marginTop: '10px' }}>{jupyterInfo.name}</span>
<span className="title_time jupytertitle_time">
<Countdown value={jupytertime} format="HH:mm:ss" onFinish={onFinish}/>
<span className={"Countdowntypes"}>
{/*{endjupytertime===false?"":<Countdown value={endjupytertime} format="HH:mm:ss" onFinish={endonFinish}/>}*/}
</span>
</span>
</p>
<p className="jupyter_btn">
@ -457,7 +475,7 @@ const mapStateToProps = (state) => {
jupyter_pagination,
jupyter_identifier
} = state.jupyterReducer;
const { loading ,drawervisible,jupytertime,spinning} = state.commonReducer;
const { loading ,drawervisible,jupytertime,spinning,endjupytertime} = state.commonReducer;
return {
loading,
jupyter_info,
@ -470,6 +488,7 @@ const mapStateToProps = (state) => {
jupyter_identifier,
drawervisible,
jupytertime,
endjupytertime,
spinning
};
}

@ -26,7 +26,7 @@
.filestyles{
color: #28b887 !important;
font-size: 25px !important;
margin-left:20px;
margin-left:48px;
}
.Resizer.horizontal:hover {
border-top: 5px solid rgba(0, 0, 0, 0.5);
@ -230,16 +230,32 @@ line-height: 50px !important;
width: 186px;
}
.maxnamewidth181{
max-width:181px;
.maxnamewidth152{
max-width:152px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
width: 181px;
width: 152px;
}
.height45lineheight45{
height: 45px;
line-height: 45px !important;
}
.Countdowntypes{
width:1px;
height:1px;
overflow: hidden;
display: block;
}
.Countdownfonttpi{
width: 60px;
display: inline-block;
}
.Countdownfonttpi .ant-statistic-content-value{
font-size: 14px;
}

@ -30,7 +30,8 @@ class Challengesjupyter extends Component {
fileList:[],
shuaxin:false,
showtime:false,
jupytertime:Date.now() +3600 * 1000
jupytertime:Date.now() +3600 * 1000,
endtimes:false
}
}
@ -119,10 +120,12 @@ class Challengesjupyter extends Component {
let remainingSeconds=response.data.remainingSeconds;
// let summain=3600 * 1000;
let sums= remainingSeconds * 1000;
let endsms=(remainingSeconds-300<=0?0:remainingSeconds-300)*1000
// let sum=summain-sums;
setTimeout(()=>{
this.setState({
jupytertime:Date.now() +sums
jupytertime:Date.now() +sums,
endtimes:endsms===0?Date.now()+1000:Date.now() +endsms
})
},500);
}
@ -420,6 +423,7 @@ class Challengesjupyter extends Component {
}
onFinish=()=>{
Modal.destroyAll();
let id=this.props.match.params.shixunId;
let that=this;
Modal.confirm({
@ -436,8 +440,45 @@ class Challengesjupyter extends Component {
}
})
}
onendFinish=()=>{
let id=this.props.match.params.shixunId;
let that=this;
Modal.confirm({
title:"服务中断提醒",
content: (
<p style={{ lineHeight: '24px' }}>
jupyter将于<span className={"Countdownfonttpm"}><Countdown value={this.state.jupytertime} format="HH:mm:ss" onFinish={this.onFinish}/></span>使
</p>
),
okText: '立即延长',
cancelText: '不需要',
onOk () {
that.onendhandleClickResetTpi(id)
}
})
}
onendhandleClickResetTpi=(id)=>{
const url = `/jupyters/active_with_tpm.json`;
axios.get(url,{params:{
identifier:id
}}).then((response) => {
if(response.data.status===0){
this.props.showNotification('延长成功!');
setTimeout(()=>{
this.setState({
jupytertime:Date.now() + 900 * 1000,
endtimes:Date.now() + 300 * 1000
})
},500);
}
});
}
render() {
let{ChallengesDataList,booljupyterurls,enlarge,fileList}=this.state;
let{ChallengesDataList,booljupyterurls,enlarge,fileList,endtimes}=this.state;
let id = this.props.match.params.shixunId;
//老师
const is_teacher = this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
@ -509,6 +550,7 @@ class Challengesjupyter extends Component {
<span className={"Countdowntypes"}>
{/*this.state.jupytertime*/}
<Countdown value={this.state.jupytertime} format="HH:mm:ss" onFinish={this.onFinish}/>
{/*{endtimes===false?"":<Countdown value={endtimes} format="HH:mm:ss" onFinish={this.onendFinish}/>}*/}
</span>
<p className="clearfix mb20 edu-back-white">

@ -239,3 +239,12 @@
background-color: #29BD8B !important;
border-color: transparent ;
}
.Countdownfonttpm{
width: 60px;
display: inline-block;
}
.Countdownfonttpm .ant-statistic-content-value{
font-size: 14px;
}

@ -74,7 +74,7 @@ export const getJupyterTpiUrl = (obj) => {
const id = obj.identifier || jupyter_info.myshixun_identifier;
fetchJupyterTpiUrl({identifier: id}).then(res => {
if (res.data.status === 401) return; // 用户未登录
console.log('获取url', res);
//console.log('获取url', res);
if (res.status === 200) {
const { status, url = '', port } = res.data;
dispatch(updataspinning(false))
@ -159,7 +159,8 @@ export const active_with_tpi = (identifier, msg) => {
const {status} = res.data
if (status === 0) {
message.success(msg);
dispatch(addjypertime(Date.now() + 900 * 1000))
// dispatch(addjypertime(Date.now() + 900 * 1000,false))
setTimeout(()=>{dispatch(addjypertime(Date.now() + 900 * 1000, Date.now() + 300 * 1000))},800);
}
}
})
@ -224,11 +225,21 @@ export const changeshowDrawer = (type) => {
}
}
//增加倒计时
export const addjypertime=(time)=>{
return {
type: types.CHANGE_JYPYTER_TIME,
payload: time
export const addjypertime=(time,endtime)=>{
if(endtime===false){
return {
type: types.CHANGE_JYPYTER_TIME,
payload: time,
endtime:false
}
}else{
return {
type: types.CHANGE_JYPYTER_TIME,
payload: time,
endtime:endtime
}
}
}
export const updataspinning=(type)=>{
@ -262,8 +273,9 @@ export const timeinfo_with_tpi = (identifier, dispatch) => {
let remainingSeconds=res.data.remainingSeconds;
// let summain=3600 * 1000;
let sums= remainingSeconds * 1000;
let endsms=(remainingSeconds-300<=0?0:remainingSeconds-300)*1000
// let sum=summain-sums;
setTimeout(()=>{ dispatch(addjypertime(Date.now() +sums))},500);
setTimeout(()=>{ dispatch(addjypertime(Date.now() +sums,endsms===0?Date.now()+1000:Date.now() +endsms))},500);
}
}
}

@ -17,11 +17,12 @@ const initialState = {
isMySource: false,
drawervisible:false,
jupytertime:0,
endjupytertime:false,
spinning:false
}
const commonReducer = (state = initialState, action) => {
console.log(action)
switch (action.type) {
case types.SHOW_OR_HIDE_CONTROL:
return {
@ -61,7 +62,8 @@ const commonReducer = (state = initialState, action) => {
case types.CHANGE_JYPYTER_TIME:
return {
...state,
jupytertime: action.payload
jupytertime: action.payload,
endjupytertime:action.endtime,
}
case types.CHANGE_UPDETA_SPIN:
return {

@ -45,7 +45,7 @@ const JupyterReducer = (state = initState, action) => {
jupyter_tpi_code: port
}
case types.SAVE_JUPYTER_IDENTIFIER:
console.log('保存的jupyter_identifier', action.payload);
//console.log('保存的jupyter_identifier', action.payload);
return {
...state,
jupyter_identifier: action.payload

Loading…
Cancel
Save