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 @@
{% for i, q in enumerate(t['questions']) %} - {% module Template(templ[q['type']], i=i, q=q, md=md) %} + {% module Template(templ[q['type']], i=i, q=q, md=md, show_ref=t['show_ref']) %} {% end %}
-- libgit2 0.21.2