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

dev_forum
cxt 5 years ago
commit 25bf4affe2

@ -556,10 +556,19 @@ class GamesController < ApplicationController
msg = @game.run_code_message msg = @game.run_code_message
msg.update_attributes(:status => 0, :message => nil) if msg.present? msg.update_attributes(:status => 0, :message => nil) if msg.present?
# 更新时间是为了TPM端显示的更新退出实训及访问实训的时候会更新 # 更新时间是为了TPM端显示的更新退出实训及访问实训的时候会更新如果版本库地址不存在重新去版本库中找
@myshixun.update_column(:updated_at, Time.now) myshixuns_update =
if @myshixun.repo_name.nil?
g = Gitlab.client
repo_name = g.project(@myshixun.gpid).path_with_namespace
{repo_name: repo_name}
else
{updated_at: Time.now}
end
logger.info("#############myshixuns_update: ##{myshixuns_update}")
@myshixun.update_attributes!(myshixuns_update)
gitUrl = repo_ip_url @myshixun.repo_path gitUrl = repo_ip_url @myshixun.repo_path
logger.info("#############giturl: ##{gitUrl}") logger.info("#############giturl: ##{gitUrl}")
gitUrl = Base64.urlsafe_encode64(gitUrl) gitUrl = Base64.urlsafe_encode64(gitUrl)

@ -54,7 +54,7 @@ class SingleDisplay extends Component{
} }
render() { render() {
let { question_title, question_score, question_type, question_choices, standard_answer, let { question_title, question_score, question_type, question_choices, standard_answer,
question_id, question_number, index, displayCount question_id, question_number, index, displayCount, showActionButton
} = this.props; } = this.props;
// const { getFieldDecorator } = this.props.form; // const { getFieldDecorator } = this.props.form;
@ -70,6 +70,9 @@ class SingleDisplay extends Component{
// const answerTagArray = standard_answer.map((item, index) => { return item == true ? tagArray[index] : -1 }).filter(item => item != -1); // const answerTagArray = standard_answer.map((item, index) => { return item == true ? tagArray[index] : -1 }).filter(item => item != -1);
let length = 5; let length = 5;
const qName = qNameArray[question_type] const qName = qNameArray[question_type]
const isPreviewPage = showActionButton == false
return( return(
<div className="bor-bottom-greyE padding20-30 singleDisplay" id={qNumber} _id={question_id}> <div className="bor-bottom-greyE padding20-30 singleDisplay" id={qNumber} _id={question_id}>
<style>{` <style>{`
@ -89,20 +92,24 @@ class SingleDisplay extends Component{
{/* 单选 or 多选 */} {/* 单选 or 多选 */}
<div className="options"> <div className="options">
{ question_choices.map((item, optionIndex) => { { question_choices.map((item, optionIndex) => {
let prefix = undefined
if (!isPreviewPage) {
prefix = `${tagArray[optionIndex]}.`
}
if (question_type == 0) { // 单选 if (question_type == 0) { // 单选
return ( return (
<div className="mb10 clearfix" key={optionIndex}> <div className="mb10 clearfix" key={optionIndex}>
<Radio disabled className="fl lineh-20" checked={item.standard_boolean}></Radio> <Radio disabled className="fl lineh-20" checked={item.standard_boolean}>{prefix}</Radio>
<span style={{ display: 'inline-block'}} className="markdown-body fl" <span style={{ display: 'inline-block'}} className="markdown-body fl"
dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span> dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
</div>) </div>)
} else { } else {
return ( return (
<div className="mb10 clearfix" key={optionIndex}> <div className="mb10 clearfix" key={optionIndex}>
<Checkbox disabled className="fl lineh-20" checked={item.standard_boolean}></Checkbox> <Checkbox disabled className="fl lineh-20" checked={item.standard_boolean}>{prefix}</Checkbox>
<span style={{ display: 'inline-block'}} className="markdown-body fl" <span style={{ display: 'inline-block'}} className="markdown-body fl"
dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span> dangerouslySetInnerHTML={{__html: markdownToHTML(item.choice_text)}}></span>
</div>) </div>)
} }
})} })}

Loading…
Cancel
Save