summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjwansek <eddie.atten.ea29@gmail.com>2022-02-21 16:25:57 +0000
committerjwansek <eddie.atten.ea29@gmail.com>2022-02-21 16:25:57 +0000
commit3e5d53b94cb535071ee0e4135de0f7d191cf26dc (patch)
treec84b0b8a739afc4d9480af061ce642b046751b0b
parentc54a8630faa8e1c597d598bf7497d724efb0fb18 (diff)
downloadSmarker-3e5d53b94cb535071ee0e4135de0f7d191cf26dc.tar.gz
Smarker-3e5d53b94cb535071ee0e4135de0f7d191cf26dc.zip
removed \rs for cross platform compatibility
-rw-r--r--ExampleAssessments/CMP-4009B.yml6
-rw-r--r--ExampleAssessments/example.yml1
-rw-r--r--ExampleSubmission/example.py6
-rw-r--r--examplerun.bat2
-rw-r--r--reflect.py1
-rw-r--r--smarker.conf4
l---------templates/markdown.jinja2bin9 -> 26 bytes
-rw-r--r--templates/md.jinja24
l---------templates/text.jinja2bin10 -> 28 bytes
-rw-r--r--templates/txt.jinja24
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
--- a/templates/markdown.jinja2
+++ b/templates/markdown.jinja2
Binary files 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
--- a/templates/text.jinja2
+++ b/templates/text.jinja2
Binary files 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