diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb index 421e5da3..e87c7297 100644 --- a/app/controllers/courses_controller.rb +++ b/app/controllers/courses_controller.rb @@ -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 diff --git a/app/controllers/managements_controller.rb b/app/controllers/managements_controller.rb index 03ffd83d..769481b0 100644 --- a/app/controllers/managements_controller.rb +++ b/app/controllers/managements_controller.rb @@ -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 diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 09626c31..b1ac0073 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -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) diff --git a/app/models/output.rb b/app/models/output.rb index 8f1547cf..aec0889d 100644 --- a/app/models/output.rb +++ b/app/models/output.rb @@ -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 diff --git a/app/views/challenges/_content_list.html.erb b/app/views/challenges/_content_list.html.erb index f9ac88b8..5e99ad06 100644 --- a/app/views/challenges/_content_list.html.erb +++ b/app/views/challenges/_content_list.html.erb @@ -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 %> 直接挑战 <% else %> @@ -96,7 +96,7 @@ 已完成 <% when 3, nil %> <% if @shixun.task_pass %> - 直接挑战 + 直接挑战 <% else %> 直接挑战 <% end %> diff --git a/app/views/managements/evaluate_simple.html.erb b/app/views/managements/evaluate_simple.html.erb index 7bf8810b..108c5c78 100644 --- a/app/views/managements/evaluate_simple.html.erb +++ b/app/views/managements/evaluate_simple.html.erb @@ -35,12 +35,12 @@ 文件更新 中间层总耗时 pull代码 - pod启动 - pod执行 + pod启动 + pod执行 中间层回传 前端轮询 回调结果存储 - 创建时间 + 创建时间 实训详情 @@ -59,7 +59,7 @@ <%= record.return_back %> <%= record.front_js %> <%= record.test_cases %> - <%= record.created_at %> + <%= format_time record.created_at %> <%= link_to record.game.try(:identifier), task_path(record.game), :target => "_blank" %> <% end %> diff --git a/app/views/managements/schools/_data_grow_list.html.erb b/app/views/managements/schools/_data_grow_list.html.erb index 6d42c8b0..27a1ccf3 100644 --- a/app/views/managements/schools/_data_grow_list.html.erb +++ b/app/views/managements/schools/_data_grow_list.html.erb @@ -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 %> 新增教师<%= @grow_summary.teacher_increase_count || 0 %>人, 新增学生<%= @grow_summary.student_increase_count || 0 %>人,