Merge remote-tracking branch 'origin/dev_aliyun' into dev_aliyun

courseware
杨树明 5 years ago
commit 9b83bd4999

@ -557,7 +557,7 @@ class StudentWorksController < ApplicationController
@work.student_works_scores.where.not(score: nil).update_all(is_invalid: 1)
reviewer_role = @user_course_identity == Course::ASSISTANT_PROFESSOR ? 2 : 1
new_score = StudentWorksScore.new(student_work_id: @work.id, score: params[:score].to_f,
comment: "使用调分功能调整了作业最终成绩:#{params[:comment]}",
comment: params[:comment],
homework_common_id: @work.homework_common_id, user_id: current_user.id,
reviewer_role: reviewer_role, is_ultimate: 1)
new_score.save!

@ -269,6 +269,23 @@ class Listjihe extends Component {
}
const types = questionType.filter(item=>item.type === items.item_type);
let Periofters = false;
let Perioftersbols=false;
if (this.props) {
if (this.props.current_user) {
if (this.props.current_user.admin) {
Periofters = true;
}
else if (this.props.current_user.business) {
Perioftersbols = true;
}
}
}
// console.log(this.props);
// console.log("PerioftersPerioftersbols");
// console.log(Periofters);
// console.log(Perioftersbols);
return (
<div key={keindex}
className={chakanjiexiboolindex === keindex ? "w100s borderwds283 pd20 mb20 listjihecolors" : "borderwds pd20 mb20 listjihecolors"}>
@ -595,6 +612,64 @@ class Listjihe extends Component {
}
</div>
:
//公开需要权限
Periofters===true?
//管理员
<div className="xaxisreverseorder">
<p className="viewparsings xiaoshou mr25" onClick={() => this.props.showmodelysl(items.id)}>
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>删除</span>
</p>
{
items.item_type === "PROGRAM" ?
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a onClick={()=>this.seturls(`/problems/${items.program_attr.identifier}/edit`)}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
:
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a onClick={()=>this.seturls(`/problemset/edit/${items.id}`)}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
}
</div>
//运营人员
:Perioftersbols===true?
<div className="xaxisreverseorder">
{
items.item_type === "PROGRAM" ?
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a onClick={()=>this.seturls(`/problems/${items.program_attr.identifier}/edit`)}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
:
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a onClick={()=>this.seturls(`/problemset/edit/${items.id}`)}>
<p className="viewparsings xiaoshou mr25">
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
}
</div>
:""
}
{

@ -106,7 +106,18 @@ class Listjihe extends Component {
const quotess =items&&items.quotes&&items.quotes;
const authors=items&&items.author&&items.author.name;
let Periofters = false;
let Perioftersbols=false;
if (this.props) {
if (this.props.current_user) {
if (this.props.current_user.admin) {
Periofters = true;
}
else if (this.props.current_user.business) {
Perioftersbols = true;
}
}
}
return (
<div className={" borderwdsst pd20 mb20 intermediatecenter listjihecolor "} >
{
@ -206,7 +217,43 @@ class Listjihe extends Component {
</p>
}
</div>
:""}
:Periofters===true?
<div className="w35s xaxisreverseorder">
<p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.showmodelysl(items.id)}>
<i className="iconfont icon-shanchu1 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>删除</span>
</p>
{
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a >
<p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.Testpapereditor(items.id)}>
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
}
</div>
:Perioftersbols===true?
<div className="w35s xaxisreverseorder">
{
this.props.Isitapopup&&this.props.Isitapopup==="true"?
""
:
<a >
<p className="viewparsings xiaoshou mr25 " onClick={()=>this.props.Testpapereditor(items.id)}>
<i className="iconfont icon-bianji2 font-17 lg ml7 lh30 icontianjiadaohangcolors mr5"></i>
<span>编辑</span>
</p>
</a>
}
</div>
:
""
}

Loading…
Cancel
Save