Merge branch 'dev_aliyun' into develop

dev_hjm
daiao 6 years ago
commit 2549b80e53

@ -354,7 +354,7 @@ class ApplicationController < ActionController::Base
logger.info("--uri_exec: .....res is #{res}") logger.info("--uri_exec: .....res is #{res}")
JSON.parse(res) JSON.parse(res)
rescue Exception => e rescue Exception => e
uid_logger("--uri_exec: exception #{e.message}") uid_logger_error("--uri_exec: exception #{e.message}")
raise Educoder::TipException.new("实训平台繁忙繁忙等级84") raise Educoder::TipException.new("实训平台繁忙繁忙等级84")
end end
end end

@ -1,7 +1,6 @@
class Challenge < ApplicationRecord class Challenge < ApplicationRecord
# difficulty: 关卡难度: 1.简单 2.中等 3.困难 # difficulty: 关卡难度: 1.简单 2.中等 3.困难
# show_type: 效果展示:-1.无效果 1.图片 2.apk/exe 3.txt 4.html 5.mp3 6.mp4 # show_type: 效果展示:-1.无效果 1.图片 2.apk/exe 3.txt 4.html 5.mp3 6.mp4
default_scope { order("challenges.position asc") }
belongs_to :shixun, :touch => true, counter_cache: true belongs_to :shixun, :touch => true, counter_cache: true
belongs_to :user belongs_to :user

@ -5,7 +5,7 @@ class Shixun < ApplicationRecord
# hide_code 隐藏代码窗口 # hide_code 隐藏代码窗口
# code_hidden: 隐藏代码目录 # code_hidden: 隐藏代码目录
# task_pass: 跳关 # task_pass: 跳关
has_many :challenges, dependent: :destroy has_many :challenges, -> {order("challenges.position asc")}, dependent: :destroy
has_many :challenge_tags, through: :challenges has_many :challenge_tags, through: :challenges
has_many :myshixuns, :dependent => :destroy has_many :myshixuns, :dependent => :destroy
has_many :shixun_members, dependent: :destroy has_many :shixun_members, dependent: :destroy

@ -103,14 +103,14 @@ class NullDisplay extends Component{
</div> */} </div> */}
<div className="options"> <div className="options">
{ {
standard_answer.map((answers, index) => { standard_answer.map((answers, _index) => {
return <div className="df answerRow" key={index}> return <div className="df answerRow" key={_index}>
<span className="lineh-40">答案填空{index+1}</span> <span className="lineh-40">答案填空{_index+1}</span>
<div className="answers"> <div className="answers">
{ answers.answer_text.map((item, itemIndex) => { { answers.answer_text.map((item, itemIndex) => {
return <MarkdownToHtml return <MarkdownToHtml
className="answer" key={itemIndex} className="answer" key={itemIndex}
content={item} selector={'null_' + (index + 1) + '' + (itemIndex + 1)} content={item} selector={'null_' + (index + 1) + (_index + 1) + (itemIndex + 1)}
></MarkdownToHtml> ></MarkdownToHtml>
})} })}
{/* <span className="answer" key={itemIndex}>{item}</span> */} {/* <span className="answer" key={itemIndex}>{item}</span> */}

@ -554,9 +554,9 @@ class CoursesNew extends Component {
{getFieldDecorator("period", {getFieldDecorator("period",
{ {
rules:[{ rules:[{
required:true, required:false,
pattern: new RegExp(/^[0-9]\d*$/, "g"), pattern: new RegExp(/^[0-9]\d*$/, "g"),
message: '不能小于0' message: ''
}], }],
getValueFromEvent: (event) => { getValueFromEvent: (event) => {
return event.target.value.replace(/\D/g,'') return event.target.value.replace(/\D/g,'')
@ -573,9 +573,9 @@ class CoursesNew extends Component {
{getFieldDecorator("credit", {getFieldDecorator("credit",
{ {
rules:[{ rules:[{
required:true, required:false,
pattern: new RegExp(/^[0-9]\d*$/, "g"), pattern: new RegExp(/^[0-9]\d*$/, "g"),
message: '不能小于0' message: ''
}], }],
getValueFromEvent: (event) => { getValueFromEvent: (event) => {
return event.target.value.replace(/\D/g,'') return event.target.value.replace(/\D/g,'')

Loading…
Cancel
Save