Merge branch 'develop' into educoder

dev_ec
daiao 6 years ago
commit 254618b3b9

@ -2394,9 +2394,10 @@ class CoursesController < ApplicationController
sheet1[4,0] = "排名"
sheet1[4,1] = "学生姓名"
sheet1[4,2] = "昵称"
sheet1[4,3] = "学号"
sheet1[4,4] = "分班"
current_col = 4
sheet1[4,3] = "邮箱"
sheet1[4,4] = "学号"
sheet1[4,5] = "分班"
current_col = 5
homeworks.where(:homework_type => 4).each do |homework|
sheet1[4,current_col+=1] = "#{homework.name}"
end
@ -2428,6 +2429,7 @@ class CoursesController < ApplicationController
sheet1[count_row,column]= i+1
sheet1[count_row,column+=1] = member.user.show_real_name
sheet1[count_row,column+=1] = member.user.login
sheet1[count_row,column+=1] = member.user.mail
sheet1[count_row,column+=1] = member.user.user_extensions.student_id
sheet1[count_row,column+=1] = member.course_group_id == 0 ? "暂无" : member.course_group.name
# current_col = 5

@ -4208,7 +4208,7 @@ end
sheet1 = book.create_worksheet :name => "course"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat(["ID","课堂名称","成员","资源","普通作业"," 实训作业","试卷","私有","状态","创建者单位","创建者","动态时间","创建时间"])
sheet1.row(0).concat(["ID","课堂名称","成员","资源","普通作业"," 实训作业","试卷","评测次数", "私有","状态","创建者单位","创建者","动态时间","创建时间"])
count_row = 1
courses.each do |course|
school = course.teacher.try(:user_extensions).try(:school).try(:name).blank? ? "--" : course.teacher.school_name
@ -4220,12 +4220,13 @@ end
sheet1[count_row,4] = course.homework_commons.where(:homework_type => 1).count
sheet1[count_row,5] = course.homework_commons.where(:homework_type => 4).count
sheet1[count_row,6] = course.exercises.count
sheet1[count_row,7] = course.is_public.to_i == 1 ? '否' : '是'
sheet1[count_row,8] = course.is_end ? "已结束" : "正在进行"
sheet1[count_row,9] = school
sheet1[count_row,10] = teacher_name
sheet1[count_row,11] = format_time(course.updatetime)
sheet1[count_row,12] = format_time(course.created_at)
sheet1[count_row,7] = course.evaluate_count
sheet1[count_row,8] = course.is_public.to_i == 1 ? '否' : '是'
sheet1[count_row,9] = course.is_end ? "已结束" : "正在进行"
sheet1[count_row,10] = school
sheet1[count_row,11] = teacher_name
sheet1[count_row,12] = format_time(course.updatetime)
sheet1[count_row,13] = format_time(course.created_at)
count_row += 1
end
book.write xls_report

@ -467,7 +467,7 @@ class MyshixunsController < ApplicationController
# taskId 即返回的game id
# 返回结果params [:stauts] 0 表示运行结果成功,其它则失败
# compile_success 1 表示成功; 0表示失败
# compile_success 1 表示成功; 0表示编译失败; -1 表示创建pod失败 -2 表示克隆代码失败
# msg 错误信息
# output 为测试用户编译输出结果
# myshixun:status 1为完成实训
@ -475,7 +475,7 @@ class MyshixunsController < ApplicationController
# resubmit 1表示已通关后重新评测0表示非重新评测
# retry_status 0初始值1重新评测失败2重新评测成功
# tpiRepoPath 中间层图片的workspace路径
# params[:jsonTestDetails] = '{"buildID":"19284","compileSuccess":"1",
# params[:jsonTestDetails] = '{"buildID":"19284","compileSuccess":"1","createPodStatus": "1", "downloadStatus": "1",
# "msg":[{"caseId":"1","expectedOutput":"MSAyIDMNCg","input":"MiAzIDE","output":"MSAyIDMNCg","passed":"1"},
# {"caseId":"2","expectedOutput":"LTMgMSA2DQo","input":"LTMgNiAx","output":"LTMgMSA2DQo","passed":"1"},
# {"caseId":"3","expectedOutput":"LTcgLTUgLTMNCg","input":"LTcgLTMgLTU","output":"LTcgLTUgLTMNCg","passed":"1"}],
@ -497,7 +497,19 @@ class MyshixunsController < ApplicationController
resubmit = jsonTestDetails['resubmit']
outPut = tran_base64_decode64(jsonTestDetails['outPut'])
jenkins_testsets = jsonTestDetails['msg']
compile_success = jsonTestDetails['compileSuccess']
compile_success = jsonTestDetails['compileSuccess']
# # 创建pod的状态 0 失败 1 成功
# create_pod_status = jsonTestDetails['createPodStatus']
# # 克隆代码的装填 0 失败 1 成功
# clone_code_status = jsonTestDetails['downloadStatus']
# # 1表示编译成功0 表示运行异常; -1 表示克隆代码失败; -2 表示创建pod失败
# compile_success = if clone_code_status == "0"
# -1
# elsif create_pod_status == "0"
# -2
# else
# jsonTestDetails['compileSuccess']
# end
# message = Base64.decode64(params[:msg]) unless params[:msg].blank?
logger.info(outPut)
game = Game.find(game_id)

@ -1,7 +1,7 @@
class Output < ActiveRecord::Base
# attr_accessible :title, :body
# actual_output 编程题:实际输出, 选择题: 用户提交的答案(如: 014 对应用户选择为A B E
# compile_success 1 表示程序未报错,有正常输出, 0.表示程序抛异常了,报错!
# compile_success 1 表示程序未报错,有正常输出, 0.表示程序抛异常了,报错! -1 表示克隆代码失败; -2 表示创建pod失败
default_scope :order => 'query_index desc'
belongs_to :game
#belongs_to :challenge_choose

@ -86,7 +86,7 @@
<% if @current_myshixun %>
<% current_game = challenge.games.where(:user_id => User.current).first %>
<% case current_game.try(:status) %>
<% when 0, 1 %>
<% when 0, 1 %>
<% if @current_modify %>
<a href='javascript:void(0)' class="edu-default-btn edu-blueback-btn fr" onclick="begin_sXun('<%= @current_myshixun.try(:id) %>')">直接挑战</a>
<% else %>
@ -96,7 +96,7 @@
<a href="<%= operation_shixun_path(@shixun, :myshixun_id => @current_myshixun.try(:id)) %>" data-remote="true" class="edu-default-btn edu-blueline-btn fr">已完成</a>
<% when 3, nil %>
<% if @shixun.task_pass %>
<a href='javascript:void(0)' class="edu-default-btn edu-blueback-btn fr" onclick="begin_sXun('<%= @current_myshixun.try(:id) %>')">直接挑战</a>
<a href='<%= myshixun_game_path(current_game, :myshixun_id => @current_myshixun.try(:id)) %>' class="edu-default-btn edu-blueback-btn fr" >直接挑战</a>
<% else %>
<a href="javascript:void(0)" data-tip-down="请先完成前序关卡" class="edu-default-btn edu-greyback-btn fr">直接挑战</a>
<% end %>

@ -35,12 +35,12 @@
<th width="5%">文件更新</th>
<th width="10%">中间层总耗时<i class="fa fa-long-arrow-down color-light-green ml5" ></i></th>
<th width="5%">pull代码</th>
<th width="10%">pod启动</th>
<th width="10%">pod执行</th>
<th width="5%">pod启动</th>
<th width="5%">pod执行</th>
<th width="10%">中间层回传</th>
<th width="10%">前端轮询</th>
<th width="10%">回调结果存储</th>
<th width="5%">创建时间</th>
<th width="15%">创建时间</th>
<th width="10%">实训详情</th>
</tr>
</thead>
@ -59,7 +59,7 @@
<td><%= record.return_back %></td>
<td><%= record.front_js %></td>
<td><%= record.test_cases %></td>
<td><%= record.created_at %></td>
<td><%= format_time record.created_at %></td>
<td><%= link_to record.game.try(:identifier), task_path(record.game), :target => "_blank" %></td>
</tr>
<% end %>

@ -3,7 +3,8 @@
<% if params[:grow_begin_date].present? %>
<%= params[:grow_date_input] %>
<% else %>
昨日至今日,
<%= (Time.current - 5.hour).beginning_of_day.ago(1.days).strftime('%Y-%m-%d') %> 05:00至
<%= (Time.current - 5.hour).beginning_of_day.strftime('%Y-%m-%d') %> 05:00
<% end %>
新增教师<span class="color-red"><%= @grow_summary.teacher_increase_count || 0 %></span>人,
新增学生<span class="color-red"><%= @grow_summary.student_increase_count || 0 %></span>人,

Loading…
Cancel
Save