Merge branch 'develop' into dev_cxt

dev_winse
cxt 6 years ago
commit 9b129e4f2c

@ -40,6 +40,8 @@ class Users::VideosController < Users::BaseController
def batch_publish
Videos::BatchPublishService.call(observed_user, batch_publish_params)
render_ok
rescue Videos::BatchPublishService::Error => ex
render_error(ex.message)
end
private

@ -8,7 +8,7 @@ class CourseGroup < ApplicationRecord
has_many :homework_group_reviews, :dependent => :destroy
scope :by_group_ids, lambda { |ids| where(id: ids)}
validates :name, length: { maximum: 20 }
validates :name, length: { maximum: 60 }
after_create :generate_invite_code

@ -28,7 +28,7 @@ class CourseMessage < ApplicationRecord
def send_deal_tiding deal_status
# 发送申请处理结果消息
Tiding.create!(
user_id: course_message_id, trigger_user: 1, container_id: course_id, container_type: 'DealCourse',
user_id: course_message_id, trigger_user_id: 1, container_id: course_id, container_type: 'DealCourse',
belong_container: course, extra: content.to_i == 2 ? '9' : '7', tiding_type: 'System', status: deal_status
)
# 将申请消息置为已处理

@ -1,4 +1,6 @@
class Videos::BatchPublishService < ApplicationService
Error = Class.new(StandardError)
attr_reader :user, :params
def initialize(user, params)
@ -16,6 +18,8 @@ class Videos::BatchPublishService < ApplicationService
video = user.videos.find_by(uuid: param[:video_id])
next if video.blank? || video.processing_video_apply.present?
raise Error, '视频还未上传完成' if video.vod_uploading?
video.title = param[:title].to_s.strip.presence || video.title
video.apply_publish
video.save!

@ -17,7 +17,8 @@ if question.question_type <= 2 #当为选择题或判断题时,只显示选
end
json.question_choices do
json.array! exercise_choices.each_with_index.to_a do |a,index|
standard_answer_b = standard_answers_array.include?(a.choice_position)
#TODO: 旧版本来一个题只有一个标准答案的新版又做成了一个题有多个标准答案exercise_choice_id存放的是标准答案的位置..
standard_answer_b = standard_answers_array.join("").include?(a.choice_position.to_s)
user_answer_b = user_answer.include?(a.id)
json.c_position (index+1) if ex_choice_random_boolean #当选项随机时,选项位置以此为准,否则不出现
json.choice_id a.id

@ -4,5 +4,5 @@
# Rails.application.config.session_store :active_record_store
# Be sure to restart your server when you modify this file.
Rails.application.config.session_store :cache_store, :expire_after => 10.hours, key: '_educoder_session', domain: :all
Rails.application.config.session_store :cache_store, :expire_after => 24.hours, key: '_educoder_session', domain: :all

@ -274,6 +274,11 @@ class App extends Component {
// }, (error) => {
// //TODO 这里如果样式变了会出现css不加载的情况
// });
window.addEventListener('error', (event) => {
const msg = `${event.type}: ${event.message}`;
console.log(msg)
});
}
//修改登录方法
Modifyloginvalue=()=>{

@ -13,7 +13,7 @@ export function getImageUrl(path) {
export function setImagesUrl(path){
const local = 'http://47.96.87.25:48080'
let firstStr=path.substr(0,1);
console.log(firstStr);
// console.log(firstStr);
if(firstStr=="/"){
return isDev?`${local}${path}`:`${path}`;
}else{

@ -68,17 +68,21 @@ class ListPageIndex extends Component{
constructor(props) {
super(props);
this.state={
yslGuideone:null,
yslGuideone:undefined,
mysearch:undefined,
}
}
componentDidMount(){
var yslGuideone = window.localStorage.getItem('yslGuideone');
var yslGuideone = window.sessionStorage.getItem('yslGuideone');
console.log("77");
console.log(yslGuideone);
var mysearchs= this.props.location.search===""?undefined:this.props.location.search===undefined?undefined:this.props.location.search==="?exhibition=true"?true:undefined;
this.setState({
yslGuideone:yslGuideone,
mysearch:mysearchs,
})
}
//
// getleftNavid=(navid,newselectnavid)=>{
@ -88,34 +92,44 @@ class ListPageIndex extends Component{
// navttype:newselectnavid
// })
// }
setwindowlocal=(bool)=>{
window.localStorage.setItem('yslGuideone', bool);
componentWillUnmount(){
window.sessionStorage.setItem('yslGuideone', false);
}
setwindowlocal=(bool)=>{
window.sessionStorage.setItem('yslGuideone', bool);
this.setState({
yslGuideone:bool,
})
mysearch:undefined,
});
var currenturl = this.props.location.pathname;
var newUrl = (currenturl.split("?"))[0];
window.history.pushState('','',newUrl);
}
render() {
let {yslGuideone} =this.state;
let {yslGuideone,mysearch} =this.state;
// console.log("98");
// console.log(yslGuideone);
// console.log(this.props.isAdmin());
// // var yslGuideones = window.sessionStorage.getItem('yslGuideone');
// console.log(this.props);
// console.log(this.props.location.search);
return (
<div>
<div className="newMain clearfix">
{/*头部banner*/}
<CoursesBanner {...this.props}></CoursesBanner>
{/*{yslGuideone===null||yslGuideone===undefined||yslGuideone===false?*/}
{/* (*/}
{/* this.props.isAdmin()===true?*/}
{/* <Guide*/}
{/* setwindowlocal={(b)=>this.setwindowlocal(b)}*/}
{/* >*/}
{/* </Guide>*/}
{/* :""*/}
{/* )*/}
{/* :""*/}
{/*}*/}
{mysearch!==undefined?
(
mysearch===true?
<Guide
setwindowlocal={(b)=>this.setwindowlocal(b)}
>
</Guide>
:""
)
:""
}
<div className="educontent clearfix" style={{flex: "1 0 auto"}}>
<div className="stud-class-set">

@ -1,12 +1,15 @@
.edu-class-container {
width: 1200px;
margin: 10px auto 20px;
}
#forum_index_list {
margin-top: 90px;
margin-bottom: 320px;
}
.uploadBtn {
margin-left: 0px;
.edu-class-container {
width: 1200px;
margin: 10px auto 20px;
}
#forum_index_list {
margin-top: 90px;
margin-bottom: 320px;
}
#yslforum_index_list {
margin-top: 20px;
margin-bottom: 320px;
}
.uploadBtn {
margin-left: 0px;
}

@ -526,7 +526,7 @@ class TopicDetail extends Component {
const courseId=this.props.match.params.coursesId;
const boardId = this.props.match.params.boardId
return (
<div className="edu-back-white edu-class-container edu-position course-message topicDetail" id="forum_index_list"> {/* fl with100 */}
<div className="edu-back-white edu-class-container edu-position course-message topicDetail" id="yslforum_index_list"> {/* fl with100 */}
<style>{`
.topicDetail #forum_list .return_btn.no_mr {
margin-right: 1px;

@ -278,7 +278,7 @@ class CommonWorkPost extends Component{
}
// 附件相关 START
handleChange = (info) => {
if (info.file.status === 'uploading') {
if (info.file.status === 'uploading' || info.file.status === 'done') {
let fileList = info.fileList;
this.setState({ fileList: appendFileSizeToUploadFileAll(fileList) });

@ -196,12 +196,14 @@ class NullEditor extends Component{
}
onAnswerChange = (index, itemIndex, val) => {
if (this.state.standard_answers[index]) {
this.setState(
(prevState) => ({
standard_answers : update(prevState.standard_answers
, {[index]: {$splice: [[itemIndex, 1, val]]}}),
})
)
}
}
addChildAnswer = (index) => {
this.setState(

@ -76,7 +76,7 @@ class CoursesNew extends Component {
Realnamecertification: data.authentication,
Professionalcertification:data.professional_certification,
})
this.handleSearchschool(data.school);
}).catch((error) => {
console.log(error);
})
@ -93,7 +93,9 @@ class CoursesNew extends Component {
});
this.setState({
school:user_school,
})
});
this.handleSearchschool(user_school);
}
@ -203,7 +205,9 @@ class CoursesNew extends Component {
// debugger
if (response.data.status === 0) {
// this.goback()
window.location.href=first_category_url;
window.location.href=first_category_url+"?exhibition=true";
window.sessionStorage.setItem('yslGuideone', true);
}
}).catch((error) => {
console.log(error)
@ -247,7 +251,8 @@ class CoursesNew extends Component {
).then((response) => {
if (response.status === 200) {
// this.goback
window.location.href=response.data.first_category_url;
window.location.href=response.data.first_category_url+"?exhibition=true";
window.sessionStorage.setItem('yslGuideone', true);
}
}).catch((error) => {
console.log(error)
@ -403,7 +408,9 @@ class CoursesNew extends Component {
const optionschool = this.state.searchlistscholl&&this.state.searchlistscholl.map(z => <Option key={z} value={z}>{z}</Option>);
// console.log(this.props.current_user.user_school)
// form合并了
console.log(this.state);
console.log(this.props);
console.log(this.props.current_user);
return (
<React.Fragment>

@ -21,6 +21,7 @@ class Guide extends Component {
}
componentDidMount() {
console.log("GuideGuideGuideGuide加载了")
// 1366x768
// var mywidthone=7;
@ -59,7 +60,7 @@ class Guide extends Component {
page:i,
})
if(i===7){
this.props.setwindowlocal(true);
this.props.setwindowlocal(false);
}
}
render() {

@ -71,13 +71,13 @@ class ShixunWorkDetails extends Component {
<div className="educontent">
<p className="clearfix mt20">
<a className="fl color-grey-9 btn colorgrey hovercolorblue"
onClick={()=>this.goback(1)}
href={`/courses/${data&&data.course_id}/shixun_homeworks/${data&&data.homework_common_id}`}
>
<span className={"color-grey-9"}>{data&&data.course_name}123</span>
<a className={"color-grey-9"} >{data&&data.course_name}</a>
</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a className="btn colorgrey fl hovercolorblue grey"
onClick={this.goback}
href={`/courses/${data&&data.course_id}/shixun_homeworks/${data&&data.homework_common_id}/list?tab=0`}
// to={"/courses/"+data&&data.course_id+"/"+this.state.shixuntypes+"/"+data&&data.homework_common_id}
>
<span className={"color-grey-9"}>实训作业</span>

@ -28,10 +28,10 @@ class ShixunCustomsPass extends Component {
datas.push({
customs:{position:item.position,subject:item.subject},
taskname:{name:item.username},
openingtime:moment(item.end_time).format('YYYY-MM-DD HH:mm:ss'),
openingtime:item.end_time===null?"无":item.end_time===undefined?"无":item.end_time===""?"无":moment(item.end_time).format('YYYY-MM-DD HH:mm:ss'),
evaluating: {final_score:item.final_score,all_score:item.all_score},
finishtime:item.copy_username,
elapsedtime:moment(item.copy_end_time).format('YYYY-MM-DD HH:mm:ss'),
elapsedtime:item.copy_end_time===null?"无":item.copy_end_time===undefined?"无":item.copy_end_time===""?"无":moment(item.copy_end_time).format('YYYY-MM-DD HH:mm:ss'),
empvalue:item.code_rate,
// adjustmentminute:asdasd
})
@ -200,6 +200,9 @@ class ShixunCustomsPass extends Component {
</style>
{
data&&data.challenge_list.map((item,key)=>{
// console.log("203challenge_list下面的数据");
// console.log(item);
// console.log(JSON.stringify(item));
return(
<div key={key} className={"mb20"}>
<div className="font-16 color-dark-21 ml20 mr20">
@ -213,46 +216,46 @@ class ShixunCustomsPass extends Component {
<span className={"font-14"}>{item.subject}</span>
</a>
</span>
<span className="fr codeboxright">代码文件{item.code_list[0].path}</span>
<span className="fr codeboxright">代码文件{item.code_list.length===0?"无":item.code_list[0].path===undefined?"无":item.code_list[0].path}</span>
</p>
</div>
{item.code_list.map((ite,k)=>{
{item.code_list.length===0?"":item.code_list.map((ite,k)=>{
return(
<div className="font-16 color-dark-21 ml20 mr20" key={k}>
<div className=" mt15">
<p className="clearfix pt5 pb5 codebox">
<span className="fl">
<span className={"colorC8161D"}>{item.username}</span>
的代码文件
</span>
<span className="fr">
<span className={"color-green"}>{item.copy_username}</span>
的代码文件
</span>
</p>
<style>
{`
.borderccc{
border:1px solid #ccc
}
`}
</style>
<div className="test-code mt20 borderccc">
<li className="clearfix">
<MonacoDiffEditor
height="500"
// language="javascript"
original={ite.origin_content}
value={ ite.target_content}
// options={options}
/>
</li>
</div>
</div>
</div>
<div className="font-16 color-dark-21 ml20 mr20" key={k}>
<div className=" mt15">
<p className="clearfix pt5 pb5 codebox">
<span className="fl">
<span className={"colorC8161D"}>{item.username}</span>
的代码文件
</span>
<span className="fr">
<span className={"color-green"}>{item.copy_username}</span>
的代码文件
</span>
</p>
<style>
{`
.borderccc{
border:1px solid #ccc
}
`}
</style>
<div className="test-code mt20 borderccc">
<li className="clearfix">
<MonacoDiffEditor
height="500"
// language="javascript"
original={ite.origin_content}
value={ ite.target_content}
// options={options}
/>
</li>
</div>
</div>
</div>
)
})}
</div>
@ -267,4 +270,4 @@ class ShixunCustomsPass extends Component {
}
}
export default ShixunCustomsPass;
export default ShixunCustomsPass;

Loading…
Cancel
Save