diff --git a/app/controllers/courses_controller.rb b/app/controllers/courses_controller.rb
index dd8c7c5c0..723f4e0da 100644
--- a/app/controllers/courses_controller.rb
+++ b/app/controllers/courses_controller.rb
@@ -1539,7 +1539,7 @@ class CoursesController < ApplicationController
end
def course_statistics course, max_exp, limit
- max_rate = 20.0 / max_exp
+ max_rate = max_exp.nil? ? 0 : 20.0 / max_exp
sql_select = %Q{ SELECT a.*, (message_num*0.2 + message_reply_num*0.1 + resource_num*0.5 + homework_journal_num*0.1 + graduation_num +
homework_num + exercise_num + poll_num*0.7 + exercise_score * 0.7 + graduation_score * 0.7 + homework_score * 0.7 + exp*#{max_rate})
diff --git a/public/react/src/modules/user/account/AccountBasicEditItem.js b/public/react/src/modules/user/account/AccountBasicEditItem.js
index 3190b2221..9f362d973 100644
--- a/public/react/src/modules/user/account/AccountBasicEditItem.js
+++ b/public/react/src/modules/user/account/AccountBasicEditItem.js
@@ -28,6 +28,7 @@ class AccountBasicEditItem extends Component {
label="职业"
className="formItemInline fl"
>
+ (已提交职业认证
可在认证信息中通过“重新认证”进行修改
)} condition= { professionalFlag }>
{getFieldDecorator('job', {
rules: [{
initialValue:"teacher",
@@ -41,6 +42,7 @@ class AccountBasicEditItem extends Component {
)}
+
{
identity && identity=="student" &&
@@ -50,6 +52,7 @@ class AccountBasicEditItem extends Component {
style={{ 'margin-top': '3px'}}
// style={{display:identity && identity=="student" ? "block":"none"}}
>
+ (已提交职业认证
可在认证信息中通过“重新认证”进行修改
)} condition= { professionalFlag }>
{getFieldDecorator('student_No', {
rules: [{
required: true,
@@ -58,6 +61,7 @@ class AccountBasicEditItem extends Component {
})(
)}
+
}
{
@@ -67,6 +71,7 @@ class AccountBasicEditItem extends Component {
className="formItemInline fl"
// style={{display:identity && identity=="teacher" ? "block":"none"}}
>
+ (已提交职业认证
可在认证信息中通过“重新认证”进行修改
)} condition= { professionalFlag }>
{getFieldDecorator('job1', {
rules: [{
initialValue:"教授",
@@ -81,6 +86,7 @@ class AccountBasicEditItem extends Component {
)}
+
}
{
@@ -90,6 +96,7 @@ class AccountBasicEditItem extends Component {
className="formItemInline fl mb0"
// style={{display:identity && identity=="professional" ? "block":"none"}}
>
+ (已提交职业认证
可在认证信息中通过“重新认证”进行修改
)} condition= { professionalFlag }>
{getFieldDecorator('job2', {
rules: [{
initialValue:"企业管理者",
@@ -105,6 +112,7 @@ class AccountBasicEditItem extends Component {
)}
+
}
@@ -112,6 +120,7 @@ class AccountBasicEditItem extends Component {
label="学校/单位"
className="formItemInline mb0"
>
+ (已提交职业认证
可在认证信息中通过“重新认证”进行修改
)} condition= { professionalFlag }>
{getFieldDecorator('org', {
rules: [{
// initialValue: this.state.cityDefaultValue,
@@ -138,6 +147,7 @@ class AccountBasicEditItem extends Component {
}
)}
+
{!filterSchoolList || (filterSchoolList && filterSchoolList.length==0 )&& school &&
@@ -148,39 +158,40 @@ class AccountBasicEditItem extends Component {
}
-
-
- {getFieldDecorator('org2', {
- rules: [{
- // initialValue: this.state.cityDefaultValue,
- // type: 'array',
- required: true,
- message: '请先选择院系/部门',
- // validator: (rule, value, callback) => {
- // if (this.this_department_id) {
- // callback();
- // return;
- // }
- // callback('请先选择院系/部门');
- // }
- }],
- })(
-
- {
- filterDepartments && filterDepartments.map((item,key)=>{
- return(
-
- )
- })
- }
-
- )}
-
-
+
+
+ (已提交职业认证
可在认证信息中通过“重新认证”进行修改
)} condition= { professionalFlag }>
+ {getFieldDecorator('org2', {
+ rules: [{
+ // initialValue: this.state.cityDefaultValue,
+ // type: 'array',
+ required: true,
+ message: '请先选择院系/部门',
+ // validator: (rule, value, callback) => {
+ // if (this.this_department_id) {
+ // callback();
+ // return;
+ // }
+ // callback('请先选择院系/部门');
+ // }
+ }],
+ })(
+
+ {
+ filterDepartments && filterDepartments.map((item,key)=>{
+ return(
+
+ )
+ })
+ }
+
+ )}
+
+
{
filterDepartments != undefined && ( (filterDepartments && filterDepartments.length==0 )
|| (departmentsName == '' && ! department_id
diff --git a/public/react/src/modules/user/modal/RealNameCertificationModal.js b/public/react/src/modules/user/modal/RealNameCertificationModal.js
index 51405fcdf..b62a299a1 100644
--- a/public/react/src/modules/user/modal/RealNameCertificationModal.js
+++ b/public/react/src/modules/user/modal/RealNameCertificationModal.js
@@ -53,6 +53,7 @@ class RealNameCertificationModal extends Component{
schoolList:undefined,
departments:undefined,
showRealName:true,
+ realName:undefined
}
}
@@ -137,16 +138,7 @@ class RealNameCertificationModal extends Component{
})
}
- // 将名字隐藏起来
- hideRealName=(name)=>{
- this.setState({ realName: name })
- const newName = getHiddenName(name)
-
- this.props.form.setFieldsValue({
- name: newName
- })
- return newName
- }
+
getDepartments=(e,flag)=>{
let arr=this.state.schoolList.filter(function(item){
@@ -257,11 +249,12 @@ class RealNameCertificationModal extends Component{
onSendOk = () => {
this.props.form.validateFieldsAndScroll((err, values) => {
- // console.log(values);
- // console.log(this.state.realName);
+ console.log(values);
+ console.log(this.state.showRealName ? values.name : this.state.realName);
+ // return;
if(!err){
- let{imageUrl2,showRealName}=this.state;
- let{current_user,basicInfo}=this.props;
+ let{ imageUrl2 , showRealName , realName }=this.state;
+ let{ current_user , basicInfo }=this.props;
if(imageUrl2){
let { certification } = this.props;
if(certification == 1){
@@ -275,7 +268,7 @@ class RealNameCertificationModal extends Component{
}
axios.post((url),{
- name:this.state.realName || basicInfo.name,
+ name:this.state.showRealName ? values.name : realName,
gender:parseInt(values.sex),
id_number:values.credentials,
show_realname:showRealName,
@@ -422,6 +415,16 @@ class RealNameCertificationModal extends Component{
name: this.state.realName
})
}
+ }
+ // 将名字隐藏起来
+ hideRealName=(name)=>{
+ this.setState({ realName: name })
+ const newName = getHiddenName(name)
+
+ this.props.form.setFieldsValue({
+ name: newName
+ })
+ return newName
}
// 选择部门、学院
changeDepartment=(e)=>{
@@ -463,7 +466,7 @@ class RealNameCertificationModal extends Component{
// /api/users/accounts/${this.props.current_user.login}/auth_attachment.json
// 已职业认证的账户不能修改职业,学校/单位,院系/部门(true为disable)
- const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ;
+ // const professionalFlag = basicInfo && basicInfo.professional_certification == "certified" ;
let{ basicInfo }=this.props
let common={
@@ -645,7 +648,7 @@ class RealNameCertificationModal extends Component{
label="姓名"
className="formItemInline"
>
- {basicInfo && basicInfo.authentication == 'uncertified' ? {getFieldDecorator('name', {
+ {getFieldDecorator('name', {
rules: [{
// initialValue: this.state.cityDefaultValue,
required: true,
@@ -659,16 +662,16 @@ class RealNameCertificationModal extends Component{
}>
)}
{ showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }
- :
-
-
- {showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)}
-
- this.showOrHide(showRealName)}>
- { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }
-
- }
+
+ {/* //
+ //
+ // {showRealName ? this.props.basicInfo.name : getHiddenName(this.props.basicInfo.name)}
+ //
+ // this.showOrHide(showRealName)}>
+ // { showRealName ? '(显示:平台将显示您的真实姓名)' : '(隐藏:平台将显示你的昵称)' }
+ //
*/}
+
-
- 男
- 女
-
+ 男
+ 女
)}
@@ -708,7 +709,7 @@ class RealNameCertificationModal extends Component{
this.changeType("publicly")}>{is_current ? "我":"TA"}的题库
this.changeType("personal")}>公共题库
-
+
- this.changeCategory("common")}>普通作业
- this.changeCategory("group")}>分组作业
diff --git a/public/react/src/modules/user/usersInfo/InfosCourse.js b/public/react/src/modules/user/usersInfo/InfosCourse.js
index 85ae6b9c5..7a56d0ccf 100644
--- a/public/react/src/modules/user/usersInfo/InfosCourse.js
+++ b/public/react/src/modules/user/usersInfo/InfosCourse.js
@@ -238,7 +238,7 @@ class InfosCourse extends Component{
{
is_current &&
-
+
- this.changeStatus()}
className="w32">全部
diff --git a/public/react/src/modules/user/usersInfo/InfosPackage.js b/public/react/src/modules/user/usersInfo/InfosPackage.js
index ad2c1c0ab..bb2637158 100644
--- a/public/react/src/modules/user/usersInfo/InfosPackage.js
+++ b/public/react/src/modules/user/usersInfo/InfosPackage.js
@@ -227,7 +227,7 @@ class InfosPackage extends Component{
{
category=="manage"?
-
+
: category=="bidden"?
-