Merge branch 'develop' of https://bdgit.trustie.net/hushasha/bigdata into develop
This commit is contained in:
commit
a234bdc01b
|
@ -203,7 +203,7 @@ class ChallengesController < ApplicationController
|
|||
|
||||
def add_choose_question
|
||||
@category = params[:category].to_i
|
||||
@position = params[:position]
|
||||
@position = params[:position].to_i
|
||||
#@challenge_choose = @challenge.challenge_chooses
|
||||
respond_to do |format|
|
||||
format.js
|
||||
|
|
|
@ -36,7 +36,7 @@ class CoursesController < ApplicationController
|
|||
before_filter :require_login, :only => [:join, :unjoin]
|
||||
#before_filter :allow_join, :only => [:join]
|
||||
require 'bundler/setup'
|
||||
require 'simple_xlsx_reader'
|
||||
#require 'simple_xlsx_reader'
|
||||
|
||||
# params[:search] 搜索课程的名称
|
||||
# params[:select] "join" "create" "all" 参与的 创建的 所有的课程
|
||||
|
|
|
@ -92,6 +92,7 @@ class GamesController < ApplicationController
|
|||
@had_passed_testsests_hidden_count = had_test.blank? ? 0 : had_test.select{|had_test| had_test.result == true && had_test.is_public == false}.count
|
||||
@had_passed_testsests_public_count = had_test.blank? ? 0 : had_test.select{|had_test| had_test.result == true && had_test.is_public == true}.count
|
||||
@final_score = ((@game.answer_open? || @shixun.status <= 1) ? 0 : @game.final_score.to_i)
|
||||
@gold = @myshixun.shixun.status <= 1 ? 0 : (@game.answer_open? ? -@game_challenge.score.to_i : @game.final_score.to_i)
|
||||
@had_done = @game.had_done
|
||||
@language = @game_challenge.shixun.language
|
||||
error_position = had_test.blank? ? nil : had_test.select{|had_test| had_test.result == false}.last
|
||||
|
@ -278,6 +279,7 @@ class GamesController < ApplicationController
|
|||
@had_passed_testsests_hidden_count = had_test.blank? ? 0 : had_test.select{|had_test| had_test.result == true && had_test.is_public == false}.count
|
||||
@had_passed_testsests_public_count = had_test.blank? ? 0 : had_test.select{|had_test| had_test.result == true && had_test.is_public == true}.count
|
||||
@final_score = ((@game.answer_open? || shixun.status <= 1) ? 0 : @game.final_score.to_i)
|
||||
@gold = @myshixun.shixun.status <= 1 ? 0 : (@game.answer_open? ? -game_challenge.score.to_i : @game.final_score.to_i)
|
||||
error_position = had_test.blank? ? nil : had_test.select{|had_test| had_test.result == false}.last
|
||||
@latest_output = error_position.try(:out_put).gsub(/\n/, '<br/>').gsub(/\t/, ' ') unless error_position.try(:out_put).blank?
|
||||
logger.info("@compile_success###################{@compile_success}")
|
||||
|
@ -291,6 +293,7 @@ class GamesController < ApplicationController
|
|||
had_passed_testsests_hidden_count: @had_passed_testsests_hidden_count,
|
||||
had_passed_testsests_public_count: @had_passed_testsests_public_count,
|
||||
final_score: @final_score,
|
||||
gold: @gold,
|
||||
latest_output: @latest_output,
|
||||
status: game_status,
|
||||
had_done: had_done,
|
||||
|
@ -414,7 +417,6 @@ class GamesController < ApplicationController
|
|||
if challenge.shixun.status < 2 || @game.answer_open || (challenge.st != 0 && @game.status == 2)
|
||||
@viewed = 1
|
||||
else
|
||||
@game.update_attributes(:answer_open => true) unless @game.answer_open
|
||||
if @score >= 0
|
||||
@viewed = 2
|
||||
else
|
||||
|
|
|
@ -441,27 +441,27 @@ class HomeworkCommonController < ApplicationController
|
|||
is_eva_student_works = StudentWork.where(:homework_common_id => is_eva_homeworks.map{|hw| hw.id})
|
||||
has_eva_homeworks = @course.homework_commons.includes(:homework_detail_manual).where("homework_commons.anonymous_comment = 0 and homework_detail_manuals.comment_status = 3")
|
||||
has_eva_student_works = StudentWork.where(:homework_common_id => has_eva_homeworks.map{|hw| hw.id})
|
||||
@course.student.each do |student|
|
||||
user = student.student
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, student.student_id)
|
||||
if user && course_statistics
|
||||
committed_work_num = user.student_works.where("homework_common_id in #{homework_ids} and work_status != 0").count
|
||||
un_commit_work_num = (hw_count - committed_work_num) < 0 ? 0 : (hw_count - committed_work_num)
|
||||
late_commit_work_num = user.student_works.where("homework_common_id in #{homework_ids} and work_status = 2").count
|
||||
absence_evaluation_work_num = user.student_works_evaluation_distributions.where(:student_work_id => has_eva_student_works.map(&:id)).count -
|
||||
user.student_works_scores.where(:reviewer_role => 3, :student_work_id => has_eva_student_works.map(&:id)).group_by(&:student_work_id).count
|
||||
absence_evaluation_work_num = absence_evaluation_work_num < 0 ? 0 : absence_evaluation_work_num
|
||||
un_evaluation_work_num = user.student_works_evaluation_distributions.where(:student_work_id => is_eva_student_works.map(&:id)).count -
|
||||
user.student_works_scores.where(:reviewer_role => 3, :student_work_id => is_eva_student_works.map(&:id)).group_by(&:student_work_id).count
|
||||
un_evaluation_work_num = un_evaluation_work_num < 0 ? 0 : un_evaluation_work_num
|
||||
appeal_num = user.student_works_scores.where(:student_work_id => student_works.map(&:id), :appeal_status => 3).count
|
||||
average_score = user.student_works.where(:id => student_works.map(&:id)).select("AVG(student_works.work_score) as score").first ? user.student_works.where(:id => student_works.map(&:id)).select("AVG(student_works.work_score) as score").first.score : 0
|
||||
total_score = user.student_works.where(:id => student_works.map(&:id)).select("SUM(student_works.work_score) as score").first ? user.student_works.where(:id => student_works.map(&:id)).select("SUM(student_works.work_score) as score").first.score : 0
|
||||
course_statistics.update_attributes(:committed_work_num => committed_work_num, :un_commit_work_num => un_commit_work_num,
|
||||
:late_commit_work_num => late_commit_work_num, :absence_evaluation_work_num => absence_evaluation_work_num, :un_evaluation_work_num => un_evaluation_work_num,
|
||||
:appeal_num => appeal_num, :average_score => average_score, :total_score => total_score)
|
||||
end
|
||||
end
|
||||
# @course.student.each do |student|
|
||||
# user = student.student
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, student.student_id)
|
||||
# if user && course_statistics
|
||||
# committed_work_num = user.student_works.where("homework_common_id in #{homework_ids} and work_status != 0").count
|
||||
# un_commit_work_num = (hw_count - committed_work_num) < 0 ? 0 : (hw_count - committed_work_num)
|
||||
# late_commit_work_num = user.student_works.where("homework_common_id in #{homework_ids} and work_status = 2").count
|
||||
# absence_evaluation_work_num = user.student_works_evaluation_distributions.where(:student_work_id => has_eva_student_works.map(&:id)).count -
|
||||
# user.student_works_scores.where(:reviewer_role => 3, :student_work_id => has_eva_student_works.map(&:id)).group_by(&:student_work_id).count
|
||||
# absence_evaluation_work_num = absence_evaluation_work_num < 0 ? 0 : absence_evaluation_work_num
|
||||
# un_evaluation_work_num = user.student_works_evaluation_distributions.where(:student_work_id => is_eva_student_works.map(&:id)).count -
|
||||
# user.student_works_scores.where(:reviewer_role => 3, :student_work_id => is_eva_student_works.map(&:id)).group_by(&:student_work_id).count
|
||||
# un_evaluation_work_num = un_evaluation_work_num < 0 ? 0 : un_evaluation_work_num
|
||||
# appeal_num = user.student_works_scores.where(:student_work_id => student_works.map(&:id), :appeal_status => 3).count
|
||||
# average_score = user.student_works.where(:id => student_works.map(&:id)).select("AVG(student_works.work_score) as score").first ? user.student_works.where(:id => student_works.map(&:id)).select("AVG(student_works.work_score) as score").first.score : 0
|
||||
# total_score = user.student_works.where(:id => student_works.map(&:id)).select("SUM(student_works.work_score) as score").first ? user.student_works.where(:id => student_works.map(&:id)).select("SUM(student_works.work_score) as score").first.score : 0
|
||||
# course_statistics.update_attributes(:committed_work_num => committed_work_num, :un_commit_work_num => un_commit_work_num,
|
||||
# :late_commit_work_num => late_commit_work_num, :absence_evaluation_work_num => absence_evaluation_work_num, :un_evaluation_work_num => un_evaluation_work_num,
|
||||
# :appeal_num => appeal_num, :average_score => average_score, :total_score => total_score)
|
||||
# end
|
||||
# end
|
||||
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
|
@ -539,10 +539,10 @@ class HomeworkCommonController < ApplicationController
|
|||
create_works_list @homework
|
||||
end
|
||||
#更新CourseHomeworkStatistics中每个学生的未交作品数
|
||||
@course.student.each do |student|
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, student.student_id)
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
end
|
||||
# @course.student.each do |student|
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, student.student_id)
|
||||
# course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
# end
|
||||
|
||||
@course.members.each do |m|
|
||||
@homework.course_messages << CourseMessage.new(:user_id => m.user_id, :course_id => @course.id, :viewed => false, :status => nil)
|
||||
|
@ -599,8 +599,8 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
|
||||
#更新CourseHomeworkStatistics中该学生的待匿评数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, pro_work.user_id)
|
||||
course_statistics.update_attribute('un_evaluation_work_num', course_statistics.un_evaluation_work_num + n) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, pro_work.user_id)
|
||||
# course_statistics.update_attribute('un_evaluation_work_num', course_statistics.un_evaluation_work_num + n) if course_statistics
|
||||
end
|
||||
else
|
||||
student_works.each_with_index do |work, index|
|
||||
|
@ -614,8 +614,8 @@ class HomeworkCommonController < ApplicationController
|
|||
end
|
||||
|
||||
#更新CourseHomeworkStatistics中该学生的待匿评数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, user.id)
|
||||
course_statistics.update_attribute('un_evaluation_work_num', course_statistics.un_evaluation_work_num + n) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, user.id)
|
||||
# course_statistics.update_attribute('un_evaluation_work_num', course_statistics.un_evaluation_work_num + n) if course_statistics
|
||||
end
|
||||
end
|
||||
@homework_detail_manual.update_column('comment_status', 2)
|
||||
|
@ -650,9 +650,9 @@ class HomeworkCommonController < ApplicationController
|
|||
student_work.save
|
||||
|
||||
#更新CourseHomeworkStatistics中该学生的待匿评数和缺评数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, student_work.user_id)
|
||||
course_statistics.update_attribute('un_evaluation_work_num', (course_statistics.un_evaluation_work_num - absence_penalty_count) < 0 ? 0 : (course_statistics.un_evaluation_work_num - absence_penalty_count)) if course_statistics
|
||||
course_statistics.update_attribute('absence_evaluation_work_num', course_statistics.absence_evaluation_work_num + absence_penalty_count) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, student_work.user_id)
|
||||
# course_statistics.update_attribute('un_evaluation_work_num', (course_statistics.un_evaluation_work_num - absence_penalty_count) < 0 ? 0 : (course_statistics.un_evaluation_work_num - absence_penalty_count)) if course_statistics
|
||||
# course_statistics.update_attribute('absence_evaluation_work_num', course_statistics.absence_evaluation_work_num + absence_penalty_count) if course_statistics
|
||||
end
|
||||
|
||||
# 未参与匿评的缺评计算
|
||||
|
|
|
@ -140,7 +140,7 @@ class ShixunsController < ApplicationController
|
|||
@sort = "asc"
|
||||
search = params[:search]
|
||||
@mail = User.current.mail.blank?
|
||||
@shixun_all_count = Shixun.all.count
|
||||
@shixun_all_count = Shixun.where(:hidden => 0).count
|
||||
@shixuns = Shixun.where("name like ? and hidden = 0", "%#{search}%")
|
||||
@shixuns.each do |shixun|
|
||||
shixun[:myshixunCount] = shixun.myshixuns.count
|
||||
|
@ -243,7 +243,7 @@ class ShixunsController < ApplicationController
|
|||
bsort = params[:sort] || "desc"
|
||||
@sort = bsort == "desc" ? "asc" : "desc"
|
||||
if @order == "updated_at"
|
||||
order_str = "#{Shixun.table_name}.updated_at #{bsort}"
|
||||
order_str = "#{Shixun.table_name}.updated_at #{@sort}"
|
||||
else
|
||||
order_str = "myshixun_count #{bsort}, #{Shixun.table_name}.updated_at #{bsort}"
|
||||
end
|
||||
|
|
|
@ -359,6 +359,9 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
end
|
||||
##################################################################################################################
|
||||
if @homework.homework_type == 4 && (@homework.publish_time > Time.now || (@homework.publish_time <= Time.now && @homework.allow_late))
|
||||
update_shixun_work_status @homework
|
||||
end
|
||||
@order,@b_sort,@name,@group,@comment,@status = params[:order] || "updated_at",params[:sort] || "desc",params[:name].to_s.strip || "",params[:group], params[:comment], params[:status]
|
||||
@homework_commons = @course.homework_commons.where("publish_time <= ?",Time.now).order("created_at desc")
|
||||
@all_homework_commons = @course.homework_commons.order("created_at desc")
|
||||
|
@ -549,17 +552,17 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
#更新CourseHomeworkStatistics中学生的迟交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
|
||||
course_statistics.update_attribute('late_commit_work_num', course_statistics.late_commit_work_num + 1) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
|
||||
# course_statistics.update_attribute('late_commit_work_num', course_statistics.late_commit_work_num + 1) if course_statistics
|
||||
else
|
||||
student_work.late_penalty = 0
|
||||
student_work.work_status = 1
|
||||
end
|
||||
if student_work.save
|
||||
#更新CourseHomeworkStatistics中学生的未交作品数、已交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
|
||||
course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
|
||||
# course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
|
||||
if @homework.homework_type == 3
|
||||
if @homework.homework_detail_group.base_on_project == 1
|
||||
|
@ -579,12 +582,12 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
#更新CourseHomeworkStatistics中学生的未交作品数、已交作品数、迟交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, members[i].to_i)
|
||||
course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
if student_work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', course_statistics.late_commit_work_num + 1) if course_statistics
|
||||
end
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, members[i].to_i)
|
||||
# course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
# if student_work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', course_statistics.late_commit_work_num + 1) if course_statistics
|
||||
# end
|
||||
end
|
||||
end
|
||||
@homework.update_column(:updated_at, Time.now)
|
||||
|
@ -628,14 +631,14 @@ class StudentWorkController < ApplicationController
|
|||
student_work_projects = @homework.student_work_projects.where("student_work_id=? and user_id !=?",@student_work_project.student_work_id,User.current.id)
|
||||
#user_ids = student_work_projects.empty? ? "(-1)" : "(" + student_work_projects.map{|stu|stu.user_id}.join(",") + ")"
|
||||
student_works = @homework.student_works.where("group_id = #{@work.group_id} and user_id != #{@work.user_id}")
|
||||
student_works.each do |sw|
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, sw.user_id)
|
||||
if @work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
end
|
||||
course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
end
|
||||
# student_works.each do |sw|
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, sw.user_id)
|
||||
# if @work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
# end
|
||||
# course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
# end
|
||||
student_works.update_all(:work_status => 0, :description => nil, :project_id => 0, :late_penalty => 0,:work_status => 0, :commit_time => nil, :group_id => 0)
|
||||
student_work_projects.delete_all
|
||||
@student_work_project.update_attributes(:is_leader => 1)
|
||||
|
@ -649,12 +652,12 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
#更新CourseHomeworkStatistics中学生的未交作品数、已交作品数、迟交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, members[i].to_i)
|
||||
course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
if @work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', course_statistics.late_commit_work_num + 1) if course_statistics
|
||||
end
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, members[i].to_i)
|
||||
# course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
# if @work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', course_statistics.late_commit_work_num + 1) if course_statistics
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -709,14 +712,14 @@ class StudentWorkController < ApplicationController
|
|||
|
||||
|
||||
#更新CourseHomeworkStatistics中每个学生的未交作品数、已交作品数、迟交作品数
|
||||
student_works.each do |sw|
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, sw.user_id)
|
||||
if @work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
end
|
||||
course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
end
|
||||
# student_works.each do |sw|
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, sw.user_id)
|
||||
# if @work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
# end
|
||||
# course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
# end
|
||||
student_works.update_all(:work_status => 0, :description => nil, :project_id => 0, :late_penalty => 0,:work_status => 0, :commit_time => nil)
|
||||
pros.delete_all
|
||||
|
||||
|
@ -731,12 +734,12 @@ class StudentWorkController < ApplicationController
|
|||
@work.update_all(:work_status => 0, :description => nil, :project_id => 0, :late_penalty => 0,:work_status => 0, :commit_time => nil)
|
||||
else
|
||||
#更新CourseHomeworkStatistics中学生的已交作品数、迟交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, @work.user_id)
|
||||
if @work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
end
|
||||
course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, @work.user_id)
|
||||
# if @work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
# end
|
||||
# course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
|
||||
@work.attachments.destroy_all
|
||||
@work.student_works_scores.destroy_all
|
||||
|
@ -761,14 +764,14 @@ class StudentWorkController < ApplicationController
|
|||
student_works = @homework.student_works.where("user_id in #{user_ids}")
|
||||
|
||||
#更新CourseHomeworkStatistics中每个学生的已交作品数、迟交作品数
|
||||
student_works.each do |sw|
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, sw.user_id)
|
||||
if @work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
end
|
||||
course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
end
|
||||
# student_works.each do |sw|
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, sw.user_id)
|
||||
# if @work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
# end
|
||||
# course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
# end
|
||||
student_works.delete_all
|
||||
pros.delete_all
|
||||
|
||||
|
@ -781,12 +784,12 @@ class StudentWorkController < ApplicationController
|
|||
@work.destroy
|
||||
else
|
||||
#更新CourseHomeworkStatistics中学生的已交作品数、迟交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, @work.user_id)
|
||||
if @work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
end
|
||||
course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, @work.user_id)
|
||||
# if @work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
# end
|
||||
# course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil, :project_id => 0)
|
||||
@work.attachments.destroy_all
|
||||
|
@ -803,14 +806,14 @@ class StudentWorkController < ApplicationController
|
|||
student_works = @homework.student_works.where("user_id in #{user_ids}")
|
||||
|
||||
#更新CourseHomeworkStatistics中每个学生的已交作品数、迟交作品数
|
||||
student_works.each do |sw|
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, sw.user_id)
|
||||
if @work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
end
|
||||
course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
end
|
||||
# student_works.each do |sw|
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, sw.user_id)
|
||||
# if @work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
# end
|
||||
# course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
# end
|
||||
student_works.delete_all
|
||||
pros.delete_all
|
||||
|
||||
|
@ -823,12 +826,12 @@ class StudentWorkController < ApplicationController
|
|||
@work.destroy
|
||||
else
|
||||
#更新CourseHomeworkStatistics中学生的已交作品数、迟交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, @work.user_id)
|
||||
if @work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
end
|
||||
course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, @work.user_id)
|
||||
# if @work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
# end
|
||||
# course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
|
||||
@work.update_attributes(:work_status => 0, :name => "#{@homework.name}的作品提交", :description => nil, :late_penalty => 0, :commit_time => nil, :project_id => 0)
|
||||
@work.attachments.destroy_all
|
||||
|
@ -853,17 +856,17 @@ class StudentWorkController < ApplicationController
|
|||
work.work_status = 2
|
||||
|
||||
#更新CourseHomeworkStatistics中学生的迟交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
|
||||
course_statistics.update_attribute('late_commit_work_num', course_statistics.late_commit_work_num + 1) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
|
||||
# course_statistics.update_attribute('late_commit_work_num', course_statistics.late_commit_work_num + 1) if course_statistics
|
||||
else
|
||||
work.late_penalty = 0
|
||||
work.work_status = 1
|
||||
end
|
||||
if work.save
|
||||
#更新CourseHomeworkStatistics中学生的未交作品数、已交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
|
||||
course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
|
||||
# course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
|
||||
@homework.update_column(:updated_at, Time.now)
|
||||
update_course_activity(@homework.class,@homework.id)
|
||||
|
@ -919,9 +922,9 @@ class StudentWorkController < ApplicationController
|
|||
stu_project.save
|
||||
end
|
||||
#更新CourseHomeworkStatistics中学生的已交作品数、未交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, @work.user_id)
|
||||
course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, @work.user_id)
|
||||
# course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
end
|
||||
if User.current.admin?
|
||||
@new_score.reviewer_role = 1
|
||||
|
@ -976,10 +979,10 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
#更新CourseHomeworkStatistics中该学生的待匿评数, 只计算第一次评分
|
||||
if User.current.student_works_scores.where(:student_work_id => @work.id, :reviewer_role => 3).count == 1
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
|
||||
course_statistics.update_attribute('un_evaluation_work_num', (course_statistics.un_evaluation_work_num - 1) < 0 ? 0 : (course_statistics.un_evaluation_work_num - 1)) if course_statistics
|
||||
end
|
||||
# if User.current.student_works_scores.where(:student_work_id => @work.id, :reviewer_role => 3).count == 1
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, User.current.id)
|
||||
# course_statistics.update_attribute('un_evaluation_work_num', (course_statistics.un_evaluation_work_num - 1) < 0 ? 0 : (course_statistics.un_evaluation_work_num - 1)) if course_statistics
|
||||
# end
|
||||
end
|
||||
@homework.update_column('updated_at', Time.now)
|
||||
update_course_activity(@homework.class,@homework.id)
|
||||
|
@ -1315,10 +1318,10 @@ class StudentWorkController < ApplicationController
|
|||
sw.update_attribute("appeal_penalty", homework.homework_detail_manual.appeal_penalty + sw.appeal_penalty)
|
||||
|
||||
#申诉成功,匿评学生的被申诉记录加一
|
||||
course_homework_statistics = CourseHomeworkStatistics.where(:user_id => @student_work_score.user_id, :course_id => course.id).first
|
||||
if course_homework_statistics
|
||||
course_homework_statistics.update_attribute('appeal_num', course_homework_statistics.appeal_num + 1)
|
||||
end
|
||||
# course_homework_statistics = CourseHomeworkStatistics.where(:user_id => @student_work_score.user_id, :course_id => course.id).first
|
||||
# if course_homework_statistics
|
||||
# course_homework_statistics.update_attribute('appeal_num', course_homework_statistics.appeal_num + 1)
|
||||
# end
|
||||
|
||||
# 申诉成功 重新计算申诉者的匿评分
|
||||
work = @student_work_score.student_work
|
||||
|
@ -1529,12 +1532,12 @@ class StudentWorkController < ApplicationController
|
|||
end
|
||||
|
||||
#更新CourseHomeworkStatistics中学生的未交作品数、已交作品数、迟交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, params[:member_id][i].to_i)
|
||||
course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
if student_work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', course_statistics.late_commit_work_num + 1) if course_statistics
|
||||
end
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, params[:member_id][i].to_i)
|
||||
# course_statistics.update_attribute('committed_work_num', course_statistics.committed_work_num + 1) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', (course_statistics.un_commit_work_num - 1) < 0 ? 0 : (course_statistics.un_commit_work_num - 1)) if course_statistics
|
||||
# if student_work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', course_statistics.late_commit_work_num + 1) if course_statistics
|
||||
# end
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -1546,12 +1549,12 @@ class StudentWorkController < ApplicationController
|
|||
sp.destroy
|
||||
if work
|
||||
#更新CourseHomeworkStatistics中学生的未交作品数、已交作品数、迟交作品数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, work.user_id)
|
||||
if student_work.work_status == 2
|
||||
course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
end
|
||||
course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(@homework.course_id, work.user_id)
|
||||
# if student_work.work_status == 2
|
||||
# course_statistics.update_attribute('late_commit_work_num', (course_statistics.late_commit_work_num - 1) < 0 ? 0 : (course_statistics.late_commit_work_num - 1)) if course_statistics
|
||||
# end
|
||||
# course_statistics.update_attribute('committed_work_num', (course_statistics.committed_work_num - 1) < 0 ? 0 : (course_statistics.committed_work_num - 1)) if course_statistics
|
||||
# course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
|
||||
work.destroy
|
||||
end
|
||||
|
|
|
@ -201,7 +201,7 @@ module ApplicationHelper
|
|||
|
||||
# 实训语言的种类
|
||||
def shixun_language
|
||||
["Java", "C", "C++", "Python2.7", "Python3.6", "MySQL/Java", "Html", "JFinal", "Docker", "Ethereum", "Dynamips", "MachineLearning"]
|
||||
["Java", "C", "C++", "Python2.7", "Python3.6", "MySQL/Java", "Html", "JFinal", "Docker", "Ethereum", "Dynamips", "MachineLearning", "verilog"]
|
||||
end
|
||||
|
||||
# 实训试用专业
|
||||
|
@ -3894,7 +3894,13 @@ module ApplicationHelper
|
|||
link_to "开始实战(#{count})", shixun_path(homework.homework_commons_shixuns.shixun),:class => 'c_blue homepagePostSubmit',:target => "_blank"
|
||||
else
|
||||
myshixun = Myshixun.find work.myshixun_id
|
||||
link_to "继续实战(#{count})", myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun), :class => "c_blue homepagePostSubmit",:target => "_blank" if myshixun
|
||||
is_modify = ShixunModify.where(:myshixun_id => myshixun.try(:id), :shixun_id => myshixun.shixun.try(:id), :status => 1).first
|
||||
if myshixun && is_modify.blank?
|
||||
link_to "继续实战(#{count})", myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun), :class => "c_blue homepagePostSubmit", :target => "_blank"
|
||||
elsif myshixun
|
||||
link_to "继续实战(#{count})", 'javascript:void(0);', :onclick => "sure_box_redirect('#{myshixun_reset_myshixun_path(myshixun)}', '实训已经更新啦,系统正在为您重置');", :class => "c_blue homepagePostSubmit"
|
||||
end
|
||||
#link_to "继续实战(#{count})", myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun), :class => "c_blue homepagePostSubmit",:target => "_blank" if myshixun
|
||||
end
|
||||
elsif work.nil? && homework.end_time >= Time.now
|
||||
if homework.homework_type ==3 && project.nil? && homework.homework_detail_group.base_on_project == 1
|
||||
|
|
|
@ -2,6 +2,15 @@
|
|||
include UserScoreHelper
|
||||
|
||||
module StudentWorkHelper
|
||||
def update_shixun_work_status homework
|
||||
homework.student_works.where(:work_status => 0).each do |work|
|
||||
myshixun = Myshixun.where(:shixun_id => homework.homework_commons_shixuns.shixun_id, :user_id => work.user_id).first
|
||||
if myshixun
|
||||
work.update_attributes(:work_status => myshixun.created_at <= homework.publish_time ? 1 : 2, :commit_time => myshixun.created_at, :myshixun_id => myshixun.id)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#获取当前用户的项目列表
|
||||
def user_projects_option
|
||||
projects = User.current.projects.visible
|
||||
|
@ -99,14 +108,14 @@ module StudentWorkHelper
|
|||
project = cur_user_projects_for_homework homework
|
||||
if work.nil? && homework.end_time >= Time.now
|
||||
if homework.homework_type == 4
|
||||
link_to "关联实战", relate_myshixun_student_work_index_path(:homework => homework.id),:class => 'white-btn orange-btn fr mr10 mt8',:remote => true
|
||||
#link_to "关联实战", relate_myshixun_student_work_index_path(:homework => homework.id),:class => 'white-btn orange-btn fr mr10 mt8',:remote => true
|
||||
else
|
||||
link_to "提交作品", new_student_work_url_without_domain(homework.id),:class => 'white-btn orange-btn fr mr10 mt8'
|
||||
end
|
||||
elsif work.nil? && homework.end_time < Time.now
|
||||
if homework.allow_late && homework.homework_detail_manual.comment_status < 6
|
||||
if homework.homework_type == 4
|
||||
link_to "关联实战", relate_myshixun_student_work_index_path(:homework => homework.id),:class => 'white-btn orange-btn fr mr10 mt8',:remote => true
|
||||
#link_to "关联实战", relate_myshixun_student_work_index_path(:homework => homework.id),:class => 'white-btn orange-btn fr mr10 mt8',:remote => true
|
||||
else
|
||||
link_to "补交作品", new_student_work_url_without_domain(homework.id),:class => 'white-btn orange-btn fr mr10 mt8'
|
||||
end
|
||||
|
@ -114,7 +123,12 @@ module StudentWorkHelper
|
|||
elsif work
|
||||
if homework.homework_type == 4
|
||||
myshixun = Myshixun.find work.myshixun_id
|
||||
link_to "继续实战", myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun), :class => "white-btn orange-btn fr mr10 mt8",:target => "_blank" if myshixun
|
||||
is_modify = ShixunModify.where(:myshixun_id => myshixun.try(:id), :shixun_id => myshixun.shixun.try(:id), :status => 1).first
|
||||
if myshixun && is_modify.blank?
|
||||
link_to "继续实战", myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun), :class => "white-btn orange-btn fr mr10 mt8", :target => "_blank"
|
||||
elsif myshixun
|
||||
link_to "继续实战", 'javascript:void(0);', :onclick => "sure_box_redirect('#{myshixun_reset_myshixun_path(myshixun)}', '实训已经更新啦,系统正在为您重置');", :class => "white-btn orange-btn fr mr10 mt8"
|
||||
end
|
||||
else
|
||||
work_ids = "(" + homework.student_works.has_committed.map(&:id).join(",") + ")"
|
||||
if homework.homework_detail_manual && homework.homework_detail_manual.comment_status == 3 && User.current.student_works_evaluation_distributions.where("student_work_id IN #{work_ids}").count > 0 #匿评作业,且作业状态不是在开启匿评之前
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#学生提交作品表 #work_status :0 未提交 1 已提交 2 迟交 3 分组作品复制的组员作品
|
||||
class StudentWork < ActiveRecord::Base
|
||||
attr_accessible :name, :description, :homework_common_id, :user_id, :final_score, :teacher_score, :student_score, :teaching_asistant_score, :system_score, :work_score, :project_id, :is_test, :simi_id,
|
||||
:simi_value, :work_status, :commit_time, :late_penalty, :absence_penalty, :re_commit, :late_reason, :group_id
|
||||
:simi_value, :work_status, :commit_time, :late_penalty, :absence_penalty, :re_commit, :late_reason, :group_id, :myshixun_id
|
||||
|
||||
belongs_to :homework_common
|
||||
belongs_to :user
|
||||
|
@ -178,16 +178,16 @@ class StudentWork < ActiveRecord::Base
|
|||
|
||||
#更新course_homework_statistics中的avg_score和total_score
|
||||
def update_avg_sum_score
|
||||
course_homework_statistics = CourseHomeworkStatistics.where(:user_id => self.user_id, :course_id => self.homework_common.course_id).first
|
||||
if course_homework_statistics
|
||||
course = self.homework_common.course
|
||||
homework_ids = course.homework_commons.empty? ? "(-1)" : "(" + course.homework_commons.map{|hw| hw.id}.join(",") + ")"
|
||||
student_works = StudentWork.where("homework_common_id in #{homework_ids} and work_status !=0")
|
||||
user = self.user
|
||||
average_score = user.student_works.where(:id => student_works.map(&:id)).select("AVG(student_works.work_score) as score").first ? user.student_works.where(:id => student_works.map(&:id)).select("AVG(student_works.work_score) as score").first.score : 0
|
||||
total_score = user.student_works.where(:id => student_works.map(&:id)).select("SUM(student_works.work_score) as score").first ? user.student_works.where(:id => student_works.map(&:id)).select("SUM(student_works.work_score) as score").first.score : 0
|
||||
course_homework_statistics.update_attributes(:average_score => average_score, :total_score => total_score)
|
||||
end
|
||||
# course_homework_statistics = CourseHomeworkStatistics.where(:user_id => self.user_id, :course_id => self.homework_common.course_id).first
|
||||
# if course_homework_statistics
|
||||
# course = self.homework_common.course
|
||||
# homework_ids = course.homework_commons.empty? ? "(-1)" : "(" + course.homework_commons.map{|hw| hw.id}.join(",") + ")"
|
||||
# student_works = StudentWork.where("homework_common_id in #{homework_ids} and work_status !=0")
|
||||
# user = self.user
|
||||
# average_score = user.student_works.where(:id => student_works.map(&:id)).select("AVG(student_works.work_score) as score").first ? user.student_works.where(:id => student_works.map(&:id)).select("AVG(student_works.work_score) as score").first.score : 0
|
||||
# total_score = user.student_works.where(:id => student_works.map(&:id)).select("SUM(student_works.work_score) as score").first ? user.student_works.where(:id => student_works.map(&:id)).select("SUM(student_works.work_score) as score").first.score : 0
|
||||
# course_homework_statistics.update_attributes(:average_score => average_score, :total_score => total_score)
|
||||
# end
|
||||
end
|
||||
|
||||
# status == 0 : delay
|
||||
|
|
|
@ -39,11 +39,20 @@ class StudentsForCourse < ActiveRecord::Base
|
|||
if str != ""
|
||||
str += ","
|
||||
end
|
||||
str += "('#{hw.name}的作品提交',#{hw.id},#{self.student_id}, '#{format_time(Time.now)}', '#{format_time(Time.now)}')"
|
||||
if hw.homework_type == 4
|
||||
myshixun = Myshixun.where(:shixun_id => hw.homework_commons_shixuns.shixun_id, :user_id => self.student_id).first
|
||||
if myshixun
|
||||
str += "('#{hw.name}的作品提交',#{hw.id},#{self.student_id}, 1, #{myshixun.id}, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
||||
else
|
||||
str += "('#{hw.name}的作品提交',#{hw.id},#{self.student_id}, 0, null, null, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
||||
end
|
||||
else
|
||||
str += "('#{hw.name}的作品提交',#{hw.id},#{self.student_id}, 0, null, null, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
||||
end
|
||||
end
|
||||
end
|
||||
if str != ""
|
||||
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
|
||||
sql = "insert into student_works (name, homework_common_id, user_id, work_status, myshixun_id, commit_time, created_at, updated_at) values" + str
|
||||
ActiveRecord::Base.connection.execute sql
|
||||
end
|
||||
end
|
||||
|
|
|
@ -41,17 +41,23 @@
|
|||
<%#= render :partial => 'single_or_multiple_question_show'%>
|
||||
</div>
|
||||
<script>
|
||||
editormd.loadKaTeX(function() {
|
||||
var taskPassMD = editormd.markdownToHTML("challenge_task_pass_show", {
|
||||
htmlDecode: "style,script,iframe", // you can filter tags decode
|
||||
taskList: true,
|
||||
tex: true, // 默认不解析
|
||||
flowChart: true, // 默认不解析
|
||||
sequenceDiagram: true // 默认不解析
|
||||
});
|
||||
});
|
||||
editormd.loadKaTeX(function() {
|
||||
var taskPassMD = editormd.markdownToHTML("challenge_task_pass_show", {
|
||||
htmlDecode: "style,script,iframe", // you can filter tags decode
|
||||
taskList: true,
|
||||
tex: true, // 默认不解析
|
||||
flowChart: true, // 默认不解析
|
||||
sequenceDiagram: true // 默认不解析
|
||||
});
|
||||
});
|
||||
//添加单选、多选tab
|
||||
$(".addoption-btn").on("click",function(){
|
||||
var len= $(".stage-part-2").find(".nav_check_item li").length;
|
||||
for(var i = 1; i < len; i ++){
|
||||
if($(".stage-part-2").find(".nav_check_item li a").eq(i).attr("href") == "javascript:void(0)"){
|
||||
$(".stage-part-2").find(".nav_check_item li").eq(i).remove()
|
||||
}
|
||||
}
|
||||
var length= $(".stage-part-2").find(".nav_check_item li").length;
|
||||
if(length<11){
|
||||
var title=$(this).html();
|
||||
|
|
|
@ -1,5 +1,16 @@
|
|||
<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
|
||||
<%= javascript_include_tag '/editormd/editormd.min.js','/editormd/examples/js/jquery.min.js' %>
|
||||
<style>
|
||||
.CodeMirror-scroll{
|
||||
overflow: auto !important;
|
||||
margin-bottom: -30px;
|
||||
margin-right: -30px;
|
||||
padding-bottom: 30px;
|
||||
height: 100%;
|
||||
outline: none;
|
||||
position: relative;
|
||||
}
|
||||
</style>
|
||||
<script id="t:set-option-list" type="text/html">
|
||||
<li class="clearfix pr">
|
||||
<label class="panel-form-label fl"><span class="option-item fr mr10 color-grey select-choice" onclick="selectchoice(this, <%= @category %>);" name="option_span" title="点击设置答案">A</span></label>
|
||||
|
@ -12,13 +23,13 @@
|
|||
<%#= form_tag(url_for(new_or_edit_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :type => @type, :position => @position)), :remote => true, :id => 'challenge_choose_update') do |f| %>
|
||||
<!--<li class="clearfix pt30 pr30">
|
||||
<a href="javascript:void(0);" class="task-btn task-btn-green fr" >编辑</a>
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" class="task-btn fr mr10 deloption-btn" id="skill_cancel">删除</a>
|
||||
<a href="<%#= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun) %>" class="task-btn fr mr10 deloption-btn" id="skill_cancel">删除</a>
|
||||
</li>-->
|
||||
<div class="panel-form">
|
||||
<div id="shixun_form">
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl"><span class="c_red mr5">*</span>题干:</label>
|
||||
<div id="challenge_choose_subject" class="fl task-bg-grey panel-box-sizing panel-form-width-690 new_li">
|
||||
<div id="challenge_choose_subject" class="fl new_li">
|
||||
<textarea name="choose[subject]"><%= @challenge_choose.try(:subject) %></textarea>
|
||||
</div>
|
||||
<span style="display: none;margin-left: 10%;" class="c_red" id="new_shixun_name">题干不能为空</span>
|
||||
|
@ -120,7 +131,7 @@
|
|||
<div class="panel-form">
|
||||
<div id="shixun_form">
|
||||
<li class="clearfix" style="margin-bottom: 0;">
|
||||
<label class=" panel-form-label fl"> 技能标签:</label>
|
||||
<label class=" panel-form-label fl"> 知识点:</label>
|
||||
<div class="fl task-bd-grey">
|
||||
<% unless @challenge_choose.blank? %>
|
||||
<% @challenge_choose.challenge_tags.each do |tag| %>
|
||||
|
@ -151,59 +162,6 @@
|
|||
</li>
|
||||
<% end %>
|
||||
<script>
|
||||
subject_editormd = editormd("challenge_choose_subject", {
|
||||
width : "89.6%",
|
||||
height : 400,
|
||||
syncScrolling : "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path : "/editormd/lib/",
|
||||
tex : true,
|
||||
autoFocus: false,
|
||||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
|
||||
dialogMaskOpacity : 0.6,
|
||||
placeholder: "请输入选择题的题干内容" ,
|
||||
imageUpload : true,
|
||||
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>"//url
|
||||
});
|
||||
|
||||
choose_answer_editormd = editormd("challenge_choose_answer", {
|
||||
width : "89.6%",
|
||||
height : 400,
|
||||
syncScrolling : "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path : "/editormd/lib/",
|
||||
tex : true,
|
||||
autoFocus: false,
|
||||
toolbarIcons : function() {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons : {
|
||||
testIcon : "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1 : "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea : true,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
|
||||
dialogMaskOpacity : 0.6,
|
||||
placeholder: "请输入各个选项的具体解析或其他相关信息",
|
||||
imageUpload : true,
|
||||
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>"//url
|
||||
});
|
||||
//技能标签
|
||||
var SnSkill = $(".knowledge_frame").length;
|
||||
function add_tag(){
|
||||
|
@ -235,8 +193,59 @@
|
|||
//$("#challenge_skill_update").submit();
|
||||
}
|
||||
|
||||
|
||||
$(function(){
|
||||
var subject_editormd = editormd("challenge_choose_subject", {
|
||||
width: "89.6%",
|
||||
height: 400,
|
||||
syncScrolling: "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path: "/editormd/lib/",
|
||||
tex: true,
|
||||
autoFocus: false,
|
||||
toolbarIcons: function () {
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons: {
|
||||
testIcon: "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1: "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea: true,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
|
||||
dialogMaskOpacity: 0.6,
|
||||
placeholder: "请输入选择题的题干内容",
|
||||
imageUpload: true,
|
||||
imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL: "<%= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>"//url
|
||||
});
|
||||
|
||||
var choose_answer_editormd = editormd("challenge_choose_answer", {
|
||||
width: "89.6%",
|
||||
height: 400,
|
||||
syncScrolling: "single",
|
||||
//你的lib目录的路径,我这边用JSP做测试的
|
||||
path: "/editormd/lib/",
|
||||
tex: true,
|
||||
autoFocus: false,
|
||||
toolbarIcons: function () {
|
||||
// Or return editormd.toolbarModes[name]; // full, simple, mini
|
||||
// Using "||" set icons align right.
|
||||
return ["bold", "italic", "|", "list-ul", "list-ol", "|", "code", "code-block", "|", "testIcon", "testIcon1", '|', "image", "table", '|', "watch", "clear" ]
|
||||
},
|
||||
toolbarCustomIcons: {
|
||||
testIcon: "<a type=\"inline\" class=\"latex\" ><div class='zbg'></div></a>",
|
||||
testIcon1: "<a type=\"latex\" class=\"latex\" ><div class='zbg_latex'></div></a>"
|
||||
},
|
||||
//这个配置在simple.html中并没有,但是为了能够提交表单,使用这个配置可以让构造出来的HTML代码直接在第二个隐藏的textarea域中,方便post提交表单。
|
||||
saveHTMLToTextarea: true,
|
||||
// 用于增加自定义工具栏的功能,可以直接插入HTML标签,不使用默认的元素创建图标
|
||||
dialogMaskOpacity: 0.6,
|
||||
placeholder: "请输入各个选项的具体解析或其他相关信息",
|
||||
imageUpload: true,
|
||||
imageFormats: ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
|
||||
imageUploadURL: "<%= upload_with_markdown_path(:container_id => @shixun.id, :container_type => @shixun.class) %>"//url
|
||||
});
|
||||
|
||||
var bt = baidu.template;
|
||||
bt.LEFT_DELIMITER = '<!';
|
||||
bt.RIGHT_DELIMITER = '!>';
|
||||
|
@ -446,7 +455,7 @@
|
|||
});
|
||||
}else{
|
||||
$.ajax({
|
||||
url: "<%= update_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.try(:id), :index => @position ) %>",
|
||||
url: "<%= update_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.try(:id), :index => @position - 1) %>",
|
||||
data: $("#challenge_choose_update").serialize(),
|
||||
type: 'POST',
|
||||
dataType: "script",
|
||||
|
@ -474,7 +483,7 @@
|
|||
});
|
||||
}else{
|
||||
$.ajax({
|
||||
url: "<%= update_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.try(:id), :index => @position) %>",
|
||||
url: "<%= update_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.try(:id), :index => @position - 1) %>",
|
||||
data: $("#challenge_choose_update").serialize(),
|
||||
type: 'POST',
|
||||
dataType: "script",
|
||||
|
@ -495,7 +504,7 @@
|
|||
});
|
||||
}else{
|
||||
$.ajax({
|
||||
url: "<%= update_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.try(:id), :index => @position) %>",
|
||||
url: "<%= update_choose_question_shixun_challenge_path(@challenge, :shixun_id => @shixun, :choose_id => @challenge_choose.try(:id), :index => @position - 1) %>",
|
||||
data: $("#challenge_choose_update").serialize(),
|
||||
type: 'POST',
|
||||
dataType: "script",
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
<%= javascript_include_tag '/editormd/lib/marked.min.js','/editormd/lib/prettify.min.js','/editormd/lib/raphael.min.js','/editormd/lib/underscore.min.js','/editormd/lib/sequence-diagram.min.js',
|
||||
'/editormd/lib/flowchart.min.js','/editormd/lib/jquery.flowchart.min.js','/editormd/editormd.js' %>
|
||||
<div class="white_bg">
|
||||
<div class="panel-form">
|
||||
<li class="clearfix pr30">
|
||||
|
@ -7,7 +9,7 @@
|
|||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">题干: </label>
|
||||
<div class="fl panel-box-sizing panel-form-width-690 new_li white_bg bor-grey-e" id="challenge_choose_subject_show" style="width: 90%;">
|
||||
<textarea name="choose[subject]"><%= @challenge_choose.subject %></textarea>
|
||||
<textarea name="choose[subject]" style="display: none"><%= @challenge_choose.subject %></textarea>
|
||||
</div>
|
||||
</li>
|
||||
<% @challenge_choose.challenge_questions.each_with_index do |option, index| %>
|
||||
|
@ -24,7 +26,7 @@
|
|||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">参考答案: </label>
|
||||
<div class="fl panel-box-sizing panel-form-width-690 new_li white_bg bor-grey-e" id="choose_task_pass_show" style="width: 90%;">
|
||||
<textarea name="choose[subject]"><%= @challenge_choose.answer %></textarea>
|
||||
<textarea name="choose[subject]" style="display: none;"><%= @challenge_choose.answer %></textarea>
|
||||
</div>
|
||||
</li>
|
||||
</div>
|
||||
|
@ -46,7 +48,7 @@
|
|||
<p class="bor-bottom-greyE"></p>
|
||||
<div class="panel-form">
|
||||
<li class="clearfix">
|
||||
<label class="panel-form-label fl">技能标签: </label>
|
||||
<label class="panel-form-label fl">知识点: </label>
|
||||
<div class="fl task-inputs mt5">
|
||||
<% if @challenge_choose.challenge_tags.blank? %>
|
||||
无
|
||||
|
@ -63,22 +65,23 @@
|
|||
</div>
|
||||
|
||||
<script>
|
||||
/* $(document).ready(function() {
|
||||
editormd.loadKaTeX(function() {
|
||||
var subjectMD = editormd.markdownToHTML("challenge_choose_subject_show", {
|
||||
htmlDecode: "style,script,iframe", // you can filter tags decode
|
||||
taskList: true,
|
||||
tex: true, // 默认不解析
|
||||
flowChart: true, // 默认不解析
|
||||
sequenceDiagram: true // 默认不解析
|
||||
$(function(){
|
||||
var subjectMD, taskPassMD;
|
||||
$.get("", function(markdown){
|
||||
subjectMD = editormd.markdownToHTML("challenge_choose_subject_show", {
|
||||
htmlDecode : "style,script,iframe", // you can filter tags decode
|
||||
taskList : true,
|
||||
tex : true, // 默认不解析
|
||||
flowChart : true, // 默认不解析
|
||||
sequenceDiagram : true // 默认不解析
|
||||
});
|
||||
var taskPassMD = editormd.markdownToHTML("choose_task_pass_show", {
|
||||
htmlDecode: "style,script,iframe", // you can filter tags decode
|
||||
taskList: true,
|
||||
tex: true, // 默认不解析
|
||||
flowChart: true, // 默认不解析
|
||||
sequenceDiagram: true // 默认不解析
|
||||
taskPassMD = editormd.markdownToHTML("choose_task_pass_show", {
|
||||
htmlDecode : "style,script,iframe", // you can filter tags decode
|
||||
taskList : true,
|
||||
tex : true, // 默认不解析
|
||||
flowChart : true, // 默认不解析
|
||||
sequenceDiagram : true // 默认不解析
|
||||
});
|
||||
});
|
||||
});*/
|
||||
});
|
||||
</script>
|
|
@ -1,6 +1,7 @@
|
|||
$("#task_content").html("<%= j(render :partial => 'single_or_multiple_question_show')%>");
|
||||
$("#challenge_choose_tab").html("<%= j(render :partial => "challenges/choose_tab") %>");
|
||||
|
||||
/*
|
||||
// JS局部刷新时,有可能加载不成功,需要重新加载一次(具体原因不明)
|
||||
editormd.loadKaTeX(function() {
|
||||
editormd.markdownToHTML("challenge_choose_subject_show", {
|
||||
|
@ -17,4 +18,4 @@ editormd.loadKaTeX(function() {
|
|||
flowChart: true, // 默认不解析
|
||||
sequenceDiagram: true // 默认不解析
|
||||
})
|
||||
});
|
||||
});*/
|
||||
|
|
|
@ -56,9 +56,9 @@
|
|||
<li class="fl <%= @tab == 3 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 3) %>" class="color-black">参考答案</a>
|
||||
</li>
|
||||
<li class="fl <%= @tab == 6 ? "check_nav" : "" %>
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 6) %>" class="color-black">预备知识</a>
|
||||
</li>
|
||||
<li class="fl <%= @tab == 6 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 6) %>" class="color-black">预备知识</a>
|
||||
</li>
|
||||
<li class="fl <%= @tab == 4 ? "check_nav" : "" %>">
|
||||
<a href="<%= edit_shixun_challenge_path(@challenge, :shixun_id => @shixun, :tab => 4) %>" class="color-black">评分设置</a>
|
||||
</li>
|
||||
|
|
|
@ -189,6 +189,7 @@
|
|||
data.had_passed_testsests_hidden_count,
|
||||
data.had_passed_testsests_public_count,
|
||||
data.final_score,
|
||||
data.gold,
|
||||
data.latest_output,
|
||||
data.language,
|
||||
data.compile_success
|
||||
|
@ -204,7 +205,7 @@
|
|||
console.log(data.tag_count);
|
||||
console.log($("#shixun_exp_<%=@game_challenge.id %>")[0]);
|
||||
$("#shixun_exp_<%=@game_challenge.id %>").html("经验值<span class='color-light-green mr5'>+"+ data.score + "</span>");
|
||||
$("#shixun_grade_<%=@game_challenge.id %>").html("金币<span class='color-light-green mr5'>+"+ data.score + "</span>");
|
||||
$("#shixun_grade_<%=@game_challenge.id %>").html("金币<span class='color-light-green mr5'>+"+ data.gold + "</span>");
|
||||
$("#shixun_tag_<%=@game_challenge.id %>").html("技能标签<span class='color-light-green mr5'>+"+ data.tag_count + "</span>");
|
||||
icon.find("i").attr("class", "fa fa-unlock fr font-18 mt5 color-light-green w20_center");
|
||||
icon.find("a:last").attr("title", "已完成");
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
'<%= @had_passed_testsests_hidden_count %>',
|
||||
'<%= @had_passed_testsests_public_count %>',
|
||||
'<%= @final_score %>',
|
||||
'<%= @gold %>',
|
||||
[<%= @latest_output.html_safe unless @latest_output.blank? %>],
|
||||
'<%= @language %>'
|
||||
);
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
<% end %>
|
||||
<li id="tab_nav_4">
|
||||
<a href="<%= shixun_discuss_shixun_path(@myshixun.shixun) %>" class="tab_type" style="font-size: 16px" data-remote="true">
|
||||
评论<span id="discusses_count"><%= @discusses_count if @discusses_count > 0%></span>
|
||||
评论<span id="discusses_count" class="edu-cir-grey1" style="line-height: 18px!important;"><%= @discusses_count if @discusses_count > 0%></span>
|
||||
</a>
|
||||
<%#= link_to '', shixun_discuss_shixun_path(@myshixun.shixun), :class => "tab_type", :style => "font-size: 16px", :remote => true %>
|
||||
</li>
|
||||
|
|
|
@ -39,22 +39,21 @@
|
|||
<div style="display: flex;" class="with80 ml30">
|
||||
<% if game.try(:status) != 2 %>
|
||||
<% if challenge.st == 0 %>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="ml5"><%= challenge.score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="ml5"><%= challenge.score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="ml5"><%= challenge.score.to_i %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="ml5"><%= challenge.score.to_i %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="ml5"><%= challenge.challenge_tags.count %></span></span>
|
||||
<% else %>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="ml5"><%= challenge.choose_score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="ml5"><%= challenge.choose_score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="ml5"><%= challenge.choose_tags_num %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="ml5"><%= challenge.choose_score.to_i %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="ml5"><%= challenge.choose_score.to_i %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">知识点<span class="ml5"><%= challenge.choose_tags_num %></span></span>
|
||||
<% end %>
|
||||
<% elsif game.try(:status) == 2 %>
|
||||
<% final_score = (game.answer_open? || @myshixun.shixun.status <= 1) ? 0 : game.final_score.to_i %>
|
||||
<% gold_score = @myshixun.shixun.status <= 1 ? 0 : (game.answer_open? ? -challenge.score.to_i : game.final_score.to_i) %>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="color-light-green ml5">+<%= final_score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="<%= gold_score < 0 ? "u-color-light-red" : "color-light-green" %> ml5"><%= gold_score < 0 ? gold_score : "+"+gold_score.to_s %></span></span>
|
||||
<%# final_score = (game.answer_open? || @myshixun.shixun.status <= 1) ? 0 : game.final_score.to_i %>
|
||||
<%# gold_score = @myshixun.shixun.status <= 1 ? 0 : (game.answer_open? ? -challenge.score.to_i : game.final_score.to_i) %>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_exp_<%=challenge.id %>">经验值<span class="color-light-green ml5">+<%= @final_score %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_grade_<%=challenge.id %>">金币<span class="<%= @gold < 0 ? "u-color-light-red" : "color-light-green" %> ml5"><%= @gold < 0 ? @gold : "+"+@gold.to_s %></span></span>
|
||||
<span class="color-dark-grey font-12 mr15 info-partly" id="shixun_tag_<%=challenge.id %>">技能标签<span class="color-light-green ml5">+<%= (game.answer_open? || @myshixun.shixun.status <= 1) ? 0 : challenge.challenge_tags.count %></span></span>
|
||||
<% end %>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
<span></span>
|
||||
<p>系统评分是根据学生的任务完成情况,按照百分比计算 <br/>
|
||||
例如实训任务5关,学生A完成3关,则最终成绩为 3 / 5 * 100 = 60分 <br/>
|
||||
注意:学生完成实训后,必须关联实训项目,否则成绩为零
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
@ -33,7 +33,6 @@
|
|||
<span></span>
|
||||
<p>系统评分是根据学生的任务完成情况,按照百分比计算 <br/>
|
||||
例如实训任务5关,学生A完成3关,则最终成绩为 3 / 5 * 100 = 60分 <br/>
|
||||
注意:学生完成实训后,必须关联实训项目,否则成绩为零
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<div class="cl"></div>
|
||||
<div class="fl mt20" style="width:650px;height: 50px">
|
||||
<!-- <p class="footer_con-p">Email:zhiqingcs@163.com</p>-->
|
||||
<p class="footer_con-p">Copyright 2007~2017, All Rights Reserved. 湘ICP备17009477号<br />Powered by <a href="www.trustie.net" style="color: #888;">Trustie</a> and <a href="intellide.trustie.net" style="color: #888;">IntelliDE</a>.</p>
|
||||
<p class="footer_con-p">Copyright 2007~2017, All Rights Reserved. 湘ICP备17009477号<br />Powered by <a href="https://www.trustie.net" style="color: #888;" target="_blank">Trustie</a> and <a href="https://intellide.trustie.net" target="_blank" style="color: #888;">IntelliDE</a>.</p>
|
||||
</div>
|
||||
<div class="fr mt20">
|
||||
<!--<ul class="saoma-box fl mr30">-->
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
<% if @changesets_latest_coimmit && @changesets_latest_coimmit.try(:time) %>
|
||||
<div class="recordBanner mt3 fl" style="width: 96%;">
|
||||
<%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.try(:author_email))), :width => "25", :height => "25", :class => "fl portraitRadius mt2 ml4 mr5") %>
|
||||
<div class="recordBanner mb10 fl" style="width: 96%;">
|
||||
<%= image_tag(url_to_avatar(user_commit_rep(@changesets_latest_coimmit.try(:author_email))), :width => "35", :height => "35", :class => "fl portraitRadius mt2 ml4 mr5") %>
|
||||
<%= link_to_user_mail(@changesets_latest_coimmit.try(:author_email), "fb fontGrey3 mr5 fl hidden maxwidth150 ml5") %>
|
||||
<div class="fl">提交于 <%= time_tag(@changesets_latest_coimmit.try(:time)) %> 前:</div>
|
||||
<div class="commit_content_dec fl" title="<%= @changesets_latest_coimmit.message %>"><%= @changesets_latest_coimmit.message %></div>
|
||||
</div>
|
||||
<div id="file_action" class="recordBanner mt3 fl" style="width: 4%;float: right;">
|
||||
<div id="file_action" class="recordBanner mb10 fl" style="width: 4%;float: right;">
|
||||
<%= render :partial => 'link_to_functions' %>
|
||||
</div>
|
||||
<% end %>
|
|
@ -7,7 +7,7 @@
|
|||
<%# latest_changes = get_trees_last_changes(@project.gpid, @rev, ent_path, @g) %>
|
||||
|
||||
<tr id="<%= tr_id %>" class="<%= h params[:parent_id] %> entry <%= entry.kind %>">
|
||||
<td style="padding-left: <%=18 * depth%>px;" class="filename_no_report hidden">
|
||||
<td style="padding-left: <%=10 * (depth + 1)%>px;" class="filename_no_report hidden">
|
||||
|
||||
<%= link_to h(ent_name),
|
||||
{:action => (entry.is_dir? ? 'shixun_show' : 'shixun_entry'), :id => @shixun, :repository_id => @repository.identifier_param, :path => to_path_param(ent_path), :rev => @rev},
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
<%#= link_to l(:label_statistics),
|
||||
{:action => 'stats', :id => @project, :repository_id => @repository.identifier_param},
|
||||
:class => 'mt3 c_blue fl' if @repository.supports_all_revisions? %>
|
||||
<div class="repositorytitle mr15">
|
||||
<div class="repositorytitle mb10">
|
||||
<% content_for :header_tags do %>
|
||||
<%= javascript_include_tag 'repository_navigation' %>
|
||||
<% end %>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<div class="container-big mt15">
|
||||
<div class="container-big mt20 mb20" style="width: 100%;">
|
||||
<div class="new_roadmap_conbox mb10" >
|
||||
<div class="new_roadmap_info_top clear ">
|
||||
<%=link_to "<span class='new_roadmap_icons_back mr5'></span>返回提交历史".html_safe,
|
||||
|
|
|
@ -1,22 +1,23 @@
|
|||
<%= 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" %>
|
||||
<%= stylesheet_link_tag "/codemirror/lib/codemirror" %>
|
||||
|
||||
<div class="wrap-big">
|
||||
<div style="padding-left: 8px;">
|
||||
<div class="contextual mt-5 mb5">
|
||||
<%= render :partial => 'shixun_navigation' %>
|
||||
<div class="box_bg_shandow border-arroud mt20 mb20">
|
||||
<div class="new_wrap-big">
|
||||
<div>
|
||||
<div class="contextual mt-5 mb5">
|
||||
<%= render :partial => 'shixun_navigation' %>
|
||||
</div>
|
||||
<!--目录跳转-->
|
||||
<div class="fl mb10">
|
||||
<%= render :partial => 'shixun_breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<%= render :partial => 'latest_commit' %>
|
||||
<div id="common_file_content">
|
||||
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
|
||||
</div>
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag "scm" %>
|
||||
<% end %>
|
||||
</div>
|
||||
<!--目录跳转-->
|
||||
<div class="fl mt3">
|
||||
<%= render :partial => 'shixun_breadcrumbs', :locals => {:path => @path, :kind => 'dir', :revision => @rev} %>
|
||||
</div>
|
||||
<div class="cl"></div>
|
||||
<%= render :partial => 'latest_commit' %>
|
||||
<div id="common_file_content">
|
||||
<%= render :partial => 'common/file', :locals => {:filename => @path, :content => @content} %>
|
||||
</div>
|
||||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag "scm" %>
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -1,59 +1,66 @@
|
|||
<div class="wrap-big mt20 pr" style="min-height: 600px">
|
||||
<div class="popup_tip_box fontGrey2" style="right:-315px; top:68px;position: absolute">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p class="font-12">
|
||||
提交代码的方法:<br/>
|
||||
1、在你自己的电脑安装Git tortoise客户端,<br/>
|
||||
或者其他你熟悉的Git客户端;<br/>
|
||||
2、在Git客户端向左侧的地址提交代码。<br/>
|
||||
注意:<br/>
|
||||
请务必在Git客户端填写如下信息:<br/>
|
||||
* 用户名:使用您在本平台绑定的邮箱<br/>
|
||||
* 口令:使用您在本平台的登录口令<br/>
|
||||
</p>
|
||||
<div class="box_bg_shandow border-arroud mt20 mb20">
|
||||
<div class="panel-header clearfix">
|
||||
<h3 class="shixun_title fl mt5">版本库</h3>
|
||||
</div>
|
||||
<div class="repository_con" style="line-height:1.9;">
|
||||
<ul class="clearfix pro-top-info mb10 box_bg_shandow">
|
||||
<%=link_to "<li style=\"width: 459px;\"><i class=\"icon-time mr5 c_grey02 f16 fb\"></i>#{choise_commit_count(@changesets_all_count, @g_project.commit_count.to_i)}提交</li>".html_safe,
|
||||
{:action => 'commits', :path => to_path_param(@path), :id => @shixun, :repository_id => @repository.identifier_param,
|
||||
:rev => @rev, :page => 1 ,:commit_count =>"#{@changesets_all_count}"}, :class => "linkBlue fb" %>
|
||||
<li style="width: 459px;"><i class="icon-sitemap mr5 c_grey02 f16 fb"></i>
|
||||
<a class="linkBlue fb"><%= @branchs.count %></a>分支
|
||||
</li>
|
||||
</ul>
|
||||
<div class=" clearfix mb5">
|
||||
<div class=" fl clearfix">
|
||||
<%= render :partial => 'shixun_navigation' %>
|
||||
</div>
|
||||
<% if !@entries.blank? %>
|
||||
<a href="<%= @zip_path %>" class="btn_zipdown fl ml10" onclick="">ZIP下载</a>
|
||||
<% end %>
|
||||
|
||||
<div class="fr">
|
||||
<label class="pro-fenzhi-label fl">克隆网址</label>
|
||||
<input type="text" id="copy_rep_content" class="pro-fenzhi-input fl" value="<%= @repos_url.to_s.lstrip %>"/>
|
||||
<a href="javascript:void(0);" alt="点击复制版本库地址" onclick="jsCopy()" title="点击复制版本库地址" class="fl pro-fenzhi-a">
|
||||
<i class="fa fa-copy" style="font-size:12px"></i>
|
||||
</a>
|
||||
</div>
|
||||
<div class="new_wrap-big">
|
||||
<div class="popup_tip_box fontGrey2" style="right:75px; top:360px;position: absolute">
|
||||
<em></em>
|
||||
<span></span>
|
||||
<p class="font-12">
|
||||
提交代码的方法:<br/>
|
||||
1、在你自己的电脑安装Git tortoise客户端,<br/>
|
||||
或者其他你熟悉的Git客户端;<br/>
|
||||
2、在Git客户端向左侧的地址提交代码。<br/>
|
||||
注意:<br/>
|
||||
请务必在Git客户端填写如下信息:<br/>
|
||||
* 用户名:使用您在本平台绑定的邮箱<br/>
|
||||
* 口令:使用您在本平台的登录口令<br/>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="cl"></div>
|
||||
<%= render :partial => 'latest_commit' %>
|
||||
<div class="cl"></div>
|
||||
<div class="repository_con" style="line-height:1.9;">
|
||||
<ul class="clearfix pro-top-info mb10">
|
||||
<%=link_to "<li style=\"width: 558px;\"><i class=\"icon-time mr5 c_grey02 f16 fb\"></i>#{choise_commit_count(@changesets_all_count, @g_project.commit_count.to_i)}提交</li>".html_safe,
|
||||
{:action => 'commits', :path => to_path_param(@path), :id => @shixun, :repository_id => @repository.identifier_param,
|
||||
:rev => @rev, :page => 1 ,:commit_count =>"#{@changesets_all_count}"}, :class => "linkBlue fb" %>
|
||||
<li style="width: 558px;">
|
||||
<i class="icon-sitemap mr5 c_grey02 f16 fb"></i>
|
||||
<%= @branchs.count %>分支
|
||||
</li>
|
||||
</ul>
|
||||
<div class=" clearfix mb10">
|
||||
<div class=" fl clearfix">
|
||||
<%= render :partial => 'shixun_navigation' %>
|
||||
</div>
|
||||
<% if !@entries.blank? %>
|
||||
<a href="<%= @zip_path %>" class="btn_zipdown fl ml10" onclick="">ZIP下载</a>
|
||||
<% end %>
|
||||
|
||||
<% if !@entries.blank? && authorize_for('repositories', 'browse') %>
|
||||
<%= render :partial => 'shixun_dir_list' %>
|
||||
<% else %>
|
||||
<%= render :partial => "projects/no_data" %>
|
||||
<% end %>
|
||||
<div class="fr">
|
||||
<label class="pro-fenzhi-label fl">克隆网址</label>
|
||||
<input type="text" id="copy_rep_content" class="pro-fenzhi-input fl" value="<%= @repos_url.to_s.lstrip %>"/>
|
||||
<a href="javascript:void(0);" alt="点击复制版本库地址" onclick="jsCopy()" title="点击复制版本库地址" class="fl pro-fenzhi-a">
|
||||
<i class="fa fa-copy" style="font-size:12px"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% memo = Memo.where(:id => 1232).first %>
|
||||
<%# unless memo.nil? %>
|
||||
<!-- <a href="<%#= Setting.protocol + "://" %><%#=Setting.host_name %>/forums/1/memos/1232" class="linkBlue2" target="_blank">如何提交代码</a>-->
|
||||
<%# end %>
|
||||
<div class="cl"></div>
|
||||
<%= render :partial => 'latest_commit' %>
|
||||
<div class="cl"></div>
|
||||
|
||||
<% if !@entries.blank? && authorize_for('repositories', 'browse') %>
|
||||
<%= render :partial => 'shixun_dir_list' %>
|
||||
<% else %>
|
||||
<%= render :partial => "projects/no_data" %>
|
||||
<% end %>
|
||||
|
||||
<% memo = Memo.where(:id => 1232).first %>
|
||||
<%# unless memo.nil? %>
|
||||
<!-- <a href="<%#= Setting.protocol + "://" %><%#=Setting.host_name %>/forums/1/memos/1232" class="linkBlue2" target="_blank">如何提交代码</a>-->
|
||||
<%# end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% html_title(l(:label_repository)) -%>
|
||||
<% html_title(l(:label_repository)) -%>
|
||||
</div>
|
|
@ -2,8 +2,8 @@
|
|||
<li class="fl <%= @order == 'myshixun_count' ? 'check_nav' : "" %>">
|
||||
<%= link_to "最热", search_shixuns_path(:order => "myshixun_count", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
|
||||
</li>
|
||||
<li class="fl <%= @order == 'created_at' ? 'check_nav' : "" %>" id="nav_check_item_2">
|
||||
<%= link_to "最新", search_shixuns_path(:order => "created_at", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
|
||||
<li class="fl <%= @order == 'updated_at' ? 'check_nav' : "" %>" id="nav_check_item_2">
|
||||
<%= link_to "最新", search_shixuns_path(:order => "updated_at", :shixun_status => @shixun_status, :status => @status, :language => @language, :search => @search, :trainee => @trainee, :major =>@major, :course => @course, :sort => @sort), :remote => true %>
|
||||
</li>
|
||||
<div class="fr color-grey3" style="margin:0px;width:150px;text-align:right;margin-top: 5px;">共<span class="color-orange"><%= @shixuns_count %></span>个检索结果</div>
|
||||
</ul>
|
||||
|
|
|
@ -31,7 +31,10 @@
|
|||
<% end %>
|
||||
<%= @homework.name %>
|
||||
</p>
|
||||
<%= link_to '返回', homework_common_index_path(:course => @homework.course_id, :homework_type => @homework.homework_type), :class => 'fr font-12 mr15 mt3 color-orange03' %>
|
||||
<%= link_to '返回', homework_common_index_path(:course => @homework.course_id, :homework_type => @homework.homework_type), :class => 'fr font-12 mr15 mt3 color-grey' %>
|
||||
<% if @homework.homework_type == 4 && @is_teacher && @homework.homework_commons_shixuns && @homework.homework_commons_shixuns.shixun %>
|
||||
<%= link_to '查看实训', shixun_path(@homework.homework_commons_shixuns.shixun), :target => "_blank", :class => 'fr font-12 mr15 mt3 color-orange03' %>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="edu-con-bg01 mt30">
|
||||
<div class="">
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
<%= content_for(:header_tags) do %>
|
||||
<%= import_ke(enable_at: false, prettify: false, init_activity: false) %>
|
||||
<% end %>
|
||||
<div class="active-class ">
|
||||
<p style="line-height: 42px;">
|
||||
<i class="fa fa-map-marker mr5 color-grey"></i>
|
||||
|
@ -23,14 +26,41 @@
|
|||
<!--<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_intro_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入描述</span>-->
|
||||
<!--</li>-->
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span>简介</label>
|
||||
<textarea name="subject[description]" id="new_subject_description" class="task task-height-220 panel-box-sizing task-form-80 fl color-grey ml20"></textarea>
|
||||
<label class="panel-form-label label fl mr20"><span class="color-orange">*</span>简介</label>
|
||||
<%#= hidden_field_tag :asset_id, params[:asset_id], :required => false, :style => 'display:none' %>
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" style="display: none"></textarea>
|
||||
<%= f.kindeditor :description,
|
||||
:editor_id => 'new_subject_description',
|
||||
:owner_id => 0,
|
||||
:owner_type => OwnerTypeHelper::MESSAGE,
|
||||
:width => '80%',
|
||||
:height => 300,
|
||||
:minHeight=>300,
|
||||
:class => 'talk_text fl',
|
||||
:input_html => { :id => 'new_subject_description',
|
||||
:class => 'task task-height-220 panel-box-sizing task-form-80 fl color-grey ml20',
|
||||
:maxlength => 5000 }
|
||||
%>
|
||||
<!-- <textarea name="subject[description]" id="new_subject_description" class="task task-height-220 panel-box-sizing task-form-80 fl color-grey ml20"></textarea>-->
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_subject_description_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入简介</span>
|
||||
</li>
|
||||
<li class="clearfix pt20">
|
||||
<label class="panel-form-label label fl"><span class="color-orange">*</span> 学习须知</label>
|
||||
<textarea type="text" name="subject[learning_notes]" id="new_learning_notes" class="task task-height-220 panel-box-sizing task-form-70 fl color-grey ml20" placeholder=""></textarea>
|
||||
<label class="panel-form-label label fl mr20"><span class="color-orange">*</span> 学习须知</label>
|
||||
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing" style="display: none"></textarea>
|
||||
<%= f.kindeditor :learning_notes,
|
||||
:editor_id => 'new_learning_notes',
|
||||
:owner_id => 0,
|
||||
:owner_type => OwnerTypeHelper::MESSAGE,
|
||||
:width => '80%',
|
||||
:height => 300,
|
||||
:minHeight=>300,
|
||||
:class => 'talk_text fl',
|
||||
:input_html => { :id => 'new_learning_notes',
|
||||
:class => 'task task-height-220 panel-box-sizing task-form-80 fl color-grey ml20',
|
||||
:maxlength => 5000 }
|
||||
%>
|
||||
<!--textarea type="text" name="subject[learning_notes]" id="new_learning_notes" class="task task-height-220 panel-box-sizing task-form-70 fl color-grey ml20" placeholder=""></textarea>-->
|
||||
<div class="cl"></div>
|
||||
<span class="color-orange ml20 fl none" style="margin-left: 12%;" id="new_learning_notes_notice"><i class="fa fa-exclamation-circle mr5" ></i>请输入学习须知</span>
|
||||
</li>
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<% end %>
|
||||
</p>
|
||||
<div class="color-dark-grey <%= @subject.description.blank? ? 'color-light-grey' : '' %> justify">
|
||||
<pre class="pre_word font-15" style="color: #666;font-family: '微软雅黑','宋体';"><%= @subject.description.blank? ? "暂未填写" : (@subject.description) %></pre>
|
||||
<pre class="pre_word font-15" style="color: #666;font-family: '微软雅黑','宋体';"><%= @subject.description.blank? ? "暂未填写" : (@subject.description.html_safe) %></pre>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
@ -142,7 +142,7 @@
|
|||
<a href="<%= edit_subject_path(@subject) %>"><i class="fa fa-pencil mt10 mr5 color-grey-c edit-produce font-12"data-tip-down="编辑" style="position: relative;top:-3px"></i></a>
|
||||
<% end %>
|
||||
</p>
|
||||
<div class="mt10 mb10 color-dark-grey justify"><pre class="pre_word font-15" style="color: #666;font-family: '微软雅黑','宋体';"><%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes %></pre></div>
|
||||
<div class="mt10 mb10 color-dark-grey justify"><pre class="pre_word font-15" style="color: #666;font-family: '微软雅黑','宋体';"><%= @subject.learning_notes.blank? ? "暂未填写" : @subject.learning_notes.html_safe %></pre></div>
|
||||
</div>
|
||||
<div class="edu-class-right-box ml15 bor-radius4 bor-grey01 pt20 mb40">
|
||||
<p class="font-18 mb20" style="text-align: center">教学团队
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
class ModifyPositionTypeForChallengeChoose < ActiveRecord::Migration
|
||||
def up
|
||||
change_column :challenge_chooses, :position, :integer
|
||||
end
|
||||
|
||||
def down
|
||||
end
|
||||
end
|
|
@ -38,8 +38,8 @@ namespace :homework_evaluation do
|
|||
end
|
||||
|
||||
#更新CourseHomeworkStatistics中该学生的待匿评数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(homework_common.course_id, pro_work.user_id)
|
||||
course_statistics.update_attribute('un_evaluation_work_num', course_statistics.un_evaluation_work_num + n) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(homework_common.course_id, pro_work.user_id)
|
||||
# course_statistics.update_attribute('un_evaluation_work_num', course_statistics.un_evaluation_work_num + n) if course_statistics
|
||||
end
|
||||
else
|
||||
student_works.each_with_index do |work, index|
|
||||
|
@ -53,8 +53,8 @@ namespace :homework_evaluation do
|
|||
end
|
||||
|
||||
#更新CourseHomeworkStatistics中该学生的待匿评数
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(homework_common.course_id, user.id)
|
||||
course_statistics.update_attribute('un_evaluation_work_num', course_statistics.un_evaluation_work_num + n) if course_statistics
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(homework_common.course_id, user.id)
|
||||
# course_statistics.update_attribute('un_evaluation_work_num', course_statistics.un_evaluation_work_num + n) if course_statistics
|
||||
end
|
||||
end
|
||||
homework_detail_manual.update_column('comment_status', 3)
|
||||
|
|
|
@ -29,21 +29,37 @@ namespace :homework_publishtime do
|
|||
name = homework.name
|
||||
name_str = name + "的作品提交"
|
||||
str = ""
|
||||
students.each do |student|
|
||||
if str != ""
|
||||
str += ","
|
||||
if homework.homework_type == 4
|
||||
students.each do |student|
|
||||
if str != ""
|
||||
str += ","
|
||||
end
|
||||
myshixun = Myshixun.where(:shixun_id => homework.homework_commons_shixuns.shixun_id, :user_id => student.student_id).first
|
||||
if myshixun
|
||||
str += "('#{name_str}',#{homework.id},#{student.student_id}, 1, #{myshixun.id}, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
||||
else
|
||||
str += "('#{name_str}',#{homework.id},#{student.student_id}, 0, null, null, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
||||
end
|
||||
end
|
||||
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
||||
sql = "insert into student_works (name, homework_common_id, user_id, work_status, myshixun_id, commit_time, created_at, updated_at) values" + str
|
||||
else
|
||||
students.each do |student|
|
||||
if str != ""
|
||||
str += ","
|
||||
end
|
||||
str += "('#{name_str}',#{homework.id},#{student.student_id}, '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}', '#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}')"
|
||||
end
|
||||
sql = "insert into student_works (name, homework_common_id, user_id, created_at, updated_at) values" + str
|
||||
end
|
||||
sql = "insert into student_works (name, homework_common_id,user_id, created_at, updated_at) values" + str
|
||||
|
||||
ActiveRecord::Base.connection.execute sql
|
||||
end
|
||||
|
||||
#更新CourseHomeworkStatistics中每个学生的未交作品数
|
||||
homework.course.student.each do |student|
|
||||
course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(homework.course_id, student.student_id)
|
||||
course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
end
|
||||
# homework.course.student.each do |student|
|
||||
# course_statistics = CourseHomeworkStatistics.find_by_course_id_and_user_id(homework.course_id, student.student_id)
|
||||
# course_statistics.update_attribute('un_commit_work_num', course_statistics.un_commit_work_num + 1) if course_statistics
|
||||
# end
|
||||
|
||||
course = homework.course
|
||||
course.members.each do |m|
|
||||
|
|
|
@ -1094,19 +1094,21 @@ function submit_new_subject(){
|
|||
} else{
|
||||
$("#new_subject_name_notice").hide();
|
||||
}
|
||||
if($("#new_subject_description").val().trim() == ""){
|
||||
if(new_subject_description.isEmpty()){
|
||||
check = false;
|
||||
$("#new_subject_description_notice").show();
|
||||
} else{
|
||||
$("#new_subject_description_notice").hide();
|
||||
}
|
||||
if($("#new_learning_notes").val().trim() == ""){
|
||||
if(new_learning_notes.isEmpty()){
|
||||
check = false;
|
||||
$("#new_learning_notes_notice").show();
|
||||
} else {
|
||||
$("#new_learning_notes_notice").hide();
|
||||
}
|
||||
if(check){
|
||||
new_subject_description.sync();
|
||||
new_learning_notes.sync();
|
||||
$("#new_subject").submit();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -339,6 +339,7 @@ function setupAjaxIndicatorBase() {
|
|||
|| settings.url.match(/prev_step/)
|
||||
|| settings.url.match(/open_webssh/)
|
||||
|| settings.url.match(/repository/)
|
||||
|| settings.url.match(/get_waiting_time/)
|
||||
)){
|
||||
return;
|
||||
}
|
||||
|
@ -367,7 +368,7 @@ function match_specific_symbol(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:通过的公开测试集个数
|
||||
// final_score:最终得分;latest_output:最新的输出;language:实训的语言
|
||||
// final_score:最终得经验数;gold:最终得的金币数;latest_output:最新的输出;language:实训的语言
|
||||
function code_evaluation(test_sets,
|
||||
had_test_count,
|
||||
test_sets_count,
|
||||
|
@ -377,6 +378,7 @@ function code_evaluation(test_sets,
|
|||
had_passed_testsests_hidden_count,
|
||||
had_passed_testsests_public_count,
|
||||
final_score,
|
||||
gold,
|
||||
latest_output,
|
||||
language
|
||||
) {
|
||||
|
@ -521,7 +523,7 @@ function code_evaluation(test_sets,
|
|||
"</li>" +
|
||||
"<li>" +
|
||||
"<span class=\"-task-ces-info-left\">金币:</span>" +
|
||||
"<span class=\"color-light-green\" id=\"grade_value\">+ " + final_score + "</span>" +
|
||||
"<span class=\""+ (gold >= 0 ? "color-light-green" : "-text-danger") + "\"" +"id=\"grade_value\"> " + (gold >= 0 ? ("+" + gold) : gold) + "</span>" +
|
||||
"</li>" +
|
||||
"</ul>" +
|
||||
"</div>" +
|
||||
|
|
|
@ -248,6 +248,7 @@ a.edu-txt-w100,.edu-txt-w100{ width:100px; display: inline-block;}
|
|||
a.edu-btn{display: inline-block;border:none; padding:0 12px;color: #666!important;border:1px solid #ccc; text-align:center;font-size: 14px; height: 29px;line-height: 29px; border-radius:3px; font-weight: bold;letter-spacing:1px;}
|
||||
a:hover.edu-btn{ border:1px solid #5faee3; color: #5faee3!important;}
|
||||
.edu-cir-grey{ display: inline-block; padding:0px 5px; color:#666; background:#f3f3f3; text-align: center; border-radius:15px; font-size:12px; line-height:20px!important;}
|
||||
.edu-cir-grey1{ display: inline-block; padding:0px 5px; margin-left: 5px; color:#666; background:#ccc; text-align: center; border-radius:15px; font-size:12px; line-height:20px!important;}
|
||||
.edu-cir-grey-q{ display: inline-block; padding:0px 7px; color:#666; background:#f3f3f3; text-align: center; border-radius:15px; font-size:12px; line-height:20px!important;}
|
||||
|
||||
/*a.edu-filter-cir-grey{display: inline-block; padding:0px 15px; color:#666; border:1px solid #ddd; text-align: center; border-radius:3px; font-size:12px; height:25px; line-height:25px;}
|
||||
|
|
|
@ -163,7 +163,7 @@ table.list td.checkbox input {padding:0px;}
|
|||
table.list td.buttons { width: 15%; white-space:nowrap; text-align: right; }
|
||||
table.list td.buttons a { padding-right: 0.6em; }
|
||||
table.list caption { text-align: left; padding: 0.5em 0.5em 0.5em 0; }
|
||||
table.list tbody td, table.list tbody tr td, table.list tbody tr td.checkbox { border-bottom: solid 1px #ddd; font-size: 11px; padding: 4px 10px 4px 3px;}
|
||||
table.list tbody td, table.list tbody tr td, table.list tbody tr td.checkbox { border-bottom: solid 1px #ddd; font-size: 11px; padding: 9px 10px 9px 3px;}
|
||||
table.list thead th{ border:none; border-bottom:1px solid #999; font-size:12px;/*by young*/ font-weight:400; padding:0 3px 3px; text-transform:uppercase}
|
||||
table.list th{ background-color:#fff;}
|
||||
table.list thead th{ border:none; border-bottom:1px solid #999; font-size:12px;/*by young*/ font-weight:400; padding:0 3px 3px; text-transform:uppercase}
|
||||
|
@ -643,14 +643,14 @@ td.t-r{ text-align:right;}
|
|||
.pro-top-info{border:1px solid #eee; }
|
||||
.pro-top-info li{ width:295px; padding:10px 15px; font-size: 14px; float: left; text-align: center;}
|
||||
.pro-top-info li:hover{ background:#f2f2f2;}
|
||||
a.btn_zipdown{ display:block; height:25px; width:80px; text-align: center; line-height: 25px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);
|
||||
a.btn_zipdown{ display:block; height:30px; width:80px; text-align: center; line-height: 30px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);
|
||||
color: #7f7f7f; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; margin-left: 5px;}
|
||||
a:hover.btn_zipdown{color:#3b94d6;}
|
||||
label.pro-fenzhi-label{ height:25px; line-height: 25px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);color: #7f7f7f;border-radius:3px; border-top-right-radius: 0;
|
||||
label.pro-fenzhi-label{ height:30px; line-height: 30px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);color: #7f7f7f;border-radius:3px; border-top-right-radius: 0;
|
||||
border-bottom-right-radius: 0; display: inline-block; text-align: center; padding:0 15px; border-right: none;}
|
||||
select.pro-fenzhi-select{ height: 27px; line-height: 27px; color: #666;}
|
||||
input.pro-fenzhi-input { height: 25px; line-height: 25px; color: #666; width:300px;}
|
||||
a.pro-fenzhi-a{height:25px; line-height: 25px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);color: #7f7f7f;border-radius:3px; border-top-left-radius: 0;
|
||||
select.pro-fenzhi-select{ height: 32px; line-height: 32px; color: #666;}
|
||||
input.pro-fenzhi-input { height: 30px; line-height: 30px; color: #666; width:300px;}
|
||||
a.pro-fenzhi-a{height:30px; line-height: 30px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);color: #7f7f7f;border-radius:3px; border-top-left-radius: 0;
|
||||
border-bottom-right-radius: 0; display: inline-block; text-align: center; padding:0 5px; border-left: none;}
|
||||
a:hover.pro-fenzhi-a{color:#3b94d6;}
|
||||
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
#RSide{ width:670px; background:#fff; padding:10px; margin-left: 10px; margin-bottom:10px;}
|
||||
.courseRSide{ width:983px; background:#fff; padding:10px; margin-left: 15px; margin-bottom:10px;}
|
||||
.wrap-big {width:980px; background:#fff; padding:10px; margin-bottom:10px;}
|
||||
.new_wrap-big {background:#fff; padding:10px; min-height: 600px;}
|
||||
/*资源库*/
|
||||
.resources {width:973px;padding: 15px; background-color:#ffffff;float: right;}
|
||||
.resources.sources-bg:hover{background: #EFF9FD}
|
||||
|
@ -186,6 +187,7 @@ a.loginChooseTab {color:#484848; height:30px; display:block;}
|
|||
.resource-list-option {width:980px; height:40px; line-height:40px; vertical-align:middle; margin-left:auto; margin-right:auto; background-color:#f6f6f6;}
|
||||
.resource-check-all {width:20px; height:40px; line-height:40px; text-align:center; vertical-align:middle; float:left;}
|
||||
.border-bottom {border-bottom:1px solid #ddd;}
|
||||
.border-arroud {border:1px solid #e6e6e6;}
|
||||
.h34 {height:34px;}
|
||||
.resource-tab {font-size:16px; color:#4d4d4d; width:70px; padding:5px 10px; display:inline-block; text-align:left; border-bottom:1px solid #ddd;}
|
||||
a.resource-tab-active {color:#fff; background-color:#3b94d6; border-bottom:1px solid #3b94d6;}
|
||||
|
|
|
@ -211,7 +211,7 @@
|
|||
.clone_btn {width:30px; height:21px; border-top:1px solid #dddddd; border-bottom:1px solid #dddddd; border-right:1px solid #dddddd; outline:none; float:left; background-image:linear-gradient(#FCFCFC, #EEE); text-align:center;}
|
||||
.vl_btn {height:21px; padding:0px 5px; vertical-align:middle; border:1px solid #dddddd; float:left; line-height:21px; background-image:linear-gradient(#FCFCFC, #EEE);}
|
||||
.vl_btn_2 {height:21px; padding:0px 5px; vertical-align:middle; border-top:1px solid #dddddd; border-bottom:1px solid #dddddd; border-right:1px solid #dddddd; float:left; line-height:21px;}
|
||||
.recordBanner {width:100%; height:30px; background-color:#f1f1f1; color:#666666; line-height:30px; vertical-align:middle;}
|
||||
.recordBanner {width:100%; height:40px; background-color:#f1f1f1; color:#666666; line-height:40px; vertical-align:middle;}
|
||||
.vl_copy {background:url(../images/vlicon/clone_url.png) 0px 0px no-repeat; padding-left:22px;}
|
||||
.vl_copy2 {background:url(../images/vlicon/clone_url.png) 0px 0px no-repeat; padding-left:22px;}
|
||||
.vl_zip {background:url(../images/vlicon/graph.png) 0px 2px no-repeat; padding-left:22px;}
|
||||
|
@ -288,6 +288,6 @@ li.commit .commit-row-info .committed_ago {
|
|||
color: #7F7F7F;
|
||||
}
|
||||
.rep_mail_name{max-width: 150px; overflow: hidden; text-overflow: ellipsis;}
|
||||
a.btn_zipdown{ display:block; height:25px; width:80px; text-align: center; line-height: 25px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);
|
||||
a.btn_zipdown{ display:block; height:30px; width:80px; text-align: center; line-height: 30px; border: 1px solid #dddddd; background-image: linear-gradient(#FCFCFC, #EEE);
|
||||
color: #7f7f7f; -webkit-border-radius:3px;-moz-border-radius:3px;-o-border-radius:3px;border-radius:3px; margin-left: 5px;}
|
||||
a:hover.btn_zipdown{color:#269ac9;}
|
Loading…
Reference in New Issue