Merge branch 'educoder' of http://bdgit.educoder.net/Hjqreturn/pgfqe6ch8 into educoder

dev_local
jingquan huang 6 years ago
commit ef0ffc1295

@ -508,7 +508,7 @@ class StudentWorkController < ApplicationController
end end
@tab = params[:tab].nil? ? 1 : params[:tab].to_i @tab = params[:tab].nil? ? 1 : params[:tab].to_i
if User.current.member_of_course?(@homework.course) && params[:order].nil? && params[:sort].nil? && params[:name].nil? && params[:group].nil? && params[:page].nil? if (User.current.member_of_course?(@homework.course) || User.current.admin?) && params[:order].nil? && params[:sort].nil? && params[:name].nil? && params[:group].nil? && params[:page].nil?
if !@course.is_end && @homework.homework_type == 4 && @homework.homework_detail_manual.comment_status > 0 && (@homework.end_time > Time.now || (@homework.end_time <= Time.now && @homework.allow_late)) if !@course.is_end && @homework.homework_type == 4 && @homework.homework_detail_manual.comment_status > 0 && (@homework.end_time > Time.now || (@homework.end_time <= Time.now && @homework.allow_late))
update_shixun_work_status @homework update_shixun_work_status @homework
end end

@ -4340,7 +4340,7 @@ module ApplicationHelper
candown = (attachment.is_public == 1 || attachment.is_public == true) candown = (attachment.is_public == 1 || attachment.is_public == true)
end end
else else
if attachment.container_type == "MarkDown" || attachment.container_type == "Shixun" || attachment.container_type == "Memo" || attachment.container_type == "Career" || attachment.container_type == "Exercise" || attachment.container_type == "ExerciseBank" if attachment.container_type == "MarkDown" || attachment.container_type.nil? || attachment.container_type == 'Subject' || attachment.container_type == "Shixun" || attachment.container_type == "Memo" || attachment.container_type == "Career" || attachment.container_type == "Exercise" || attachment.container_type == "ExerciseBank"
candown = true candown = true
end end
end end

@ -78,7 +78,7 @@
placeholder: "请在此输入实训课程的简介", placeholder: "请在此输入实训课程的简介",
imageUpload : true, imageUpload : true,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => @subject.class) %>" //url imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => 'MarkDown') %>" //url
}); });
md_elocalStorage(shixun_editormd, "subject_desc_<%= User.current.id %>", "desc"); md_elocalStorage(shixun_editormd, "subject_desc_<%= User.current.id %>", "desc");
/* --------------------------------- 学习须知 -------------------------------------- */ /* --------------------------------- 学习须知 -------------------------------------- */
@ -106,7 +106,7 @@
placeholder: "请在此输入实训课程的学习须知", placeholder: "请在此输入实训课程的学习须知",
imageUpload : true, imageUpload : true,
imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"], imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp", "JPG", "JPEG", "GIF", "PNG", "BMP", "WEBP"],
imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => @subject.class) %>" //url imageUploadURL : "<%= upload_with_markdown_path(:container_id => @subject.id, :container_type => 'MarkDown') %>" //url
}); });
md_elocalStorage(shixun_propaedeutics, "subject_notes_<%= User.current.id %>", "notes"); md_elocalStorage(shixun_propaedeutics, "subject_notes_<%= User.current.id %>", "notes");

@ -25,6 +25,8 @@ class CreateShixunStudentWorks < ActiveRecord::Migration
begin begin
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
if shixun.present? && user.present? if shixun.present? && user.present?
myshixun = Myshixun.where(:user_id => user.id, :shixun_id => shixun.id).first
if myshixun.blank?
# 创建新的myshixun和games # 创建新的myshixun和games
# fork版本库如果用户没有同步则先同步用户 # fork版本库如果用户没有同步则先同步用户
g = Gitlab.client g = Gitlab.client
@ -69,6 +71,7 @@ class CreateShixunStudentWorks < ActiveRecord::Migration
Game.create!(:challenge_id => challenge.id, :myshixun_id => myshixun.id, :status => status, :user_id => myshixun.user_id, Game.create!(:challenge_id => challenge.id, :myshixun_id => myshixun.id, :status => status, :user_id => myshixun.user_id,
:open_time => Time.now, :identifier => code, :modify_time => challenge.modify_time) :open_time => Time.now, :identifier => code, :modify_time => challenge.modify_time)
end end
end
work_score = work.final_score work_score = work.final_score
work.homework_common.homework_challenge_settings.each do |setting| work.homework_common.homework_challenge_settings.each do |setting|
if work_score > 1 if work_score > 1
@ -78,6 +81,8 @@ class CreateShixunStudentWorks < ActiveRecord::Migration
end end
end end
work.update_column("myshixun_id", myshixun.id) work.update_column("myshixun_id", myshixun.id)
else
work.update_attributes(:myshixun_id => 0, :work_status => 0)
end end
end end
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 293 KiB

Loading…
Cancel
Save