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

yslnewtiku
杨树林 5 years ago
commit d478fb416f

@ -188,10 +188,13 @@ class HacksController < ApplicationController
def param_update_sets sets, all_sets_id def param_update_sets sets, all_sets_id
delete_set_ids = all_sets_id - sets.map{|set|set[:id]} delete_set_ids = all_sets_id - sets.map{|set|set[:id]}
@hack.hack_sets.where(id: delete_set_ids).destroy_all @hack.hack_sets.where(id: delete_set_ids).destroy_all
logger.info("#######sets:#{sets}")
sets.each do |set| sets.each do |set|
logger.info("###set[:id] #{set[:id]}")
logger.info("###all_sets #{all_sets_id.include?(set[:id])}")
if all_sets_id.include?(set[:id]) if all_sets_id.include?(set[:id])
update_attrs = {input: set[:input], output: set[:output], position: set[:position]} update_attrs = {input: set[:input], output: set[:output], position: set[:position]}
@hack.hack_sets.find_by!(id: set[:id]).update_attributes(update_attrs) @hack.hack_sets.find_by!(id: set[:id]).update_attributes!(update_attrs)
end end
end end
end end

@ -33,7 +33,7 @@ module GradeDecorator
game.present? ? "查看实训“#{game.challenge.shixun.name}”第#{game.challenge.position}关的TA人解答消耗的金币" : '' game.present? ? "查看实训“#{game.challenge.shixun.name}”第#{game.challenge.position}关的TA人解答消耗的金币" : ''
when 'hack' then when 'hack' then
hack = Hack.find_by(id: container_id) hack = Hack.find_by(id: container_id)
game.present? ? "完成了题目解答“#{hack.name}”,获得金币奖励:#{hack.score}" : '' hack.present? ? "完成了题目解答“#{hack.name}”,获得金币奖励:#{hack.score}" : ''
end end
end end
end end

@ -226,7 +226,7 @@ module TidingDecorator
end end
def discuss_content def discuss_content
I18n.t(locale_format(container_type, container.parent_id.present?)) % message_content_helper(container.content) I18n.t(locale_format(parent_container_type, container.parent_id.present?)) % message_content_helper(container.content)
end end
def grade_content def grade_content

@ -108,7 +108,7 @@
Issue_end: "赞了你发布的项目Issue%s" Issue_end: "赞了你发布的项目Issue%s"
Journal_end: "赞了你的回复%s" Journal_end: "赞了你的回复%s"
Discuss: Discuss:
Shixun: Challenge:
true_end: "评论了你的回复:%s" true_end: "评论了你的回复:%s"
false_end: "评论了你发布的实训:%s" false_end: "评论了你发布的实训:%s"
Hack: Hack:

@ -219,7 +219,7 @@ class Challengesjupyter extends Component {
modifyjupyter=()=>{ modifyjupyter=()=>{
// this.props.showNotification('实训正在保存中...!'); // this.props.showNotification('实训正在保存中...!');
setTimeout(() => {
let id=this.props.match.params.shixunId; let id=this.props.match.params.shixunId;
var jupyter_port=""; var jupyter_port="";
try{ try{
@ -257,8 +257,10 @@ class Challengesjupyter extends Component {
}) })
this.props.showNotification('实训保存失败!'); this.props.showNotification('实训保存失败!');
}) })
}, 500)
} }
opentitle=()=>{ opentitle=()=>{
this.setState({ this.setState({
opentitletype:!this.state.opentitletype opentitletype:!this.state.opentitletype
@ -577,7 +579,7 @@ class Challengesjupyter extends Component {
<p className="challenbaocuntest" type="upload" >导入</p> <p className="challenbaocuntest" type="upload" >导入</p>
</div> </div>
</Upload> </Upload>
{/*<button type="button" className="ant-btn deletebuttom chongzhistyles" onClick={this.handleClickResetTpi}><span>重置实训</span></button>*/} {/*<button type="button" className="ant-btn deletebuttom chongzhistyles" onClick={this.handleClickResetTpi}><span>重置环境</span></button>*/}
</div> </div>

@ -174,7 +174,7 @@ export const changeGetJupyterUrlState = (status) => {
// 保存 jupyter tpi // 保存 jupyter tpi
export const saveJupyterTpi = () => { export const saveJupyterTpi = () => {
return (dispatch, getState) => { return (dispatch, getState) => {
setTimeout(() => {
const { jupyter_tpi_code, jupyter_info }= getState().jupyterReducer; const { jupyter_tpi_code, jupyter_info }= getState().jupyterReducer;
// console.log(jupyter_info.myshixun_identifier, jupyter_tpi_code); // console.log(jupyter_info.myshixun_identifier, jupyter_tpi_code);
if (!jupyter_info.myshixun_identifier) return; if (!jupyter_info.myshixun_identifier) return;
@ -182,7 +182,7 @@ export const saveJupyterTpi = () => {
identifier: jupyter_info.myshixun_identifier, identifier: jupyter_info.myshixun_identifier,
jupyter_port: jupyter_tpi_code jupyter_port: jupyter_tpi_code
}; };
console.log(params);
fetchSaveJupyterTpi(params).then(res => { fetchSaveJupyterTpi(params).then(res => {
dispatch({ dispatch({
type: types.LOADING_STATUS, type: types.LOADING_STATUS,
@ -200,6 +200,8 @@ export const saveJupyterTpi = () => {
payload: false payload: false
}); });
}); });
}, 500)
} }
} }
// 改变当前页数 // 改变当前页数

Loading…
Cancel
Save