导出调整

dev_static
cxt 5 years ago
parent 51bef08ac6
commit b594e4b509

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

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

Loading…
Cancel
Save