forked from Open-CT/OpenPBL
refactor: change table column
This commit is contained in:
parent
caabfd7f92
commit
109ae2a10d
|
@ -227,7 +227,6 @@ func (p *ProjectController) UpdateProjectWeight() {
|
||||||
}
|
}
|
||||||
pid, err := p.GetInt64(":id")
|
pid, err := p.GetInt64(":id")
|
||||||
learnMinuteWeight, err := p.GetInt("learnMinuteWeight")
|
learnMinuteWeight, err := p.GetInt("learnMinuteWeight")
|
||||||
learnMinute, err := p.GetInt("learnMinute")
|
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
resp = Response{
|
resp = Response{
|
||||||
|
@ -241,7 +240,6 @@ func (p *ProjectController) UpdateProjectWeight() {
|
||||||
project := models.Project{
|
project := models.Project{
|
||||||
Id: pid,
|
Id: pid,
|
||||||
LearnMinuteWeight: learnMinuteWeight,
|
LearnMinuteWeight: learnMinuteWeight,
|
||||||
LearnMinute: learnMinute,
|
|
||||||
}
|
}
|
||||||
tasks := make([]models.Task, 0)
|
tasks := make([]models.Task, 0)
|
||||||
err = json.Unmarshal([]byte(p.GetString("tasks")), &tasks)
|
err = json.Unmarshal([]byte(p.GetString("tasks")), &tasks)
|
||||||
|
|
|
@ -11,14 +11,14 @@ type TaskResponse struct {
|
||||||
Learning bool `json:"learning"`
|
Learning bool `json:"learning"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// GetSectionTasks
|
// GetSectionTasksDetail
|
||||||
// @Title
|
// @Title
|
||||||
// @Description get all the tasks of a section
|
// @Description get section tasks with submit and survey
|
||||||
// @Param sid path string true ""
|
// @Param sid path string true ""
|
||||||
// @Success 200 {object}
|
// @Success 200 {object} TaskResponse
|
||||||
// @Failure 400
|
// @Failure 400
|
||||||
// @router /:projectId/section/:sectionId/tasks [get]
|
// @router /:projectId/section/:sectionId/tasks [get]
|
||||||
func (p *ProjectController) GetSectionTasks() {
|
func (p *ProjectController) GetSectionTasksDetail() {
|
||||||
var resp TaskResponse
|
var resp TaskResponse
|
||||||
sid := p.GetString(":sectionId")
|
sid := p.GetString(":sectionId")
|
||||||
var learning bool
|
var learning bool
|
||||||
|
|
|
@ -28,7 +28,6 @@ type Project struct {
|
||||||
|
|
||||||
Published bool `json:"published" xorm:"default false index"`
|
Published bool `json:"published" xorm:"default false index"`
|
||||||
|
|
||||||
LearnMinute int `json:"learnMinute" xorm:"default 10"`
|
|
||||||
LearnMinuteWeight int `json:"learnMinuteWeight" xorm:"default 100"`
|
LearnMinuteWeight int `json:"learnMinuteWeight" xorm:"default 100"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -68,21 +68,23 @@ function StudentAdmin(obj) {
|
||||||
<span>{util.FilterTime(joinTime)}</span>
|
<span>{util.FilterTime(joinTime)}</span>
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
title: '',
|
||||||
|
dataIndex: 'showEvidence',
|
||||||
|
render: (text, item, index) => (
|
||||||
|
<Link to={`/project/${pid}/student/${item.studentId}/evidence`}>
|
||||||
|
<Button type="text" >查看学习证据</Button>
|
||||||
|
</Link>
|
||||||
|
)
|
||||||
|
},
|
||||||
{
|
{
|
||||||
title: '操作',
|
title: '操作',
|
||||||
dataIndex: 'action',
|
dataIndex: 'action',
|
||||||
key: 'action',
|
key: 'action',
|
||||||
render: (action, record) => (
|
render: (action, item) => (
|
||||||
<>
|
<Popconfirm title="确定移除学生?" onConfirm={e=>removeStudent(action, item)}>
|
||||||
<Tooltip placement="topLeft" title="点击查看学习证据">
|
|
||||||
<Link to={`/project/${pid}/student/${record.studentId}/evidence`}>
|
|
||||||
<Button type="text" icon={<ArrowRightOutlined />} style={{marginRight: '30px', width: '50px'}}/>
|
|
||||||
</Link>
|
|
||||||
</Tooltip>
|
|
||||||
<Popconfirm title="确定移除学生?" onConfirm={e=>removeStudent(action, record)}>
|
|
||||||
<Button shape="circle" type="text" style={{color: 'red'}} icon={<DeleteOutlined/>}/>
|
<Button shape="circle" type="text" style={{color: 'red'}} icon={<DeleteOutlined/>}/>
|
||||||
</Popconfirm>
|
</Popconfirm>
|
||||||
</>
|
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
|
|
|
@ -45,18 +45,18 @@ func init() {
|
||||||
|
|
||||||
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
|
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "GetProjectDetail",
|
Method: "UpdateProject",
|
||||||
Router: "/:id",
|
Router: "/:id",
|
||||||
AllowHTTPMethods: []string{"get"},
|
AllowHTTPMethods: []string{"post"},
|
||||||
MethodParams: param.Make(),
|
MethodParams: param.Make(),
|
||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
|
||||||
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
|
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "UpdateProject",
|
Method: "GetProjectDetail",
|
||||||
Router: "/:id",
|
Router: "/:id",
|
||||||
AllowHTTPMethods: []string{"post"},
|
AllowHTTPMethods: []string{"get"},
|
||||||
MethodParams: param.Make(),
|
MethodParams: param.Make(),
|
||||||
Filters: nil,
|
Filters: nil,
|
||||||
Params: nil})
|
Params: nil})
|
||||||
|
@ -207,7 +207,7 @@ func init() {
|
||||||
|
|
||||||
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
|
beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"] = append(beego.GlobalControllerRouter["OpenPBL/controllers:ProjectController"],
|
||||||
beego.ControllerComments{
|
beego.ControllerComments{
|
||||||
Method: "GetSectionTasks",
|
Method: "GetSectionTasksDetail",
|
||||||
Router: "/:projectId/section/:sectionId/tasks",
|
Router: "/:projectId/section/:sectionId/tasks",
|
||||||
AllowHTTPMethods: []string{"get"},
|
AllowHTTPMethods: []string{"get"},
|
||||||
MethodParams: param.Make(),
|
MethodParams: param.Make(),
|
||||||
|
|
Loading…
Reference in New Issue