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

chromesetting
daiao 5 years ago
commit f45fcdcacd

@ -10,7 +10,7 @@ class ShixunsController < ApplicationController
before_action :find_shixun, except: [:index, :new, :create, :menus, :get_recommend_shixuns, before_action :find_shixun, except: [:index, :new, :create, :menus, :get_recommend_shixuns,
:propaedeutics, :departments, :apply_shixun_mirror, :propaedeutics, :departments, :apply_shixun_mirror,
:get_mirror_script, :download_file, :shixun_list] :get_mirror_script, :download_file, :shixun_list, :batch_send_to_course]
before_action :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns, before_action :shixun_access_allowed, except: [:index, :new, :create, :menus, :get_recommend_shixuns,
:propaedeutics, :departments, :apply_shixun_mirror, :propaedeutics, :departments, :apply_shixun_mirror,
@ -990,6 +990,16 @@ class ShixunsController < ApplicationController
CreateStudentWorkJob.perform_later(homework.id) CreateStudentWorkJob.perform_later(homework.id)
end end
# 批量发送
def batch_send_to_course
@course = Course.find_by!(id: params[:course_id])
shixuns = Shixun.where(id: params[:shixun_ids]).unhidden
shixuns.each do |shixun|
homework = HomeworksService.new.create_homework shixun, @course, nil, current_user
CreateStudentWorkJob.perform_later(homework.id)
end
end
# 二维码扫描下载 # 二维码扫描下载
def download_file def download_file
file_path = params[:file_name] file_path = params[:file_name]

@ -0,0 +1,4 @@
json.status 1
json.message "发送成功"
json.course_id @course.id
json.first_category_url module_url(@course.none_hidden_course_modules.first, @course)

@ -224,6 +224,7 @@ Rails.application.routes.draw do
post :apply_shixun_mirror post :apply_shixun_mirror
get :download_file get :download_file
get :shixun_lists get :shixun_lists
post :batch_send_to_course
end end
member do member do

@ -127,11 +127,12 @@
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}], }],
cancel : [lang.buttons.cancel, function() { cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}] }]
} }

@ -127,11 +127,13 @@
enter : [lang.buttons.enter, function() { enter : [lang.buttons.enter, function() {
cm.replaceSelection(selecteds.join(" ")); cm.replaceSelection(selecteds.join(" "));
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}], }],
cancel : [lang.buttons.cancel, function() { cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}] }]

@ -107,12 +107,14 @@
_this.gotoLine(line); _this.gotoLine(line);
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}], }],
cancel : [lang.buttons.cancel, function() { cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}] }]

@ -19,6 +19,7 @@
exports.fn.helpDialog = function() { exports.fn.helpDialog = function() {
var _this = this; var _this = this;
var lang = this.lang; var lang = this.lang;
var cm = this.cm;
var editor = this.editor; var editor = this.editor;
var settings = this.settings; var settings = this.settings;
var path = settings.pluginPath + pluginName + "/"; var path = settings.pluginPath + pluginName + "/";
@ -46,6 +47,7 @@
buttons : { buttons : {
close : [lang.buttons.close, function() { close : [lang.buttons.close, function() {
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}] }]

@ -71,12 +71,12 @@
enter : [lang.buttons.enter, function() { enter : [lang.buttons.enter, function() {
cm.replaceSelection(selecteds.join(" ")); cm.replaceSelection(selecteds.join(" "));
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}], }],
cancel : [lang.buttons.cancel, function() { cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}] }]
} }

@ -89,13 +89,14 @@
cm.replaceSelection(str); cm.replaceSelection(str);
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}], }],
cancel : [lang.buttons.cancel, function() { cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}] }]
} }

@ -82,11 +82,13 @@
cm.replaceSelection(codeTexts); cm.replaceSelection(codeTexts);
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}], }],
cancel : [lang.buttons.cancel, function() { cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}] }]

@ -98,11 +98,13 @@
cm.setValue(cm.getValue() + "\n[" + rid + "]: " + url + title + ""); cm.setValue(cm.getValue() + "\n[" + rid + "]: " + url + title + "");
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}], }],
cancel : [lang.buttons.cancel, function() { cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}] }]

@ -154,12 +154,14 @@
cm.replaceSelection(table); cm.replaceSelection(table);
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}], }],
cancel : [lang.buttons.cancel, function() { cancel : [lang.buttons.cancel, function() {
this.hide().lockScreen(false).hideMask(); this.hide().lockScreen(false).hideMask();
cm.focus && cm.focus();
return false; return false;
}] }]

Binary file not shown.

After

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

@ -62,7 +62,7 @@ class Addshixuns extends Component {
<Modal <Modal
className={this.props.className} className={this.props.className}
keyboard={false} keyboard={false}
title="添加实训项目" title="新建实训项目"
visible={this.props.Addshixunstype===undefined?false:this.props.Addshixunstype} visible={this.props.Addshixunstype===undefined?false:this.props.Addshixunstype}
closable={false} closable={false}
footer={null} footer={null}

@ -429,17 +429,16 @@ class DetailCardsEditAndAdd extends Component{
</div> </div>
<p className="clearfix mb10"> <p className="clearfix mb10">
<a onClick={()=>this.AddShixunBox()} className="fl defalutGreyBorder color-grey-6 ml37"> <a onClick={()=>this.Addshixuns()} className="fl defalutGreyBorder color-grey-6 ml37">
<i className="iconfont icon-tianjiafangda fl mr5"></i> <i className="iconfont icon-tianjiafangda fl mr5"></i>
选用实训项目</a> 新建实训项目</a>
<span id="sx_notice" className="fl ml20 color-grey-9 mt5">选择下面实训后可以通过拖拽进行排序调整</span>
</p> </p>
<p className="clearfix mb30"> <p className="clearfix mb30">
<a onClick={()=>this.Addshixuns()} className="fl defalutGreyBorder color-grey-6 ml37"> <a onClick={()=>this.AddShixunBox()} className="fl defalutGreyBorder color-grey-6 ml37">
<i className="iconfont icon-tianjiafangda fl mr5"></i> <i className="iconfont icon-tianjiafangda fl mr5"></i>
添加实训项目</a> 选用实训项目</a>
<span id="sx_notice" className="fl ml20 color-grey-9 mt5">您只需输入实训名称即可完成实训项目的添加进入实训详情后可进行具体配置操作</span> <span id="sx_notice" className="fl ml20 color-grey-9 mt5">选择下面实训后可以通过拖拽进行排序调整</span>
</p> </p>
{selectShixun===true?<style> {selectShixun===true?<style>

@ -430,17 +430,16 @@ class DetailCardsEditAndEdit extends Component{
</div> </div>
<p className="clearfix mb10"> <p className="clearfix mb10">
<a onClick={this.AddShixunBox} className="fl defalutGreyBorder color-grey-6 ml37"> <a onClick={this.Addshixuns} className="fl defalutGreyBorder color-grey-6 ml37">
<i className="iconfont icon-tianjiafangda fl mr5"></i> <i className="iconfont icon-tianjiafangda fl mr5"></i>
</a> </a>
<span id="sx_notice" className="fl ml20 color-grey-9 mt5">选择下面实训后可以通过拖拽进行排序调整</span>
</p> </p>
<p className="clearfix mb30"> <p className="clearfix mb30">
<a onClick={this.Addshixuns} className="fl defalutGreyBorder color-grey-6 ml37"> <a onClick={this.AddShixunBox} className="fl defalutGreyBorder color-grey-6 ml37">
<i className="iconfont icon-tianjiafangda fl mr5"></i> <i className="iconfont icon-tianjiafangda fl mr5"></i>
</a> </a>
<span id="sx_notice" className="fl ml20 color-grey-9 mt5">您只需输入实训名称即可完成实训项目的添加进入实训详情后可进行具体配置操作</span> <span id="sx_notice" className="fl ml20 color-grey-9 mt5">选择下面实训后可以通过拖拽进行排序调整</span>
</p> </p>
{selectShixun===true?<style> {selectShixun===true?<style>

Loading…
Cancel
Save