Fix grader test files that don't end with \n
Review Request #139 - Created March 18, 2010 and submitted
Information | |
---|---|
Victor Rusu | |
infoarena | |
Reviewers | |
hackers | |
Wrote a script to add a \n to all grader test files that currently don't end with one and modified the attachment code to auto-check for \n at upload time.
-
trunk/common/attachment.php (Diff revision 1) -
Move this to a is_problem_page function.
-
trunk/common/attachment.php (Diff revision 1) -
check_ending_newline sound more like a function returning true if the file has \n at the end or false otherwise but doesn't really do anything. add_ending_newline sounds better.
-
trunk/common/attachment.php (Diff revision 1) -
You should check the file_path exists.
-
trunk/scripts/attach-endline-fix (Diff revision 1) -
is_grader_testfile($file['name']) && is_page_problem($file['page'])
-
trunk/scripts/attach-endline-fix (Diff revision 1) -
why chr(10) and not '\n'?
-
trunk/www/controllers/attachment.php (Diff revision 1) -
is_grader_testfile(file_att['name']) && is_problem_page(page_name)
-
trunk/common/attachment.php (Diff revision 2) -
return true;
-
trunk/common/attachment.php (Diff revision 2) -
return false;
-
trunk/scripts/attach-endline-fix (Diff revision 2) -
if (add_ending_newline())
-
trunk/scripts/attach-endline-fix (Diff revision 2) -
log_print("Added newline to file " . $file_path)