|
@@ -267,17 +267,18 @@ func GetCheckQuestionsByTemplateId(id int64) (rsp []*protocol.CheckQuestion, err |
|
@@ -267,17 +267,18 @@ func GetCheckQuestionsByTemplateId(id int64) (rsp []*protocol.CheckQuestion, err |
267
|
var tmpGroupId int64
|
267
|
var tmpGroupId int64
|
268
|
var idx int = 0
|
268
|
var idx int = 0
|
269
|
var groupIdx = 0
|
269
|
var groupIdx = 0
|
|
|
270
|
+ var parentId = 0
|
270
|
for i := range checks {
|
271
|
for i := range checks {
|
271
|
c := checks[i]
|
272
|
c := checks[i]
|
272
|
|
273
|
|
273
|
if tmpGroupId != c.Pid {
|
274
|
if tmpGroupId != c.Pid {
|
274
|
groupIdx++
|
275
|
groupIdx++
|
275
|
idx = 0
|
276
|
idx = 0
|
|
|
277
|
+ parentId = i + 1
|
276
|
}
|
278
|
}
|
277
|
tmpGroupId = c.Pid
|
279
|
tmpGroupId = c.Pid
|
278
|
item := protocol.NewCheckQuestion(c.Title, getQuestionTitle(groupIdx, idx, c.Title), c.Pid, protocol.CheckOptionsCommit)
|
280
|
item := protocol.NewCheckQuestion(c.Title, getQuestionTitle(groupIdx, idx, c.Title), c.Pid, protocol.CheckOptionsCommit)
|
279
|
- item.Id = c.Id
|
|
|
280
|
- item.ParentId = c.ParentId
|
281
|
+ item.Id, item.ParentId = genCustomizeQuestionId(i, idx, int64(parentId))
|
281
|
rsp = append(rsp, item)
|
282
|
rsp = append(rsp, item)
|
282
|
idx++
|
283
|
idx++
|
283
|
}
|
284
|
}
|
|
@@ -326,9 +327,9 @@ func GetCheckQuestionsByChanceId(header *protocol.RequestHeader, id int64) (rsp |
|
@@ -326,9 +327,9 @@ func GetCheckQuestionsByChanceId(header *protocol.RequestHeader, id int64) (rsp |
326
|
item.Answer = c.Answer
|
327
|
item.Answer = c.Answer
|
327
|
}
|
328
|
}
|
328
|
}
|
329
|
}
|
329
|
- if item.Id == 0 {
|
|
|
330
|
- item.Id, item.ParentId = genCustomizeQuestionId(i, idx, int64(parentId))
|
|
|
331
|
- }
|
330
|
+ //if item.Id == 0 {
|
|
|
331
|
+ item.Id, item.ParentId = genCustomizeQuestionId(i, idx, int64(parentId))
|
|
|
332
|
+ //}
|
332
|
rsp = append(rsp, item)
|
333
|
rsp = append(rsp, item)
|
333
|
idx++
|
334
|
idx++
|
334
|
}
|
335
|
}
|