forked from Open-CT/OpenPBL
fix: show count
This commit is contained in:
parent
0aeeb57f37
commit
fa066e49d3
|
@ -132,6 +132,7 @@ func (p *ProjectController) GetProjectTasksDetail() {
|
|||
teacherScore := false
|
||||
uid := user.Username
|
||||
editable := true
|
||||
showCount := false
|
||||
pid := p.GetString(":projectId")
|
||||
|
||||
|
||||
|
@ -140,6 +141,7 @@ func (p *ProjectController) GetProjectTasksDetail() {
|
|||
showSubmit = true
|
||||
editable = false
|
||||
teacherScore = true
|
||||
showCount = true
|
||||
}
|
||||
if user.Tag != "student" {
|
||||
learning = false
|
||||
|
@ -169,6 +171,7 @@ func (p *ProjectController) GetProjectTasksDetail() {
|
|||
Learning: learning,
|
||||
Editable: editable,
|
||||
TeacherScore: teacherScore,
|
||||
ShowCount: showCount,
|
||||
}
|
||||
}
|
||||
p.ServeJSON()
|
||||
|
|
|
@ -75,9 +75,8 @@ function FillSurvey(obj) {
|
|||
}
|
||||
|
||||
|
||||
const showCount = e => {
|
||||
const openCount = e => {
|
||||
if (e.length > 0) {
|
||||
console.log('draw')
|
||||
}
|
||||
}
|
||||
const getOption = subIndex => {
|
||||
|
@ -175,7 +174,7 @@ function FillSurvey(obj) {
|
|||
</div>
|
||||
{obj.showCount || obj.item.submitted ?
|
||||
<div style={{textAlign: 'left', marginTop: '20px'}}>
|
||||
<Collapse onChange={showCount}>
|
||||
<Collapse onChange={openCount}>
|
||||
<Collapse.Panel key={1} header="查看统计结果">
|
||||
{obj.item.questions.map((subItem, subIndex)=>(
|
||||
<div key={subIndex.toString()}>
|
||||
|
|
|
@ -45,18 +45,18 @@ func init() {
|
|||
|
||||
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
|
||||
beego.ControllerComments{
|
||||
Method: "GetProjectDetail",
|
||||
Method: "UpdateProject",
|
||||
Router: "/:id",
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
AllowHTTPMethods: []string{"post"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
||||
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
|
||||
beego.ControllerComments{
|
||||
Method: "UpdateProject",
|
||||
Method: "GetProjectDetail",
|
||||
Router: "/:id",
|
||||
AllowHTTPMethods: []string{"post"},
|
||||
AllowHTTPMethods: []string{"get"},
|
||||
MethodParams: param.Make(),
|
||||
Filters: nil,
|
||||
Params: nil})
|
||||
|
|
Loading…
Reference in New Issue