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