--
This commit is contained in:
parent
2b02739fec
commit
666a4b9f90
@ -163,27 +163,22 @@ func WriteDataToExcel(buffer io.Writer, questions []model.Question, answers []mo
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
count++
|
count++
|
||||||
} else if q.Type == model.TypeResult {
|
|
||||||
index := binarySearch(response, q.Id)
|
|
||||||
if index != -1 {
|
|
||||||
content := response[index].Content
|
|
||||||
score , err := strconv.ParseInt(content, 10, 64)
|
|
||||||
if err != nil {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
cell := ToAlphaString(count) + strconv.Itoa(row)
|
|
||||||
if err := file.SetCellValue(sheet, cell, score); err != nil {
|
|
||||||
fmt.Println(err.Error())
|
|
||||||
}
|
|
||||||
count++
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
index := binarySearch(response, results[session].QuestionId)
|
||||||
|
content := response[index].Content
|
||||||
|
score , err := strconv.ParseInt(content, 10, 64)
|
||||||
cell := ToAlphaString(len(headers)) + strconv.Itoa(row)
|
cell := ToAlphaString(len(headers)) + strconv.Itoa(row)
|
||||||
if err := file.SetCellValue(sheet, cell, mapQueRes[results[session].QuestionId]); err != nil {
|
if err != nil {
|
||||||
fmt.Println(err.Error())
|
if err := file.SetCellValue(sheet, cell, mapQueRes[results[session].QuestionId]); err != nil {
|
||||||
|
fmt.Println(err.Error())
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if err := file.SetCellValue(sheet, cell, score); err != nil {
|
||||||
|
fmt.Println(err.Error())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
row := 2
|
row := 2
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user