Merge branches 'dev_Ysm' and 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_Ysm

dev_local_2
杨树明 6 years ago
commit f5926aaf4f

@ -33,7 +33,7 @@ class AccountsController < ApplicationController
uid_logger("start register: verifi_code is #{verifi_code}, code is #{code}, time is #{Time.now.to_i - verifi_code.try(:created_at).to_i}")
# check_code = (verifi_code.try(:code) == code.strip && (Time.now.to_i - verifi_code.created_at.to_i) <= 10*60)
# todo 上线前请删除万能验证码"513231"
unless code == "513231" && request.host == "47.96.87.25"
unless code == "513231" && request.subdomain == "pre-newweb"
return normal_status(-2, "验证码不正确") if verifi_code.try(:code) != code.strip
return normal_status(-2, "验证码已失效") if !verifi_code&.effective?
end

@ -245,7 +245,8 @@ class ApplicationController < ActionController::Base
# 测试版前端需求
if request.host == "47.96.87.25"
logger.info("subdomain:#{request.subdomain}")
if request.subdomain == "pre-newweb"
if params[:debug] == 'teacher' #todo 为了测试,记得讲debug删除
User.current = User.find 81403
elsif params[:debug] == 'student'

@ -34,8 +34,7 @@ module GitHelper
rescue Exception => e
Rails.logger.error(e.message)
Rails.logger.error("#####__________文档内容获取异常")
# raise Educoder::TipException.new("文档内容获取异常")
raise Educoder::TipException.new("文档内容获取异常")
end
end

@ -484,7 +484,11 @@ module ExercisesHelper
game_code = game_challenge
code = game_code.try(:new_code)
else
code = git_fle_content(game.myshixun.repo_path,cha_path)
begin
code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
code = ""
end
end
end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里

@ -37,25 +37,25 @@ module HomeworkCommonsHelper
when 3
if ho_detail_manual.evaluation_end && ho_detail_manual.evaluation_end > Time.now
status << "匿评中"
time = how_much_time(ho_detail_manual.evaluation_end)
time = "提交剩余时间:" + how_much_time(ho_detail_manual.evaluation_end)
time_status = 3
end
when 4
if ho_detail_manual.appeal_time && ho_detail_manual.appeal_time > Time.now
status << "申诉中"
time = how_much_time(ho_detail_manual.appeal_time)
time = "申诉剩余时间:" + how_much_time(ho_detail_manual.appeal_time)
time_status = 4
end
when 2, 5, 6
status << "评阅中"
time = course.end_date.present? ? how_much_time(course.end_date.end_of_day) : ""
time = "评阅剩余时间:" + (course.end_date.present? ? how_much_time(course.end_date.end_of_day) : "")
time_status = 5
end
# 如果还在补交阶段则显示补交结束时间
if homework_common.end_time && homework_common.end_time < Time.now && homework_common.allow_late &&
homework_common.late_time && homework_common.late_time > Time.now
time = how_much_time(homework_common.late_time)
time = "补交剩余时间:" + how_much_time(homework_common.late_time)
time_status = 2
end
else
@ -74,12 +74,12 @@ module HomeworkCommonsHelper
when 1
if homework_common.end_time && homework_common.end_time >= Time.now
status << "提交中"
time = how_much_time(homework_common.end_time)
time = "提交剩余时间:" + how_much_time(homework_common.end_time)
time_status = 1
elsif homework_common.end_time && homework_common.end_time < Time.now
time_status = 5
if homework_common.allow_late && (homework_common.late_time.nil? || homework_common.late_time >= Time.now)
time = how_much_time(homework_common.late_time)
time = "补交剩余时间:" + how_much_time(homework_common.late_time)
time_status = 2
end
status << "评阅中"
@ -114,11 +114,11 @@ module HomeworkCommonsHelper
time_status = 0
elsif max_end_time.present? && max_end_time > Time.now #6.14 -hs 添加present?
status << "提交中"
time = how_much_time(max_end_time)
time = "提交剩余时间:" + how_much_time(max_end_time)
time_status = 1
elsif homework_common.allow_late && (homework_common.late_time.nil? || homework_common.late_time >= Time.now)
status << "评阅中"
time = how_much_time(homework_common.late_time)
time = "补交剩余时间:" + how_much_time(homework_common.late_time)
time_status = 2
else
status << "评阅中"

@ -68,23 +68,18 @@ class HomeworkCommon < ApplicationRecord
def category_info
case self.homework_type
when 'normal'
{category_id: course.common_course_modules.first.try(:id), category_name: course.common_course_modules.first.try(:module_name)}
{category_id: course.common_course_modules.first.try(:id), category_name: course.common_course_modules.first.try(:module_name), main: 1}
when 'group'
{category_id: course.group_course_modules.first.try(:id), category_name: course.group_course_modules.first.try(:module_name)}
{category_id: course.group_course_modules.first.try(:id), category_name: course.group_course_modules.first.try(:module_name), main: 1}
when 'practice'
if self.course_second_category.present?
{category_id: self.course_second_category.try(:id), category_name: self.course_second_category.try(:name)}
{category_id: self.course_second_category.try(:id), category_name: self.course_second_category.try(:name), main: 0}
else
{category_id: course.shixun_course_modules.take.try(:id), category_name: course.shixun_course_modules.take.try(:module_name)}
{category_id: course.shixun_course_modules.take.try(:id), category_name: course.shixun_course_modules.take.try(:module_name), main: 1}
end
end
end
# 实训作业的主目录信息
def main_category_info
{category_id: course.shixun_course_modules.take.try(:id), category_name: course.shixun_course_modules.take.try(:module_name)}
end
# 根据是否统一发布获取作业的作品列表
def all_works
student_works = self.unified_setting ? self.student_works :

@ -779,4 +779,7 @@ html>body #ajax-indicator { position: fixed; }
border-top-right-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.yslminHeigth{
min-height: 400px;
}

@ -31,8 +31,9 @@ json.shixun_detail do
if shixun_challenge.challenge&.path.present?
if game.try(:lastest_code).blank?
cha_path = challenge_path(shixun_challenge.challenge&.path)
latest_code = git_fle_content(game.myshixun.repo_path,cha_path)
if latest_code.to_s == "true"
begin
latest_code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
latest_code = ""
end
else

@ -2,7 +2,6 @@ json.course_id course.id
json.course_name course.name
json.is_end course.is_end
json.category homework.category_info
json.main_category homework.main_category_info if homework.homework_type == "practice"
member = course.course_members.find_by(user_id: user.id, is_active: 1)
curr_status = homework_curr_status(homework, user.course_identity(course), course, member, member&.teacher_course_groups)
json.homework_status curr_status[:status]

@ -1,4 +1,4 @@
class ChangeExericse1936Scores < ActiveRecord::Migration[5.2]
class RechangeExercise1936Scores < ActiveRecord::Migration[5.2]
include ExercisesHelper
def change
#1936的试卷成绩有问题。

@ -149,7 +149,12 @@ namespace :excellent_course_exercise do
game_code = game_challenge
code = game_code.try(:new_code)
else
code = git_fle_content(game.myshixun.repo_path,cha_path)
begin #8-23,hs
code = git_fle_content(game.myshixun.repo_path,cha_path)
rescue
code = ""
end
# code = git_fle_content(game.myshixun.repo_path,cha_path)
end
end
if ex_shixun_answer_content.blank? #把关卡的答案存入试卷的实训里

@ -41,10 +41,12 @@ export function initAxiosInterceptors(props) {
var proxy = "http://localhost:3000"
// proxy = "http://testbdweb.trustie.net"
// proxy = "http://testbdweb.educoder.net"
//proxy="http://47.96.87.25:48080"
proxy = "https://pre-newweb.educoder.net"
// proxy = "https://testeduplus2.educoder.net"
proxy="http://47.96.87.25:48080"
// wy
proxy="https://pre-newweb.educoder.net"
// wy
// proxy="http://192.168.2.63:3001"

@ -350,7 +350,7 @@ class BoardsNew extends Component{
}],
})(
<Input placeholder={`请输入帖子标题,最大限制${MAX_TITLE_LENGTH}个字符 `}className="searchViewAfter" maxLength={MAX_TITLE_LENGTH}
onInput={this.changeTitle} addonAfter={`${title_num}/${MAX_TITLE_LENGTH}`} />
onInput={this.changeTitle} suffix={`${title_num}/${MAX_TITLE_LENGTH}`} />
)}
</Form.Item>

@ -399,7 +399,7 @@ class NewWork extends Component{
required: true, message: '请输入标题'
}],
})(
<Input placeholder="请输入作业标题最大限制60个字符" onInput={this.changeTitle} className="searchView searchViewAfter" style={{"width":"100%"}} maxLength={MAX_TITLE_LENGTH} addonAfter={`${String(title_num)}/${MAX_TITLE_LENGTH}`}/>
<Input placeholder="请输入作业标题最大限制60个字符" onInput={this.changeTitle} className="searchView searchViewAfter" style={{"width":"100%"}} maxLength={MAX_TITLE_LENGTH} suffix={`${String(title_num)}/${MAX_TITLE_LENGTH}`}/>
)}
</Form.Item>
<style>{`

@ -450,8 +450,8 @@ class ExerciceNew extends Component{
max: 20, message: '最大限制为20个字符',
}],
})( */}
<Input placeholder={`请输入试卷标题,最大限制${TITLE_MAX_LENGTH}个字符`} maxLength={TITLE_MAX_LENGTH} className="input-100-40 mt5" value={exercise_name}
onChange={this.exercise_name_change} addonAfter={`${exercise_name ? exercise_name.length : 0}/${TITLE_MAX_LENGTH}`}
<Input placeholder={`请输入试卷标题,最大限制${TITLE_MAX_LENGTH}个字符`} maxLength={TITLE_MAX_LENGTH} className="mt5" value={exercise_name}
onChange={this.exercise_name_change} suffix={`${exercise_name ? exercise_name.length : 0}/${TITLE_MAX_LENGTH}`}
/>
{/* )} */}
</Form.Item>

@ -299,9 +299,9 @@ class Testpapersettinghomepage extends Component{
<div className="educontent mb20" style={{width:"1200px"}}>
<p className="clearfix mb20 mt10">
<a className=" btn colorgrey fl hovercolorblue " onClick={this.goback} >{this.props.coursedata.name}</a>
<Link className=" btn colorgrey fl hovercolorblue " to = {`/courses/${this.props.match.params.coursesId}`} >{this.props.coursedata.name}</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<Link className=" btn colorgrey fl hovercolorblue " to={`/courses/${this.props.match.params.coursesId}/exercises/${Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.left_banner_id}`} >试卷</Link>
<Link className=" btn colorgrey fl hovercolorblue " to={`/courses/${this.props.match.params.coursesId}/exercises/${Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.left_banner_id}`} >试卷</Link>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">试卷详情</WordsBtn>
</p>
@ -322,7 +322,7 @@ class Testpapersettinghomepage extends Component{
<CoursesListType
typelist={[`${polls_status[Commonheadofthetestpaper && Commonheadofthetestpaper.exercise_status]}`]}
/>
<a className="color-grey-6 fr font-16 summaryname mr30" onClick={this.goback}>返回</a>
<Link className="color-grey-6 fr font-16 summaryname mr30" to={`/courses/${this.props.match.params.coursesId}/exercises/${Commonheadofthetestpaper&&Commonheadofthetestpaper.user_permission.left_banner_id}`}>返回</Link>
<p className="color-grey-6 fr font-16"> </p>
</div>

@ -149,7 +149,7 @@ class Eduinforms extends Component{
</div>
:
<div className="edu-back-white ">
<div id="MakedownHTML" className={"markdown-body fonttext yslmtopcg"} style={{minHeight:"400px"}} dangerouslySetInnerHTML={{__html: markdownToHTML(description).replace(/▁/g, "▁▁▁")}}>
<div id="MakedownHTML" className={"markdown-body fonttext yslmtopcg yslminHeigth"} style={{minHeight:"400px"}} dangerouslySetInnerHTML={{__html: markdownToHTML(description).replace(/▁/g, "▁▁▁")}}>
</div>

@ -114,7 +114,7 @@ class GraduateTopicDetail extends Component{
<p className="clearfix mb20 lineh-25">
<span className="color-grey-3 font-24 fl task-hide" style={{lineHeight:"25px",maxWidth:"900px"}}>{tableData && tableData.graduation_topic_name}</span>
<span className="fl mt1" style={{height:"25px"}}><CoursesListType typelist={[`${tableData && tableData.status_name}`]} typesylename={""} /></span>
<WordsBtn className="fr font-16 mt1" style="grey" onClick={()=>this.props.history.goBack()}>返回</WordsBtn>
<WordsBtn className="fr font-16 mt1" style="grey" to={`/courses/${tableData.course_id}/graduation_topics/${tableData.graduation_id}`}>返回</WordsBtn>
</p>
<div>
<div className="clearfix edu-back-white bor-bottom-greyE" >

@ -12,6 +12,8 @@ import "../../common/formCommon.css"
import '../style.css'
import '../../css/Courses.css'
import { WordsBtn, City } from 'educoder'
import {Link} from 'react-router-dom'
// import City from './City'
// import './board.css'
@ -20,6 +22,7 @@ import { WordsBtn, City } from 'educoder'
const confirm = Modal.confirm;
const $ = window.$
const { Option } = Select;
const NAME_COUNT=60;
// 新建毕设选题
// https://lanhuapp.com/web/#/item/project/board/detail?pid=a3bcd4b1-99ce-4e43-8ead-5b8b0a410807&project_id=a3bcd4b1-99ce-4e43-8ead-5b8b0a410807&image_id=c6d9b36f-7701-4035-afdb-62404681108c
class GraduateTopicNew extends Component{
@ -38,7 +41,7 @@ class GraduateTopicNew extends Component{
topic_source:[],
topic_type:[],
attachments:undefined,
addonAfter:60,
addonAfter:0,
left_banner_id:undefined,
course_name:undefined
}
@ -99,7 +102,7 @@ class GraduateTopicNew extends Component{
topic_source:result.data.topic_source,
topic_type:result.data.topic_type,
attachments:result.data.attachments,
addonAfter:20-parseInt(result.data.selected_data.name.length)
addonAfter:parseInt(result.data.selected_data.name.length)
})
this.props.form.setFieldsValue({
tea_id:result.data.selected_data.tea_id,
@ -257,9 +260,9 @@ class GraduateTopicNew extends Component{
// 附件相关 ------------ END
changeTopicName=(e)=>{
let num= 60 - parseInt(e.target.value.length);
// let num= 60 - parseInt(e.target.value.length);
this.setState({
addonAfter:num < 0 ? 0 : num
addonAfter:e.target.value.length
})
}
render() {
@ -331,7 +334,7 @@ class GraduateTopicNew extends Component{
</p>
<div className="clearfix mb20 lineh-25">
<p className="fl color-black summaryname">{topicId==undefined?"新建":"编辑"}毕设选题</p>
<a onClick={()=>this.props.history.goBack()} className="color-grey-6 fr font-16">返回</a>
<Link to={`/courses/${coursesId}/graduation_topics/${left_banner_id}`} className="color-grey-6 fr font-16">返回</Link>
</div>
<Form {...formItemLayout} onSubmit={this.handleSubmit}>
@ -366,7 +369,7 @@ class GraduateTopicNew extends Component{
max: 60, message: '最大限制为60个字符',
}],
})(
<Input placeholder="请输入帖子选题名称最大限制60个字符" maxLength="60" onInput={this.changeTopicName} autoComplete="off" addonAfter={String(addonAfter)} className="searchViewAfter" />
<Input placeholder="请输入帖子选题名称最大限制60个字符" maxLength="60" onInput={this.changeTopicName} autoComplete="off" suffix={`${String(addonAfter)}/${NAME_COUNT}`} className="searchViewAfter" />
)}
</Form.Item>
</div>

@ -39,7 +39,7 @@ class PollNew extends Component {
visible: false,
poll_questions: [],
user_permission: "",
addonAfter: 60,
addonAfter: 0,
addonAftertwo: 100,
mysingles: 0,
mydoubles: 0,
@ -78,10 +78,13 @@ class PollNew extends Component {
changeTopicName = (e) => {
console.log("调用了changeTopicName");
let num = 60 - parseInt(e.target.value.length);
let num = parseInt(e.target.value.length);
if(num>60){
return;
}
this.setState({
addonAfter: num < 0 ? 0 : num
})
});
this.setState({
polls_nametest: e.target.value
})
@ -252,7 +255,7 @@ class PollNew extends Component {
if(result.data){
if(result.data.poll){
if(result.data.poll.polls_name){
let num = 60 - parseInt(result.data.poll.polls_name.length);
let num = parseInt(result.data.poll.polls_name.length);
this.setState({
addonAfter: num < 0 ? 0 : num
})
@ -2525,7 +2528,7 @@ class PollNew extends Component {
}
</div>
{/*addonAfter={String(addonAfter)}*/}
{/*suffix={String(addonAfter)}*/}
<Input placeholder="请输入问卷标题最大限制60个字符" maxLength="60"
style={{"margin-top": "15px", "text-align": "left"}}
onInput={this.changeTopicName}
@ -2556,7 +2559,7 @@ class PollNew extends Component {
readOnly={readOnlys}
onInput={this.changeTopicNametwo}
value={this.state.polls_descriptiontest}
autoComplete="off" addonAfter={"100"}></TextArea>
autoComplete="off" suffix={"100"}></TextArea>
{
this.state.Newedit === true || this.state.mysave === true ?
<div>

@ -77,7 +77,7 @@ function EditVideoModal (props) {
}],
})(
<Input placeholder="" className="titleInput" maxLength={MAX_LENGTH}
addonAfter={String(_title ? `${String(_title.length)}/${MAX_LENGTH}` : 0)} />
suffix={String(_title ? `${String(_title.length)}/${MAX_LENGTH}` : 0)} />
)}
</Form.Item>
</ModalWrapper>

Loading…
Cancel
Save