Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_aliyun_beta
杨树林 6 years ago
commit 9af1392f66

@ -47,6 +47,7 @@ module GitCommon
def add_file
@path, message, content = params[:path].strip, params[:message], params[:content]
author_name, author_email = current_user.real_name, current_user.git_mail
Rails.logger.info(" good repo_name is #{@repo_path}")
@content = GitService.update_file(repo_path: @repo_path,
file_path: @path,
message: message,

@ -11,7 +11,12 @@ class HomeworkBanksController < ApplicationController
def update
ActiveRecord::Base.transaction do
@bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer])
if @bank.homework_type == 1
@bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer])
elsif @bank.homework_type == 3
@bank.update_attributes(name: params[:name], description: params[:description], reference_answer: params[:reference_answer],
base_on_project: params[:base_on_project], min_num: params[:min_num], max_num: params[:max_num])
end
# 作业描述的附件
Attachment.associate_container(params[:attachment_ids], @bank.id, @bank.class) if params[:attachment_ids]

@ -19,7 +19,7 @@ if @type == "image"
end
elsif @type == "html"
json.iframe_src File.read("#{@user_path}/#{@user_picture[0]}")&.html_safe
json.iframe_src File.read("#{@user_path}/#{@user_picture[0]}")&.html_safe if @user_picture[0].present?
elsif @type == "txt"
json.contents @contents.to_s
elsif @type =="qrcode"

@ -0,0 +1,5 @@
class AddTagToLibraries < ActiveRecord::Migration[5.2]
def change
execute "insert into library_tags(name) values('企业案例')"
end
end

@ -21,7 +21,7 @@ class EvaluateSuccessEffectDisplay extends Component {
componentDidMount() {
if (this.props.type == 'html') {
const iframe = document.getElementById('_displayIframe')
if (iframe && iframe.contentWindow) {
if (iframe && iframe.contentWindow && this.props.iframe_src) {
iframe.contentWindow.open()
iframe.contentWindow.document.write(this.props.iframe_src);
iframe.contentWindow.document.close();

Loading…
Cancel
Save