Commit 6d5a034747b7fc79983b1e409ff4ceda2f1ae0f5

Authored by Miguel Barão
1 parent 3e4621f7
Exists in master and in 1 other branch dev

- fixed a path issue

Showing 3 changed files with 8 additions and 6 deletions   Show diff stats
BUGS.md
1 1 BUGS:
2 2  
3 3 - reload da página rebenta o estado.
4   -- barra de progresso no footer a funcionar
5 4 - indicar o topico actual no sidebar
6 5 - session management. close after inactive time.
7 6 - guardar state cada vez que topico termina
... ... @@ -17,6 +16,7 @@ TODO:
17 16  
18 17 SOLVED:
19 18  
  19 +- barra de progresso a funcionar
20 20 - mostra tópicos do lado esquerdo, indicando quais estão feitos
21 21 - database hardcoded in LearnApp.
22 22 - se students.db não existe, rebenta.
... ...
app.py
... ... @@ -136,7 +136,6 @@ class LearnApp(object):
136 136 finishtime=str(current_question['finish_time']),
137 137 student_id=uid))
138 138 s.commit()
139   - logger.debug('check_answer: saving done')
140 139  
141 140 return knowledge.new_question()
142 141  
... ... @@ -185,11 +184,13 @@ class LearnApp(object):
185 184 fullpath = path.expanduser(path.join(prefix, n))
186 185 if path.isdir(fullpath):
187 186 # if directory defaults to "prefix/questions.yaml"
188   - fullpath = path.join(fullpath, "questions.yaml")
  187 + filename = path.join(fullpath, "questions.yaml")
  188 + else:
  189 + logger.error(f'build_dependency_graph: "{fullpath}" is not a directory')
189 190  
190   - if path.isfile(fullpath):
191   - logger.info(f'Loading questions from "{fullpath}"')
192   - questions = load_yaml(fullpath, default=[])
  191 + if path.isfile(filename):
  192 + logger.info(f'Loading questions from "{filename}"')
  193 + questions = load_yaml(filename, default=[])
193 194 for q in questions:
194 195 q['path'] = fullpath
195 196  
... ...
models.py
... ... @@ -15,6 +15,7 @@ class StudentTopic(Base):
15 15 student_id = Column(String, ForeignKey('students.id'), primary_key=True)
16 16 topic_id = Column(String, ForeignKey('topics.id'), primary_key=True)
17 17 level = Column(Float)
  18 + # date = Column(String)
18 19  
19 20 # ---
20 21 student = relationship('Student', back_populates='topics')
... ...