From 3e5d53b94cb535071ee0e4135de0f7d191cf26dc Mon Sep 17 00:00:00 2001 From: jwansek Date: Mon, 21 Feb 2022 16:25:57 +0000 Subject: removed \rs for cross platform compatibility --- ExampleAssessments/CMP-4009B.yml | 6 +++++- ExampleAssessments/example.yml | 1 + ExampleSubmission/example.py | 6 +++++- examplerun.bat | 2 +- reflect.py | 1 + smarker.conf | 4 ++-- templates/markdown.jinja2 | Bin 9 -> 26 bytes templates/md.jinja2 | 4 ++-- templates/text.jinja2 | Bin 10 -> 28 bytes templates/txt.jinja2 | 4 ++-- 10 files changed, 19 insertions(+), 9 deletions(-) diff --git a/ExampleAssessments/CMP-4009B.yml b/ExampleAssessments/CMP-4009B.yml index d0dd2b2..c945907 100644 --- a/ExampleAssessments/CMP-4009B.yml +++ b/ExampleAssessments/CMP-4009B.yml @@ -1,4 +1,4 @@ -name: CMP-4009B +name: CMP-4009B-2020-A2 files: - pjtool.py: classes: @@ -39,6 +39,10 @@ files: - tester.py: functions: - dateTester(2) + run: + - python tester.py: + regexes: + - True\nFalse - turbine.py: classes: - Turbine: diff --git a/ExampleAssessments/example.yml b/ExampleAssessments/example.yml index 215a959..ec09561 100644 --- a/ExampleAssessments/example.yml +++ b/ExampleAssessments/example.yml @@ -29,6 +29,7 @@ files: - python example.py 1: regexes: - hello world\! + - True\n\nFalse - aFileThatIsntThere.py: functions: - hello_world(2) diff --git a/ExampleSubmission/example.py b/ExampleSubmission/example.py index 9b5f0e8..0cf7cd7 100644 --- a/ExampleSubmission/example.py +++ b/ExampleSubmission/example.py @@ -70,5 +70,9 @@ def greet(*names, greeting="Hello"): for name in names: print(greeting, name) +def make_multilines(): + print("True\n\nFalse") + if __name__ == "__main__": - print(hello_world(int(sys.argv[1])) + "\n\nowo" ) \ No newline at end of file + print(hello_world(int(sys.argv[1])) + "\n\nowo" ) + make_multilines() \ No newline at end of file diff --git a/examplerun.bat b/examplerun.bat index 3364a63..d595bca 100644 --- a/examplerun.bat +++ b/examplerun.bat @@ -1,3 +1,3 @@ zip -r 100301654.zip .\ExampleSubmission\ -python .\mark.py -s 100301654.zip -a .\ExampleAssessments\example.yml -f md -o auto +python .\mark.py -s 100301654.zip -a .\ExampleAssessments\example.yml -f md -o auto --md_show_all_run_output True rm 100301654.zip \ No newline at end of file diff --git a/reflect.py b/reflect.py index b508f15..392188c 100644 --- a/reflect.py +++ b/reflect.py @@ -362,6 +362,7 @@ def gen_reflection_report(client_code_path, assessment_struct, student_no, confi break lines += line.decode() + lines = lines.replace("\r", "") matches = {} for regex_ in contents["regexes"]: matches[regex_] = re.findall(regex_, lines) diff --git a/smarker.conf b/smarker.conf index e31970d..e8db25c 100644 --- a/smarker.conf +++ b/smarker.conf @@ -8,10 +8,10 @@ passwd = smarkerPassword show_full_docs = False show_source = False show_all_regex_occurrences = True -show_all_run_output = True +show_all_run_output = False [txt] show_full_docs = False show_source = False show_all_regex_occurrences = True -show_all_run_output = True \ No newline at end of file +show_all_run_output = False \ No newline at end of file diff --git a/templates/markdown.jinja2 b/templates/markdown.jinja2 index 4f923d6..99c26ce 120000 Binary files a/templates/markdown.jinja2 and b/templates/markdown.jinja2 differ diff --git a/templates/md.jinja2 b/templates/md.jinja2 index e1d95ca..e764a49 100644 --- a/templates/md.jinja2 +++ b/templates/md.jinja2 @@ -142,7 +142,7 @@ Please note that this file cannot be analysed or have tests preformed upon it- {%- if md_show_all_regex_occurrences == "True" and len_(results) > 0 %} - Occurrences list: {%- for result in results %} - - `{{ result }}` + - `{{ result.replace("\n", "\\n") }}` {%- endfor -%} {%- if md_show_all_run_output == "True" %} - Full runtime output: @@ -161,6 +161,6 @@ Please note that this file cannot be analysed or have tests preformed upon it- {% if out != "stdout" and format != "html" -%} ## Tests: ``` -{{ test_results["pytest_report"] }} +{{ test_results["pytest_report"].replace("\r", "") }} ``` {%- endif -%} \ No newline at end of file diff --git a/templates/text.jinja2 b/templates/text.jinja2 index aad87bd..eca6ebd 120000 Binary files a/templates/text.jinja2 and b/templates/text.jinja2 differ diff --git a/templates/txt.jinja2 b/templates/txt.jinja2 index 0d31047..9eb4beb 100644 --- a/templates/txt.jinja2 +++ b/templates/txt.jinja2 @@ -145,7 +145,7 @@ Report generated at {{ get_datetime() }} {%- if txt_show_all_regex_occurrences == "True" and len_(results) > 0 %} Occurrences list: {%- for result in results %} - {{ result }} + {{ result.replace("\n", "\\n") }} {%- endfor -%} {%- endif -%} {%- endfor -%} @@ -164,5 +164,5 @@ Report generated at {{ get_datetime() }} {% endfor %} {% if out != "stdout" -%} -{{ test_results["pytest_report"] }} +{{ test_results["pytest_report"].replace("\r", "") }} {%- endif -%} \ No newline at end of file -- cgit v1.2.3