Merge branch 'develop' into dev_cxt

Conflicts:
	app/controllers/shixuns_controller.rb
	app/views/subjects/new.html.erb
	public/javascripts/edu/base_edu.js
This commit is contained in:
cxt 2017-09-21 17:46:58 +08:00
commit 86e2f60946
64 changed files with 911 additions and 424 deletions

View File

@ -6,6 +6,7 @@ unless RUBY_PLATFORM =~ /w32/
if RUBY_PLATFORM =~ /darwin/
gem "rmagick", "= 2.15.4" ## osx must be this version
elsif RUBY_PLATFORM =~ /linux/
gem 'simple_xlsx_reader'
gem "rmagick", "~> 2.13.1" ## centos yum install ImageMagick-devel
end
gem 'certified'

View File

@ -586,9 +586,19 @@ class AccountController < ApplicationController
def apply_trail
apply_action = ApplyAction.where(:user_id => User.current.id, :container_type => "TrialAuthorization", :status => 0).first
if User.current.user_extensions.identity == 1 && !User.current.user_extensions.student_id.nil? && User.current.user_extensions.student_id != "" && !User.current.user_extensions.school.nil?
User.current.update_attributes(:certification => 1)
@tip = "申请成功,我们将在一分钟内完成审核"
if apply_action.blank?
ApplyAction.create(:user_id => User.current.id, :status => 1, :container_type => "TrialAuthorization", :apply_reason => params[:apply_reason])
else
apply_action.update_attributes(:status => 1)
end
else
@tip = "申请成功,我们将在一个工作日内完成审核"
ApplyAction.create(:user_id => User.current.id, :status => 0, :container_type => "TrialAuthorization", :apply_reason => params[:apply_reason])
end
respond_to do |format|
format.js
end

View File

@ -25,7 +25,7 @@ class CoursesController < ApplicationController
menu_item l(:label_sort_by_active), :only => :index
menu_item l(:label_sort_by_influence), :only => :index
before_filter :can_show_course, :except => []
#before_filter :can_show_course, :except => []
before_filter :logged_user_by_apptoken,:only => [:show,:feedback]
before_filter :find_course, :except => [ :index, :search, :new, :join, :unjoin, :create, :new_join, :course, :join_private_courses, :join_course_multi_role, :unjoin_group, :search_course_list]
before_filter :authorize_course, :only => [:show, :settings, :update, :course]

View File

@ -29,6 +29,7 @@ class GamesController < ApplicationController
# @st 0 实践任务 1 多选任务 2 单选任务
def show
# 展示全部实训
@is_subject = params[:is_subject]
if @game.status == 1
# 放置页面ajax数据还没获取就关闭
@game.update_attribute(:status, 0)
@ -91,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
@ -277,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/, '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;') unless error_position.try(:out_put).blank?
logger.info("@compile_success###################{@compile_success}")
@ -290,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,
@ -312,7 +316,7 @@ class GamesController < ApplicationController
answer_right = []
@game_challenge.challenge_chooses.each_with_index do |choose, index|
correct = (params[:answer][index] == choose.standard_answer) ? true : false
if choose.choose_outputs.blank?
if choose.current_choose_outputs.blank?
ChooseOutputs.create(:challenge_choose_id => choose.id, :user_id => User.current.id, :answer => params[:answer][index], :correct => correct)
end
if @shixun.status > 1 && !@game.answer_open
@ -413,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

View File

@ -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
# 未参与匿评的缺评计算

View File

@ -688,11 +688,11 @@ end
end
@search = params[:search] # 搜索字
@keyword = params[:keyword].blank? ? "u_name" : params[:keyword] # 根据姓名/课程名搜索
status = params[:status].to_i
courselist = params[:course_list]
@status = params[:status]
@courselist = params[:course_list]
@school_id = params[:school_id]
if params[:school_id] && params[:school_id] != ''
@school_id = params[:school_id]
@courses = Course.joins("join users u on courses.tea_id = u.id").joins("join user_extensions ue on u.id = ue.user_id").where("ue.school_id = #{params[:school_id]}")
end
@ -701,12 +701,11 @@ end
end
if params[:course_list] && params[:course_list] != ''
@courses = @courses.where(:course_list_id => courselist)
@courses = @courses.where(:course_list_id => @courselist)
end
if params[:status] && params[:status]!=''
@status = params[:status]
@courses =@courses.where(:is_end =>status)
@courses =@courses.where(:is_end => @status.to_i)
end
if "u_name" == @keyword
if @search.blank?
@ -719,6 +718,7 @@ end
@courses= @courses.where("name like '%#{@search}%'")
end
@courses = @courses.select("courses.*,(SELECT MAX(updated_at) FROM `course_activities` WHERE course_activities.course_id = courses.id) AS updatetime").reorder("updatetime #{@sx_order}")
@export_courses = @courses
@courses_count = @courses.count
limit = 20
@is_remote = true
@ -728,6 +728,11 @@ end
respond_to do |format|
format.js
format.html
format.xls{
@export_courses = @export_courses.all
filename = "#{l(:label_course_list_xls)}.xls"
send_data(course_list_xls(@export_courses), :type => 'application/octet-stream', :filename => filename_for_content_disposition(filename))
}
end
end
@ -1379,28 +1384,29 @@ end
render_404
end
def course_list_xls course
def course_list_xls courses
xls_report = StringIO.new
book = Spreadsheet::Workbook.new
sheet1 = book.create_worksheet :name => "course"
blue = Spreadsheet::Format.new :color => :blue, :weight => :bold, :size => 10
sheet1.row(0).default_format = blue
sheet1.row(0).concat([l(:issue_xls_id),l(:issue_xls_tracker_id),l(:issue_xls_title),l(:issue_xls_description),l(:issue_xls_status),l(:issue_xls_assign),l(:issue_xls_priority),l(:issue_xls_author),l(:issue_xls_created_at),l(:milestone),l(:issue_xls_start),l(:issue_xls_due),l(:issue_xls_ratio)])
sheet1.row(0).concat(["ID","课堂名称","成员","资源","普通作业"," 实训作业","试卷","私有","状态","创建者单位","创建者","动态时间"])
count_row = 1
issues.each do |issue|
sheet1[count_row,0] = issue.id
sheet1[count_row,1] = issue_tracker_change(issue.tracker_id)
sheet1[count_row,2] = issue.subject
sheet1[count_row,3] = (issue.description.gsub(/<\/?.*?>/,"")).html_safe
sheet1[count_row,4] = issue_status_change(issue.status_id)
sheet1[count_row,5] = issue.assigned_to.try(:show_name)
sheet1[count_row,6] = issue_priority_change(issue.priority_id)
sheet1[count_row,7] = issue.author.show_name
sheet1[count_row,8] = issue.created_on.nil? ? issue.created_on : issue.created_on.strftime('%Y-%m-%d %H:%M:%S')
sheet1[count_row,9] = issue.fixed_version.try(:name)
sheet1[count_row,10] = issue.start_date.nil? ? issue.start_date : issue.start_date.strftime('%Y-%m-%d')
sheet1[count_row,11] = issue.due_date.nil? ? issue.due_date : issue.due_date.strftime('%Y-%m-%d')
sheet1[count_row,12] = issue_ratio_change(issue.done_ratio, issue.status_id)
courses.each do |course|
school = course.teacher.try(:user_extensions).try(:school).try(:name).blank? ? "--" : course.teacher.school_name
teacher_name = course.teacher ? course.teacher.show_real_name : ""
sheet1[count_row,0] = course.id
sheet1[count_row,1] = course.name
sheet1[count_row,2] = course.members.count
sheet1[count_row,3] = course.attachments.count
sheet1[count_row,4] = course.homework_commons.where(:homework_type => 1).count
sheet1[count_row,5] = course.homework_commons.where(:homework_type => 4).count
sheet1[count_row,6] = course.exercises.count
sheet1[count_row,7] = course.is_public.to_i == 1 ? '否' : '是'
sheet1[count_row,8] = course.is_end ? "已结束" : "正在进行"
sheet1[count_row,9] = school
sheet1[count_row,10] = teacher_name
sheet1[count_row,11] = format_time(course.updatetime)
count_row += 1
end
book.write xls_report

View File

@ -487,7 +487,7 @@ class MembersController < ApplicationController
CourseMessage.create(:user_id => @member.user_id, :course_id => @course.id, :course_message_type => "RemoveFromCourse", :viewed => false, :course_message_id => User.current.id)
end
respond_to do |format|
format.html { redirect_to_settings_in_courses }
format.html { redirect_to members_course_path(@course) }
format.js
format.api {
if @member.destroyed?

View File

@ -98,7 +98,7 @@ class MyshixunsController < ApplicationController
raise("实训云平台繁忙繁忙等级87")
end
end
redirect_to shixun_exec_shixun_path(shixun, :type => 1)
redirect_to shixun_exec_shixun_path(shixun, :type => 1, :is_subject => params[:is_subject])
rescue Exception => e
flash[:error] = "实训云平台繁忙繁忙等级89"
g.delete_project(@myshixun.gpid) if !g_project.try(:id).nil?

View File

@ -20,7 +20,7 @@ class ShixunsController < ApplicationController
end
# push代码的时候会触发gitlab hook
def ghook
shixun_modify_status_without_publish(@shixun, 1)
# shixun_modify_status_without_publish(@shixun, 1)
render :json => {status: "success"}
end
@ -139,7 +139,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
@ -388,7 +388,7 @@ class ShixunsController < ApplicationController
myshixun = Myshixun.where(:user_id => User.current.id, :shixun_id => @shixun.id).first
unless myshixun.blank?
logger.info("current task id is #{myshixun.current_task}")
redirect_to myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun)
redirect_to myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun, :is_subject => params[:is_subject])
return
end
ActiveRecord::Base.transaction do
@ -408,7 +408,9 @@ class ShixunsController < ApplicationController
rep = Repository.create!(:myshixun_id => myshixun.id, :identifier => gshixun.name,:project_id => -1, :shixun_id => -2)
rep.update_column(:type, "Repository::Gitlab")
rep_url = Base64.urlsafe_encode64(git_shixun_url_ip @shixun, "educoder") # 注意educoder为默认给实训创建版本库的用户如果换成别的用户名字要相应的修改
logger.info("start openGameInstance")
uri = "#{shixun_tomcat}/bridge/game/openGameInstance"
logger.info("end openGameInstance")
params = {tpiID: "#{myshixun.id}", tpmID: "#{@shixun.id}", instanceGitURL:rep_url, operationEnvironment:"#{@shixun.try(:language)}"}
logger.info("openGameInstance params is #{params}")
res = uri_exec uri, params
@ -438,7 +440,7 @@ class ShixunsController < ApplicationController
raise("实训云平台繁忙繁忙等级81")
end
logger.info("myshixun id si #{myshixun.id} and current_task id is#{myshixun.current_task.id}")
redirect_to myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun)
redirect_to myshixun_game_path(myshixun.current_task, :myshixun_id => myshixun, :is_subject => params[:is_subject])
rescue Exception => e
flash[:error] = e.message
logger.info("failed to exec shixun: current task id is #{e}")
@ -584,7 +586,7 @@ class ShixunsController < ApplicationController
begin
@shixun.save!
if language != params[:language]
shixun_modify_status_without_publish(@shixun, 1)
add_shixun_modify_status(@shixun, 1)
end
rescue
@error = "实训保存失败"

View File

@ -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

View File

@ -820,7 +820,7 @@ class UsersController < ApplicationController
cs.send_wechat_join_class_notice apply_user,c,7,1
end
end
redirect_to settings_course_path(@msg.course_id, :tab => 'member')
redirect_to members_course_path(@msg.course_id)
end
# 处理资源引用请求

View File

@ -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

View File

@ -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 #匿评作业,且作业状态不是在开启匿评之前

View File

@ -31,7 +31,7 @@ class Challenge < ActiveRecord::Base
def choose_correct_num
num = 0
self.challenge_chooses.each do |choose|
outputs = ChooseOutputs.where(:challenge_choose_id => choose.id).first
outputs = ChooseOutputs.where(:challenge_choose_id => choose.id, :user_id => User.current.id).first
if outputs.nil?
num = nil
else

View File

@ -10,4 +10,9 @@ class ChallengeChoose < ActiveRecord::Base
validates_presence_of :subject
# 判断当前用户是否答题
def current_choose_outputs
ChooseOutputs.where(:challenge_choose_id => self.id, :user_id => User.current.id).first
end
end

View File

@ -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

View File

@ -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

View File

@ -1 +1 @@
$("body").append('<%= j( render :partial => 'welcome/one_btn_mask_pop', :locals => {:btn => "确定", :tip1 => "申请成功,我们将在一个工作日内完成审核", :url => "#{my_account_path()}"}) %>');
$("body").append('<%= j( render :partial => 'welcome/one_btn_mask_pop', :locals => {:btn => "确定", :tip1 => @tip, :url => "#{my_account_path()}"}) %>');

View File

@ -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 = '!>';

View File

@ -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,13 +9,13 @@
<li class="clearfix">
<label class="panel-form-label fl">题干:&nbsp;&nbsp;</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| %>
<li class="clearfix">
<label class="panel-form-label fl <%= option.right_key ? 'color-orange03' : '' %>"><%= (option.position+ 65).chr %>&nbsp;&nbsp;</label>
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690 color-grey3">
<div class="fl task-bg-grey panel-box-sizing panel-form-width-690 color-grey3 break-word">
<%= option.option_name %>
</div>
</li>
@ -24,7 +26,7 @@
<li class="clearfix">
<label class="panel-form-label fl">参考答案:&nbsp;&nbsp;</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">技能标签&nbsp;&nbsp;</label>
<label class="panel-form-label fl">知识点&nbsp;&nbsp;</label>
<div class="fl task-inputs mt5">
<% if @challenge_choose.challenge_tags.blank? %>
@ -63,16 +65,17 @@
</div>
<script>
/* $(document).ready(function() {
editormd.loadKaTeX(function() {
var subjectMD = editormd.markdownToHTML("challenge_choose_subject_show", {
$(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", {
taskPassMD = editormd.markdownToHTML("choose_task_pass_show", {
htmlDecode : "style,script,iframe", // you can filter tags decode
taskList : true,
tex : true, // 默认不解析
@ -80,5 +83,5 @@
sequenceDiagram : true // 默认不解析
});
});
});*/
});
</script>

View File

@ -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 // 默认不解析
})
});
});*/

View File

@ -56,7 +56,7 @@
<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" : "" %>
<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" : "" %>">

View File

@ -0,0 +1,68 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/application.js" type="text/javascript" charset="utf-8"></script>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)">kosasa</a> &gt; <a href="javascript:void(0)">讨论 </a> &gt; 新建
</p>
<div class="edu-con-top user_bg_shadow bor-grey-e">
<p class="ml15 color-grey3">新建话题</p>
</div>
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e pt30 pb30">
<ul>
<!--<li class="clearfix mb15 pl30 pr30">
<label class="panel-form-label fl color-dark-grey"><span class="color-orange mr5">*</span>类别&nbsp;&nbsp;&nbsp;</label>
<div class="with30 fl pr" select-for>
<input type="hidden" name="major_level" id="major_level" value="0">
<input class="task-height-40 task-form-100 panel-box-sizing pr20 color-grey3" readonly placeholder="选择话题类别"/>
<div class="down-select bor-grey-e user_bg_shadow" id="major_level_option">
<p data-major="3">通 告</p>
<p data-major="2">智能课堂</p>
<p data-major="1">实训项目</p>
</div>
</div>
</li>-->
<li class="clearfix mb15 pl30 pr30">
<label class="panel-form-label fl color-dark-grey"><span class="color-orange mr5">*</span>标题&nbsp;&nbsp;&nbsp;</label>
<input type="text" name="homework_common[name]" id="new_homework_name" value="" class="panel-form-width-690 panel-form-height-30 fl panel-box-sizing" maxlength="60" placeholder="最多60个字符">
<p class="color-orange" style="margin-left: 10%;"><i class="fa fa-exclamation-circle mr5"></i>标题不能超过60个字符</p>
</li>
<li class="clearfix mb5 pl30 pr30">
<label class="panel-form-label fl color-dark-grey"><span class="color-orange mr5">*</span>内容&nbsp;&nbsp;&nbsp;</label>
<input id="asset_id" name="asset_id" style="display:none" type="hidden">
<textarea class="panel-form-width-690 panel-form-height-150 fl panel-box-sizing"></textarea>
<p class="color-orange" style="margin-left: 10%;"><i class="fa fa-exclamation-circle mr5"></i>内容不能为空</p>
</li>
<li class="clearfix mb5 pl30 pr30">
<div class="mt5 clearfix">
<label class="panel-form-label fl">&nbsp;</label>
<a href="javascript:void(0);" class="fl" onclick="$('#_file').click();" title="请选择文件上传">
<i class="fa fa-upload mr5"></i>
<span>上传附件</span>
</a>
</div>
</li>
<li class="clearfix mt10 pl30 pr30">
<a href="javascript:void(0);" class="task-btn task-btn-blue fr">保存</a>
<a href="javascript:void(0)" class="task-btn fr mr10">取消</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -0,0 +1,116 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/edu/application.js" type="text/javascript" charset="utf-8"></script>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="javascript:void(0)">kosasa</a> &gt; <a href="javascript:void(0)">讨论 </a> &gt; 新建
</p>
<div class="edu-con-top user_bg_shadow bor-grey-e clearfix mb20">
<p class="ml15 color-grey3 fl">五个值得推荐的英语学习网站,不可错过哦!</p>
<p class="color-grey fr font-12 mr15 mt5"><a href="javascript:void(0)">返回</a></p>
</div>
<div class="edu-tab clearfix mb20 user_bg_shadow bor-grey-e">
<div class="panel-inner-fourm nobg">
<div class="clearfix pr">
<a href="/users/innov" class="fl"><img alt="用户头像" class="panel-list-img mr15" height="60" src="http://tx.haiqq.com/uploads/allimg/150331/214H3HN-8.jpg" width="60"></a>
<div class="panel-list-infobox fl" style="margin:0;margin-left: 9px">
<p><a href="/users/innov" class="font-14 mr15 color-grey">创新使者</a></p>
<p class="color-grey panel-lightgrey fl mt3">
<!--<span class="fl mr10 mt2">类别:分享</span>--><span class="fl mr10 mt2">发表于1年前</span>
</p>
</div>
<div class="edu-position-hidebox" style="position: absolute;right: 10px;top:0px;">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">&nbsp;&nbsp;</a></li>
<li><a href="javascript:void(0);">&nbsp;&nbsp;</a></li>
<li><a href="javascript:void(0)">&nbsp;&nbsp;</a></li>
</ul>
</div>
</div>
<div class="panel-inner-info clearfix">
<!--帖子内容-->
<strong><span style="background-color:#00D5FF;">上传文件</span></strong>
</div>
<ul class="panel-inner-info mt10">
<!--上传的文件内容-->
<li class="color-grey">
<a href="javascript:void(0)" class="link-color-grey">
<i class="fa fa-folder" aria-hidden="true"></i>
</a>
<a href="http://localhost:3000/attachments/download/160765/bigdata-logo.png" class="link-color-grey" length="58">bigdata-logo.png</a>
<span class="color-grey">(868 Bytes)</span>
<span title="kosasa">
<a href="/users/kosasa" class="link-color-grey">kosasa</a>,2017-09-19 09:02
</span>
</li>
</ul>
</div>
<div class="panel-mesbox" id="message_replies_box">
<div class="panel-mes-head clearfix">
<h4 class="fl">全部回复<span class="ml5">(1)</span></h4>
<p class="fr mr15">
<a href="javascript:void(0);" class="mr15 white-btn orange-btn" onclick="editor_focus(20198);"><i class="fa fa-comments-o mr5"></i>回复<!--<span class="ml5"></span>--></a>
<span id="praise_count_20198" class="fr mr10">
<a href="/praise_tread/praise_plus?obj_id=20198&amp;obj_type=Message&amp;type=activity&amp;user_activity_id=20198" data-remote="true" class="white-btn orange-btn" title="点赞">
<i class="fa fa-thumbs-up mr5"></i>
<span>0</span>
</a>
</span>
</p>
</div>
<!--回复框 messages/_message_all_replies.html.erb-->
<div class="comment_item_cont clearfix">
<div class="comment_reply_box">
<div class="J_Comment_Face fl">
<!--<%#= link_to image_tag(url_to_avatar(User.current), :width => "50", :height => "50"), :target => "_blank", :alt => "用户头像" %>-->
</div>
<!--<div nhname='new_message_<%= @topic.id%>' class="fr ml20 mr20" style="display:none; width: 92%;">
<%#= form_for @reply, :as => :reply, :url => {:action => 'reply', :id => @topic}, :remote => true, :html => {:multipart => true, :id => 'message_form'} do |f| %>
<input type="hidden" name="journal_id" value="<%= @topic.id %>"/>
<div nhname='toolbar_container_<%= @topic.id%>'></div>
<textarea placeholder="有问题或有建议,请直接给我留言吧!" style="display: none" nhname='new_message_textarea_<%= @topic.id%>' name="content"></textarea>
<a id="new_message_submit_btn_<%= @topic.id%>" href="javascript:void(0)" onclick="this.style.display='none'" class="mt10 task-btn task-btn-blue fr">发布</a>
<div class="cl"></div>
<p nhname='contentmsg_<%= @topic.id%>'></p>
<%# end%>
</div>-->
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
function ThumbUp(item){
$(item).toggleClass("orange-btn");
$(item).toggleClass("orange-bg-btn");
if($(item).attr("attr-thumb")=="0"){
$(item).find("span").html(parseInt($(item).find("span").html())+1);
$(item).attr("attr-thumb","1");
}else{
$(item).find("span").html(parseInt($(item).find("span").html())-1);
$(item).attr("attr-thumb","0");
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,143 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link href="../../../public/stylesheets/css/edu-common.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-public.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/edu-class.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/taskstyle.css" rel="stylesheet" type="text/css"/>
<link href="../../../public/stylesheets/css/font-awesome.css" rel="stylesheet" type="text/css"/>
<script src="../../../public/javascripts/application.js" type="text/javascript" charset="utf-8"></script>
<script src="../../../public/javascripts/jquery-1.8.3.min.js" type="text/javascript" charset="utf-8"></script>
</head>
<body style="height: 100%; background: #fff;">
<div class="newContainer">
<div class="newMain clearfix">
<div class="edu-class-container edu-position">
<p class="mb10 font-14">
<i class="fa fa-map-marker mr5 color-grey"></i>
<a href="/users/kosasa">kosasa</a> &gt; 讨论
</p>
<div class="edu-class-top clearfix mb30 pr user_bg_shadow bor-grey-e">
<div class="clearfix">
<div class="fl with60 mt5">
<a href="javascript:void(0)" class="fl"><img src="http://tx.haiqq.com/uploads/allimg/150331/214H3HN-8.jpg" class="bor-radius-all" width="60" height="60"/></a>
<div class="fl ml15">
<li class="font-16">胡莎莎</li>
<li class="mt5 color-grey">P547687645213</li>
</div>
</div>
<ul class="task-index-head-info fr with30" style="padding: 10px 0px;">
<li><span class="color-orange font-bd" id="all_syllabuses">983</span><br><span>被赞</span></li>
<li><span class="color-orange font-bd" id="all_syllabuses">983</span><br><span>回复/评论</span></li>
<li><span class="color-orange font-bd" id="all_syllabuses">983</span><br><span>主题</span></li>
</ul>
</div>
</div>
<div class="clearfix user_bg_shadow bor-grey-e">
<div class="clearfix pt10 pb10 pl15 pr15 bor-bottom-greyE">
<p class="color-grey3 fl font-16">问吧</p>
<a href="javascript:void(0)" class="mt3 white-btn orange-btn fr">+&nbsp;新话题</a>
</div>
<div id="forum_list" class="forum_table mh650">
<div class="forum_table_item">
<a class="fr mr15"><img src="http://tx.haiqq.com/uploads/allimg/150331/214H3HN-8.jpg" class="bor-radius-all mt3" width="50" height="50"/></a>
<div class="fl color-grey pr" style="flex: 1;">
<a href="javascript:void(0)">华沙沙</a>
<p class="font-16">
<a href="javascript:void(0)" class="clearfix item_name">五个值得推荐的英语学习网站,不可错过哦!</a>
</p>
<p style="width: 1103px;" class="overellipsis">1.练习口语 在线英语: http://dwz.cn/1XHGmL免费在线口语课领取外教一对一交流互动~ 特点:有正式课程挂网上公开,注册可免费听口语课,与外国老师实时交流哦~哈哈哈哈哈哈</p>
<p class="clearfix font-12 mt5">
<span class="mr20 fl" style="cursor: pointer;"><i class="fa fa-eye mr5"></i>10</span>
<span class="mr20 fl" style="cursor: pointer;"><i class="fa fa-thumbs-o-up mr5"></i>10</span>
<span class="mr50 fl" style="cursor: pointer;"><i class="fa fa-comments-o mr5"></i>10</span>
<!--<span class="fl">类别:分享</span>-->
<span class="fr mr5">最后更新2小时前</span>
</p>
<div class="edu-position-hidebox" style="position: absolute;right: 10px;top:0px;">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">&nbsp;&nbsp;</a></li>
<li><a href="javascript:void(0);">&nbsp;&nbsp;</a></li>
<li><a href="javascript:void(0)">&nbsp;&nbsp;</a></li>
</ul>
</div>
</div>
</div>
<div class="forum_table_item">
<a class="fr mr15"><img src="http://tx.haiqq.com/uploads/allimg/150331/214H3HN-8.jpg" class="bor-radius-all mt3" width="50" height="50"/></a>
<div class="fl color-grey pr" style="flex: 1;">
<a href="javascript:void(0)">华沙沙</a>
<p class="font-16">
<a href="javascript:void(0)" class="clearfix item_name">五个值得推荐的英语学习网站,不可错过哦!</a>
</p>
<p style="width: 1103px;" class="overellipsis">1.练习口语 在线英语: http://dwz.cn/1XHGmL免费在线口语课领取外教一对一交流互动~ 特点:有正式课程挂网上公开,注册可免费听口语课,与外国老师实时交流哦~哈哈哈哈哈哈</p>
<p class="clearfix font-12 mt5">
<span class="mr20 fl" style="cursor: pointer;"><i class="fa fa-eye mr5"></i>10</span>
<span class="mr20 fl" style="cursor: pointer;"><i class="fa fa-thumbs-o-up mr5"></i>10</span>
<span class="mr50 fl" style="cursor: pointer;"><i class="fa fa-comments-o mr5"></i>10</span>
<!--<span class="fl">类别:分享</span>-->
<span class="fr mr5">最后更新2小时前</span>
</p>
<div class="edu-position-hidebox" style="position: absolute;right: 10px;top:0px;">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">&nbsp;&nbsp;</a></li>
<li><a href="javascript:void(0);">&nbsp;&nbsp;</a></li>
<li><a href="javascript:void(0)">&nbsp;&nbsp;</a></li>
</ul>
</div>
</div>
</div>
<div class="forum_table_item">
<a class="fr mr15"><img src="http://tx.haiqq.com/uploads/allimg/150331/214H3HN-8.jpg" class="bor-radius-all mt3" width="50" height="50"/></a>
<div class="fl color-grey pr clearfix" style="flex: 1;">
<a href="javascript:void(0)">华沙沙</a>
<p class="font-16">
<a href="javascript:void(0)" class="clearfix item_name">五个值得推荐的英语学习网站,不可错过哦!</a>
</p>
<p style="width: 1103px;" class="overellipsis">1.练习口语 在线英语: http://dwz.cn/1XHGmL免费在线口语课领取外教一对一交流互动~ 特点:有正式课程挂网上公开,注册可免费听口语课,与外国老师实时交流哦~哈哈哈哈哈哈</p>
<p class="clearfix font-12 mt5">
<span class="mr20 fl" style="cursor: pointer;"><i class="fa fa-eye mr5"></i>10</span>
<span class="mr20 fl" style="cursor: pointer;"><i class="fa fa-thumbs-o-up mr5"></i>10</span>
<span class="mr50 fl" style="cursor: pointer;"><i class="fa fa-comments-o mr5"></i>10</span>
<!--<span class="fl">类别:分享</span>-->
<span class="fr mr5">最后更新2小时前</span>
</p>
<div class="edu-position-hidebox" style="position: absolute;right: 10px;top:0px;">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0)">&nbsp;&nbsp;</a></li>
<li><a href="javascript:void(0);">&nbsp;&nbsp;</a></li>
<li><a href="javascript:void(0)">&nbsp;&nbsp;</a></li>
</ul>
</div>
</div>
</div>
</div>
<div style="text-align:center;" class="new_expand">
<div class="pages_user_show" style="width:auto; display:inline-block;margin: 18px 0;">
<ul id="homework_pository_ref_pages">
<li><a href="javascript:void(0)" class="pages-big" data-remote="true">上一页</a></li>
<li><a class="active">1</a></li>
<li><a href="javascript:void(0)" class="page c_blue" data-remote="true">2</a></li>
<li><a href="javascript:void(0)" class="page c_blue" data-remote="true">3</a></li>
<li><a href="javascript:void(0)" class="pages-big pages-border-right" data-remote="true">下一页</a></li>
</ul>
<div class="cl"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</body>
</html>

View File

@ -22,12 +22,12 @@
<p class="ml10 mb10 ">
<span>
<% if choose.category == 1 %>
<input type="radio" <%= (choose.choose_outputs.try(:answer) == (i + 65).chr) ? "checked" : "" %> name="answer[<%= index + 1 %>]" category="<%= choose.category %>" value="<%= (question.position + 65).chr %>" id="result_<%= index %>_<%= i %>" class="ml-3 mr5 magic-radio ml5">
<input type="radio" <%= (choose.current_choose_outputs.try(:answer) == (i + 65).chr) ? "checked" : "" %> name="answer[<%= index + 1 %>]" category="<%= choose.category %>" value="<%= (question.position + 65).chr %>" id="result_<%= index %>_<%= i %>" class="ml-3 mr5 magic-radio ml5">
<% else %>
<!--多选-->
<input type="checkbox" <%= (!choose.choose_outputs.try(:answer).nil? && (choose.choose_outputs.try(:answer).include? ((i + 65).chr))) ? "checked" : "" %> name="answer[]" category="<%= choose.category %>" value="<%= (question.position + 65).chr %>" id="result_<%= index %>_<%= i %>" class="ml-3 mr5 magic-checkbox ml5">
<input type="checkbox" <%= (choose.current_choose_outputs.try(:answer).present? && (choose.current_choose_outputs.try(:answer).include? ((i + 65).chr))) ? "checked" : "" %> name="answer[]" category="<%= choose.category %>" value="<%= (question.position + 65).chr %>" id="result_<%= index %>_<%= i %>" class="ml-3 mr5 magic-checkbox ml5">
<% end %>
<label class="<%= (!choose.choose_outputs.try(:answer).nil? && (choose.choose_outputs.try(:answer).include? ((i + 65).chr))) ? "color-orange05" : "" %>" for="result_<%= index %>_<%= i %>" style="top: 0px"><span><%= (question.position + 65).chr %></span>.<%= question.option_name %></label>
<label class="break-word <%=(!choose.current_choose_outputs.try(:answer).nil? && (choose.current_choose_outputs.try(:answer).include? ((i + 65).chr))) ? "color-orange05" : "" %>" for="result_<%= index %>_<%= i %>" style="top: 0px"><span><%= (question.position + 65).chr %></span>.<%= question.option_name %></label>
</span>
</p>
<% end %>

View File

@ -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", "已完成");

View File

@ -28,11 +28,12 @@
<i class="fa fa-caret-right mr5 font-16" ></i>
<span class="font-14">题目<%= index + 1 %></span>
<%# outputs = ChooseOutputs.where(:challenge_choose_id => choose.id).first %>
<% unless choose.choose_outputs.blank? %>
<% if choose.choose_outputs.try(:answer) != choose.standard_answer %>
<i class="fa fa-exclamation-circle -text-danger fr mt8 ml5" ></i>
<% else %>
<% unless choose.current_choose_outputs.blank? %>
<%# if choose.choose_outputs.try(:answer) != choose.standard_answer %>
<% if choose.current_choose_outputs.try(:answer) == choose.standard_answer %>
<i class="fa fa-check-circle color-light-green fr mt8 ml5 f14" ></i>
<% else %>
<i class="fa fa-exclamation-circle -text-danger fr mt8 ml5" ></i>
<% end %>
<% else %>
<i class="fa fa-lock fr mt8" ></i>
@ -44,7 +45,7 @@
<li><span class="ml30">尚未提交,暂不支持查看</span></li>
<% else %>
<li><span class="-task-ces-info-left color-blue">正确选项:</span><span><%= choose.standard_answer %></span></li>
<li><span class="-task-ces-info-left color-blue">你的选项:</span><span class="color-orange"><%= choose.choose_outputs.try(:answer).nil? ? "无" : choose.choose_outputs.try(:answer) %></span></li>
<li><span class="-task-ces-info-left color-blue">你的选项:</span><span class="color-orange"><%= choose.current_choose_outputs.try(:answer).nil? ? "无" : choose.current_choose_outputs.try(:answer) %></span></li>
<% end %>
</ul>
</div>

View File

@ -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 %>'
);

View File

@ -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"><%= @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>

View File

@ -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>

View File

@ -33,7 +33,6 @@
<span></span>
<p>系统评分是根据学生的任务完成情况,按照百分比计算 <br/>
例如实训任务5关学生A完成3关则最终成绩为 3 / 5 * 100 = 60分 <br/>
注意:学生完成实训后,必须关联实训项目,否则成绩为零
</p>
</div>
</li>

View File

@ -58,7 +58,7 @@
</p>
</div>
<% if @is_teacher %>
<div class="fr edu-position edu-position-hidebox mr20 mt20">
<div class="fr edu-position edu-position-hidebox mr20 mt5">
<a href="javascript:void(0);"><i class="fa fa-bars font-16"></i></a>
<ul class="edu-position-hide undis">
<% if homework_common.homework_type != 4 %>

View File

@ -33,7 +33,6 @@
<span></span>
<p>系统评分是根据学生的任务完成情况,按照百分比计算 <br/>
例如实训任务5关学生A完成3关则最终成绩为 3 / 5 * 100 = 60分 <br/>
注意:学生完成实训后,必须关联实训项目,否则成绩为零
</p>
</div>
</li>

View File

@ -11,7 +11,7 @@
<% if User.current.admin? || User.current.member_of_course?(@course) %>
请将邀请码告诉成员<br/>他们可以主动加入
<% else %>
请向班级教师或助教<br/>索要邀请码
请向课堂教师或助教<br/>索要邀请码
<% end %>
<% else %>
邀请码已停用<br/>成员不能主动加入哦
@ -83,7 +83,7 @@
<% unless (is_teacher || is_TA || is_TE || is_ST) %>
<div id="join_in_course_header" class="join">
<p class="joinclass"><%= link_to "加入班级", join_private_courses_courses_path, :remote => true, :method => "post", :class => 'color_white' %></p>
<p class="joinclass"><%= link_to "加入课堂", join_private_courses_courses_path, :remote => true, :method => "post", :class => 'color_white' %></p>
</div>
<% end %>
</li>
@ -96,12 +96,12 @@
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0);" onclick="delete_confirm_box('<%=private_or_public_course_path(@course) %>', '您确定要设置为<%= @course.is_public == 0 ? "公开" : "私有" %>吗?');"><%= @course.is_public == 0 ? "设为公开" : "设为私有" %></a></li>
<% if @course.invite_code_halt == 0 %>
<li><a href="javascript:void(0);" onclick="delete_confirm_box('<%=set_invite_code_halt_course_path(@course) %>', '邀请码停用后,用户不能主动加入该班级了<br/>您是否确认停用');">停用邀请码</a></li>
<li><a href="javascript:void(0);" onclick="delete_confirm_box('<%=set_invite_code_halt_course_path(@course) %>', '邀请码停用后,用户不能主动加入该课堂了<br/>您是否确认停用');">停用邀请码</a></li>
<% elsif @course.invite_code_halt == 1 %>
<li><a href="<%=set_invite_code_halt_course_path(@course) %>" data-remote="true">恢复邀请码</a></li>
<% end %>
<li><%= link_to "设置", {:controller => 'courses', :action => 'settings', :id => @course} %></li>
<li><a href="javascript:void(0);" onclick="delete_confirm_box_3('<%= course_path(@course) %>', '班级删除后数据将无法恢复,是否确定删除?')">删除</a></li>
<li><a href="javascript:void(0);" onclick="delete_confirm_box_3('<%= course_path(@course) %>', '课堂删除后数据将无法恢复,是否确定删除?')">删除</a></li>
</ul>
</div>
@ -109,7 +109,7 @@
<div class="fr edu-position-hidebox" style="margin-top:-3px;position: absolute;right: 22px" >
<a href="javascript:void(0);" class="font-16"><i class="fa fa-bars"></i></a>
<ul class="edu-position-hide undis">
<li><a href="javascript:void(0);" onclick="delete_confirm_box_3('<%=join_path(:object_id => @course.id) %>', '您确定要退出该班级吗?');">退出班级</a></li>
<li><a href="javascript:void(0);" onclick="delete_confirm_box_3('<%=join_path(:object_id => @course.id) %>', '退出后您将不再是本课堂的成员,确定要退出该课堂吗?');">退出课堂</a></li>
</ul>
</div>
<% end %>

View File

@ -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.&nbsp;&nbsp;湘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.&nbsp;&nbsp;湘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">-->

View File

@ -17,6 +17,12 @@
</head>
<!--add by huang-->
<body onload="setupAjaxIndicator();" style="height: 100%">
<div class="loading_all <%= @is_subject ? '' : 'undis' %>" >
<div class="load">
<div class="loading_main"><img src="/images/../images/bigdata/bigdata-logo.png?1502328187" /><span>EDUCODER</span></div>
<p class="loading_seconde">LOADING<img src="/images/../images/bigdata/shenglue-ring.gif" /></p>
</div>
</div>
<div class="cl"></div>
<div class="page -layout-v -fit ">
@ -61,6 +67,9 @@
</body>
<!-- MathJax的配置 -->
<script type="text/javascript" src="/javascripts/MathJax/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
$(window).load(function (){
$(".loading_all").hide();
})
function g(o){return document.getElementById(o);}
function HoverLi1(n){
// for(var i=1;i<=2;i++){

View File

@ -34,7 +34,19 @@
</select>
<input name="sx_order" type="hidden">
<%#= link_to "导出Excel", export_excel_managements_path(:format => "xls"), :class => "task-btn task-btn-blue ml5 mt3 fr mb5 mr30" %>
<div id="export_course_to_excel">
<%= link_to "导出Excel",
classroom_classment_managements_path(
:search => @search,
:keyword => @keyword,
:status => @status,
:course_list => @courselist,
:school_id => @school_id,
:format => "xls"
),
:method => "POST",
:class => "task-btn task-btn-blue ml5 mt3 fr mb5 mr30" %>
</div>
</div>
<% end %>
<div class="edu-con-bg01 mt15" id="managements_classroom_classment">

View File

@ -1 +1,12 @@
$("#managements_classroom_classment").html("<%= j(render :partial => "managements/classroom_classment_list") %>");
$("#export_course_to_excel").html('<%= link_to "导出Excel",
classroom_classment_managements_path(
:search => @search,
:keyword => @keyword,
:status => @status,
:course_list => @courselist,
:school_id => @school_id,
:format => "xls"
),
:method => "POST",
:class => "task-btn task-btn-blue ml5 mt3 fr mb5 mr30"%>');

View File

@ -3,7 +3,7 @@
$("#project_members_number").html("<%= @project.members.count %>");
<%elsif @course%>
<% if params[:type] == '1' %>
notice_box_redirect('<%= settings_course_path(@course, :tab => 'member') %>',"删除成功");
notice_box_redirect('<%= members_course_path(@course) %>',"删除成功");
<% else %>
notice_box("删除成功");
<% if params[:group_id] == '0' %>

View File

@ -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 %>

View File

@ -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},

View File

@ -1,5 +1,9 @@
<div class="wrap-big mt20 pr" style="min-height: 600px">
<div class="popup_tip_box fontGrey2" style="right:-315px; top:68px;position: absolute">
<div class="box_bg_shandow border-arroud mt20 mb20">
<div class="panel-header clearfix">
<h3 class="shixun_title fl mt5">版本库</h3>
</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">
@ -13,16 +17,18 @@
* 口令:使用您在本平台的登录口令<br/>
</p>
</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,
<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: 459px;"><i class="icon-sitemap mr5 c_grey02 f16 fb"></i>
<li style="width: 558px;">
<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=" clearfix mb10">
<div class=" fl clearfix">
<%= render :partial => 'shixun_navigation' %>
</div>
@ -57,3 +63,4 @@
</div>
<% html_title(l(:label_repository)) -%>
</div>

View File

@ -88,7 +88,7 @@
event.stopPropagation();
});
$("body").click(function(event){
$(".task-pm-content").click(function(event){
$(".course_list_ul").hide();
event.stopPropagation();
});

View File

@ -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>
@ -56,13 +56,20 @@
<% end %>
</div>
<script>
// $(function(){
// })
//关闭搜索框
function colse_searchbox(){
$('.searchinput').val('');
<% unless @search.blank? %>
$.ajax({
url: '/shixuns/search',
type: 'post',
data: $("#shixun_index_search_form").serialize(),
remote: true,
success: function(data){
}
});
<% end %>
}
var timer="";
$(".task-index-list-box").hover(function(ev){

View File

@ -29,6 +29,9 @@
<%= link_to "继续实战", operation_shixun_path(@shixun, :myshixun_id => myshixun.try(:id)), :class => "fr shixun-task-btn task-btn-orange mr15 ", :id => "shixun_operation", :remote => true %>
<% end %>
<%= link_to '发送至', search_user_courses_shixun_path(@shixun), :remote => true, :class => "fr shixun-task-btn task-btn-green mr15" %>
<%# if User.current.manager_of_shixun?(@shixun) %>
<%#= link_to "复制", copy_shixun_path(@shixun), :class => "fr shixun-task-btn task-btn-green mr15", :target => "_blank" %>
<%# end %>
<% elsif @shixun.status == 3 %>
<% unless myshixun.blank? %>
<%= link_to "继续实战", operation_shixun_path(@shixun, :myshixun_id => myshixun.try(:id)), :class => "fr shixun-task-btn task-btn-orange mr15 ", :id => "shixun_operation", :remote => true %>
@ -44,7 +47,7 @@
<% end %>
</div>
</div>
<div class="loading_all">
<div class="loading_all" style="display: none">
<div class="load">
<div class="loading_main"><img src="/images/../images/bigdata/bigdata-logo.png?1502328187" /><span>EDUCODER</span></div>
<p class="loading_seconde">LOADING<img src="/images/../images/bigdata/shenglue-ring.gif" /></p>

View File

@ -348,18 +348,6 @@
}
});
}
//关闭搜索框
function colse_searchbox(){
$('.searchinput').val('');
$.ajax({
url: '/shixuns/search',
type: 'post',
data: $("#shixun_index_search_form").serialize(),
remote: true,
success: function(data){
}
});
}
// 新建实训
function shixun_new(mail){

View File

@ -1,8 +1,8 @@
<%= stylesheet_link_tag '/editormd/css/editormd','/editormd/css/editormd.min.css' %>
<%= 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=" box_bg_shandow mt30 mb30">
<ul id="tab_nav" style="background:#fff;border-bottom:1px solid #eee;">
<div class="mt30 mb30 box_bg_shandow">
<ul id="tab_nav" style="background:#fff;border-bottom:1px solid #eee;border-top: 1px solid #eee;">
<li id="tab_nav_1" class="tab_hover_setting" onclick="HoverLi(1);">
<a href="javascript:void(0);" class="tab_type">配置</a>
</li>

View File

@ -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="">
@ -328,9 +331,11 @@
<% if @is_teacher || (@homework.answer_public && @homework.homework_detail_manual.comment_status > 2) %>
<div id="edu-tab-con-3" class="user_bg_shadow bor-grey-e undis">
<div class="edu-tab-con-box">
<% if @is_teacher %>
<div class="clearfix">
<a href="<%= edit_homework_common_path(@homework) %>" class="fr color-grey"><i class="fa fa-pencil"></i></a>
</div>
<% end %>
<div>
<% unless @homework.reference_answer.blank? %>
<%= @homework.reference_answer.html_safe %>

View File

@ -172,10 +172,11 @@
<% end %>
<% end %>
<% end %>
<% if @is_teacher || (@homework.homework_detail_manual.comment_status == 3 && @work.user != User.current ) %>
<div class="edu-con-bg01 mt15 user_bg_shadow bor-grey-e" id="student_work_score_div">
<%= render :partial => 'student_work_score_div' %>
</div>
<% end%>
</div>
<style type="text/css">

View File

@ -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 %>
@ -61,9 +61,9 @@
<a class="task-btn task-btn-green" onclick="sure_box_redirect_without_newtab('<%= security_settings_path %>', '开启实训,请先绑定邮箱');" style = "display: none" id = "shixun_operation"><%= (myshixun.blank? ? "开始实战" : "继续实战") %></a>
<% else %>
<% if is_modify.blank? %>
<%= link_to (myshixun.blank? ? "开始实战" : "继续实战"), shixun_exec_shixun_path(shixun), :class => "task-btn task-btn-green ", :style=>"display: none", :id => "shixun_operation", :target => "_blank" %>
<%= link_to (myshixun.blank? ? "开始实战" : "继续实战"), shixun_exec_shixun_path(shixun, :is_subject => @subject.id), :class => "task-btn task-btn-green ", :style=>"display: none", :id => "shixun_operation", :target => "_blank" %>
<% else %>
<a class="task-btn task-btn-green" onclick="sure_box_redirect('<%= myshixun_reset_myshixun_path(myshixun) %>', '实训已经更新啦,系统正在为您重置');" style = "display: none" id = "shixun_operation"><%= (myshixun.blank? ? "开始实战" : "继续实战") %></a>
<a class="task-btn task-btn-green" onclick="sure_box_redirect('<%= myshixun_reset_myshixun_path(myshixun, :is_subject => @subject.id) %>', '实训已经更新啦,系统正在为您重置');" style = "display: none" id = "shixun_operation"><%= (myshixun.blank? ? "开始实战" : "继续实战") %></a>
<% end %>
<% end %>
<% else %>
@ -72,9 +72,9 @@
<a class="task-btn task-btn-green" onclick="sure_box_redirect_without_newtab('<%= security_settings_path %>', '开启实训,请先绑定邮箱');" style = "display: none" id = "shixun_operation">模拟实战</a>
<% else %>
<% if is_modify.blank? %>
<%= link_to "模拟实战", shixun_exec_shixun_path(shixun), :class => "task-btn task-btn-green ", :style=>"display: none", :id => "shixun_operation", :target => "_blank" %>
<%= link_to "模拟实战", shixun_exec_shixun_path(shixun, :is_subject => @subject.id), :class => "task-btn task-btn-green ", :style=>"display: none", :id => "shixun_operation", :target => "_blank" %>
<% else %>
<a class="task-btn task-btn-green" onclick="sure_box_redirect('<%= myshixun_reset_myshixun_path(myshixun) %>', '实训已经更新啦,系统正在为您重置');" style = "display: none" id = "shixun_operation">模拟实战</a>
<a class="task-btn task-btn-green" onclick="sure_box_redirect('<%= myshixun_reset_myshixun_path(myshixun, :is_subject => @subject.id) %>', '实训已经更新啦,系统正在为您重置');" style = "display: none" id = "shixun_operation">模拟实战</a>
<% end %>
<% end %>
<% 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">教学团队

View File

@ -74,6 +74,7 @@ RedmineApp::Application.routes.draw do
resources :shixuns do
member do
get 'copy'
get 'game_webssh'
get 'shixun_test'
get 'delete_shixun_test'

View File

@ -0,0 +1,8 @@
class ModifyTypeOfSubjectForChallengeChooses < ActiveRecord::Migration
def up
change_column :challenge_chooses, :subject, :text
end
def down
end
end

View File

@ -0,0 +1,8 @@
class ModifyPositionTypeForChallengeChoose < ActiveRecord::Migration
def up
change_column :challenge_chooses, :position, :integer
end
def down
end
end

View File

@ -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)

View File

@ -29,6 +29,20 @@ namespace :homework_publishtime do
name = homework.name
name_str = name + "的作品提交"
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
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 += ","
@ -36,14 +50,16 @@ namespace :homework_publishtime do
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
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|

View File

@ -158,7 +158,7 @@ function add_new_group(id){
'<div class="task_popup_con clearfix">' +
'<div class="pt20 clearfix mb20" style="width:400px;">' +
'<label class="panel-form-label label fl">分班名称&nbsp;&nbsp;&nbsp;&nbsp;</label>' +
'<input type="text" name="group_name" id="new_group_name" style="width:300px;" maxlength="20" class="pl10 task task-height-40 panel-box-sizing fl color-grey">' +
'<input type="text" name="group_name" id="new_group_name" style="width:300px;" placeholder="示例:分班" maxlength="20" class="pl10 task task-height-40 panel-box-sizing fl color-grey3">' +
'<div class="cl"></div>' +
'<span class="color-orange fl none" id="add_new_group_notice" style="margin-left:22.5%;"><i class="fa fa-exclamation-circle mr5" ></i>该分班已存在</span></div>' +
'<a href="javascript:void(0);" class="task-btn task-btn-blue fr mr20" onclick="submit_new_group_form('+id+');">确定</a>' +

View File

@ -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;
}
@ -360,14 +361,14 @@ function setupAjaxIndicatorBase() {
}
function match_specific_symbol(str){
str = str.replace(/ /g, "<span class=\"empty\"></span>").replace(/\r\n$/, "<i class=\"fa fa-level-down color-grey font-16\" aria-hidden=\"true\"></i>").replace(/\n$/, "<i class=\"fa fa-level-down color-grey font-16\" aria-hidden=\"true\"></i>").replace(/\r\n/g, "<br>").replace(/\n/g, "<br>").replace(/\t/g, "<span class=\"tab-key\"><i class=\"fa fa-long-arrow-right color-grey3\" aria-hidden=\"true\"></i></span>")
str = str.replace(/ /g, "<span class=\"empty\"></span>").replace(/\r\n$/, "<i class=\"fa fa-level-down color-grey font-16\" aria-hidden=\"true\"></i>").replace(/\n$/, "<i class=\"fa fa-level-down color-grey font-16\" aria-hidden=\"true\"></i>").replace(/\r$/, "<i class=\"fa fa-level-down color-grey font-16\" aria-hidden=\"true\"></i>").replace(/\r\n/g, "<br>").replace(/\n/g, "<br>").replace(/\r/g, "<br>").replace(/\t/g, "<span class=\"tab-key\"><i class=\"fa fa-long-arrow-right color-grey3\" aria-hidden=\"true\"></i></span>")
return 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=\"color-light-green\" id=\"grade_value\">+ " + gold + "</span>" +
"</li>" +
"</ul>" +
"</div>" +

View File

@ -235,6 +235,7 @@ a.edu-txt-w140,.edu-txt-w140{ width:141px; display: inline-block;}
a.edu-txt-w100,.edu-txt-w100{ width:100px; display: inline-block;}
.edu-txt-w50{ width:50px;}
.edu-w245{ width: 245px; }
.overellipsis{overflow: hidden;white-space: nowrap;text-overflow: ellipsis;}
/* 筛选按钮 */
.edu-btn-search{ position: absolute; top:0; right:15px;}
.edu-bg-light-blue{ background:#f7f9fd; padding:5px;}
@ -247,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;}
@ -326,6 +328,12 @@ html>body #ajax-indicator { position: fixed; }
}
/*----------------------列表结构*/
.forum_table .forum_table_item:nth-child(odd){background: #fafbfb}
.forum_table_item{padding: 10px 15px;display: flex;}
.forum_table_item .item_name{color: #333}
.forum_table_item .item_name:hover{color: #FF7500}
.edu-bg{ background:#fff;}
/*---------tab切换-----*/

View File

@ -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;}

View File

@ -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;}

View File

@ -93,7 +93,7 @@ a.task-header-name{ max-width:200px;}
.panel-form{margin:0 30px; padding:30px 0; }.panel-form li{ margin-bottom:20px; font-size: 14px; color:#666;}
.panel-form-label{ display:inline-block; width:10%; min-width:90px; text-align:right; line-height:40px; }
.panel-form-label{ display:inline-block; width:10%; min-width:90px; text-align:right; line-height:40px; color: #666;}
.panel-form-label1{ display:inline-block; width:20%; min-width:90px; text-align:right; line-height:40px; }
.panel-form input,.panel-form textarea{ border:1px solid #e2e2e2;color:#666;line-height: 1.9;}
.panel-box-sizing{-moz-box-sizing: border-box; /*Firefox3.5+*/-webkit-box-sizing: border-box; /*Safari3.2+*/-o-box-sizing: border-box; /*Opera9.6*/-ms-box-sizing: border-box; /*IE8*/box-sizing: border-box; }
@ -380,7 +380,7 @@ a.shixun-task-ban-btn{background-color: #c2c4c6;display: inline-block;font-weigh
/*模拟实战---加载等待*/
.loading_all{background:#ffffff;z-index: 100000;width: 100%;height: 100%;position: fixed;left: 0px;top:0px;text-align: center;display: none;}
.loading_all{background:#ffffff;z-index: 100000;width: 100%;height: 100%;position: fixed;left: 0px;top:0px;text-align: center;}
.loading_main img{border-radius: 4px;}
.loading_main span{font-size: 44px;font-weight: bold;color: #ff7500;letter-spacing: 5px;margin-left: 5px;}
.load{width: auto;top:50%;margin-top:-100px;position: relative;}

View File

@ -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;}