Fixed an use case where the export of Excel failed if no students had answered it

This commit is contained in:
Joao Ramos
2024-08-27 23:11:40 +01:00
parent 23e26617e2
commit aa4e13a18d

View File

@@ -195,12 +195,16 @@ function commonExcel({
// K10:M12 = 10,11,12,13 // K10:M12 = 10,11,12,13
// horizontally group Test Sections // horizontally group Test Sections
worksheet.mergeCells(
startIndexTable, // if there are test section headers to even merge:
staticHeaders.length + 1, if(testSectionHeaders.length > 1) {
startIndexTable, worksheet.mergeCells(
tableColumnHeadersFirstPart.length startIndexTable,
); staticHeaders.length + 1,
startIndexTable,
tableColumnHeadersFirstPart.length
);
}
// Add the dynamic second and third header rows for test sections and sub-columns // Add the dynamic second and third header rows for test sections and sub-columns
worksheet.addRow([ worksheet.addRow([