diff --git a/assignment/impl/src/java/org/sakaiproject/assignment/impl/SpreadsheetExporter.java b/assignment/impl/src/java/org/sakaiproject/assignment/impl/SpreadsheetExporter.java index 56bab1095226..a3c075b84a2f 100644 --- a/assignment/impl/src/java/org/sakaiproject/assignment/impl/SpreadsheetExporter.java +++ b/assignment/impl/src/java/org/sakaiproject/assignment/impl/SpreadsheetExporter.java @@ -103,7 +103,7 @@ class CsvExporter extends SpreadsheetExporter { } catch (IOException e) { // tried } - gradesBuffer = new CSVWriter(osw, csvSep.charAt(0)); + gradesBuffer = new CSVWriter(osw, csvSep.charAt(0), CSVWriter.DEFAULT_QUOTE_CHARACTER, CSVWriter.DEFAULT_ESCAPE_CHARACTER, CSVWriter.RFC4180_LINE_END); addRow(title, gradeType); addRow(""); } diff --git a/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java b/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java index e469c4643458..806c26703f7a 100644 --- a/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java +++ b/assignment/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java @@ -42,7 +42,10 @@ import java.util.zip.ZipEntry; import java.util.zip.ZipFile; +import com.opencsv.CSVParser; +import com.opencsv.CSVParserBuilder; import com.opencsv.CSVReader; +import com.opencsv.CSVReaderBuilder; import lombok.Data; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections.CollectionUtils; @@ -13271,7 +13274,8 @@ private Map uploadAll_parseZipFile(SessionState stat // read grades.cvs from zip String csvSep = assignmentService.getCsvSeparator(); - CSVReader reader = new CSVReader(new InputStreamReader(zipFile.getInputStream(entry)), csvSep.charAt(0)); + CSVParser parser = new CSVParserBuilder().withSeparator(csvSep.charAt(0)).build(); + CSVReader reader = new CSVReaderBuilder(new InputStreamReader(zipFile.getInputStream(entry))).withCSVParser(parser).build(); List lines = reader.readAll();