From 189342c67a6e29a913275c16da4731206e8578cd Mon Sep 17 00:00:00 2001
From: Miguel Barao
Date: Wed, 10 Jan 2018 17:46:52 +0000
Subject: [PATCH] - added commandline option --show-ref
---
serve.py | 6 ++++--
templates/question.html | 6 ++++++
templates/review-question.html | 11 ++++++++++-
templates/test.html | 2 +-
4 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/serve.py b/serve.py
index e131ef7..7fb278e 100755
--- a/serve.py
+++ b/serve.py
@@ -321,8 +321,9 @@ def main():
argparser = argparse.ArgumentParser(description='Server for online tests. Enrolled students and tests have to be previously configured. Please read the documentation included with this software before running the server.')
argparser.add_argument('testfile', type=str, nargs='+', help='test/exam in YAML format.') # FIXME only one exam supported at the moment
argparser.add_argument('--allow-all', action='store_true', help='Students are initially allowed to login (can be denied later)')
- argparser.add_argument('--debug', action='store_true',
- help='Enable debug messages.')
+ argparser.add_argument('--debug', action='store_true', help='Enable debug messages')
+ argparser.add_argument('--show-ref', action='store_true', help='Show question references')
+
arg = argparser.parse_args()
# --- Setup logging
@@ -342,6 +343,7 @@ def main():
'filename': arg.testfile[0] or '',
'debug': arg.debug,
'allow_all': arg.allow_all,
+ 'show_ref': arg.show_ref,
}
try:
diff --git a/templates/question.html b/templates/question.html
index ba726ad..2e34215 100644
--- a/templates/question.html
+++ b/templates/question.html
@@ -22,5 +22,11 @@
+
+ {% if show_ref %}
+
+ {% end %}
{% end %}
\ No newline at end of file
diff --git a/templates/review-question.html b/templates/review-question.html
index 79baffb..f43dbd5 100644
--- a/templates/review-question.html
+++ b/templates/review-question.html
@@ -50,6 +50,11 @@
{{ q['comments'] }}
{% end %}
+
+ {% if t['show_ref'] %}
+ {{q['ref']}}
+ {% end %}
+
@@ -77,13 +82,17 @@
-
{% end %}
diff --git a/templates/test.html b/templates/test.html
index d4d8c46..ace82d7 100644
--- a/templates/test.html
+++ b/templates/test.html
@@ -84,7 +84,7 @@