Commit c5485e4f6ba219dbca503acb22806ca9bf7c63db

Authored by Miguel Barão
2 parents b573c044 62e66219
Exists in master and in 1 other branch dev

Merge branch 'master' into dev

fixes initdb error where csv was being initialized twice.
perguntations/__init__.py
@@ -32,7 +32,7 @@ proof of submission and for review. @@ -32,7 +32,7 @@ proof of submission and for review.
32 ''' 32 '''
33 33
34 APP_NAME = 'perguntations' 34 APP_NAME = 'perguntations'
35 -APP_VERSION = '2022.01.dev1' 35 +APP_VERSION = '2022.03.dev1'
36 APP_DESCRIPTION = str(__doc__) 36 APP_DESCRIPTION = str(__doc__)
37 37
38 __author__ = 'Miguel Barão' 38 __author__ = 'Miguel Barão'
perguntations/main.py
@@ -101,7 +101,7 @@ def get_logger_config(debug=False) -> dict: @@ -101,7 +101,7 @@ def get_logger_config(debug=False) -> dict:
101 } 101 }
102 102
103 # ---------------------------------------------------------------------------- 103 # ----------------------------------------------------------------------------
104 -def main(): 104 +def main() -> None:
105 ''' 105 '''
106 Tornado web server 106 Tornado web server
107 ''' 107 '''
perguntations/templates/test.html
@@ -158,6 +158,13 @@ @@ -158,6 +158,13 @@
158 viewportMargin: Infinity, 158 viewportMargin: Infinity,
159 matchBrackets: true, 159 matchBrackets: true,
160 styleActiveLine: true, 160 styleActiveLine: true,
  161 + indentUnit: 4,
  162 + indentWithTabs: false,
  163 + smartIndent: true,
  164 + extraKeys: {
  165 + "Tab": (cm) => cm.execCommand("indentMore"),
  166 + "Shift-Tab": (cm) => cm.execCommand("indentLess"),
  167 + },
161 }); 168 });
162 }); 169 });
163 </script> 170 </script>
perguntations/test.py
@@ -16,6 +16,16 @@ logger = logging.getLogger(__name__) @@ -16,6 +16,16 @@ logger = logging.getLogger(__name__)
16 class Test(dict): 16 class Test(dict):
17 ''' 17 '''
18 Each instance Test() is a concrete test of a single student. 18 Each instance Test() is a concrete test of a single student.
  19 + A test can be in one of the states: ACTIVE, SUBMITTED, CORRECTED, QUIT
  20 + Methods:
  21 + t.start(student) - marks start of test (register time and state)
  22 + t.reset_answers() - remove all answers from the test
  23 + t.update_answer(ref, ans) - update answer of a given question
  24 + t.submit(answers_dict) - update answers, register time and state
  25 + t.correct_async()
  26 + t.correct() - corrects questions and compute grade, register state
  27 + t.giveup() - register the test as given up, answers are not corrected
  28 + t.save_json(filename) - save the current test to file in JSON format
19 ''' 29 '''
20 30
21 # ------------------------------------------------------------------------ 31 # ------------------------------------------------------------------------