tl-its-umich-edu / student_explorer

Tool used by Academic advisors to access student weekly performance
Apache License 2.0
10 stars 13 forks source link

Update formatted_grader_comment to catch newlines with or without \r (#224) #230

Closed ssciolla closed 4 years ago

ssciolla commented 4 years ago

This PR changes formatted_grader_comment on the StudentClassSiteAssignment (again!) to catch and remove leading instances of \r (common in Windows environments) as part of the replacement of newline literals with break HTML tags. I accomplished this by using a regular expression that optionally allows for \r before \n. It made sense to use this regular expression approach because I found some other occurrences of the sequence \r (not intended as a carriage return, but part of some other string, I think) which we would not want to be affected via a simple replacement. I updated the fixture .sql file with an instance of \\r\\n and the test with an additional assertion. I also decided to rename the test case to be more specifically about newlines. The PR aims to resolve issue #224.