Merge branch 'dev_aliyun' into develop

dev_forum
daiao 5 years ago
commit 5778a4dcde

@ -896,13 +896,31 @@ class PollsController < ApplicationController
def commit_poll
ActiveRecord::Base.transaction do
begin
poll_user_current = @poll.poll_users.find_by_group_ids(current_user.id).first
poll_user_params = {
:commit_status => 1,
:end_at => Time.now
}
poll_user_current.update_attributes(poll_user_params)
normal_status(0, "问卷提交成功!")
@poll_multi_questions = @poll.poll_questions.where(question_type:2).select(:id,:max_choices,:min_choices,:question_number)
error_question = []
@poll_multi_questions.each do |q|
poll_user_votes = current_user.poll_votes.where(poll_question_id:q.id)&.size
if q.max_choices.present? && (poll_user_votes > q.max_choices)
error_messages = "#{q.question_number}题:超过最大选项限制"
elsif q.min_choices.present? && (poll_user_votes < q.min_choices)
error_messages = "#{q.question_number}题:不得少于最小选项限制"
else
error_messages = nil
end
error_question.push(error_messages)
end
error_question = error_question.reject(&:blank?)
if error_question.reject(&:blank?).length > 0
normal_status(-1, "#{error_question.join("")}")
else
poll_user_current = @poll.poll_users.find_by_group_ids(current_user.id).first
poll_user_params = {
:commit_status => 1,
:end_at => Time.now
}
poll_user_current.update_attributes(poll_user_params)
normal_status(0, "问卷提交成功!")
end
## 需添加发送消息的接口,稍后添加
rescue Exception => e
uid_logger_error(e.message)

@ -297,6 +297,7 @@ class BoardsNew extends Component{
.courseForm .noBorder {
border-bottom: none;
}
`}</style>
<div className="edu-class-container edu-position courseForm">
<CBreadcrumb items={[

@ -370,7 +370,7 @@ class NewWork extends Component{
<span>{pageType==="new"?"新建":"编辑"}</span>
</p> */}
<CBreadcrumb items={[
{ to: current_user.first_category_url, name: this.state.course_name},
{ to: current_user && current_user.first_category_url, name: this.state.course_name},
{ to: `/courses/${courseId}/${moduleEngName}/${category && category.category_id ? category.category_id : ''}`
, name: category && category.category_name },
{ name: `${ this.isEdit ? '编辑' : '新建'}` }
@ -388,7 +388,7 @@ class NewWork extends Component{
</p>
<div>
{/* onSubmit={this.handleSubmit} */}
<Form >
<Form className="courseForm">
<Form.Item
label="标题"
className="AboutInputForm"

@ -36,6 +36,17 @@ class ModalWrapper extends Component{
className={className || ''}
keyboard={false}
>
{
visible == true ? <style>
{
`
body {
overflow: hidden !important;
}
`
}
</style>:""
}
<div className="newupload_conbox clearfix">
{this.props.children}
{this.props.checkBoxValuestype===true?<div className={"mt10 color-red"}>

@ -984,6 +984,26 @@ samp {
line-height: 40px;
}
.courseForm .ant-input-group > .ant-input:first-child, .ant-input-group-addon:first-child {
height: 40px;
}
.courseForm .ant-select-selection, .courseForm .ant-select-selection-selected-value {
height: 40px;
line-height: 40px;
}
.courseForm .ant-input-affix-wrapper .ant-input {
height: 40px;
}
.courseForm .ant-select-auto-complete.ant-select .ant-input {
height: 40px;
}
.courseForm .ant-select-auto-complete.ant-select .ant-select-selection__rendered {
line-height: 40px;
}
.courseForm .ant-select-auto-complete.ant-select .ant-input {
height: 40px;
}
/*新建课堂*/

@ -135,8 +135,8 @@ class shixunAnswer extends Component{
let url=`/exercise_questions/${this.props.questionType.question_id}/adjust_score.json`
const list = Object.assign({}, this.state.dataCopy[key])
console.log("111111111111111111111111");
console.log(this.props);
// console.log("111111111111111111111111");
// console.log(this.props);
// 调分值为0且和第一次的数据相同则不修改
if(parseInt(e.target.value)==parseInt(list.my_score)){
return;

@ -93,13 +93,14 @@ class AddStudentModal extends Component{
}
onSendOk = () => {
this.setState({
isSpin:true
})
if(!this.state.checkBoxValues || this.state.checkBoxValues.length == 0) {
this.props.showNotification('请从列表中先选择用户。')
return;
}
this.setState({
isSpin:true
})
const courseId = this.props.match.params.coursesId
const url = `/courses/${courseId}/add_students_by_search.json`
const params = {
@ -159,7 +160,7 @@ class AddStudentModal extends Component{
title={`添加${moduleName}`}
{...this.props }
onOk={this.onOk}
className="addStudentModal"
className="addStudentModal courseForm"
>
<style>
{`

@ -196,7 +196,7 @@ class AddTeacherModal extends Component{
title={`添加${moduleName}`}
{...this.props }
onOk={this.onOk}
className="addTeacherModal"
className="addTeacherModal courseForm"
>
<AddGraduationGroupModal ref="addGraduationGroupModal"
{...this.props} onOk={this.onAddGraduationGroupOk}

@ -459,6 +459,11 @@ class CoursesNew extends Component {
width: 280px;
margin-left: 10px;
}
.construction .ant-select-selection__placeholder, .ant-select-search__field__placeholder {
line-height: 28px;
z-index: 2000;
}
`}
</style>
@ -641,7 +646,7 @@ class CoursesNew extends Component {
</Form.Item>
</div>
<div className="stud-class-set padding10200 coursenavbox mb20">
<div className="stud-class-set padding10200 mb20">
<Form.Item label="课堂所属单位">
{getFieldDecorator('school', {
rules: [{required: true, message: "不能为空"}],

@ -464,7 +464,7 @@ class Poll extends Component{
modalsBottomval,
loadtype
}=this.state;
console.log(this.props);
// console.log(this.props);
let {child}=this.props;
let {coursesId,Id}=this.props.match.params
const isAdmin = this.props.isAdmin()

@ -34,7 +34,7 @@ class PollDetailIndex extends Component{
}
getPollInfo=()=>{
console.log(this.props);
// console.log(this.props);
let pollId=this.props.match.params.pollId;
let url=`/polls/${pollId}/common_header.json`
axios.get(url).then((result)=>{
@ -123,7 +123,7 @@ class PollDetailIndex extends Component{
/>
<div className="educontent mt10 mb50">
<p className="clearfix mb20">
<WordsBtn style="grey" className="fl" to={current_user.first_category_url}>{this.props.coursedata.name}</WordsBtn>
<WordsBtn style="grey" className="fl" to={current_user && current_user.first_category_url}>{this.props.coursedata.name}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/polls/${user_permission && user_permission.left_banner_id}`}>问卷</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>

@ -66,7 +66,7 @@ class PollDetailTabSecond extends Component{
<span className="font-16 clearfix">
<span className="color-blue fl">{parseInt(page-1)*parseInt(limit)+(key+1)}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10 mt6">必答</span>:"" }
{ item.question.question_type == 2 ?
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choices ?
<span className="color-grey-9">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :
@ -127,9 +127,9 @@ class PollDetailTabSecond extends Component{
<span className="color-green">{options.answer_users_count}</span>
<span>
<p className="percentForm fl mr15">
<span className="percentValue" style={{"width":`${parseFloat(options.answer_percent ? options.answer_percent : 0 ).toFixed(2)*100}%`}}></span>
<span className="percentValue" style={{"width":`${(options.answer_percent * 100).toFixed(1)}%`}}></span>
</p>
<font className="color-grey-9">{parseFloat(options.answer_percent ? options.answer_percent : 0 ).toFixed(2)*100} %</font>
<font className="color-grey-9">{(options.answer_percent * 100).toFixed(1)}%</font>
</span>
</ul>
{

@ -71,7 +71,7 @@ class PollDetailTabThird extends Component{
<p className="pl30 pr30 pt30 pb15 font-16 clearfix">
<span className="color-blue mr8 fl">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10">必答</span>:<span className="mustAnswer fl ml10 mr10"></span> }
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choice ?
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choices ?
<span className="color-grey-9 font-14 fl mt2">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :

@ -315,7 +315,7 @@ class PollInfo extends Component{
></Modals>
<div className="educontent mt10 mb50">
<p className="clearfix mb20">
<WordsBtn style="grey" className="fl" to={current_user.first_category_url}>{courseName}</WordsBtn>
<WordsBtn style="grey" className="fl" to={current_user && current_user.first_category_url}>{courseName}</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn style="grey" className="fl" to={`/courses/${this.props.match.params.coursesId}/polls/${poll && poll.left_banner_id}`}>问卷</WordsBtn>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
@ -383,7 +383,7 @@ class PollInfo extends Component{
<div className="pl30 pr30 mt30 mb10 clearfix">
<span className="color-blue fl font-16">{item.question.question_number}{map[item.question.question_type]}</span>
{ item.question.is_necessary==1 ? <span className="mustAnswer fl ml10 mr10 mt5">必答</span>:<span className="mustAnswer fl ml10 mr10 mt5"></span> }
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choice ?
{ item.question.question_type == 2 && item.question.min_choices && item.question.max_choices ?
<span className="color-grey-9 font-14 fl mt2">
{
item.question.min_choices == item.question.max_choices ? "可选"+item.question.max_choices+"项" :

@ -844,12 +844,12 @@ class PollNew extends Component {
if (object.question.question_type === 2) {
if (object.question.max_choices > 0) {
if (object.question.min_choices < 2) {
this.props.showNotification(`可选最小不能少于2个`);
return;
}
// if (object.question.min_choices < 2) {
// this.props.showNotification(`可选最小不能少于2个`);
//
// return;
//
// }
}
}
@ -1332,10 +1332,10 @@ class PollNew extends Component {
if (object.question.question_type === 2) {
if (object.question.max_choices > 0) {
if (object.question.min_choices < 2) {
this.props.showNotification(`可选最小不能少于2个`);
return;
}
// if (object.question.min_choices < 2) {
// this.props.showNotification(`可选最小不能少于2个`);
// return;
// }
}
}
if (object.question.new === "new") {
@ -2108,14 +2108,24 @@ class PollNew extends Component {
}
//最大值
HandleGradationGroupChangeee = (value, index) => {
HandleGradationGroupChangeee = (value, index,minchoices) => {
// console.log("2112");
// console.log(value);
// console.log(minchoices);
let arr = this.state.adddom;
for (var i = 0; i < arr.length; i++) {
if (index === i) {
arr[i].question.max_choices = parseInt(value);
if(parseInt(value)===0&&parseInt(minchoices)===0){
arr[i].question.min_choices= parseInt(minchoices);
arr[i].question.max_choices = parseInt(value);
}else {
arr[i].question.min_choices= minchoices===null?2:minchoices===undefined?2:minchoices===0?2:parseInt(minchoices);
arr[i].question.max_choices = parseInt(value);
}
}
}
// console.log(2119);
// console.log(arr);
this.setState({
adddom: arr
})
@ -2285,7 +2295,7 @@ class PollNew extends Component {
readOnlys: "readOnly",
cancellation: false,
})
window.location.href = `/courses/${coursesId}/polls/${result.data.data.id}/edit`;
})
} else {
@ -2322,7 +2332,7 @@ class PollNew extends Component {
gotohome=()=>{
const { current_user} = this.props
this.props.history.push(current_user.first_category_url);
this.props.history.push(current_user && current_user.first_category_url);
// let courseId=this.props.match.params.coursesId;
@ -2388,7 +2398,7 @@ class PollNew extends Component {
<a className=" btn colorgrey fl hovercolorblue" onClick={()=>this.gotohome()}>{this.props.coursedata.name}</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a className=" btn colorgrey fl hovercolorblue"
to={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a>
href={`/courses/${this.props.match.params.coursesId}/polls/${this.props.match.params.pollid}`}>问卷</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<span>{this.props.match.params.news === undefined ? "新建" : this.props.match.params.news === "new" ? "新建" : "编辑"}</span>
</p>
@ -2772,7 +2782,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo)}
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>
@ -3015,7 +3025,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo)}
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>
@ -3267,7 +3277,7 @@ class PollNew extends Component {
className="ml10 mr10 color-grey-6 lineh-40 fl">~</span>
{/*可选最大*/}
<Select className="fl w100"
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo)}
onChange={(value) => this.HandleGradationGroupChangeee(value, indexo,itemo.question.min_choices)}
value={itemo.question.max_choices === 0 || itemo.question.max_choices === "0" ? "--" : itemo.question.min_choices === null ? "--" : itemo.question.min_choices === undefined ? "--" : itemo.question.max_choices}
>
<Option value={String("0")}>--</Option>

@ -113,7 +113,7 @@
text-align: left;
}
.percentForm{
width: 340px;
width: 330px;
height: 11px;
background: #F5F5F5;
border-radius: 6px;

@ -135,7 +135,7 @@ class ShixunWorkReport extends Component {
<span className={"color-grey-9"}>{data===undefined?"":data.category===null?"":data.category.category_name}</span>
</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<a to={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+homework_common_id+"/list?tab=0"} className="fl color-grey-9">作业详情</a>
<a href={"/courses/"+this.props.match.params.coursesId+"/"+this.state.shixuntypes+"/"+homework_common_id+"/list?tab=0"} className="fl color-grey-9">作业详情</a>
<span className="color-grey-9 fl ml3 mr3">&gt;</span>
<WordsBtn className="fl">{data&&data.username}</WordsBtn>
</p>

File diff suppressed because it is too large Load Diff

@ -42,7 +42,7 @@ class TPMNav extends Component {
className={`${match.url.indexOf('ranking_list') != -1 ? 'active' : ''} fl`}>排行榜</Link>
{/* target="_blank"*/}
<a
href={`/shixuns/${shixunId}/settings`} className="fr"
href={`/shixuns/${shixunId}/settings`} className="edu-default-btn edu-blueline-btn ml20 fr"
style={{display: this.props.identity >4||this.props.identity===undefined ? "none" : 'block'}}
>配置</a>
</div>

@ -67,7 +67,7 @@ class TPMRightSection extends Component {
<div className="edu-back-white padding40-20 mb10">
<p className="font-16 mb20">创建者</p>
<div className="df">
<a href={TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":TPMRightSectionData.creator.user_url}>
<a href={TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":`/users/${TPMRightSectionData.creator.login}/courses`}>
<img alt="头像" className="radius mr10" height="80" src={getImageUrl(TPMRightSectionData===undefined?"":TPMRightSectionData.creator===undefined?"":'images/'+TPMRightSectionData.creator.image_url+"?1532489442")} width="80" />
</a>
<div className="flex1">

@ -65,6 +65,7 @@ class LoginRegisterComponent extends Component {
Whethertoverify:false,
pciphone:true,
MyEduCoderModals:false,
registered:undefined,
}
}
@ -101,6 +102,7 @@ class LoginRegisterComponent extends Component {
Whethertoverify:false,
pciphone:true,
MyEduCoderModals:false,
registered:undefined,
}
}
@ -358,7 +360,6 @@ class LoginRegisterComponent extends Component {
weekArray="/";
}
window.location.href = weekArray;
}
}
@ -881,12 +882,15 @@ class LoginRegisterComponent extends Component {
setNotcompleteds=()=>{
this.setState({
Notcompleteds:true,
MyEduCoderModals:false
MyEduCoderModals:false,
registered:undefined,
})
};
setMyEduCoderModals=()=>{
this.setState({
MyEduCoderModals:true
MyEduCoderModals:true,
registered:"注册成功"
})
};
render() {
@ -1040,6 +1044,7 @@ class LoginRegisterComponent extends Component {
}
{this.state.MyEduCoderModals===true? <Notcompletedysl
modalsType={this.state.MyEduCoderModals}
registered={this.state.registered}
setNotcompleteds={()=>{this.setNotcompleteds()}}
/>:""}

@ -53,13 +53,13 @@ class Notcompletedysl extends Component {
closable={false}
footer={null}
destroyOnClose={true}
title="提示"
title={this.props.registered===undefined?"提示":"注册成功"}
centered={true}
visible={this.props.modalsType}
width="530px"
>
<div className="educouddiv">
<div className={"tabeltext-alignleft mt20"}><p>完善您的资料将获得更多的使用权限</p></div>
<div className={"tabeltext-alignleft"}><p style={{fontSize: "16px"}}>完善您的资料将获得更多的使用权限</p></div>
<div className="clearfix mt30 edu-txt-center">
<a className="task-btn mr30" onClick={()=>this.modalCancel()}>取消</a>
<a className="task-btn task-btn-orange" onClick={()=>this.setDownload()}>立即完善</a>

@ -14,7 +14,7 @@ class AccountNav extends Component {
}
render() {
let { basicInfo } = this.props
console.log(this.props);
// console.log(this.props);
const path = window.location.pathname
const isBasic = path.indexOf('profile') != -1 || path == "/account"
const isCertification = path.indexOf('certification') != -1

Loading…
Cancel
Save