diff --git a/aprendizations/learnapp.py b/aprendizations/learnapp.py index bef1f10..5afa575 100644 --- a/aprendizations/learnapp.py +++ b/aprendizations/learnapp.py @@ -434,19 +434,19 @@ class LearnApp(object): # makes factory for a single topic # ------------------------------------------------------------------------ def factory_for(self, tref: str) -> Dict[str, QFactory]: - factory: Dict[str, QFactory] = {} + factory: Dict[str, QFactory] = dict() g = self.deps t = g.nodes[tref] # get node - # load questions as list of dicts topicpath: str = path.join(g.graph['prefix'], tref) try: fullpath: str = path.join(topicpath, t['file']) except Exception: msg1 = f'Invalid topic "{tref}"' - msg2 = f'Check dependencies of {", ".join(g.successors(tref))}' - raise LearnException(f'{msg1}. {msg2}') - + msg2 = f'Check dependencies of: {", ".join(g.successors(tref))}' + msg = f'{msg1}. {msg2}' + logger.error(msg) + raise LearnException(msg) logger.debug(f' Loading {fullpath}') try: questions: List[QDict] = load_yaml(fullpath) @@ -457,9 +457,9 @@ class LearnApp(object): msg = f'Failed to load "{fullpath}"' logger.error(msg) raise LearnException(msg) - if not isinstance(questions, list): msg = f'File "{fullpath}" must be a list of questions' + logger.error(msg) raise LearnException(msg) # update refs to include topic as prefix. diff --git a/aprendizations/templates/maintopics-table.html b/aprendizations/templates/maintopics-table.html index fad46b5..9a8a86c 100644 --- a/aprendizations/templates/maintopics-table.html +++ b/aprendizations/templates/maintopics-table.html @@ -60,7 +60,21 @@
-Legenda:
+
+ - Material de estudo
+ - Exercícios
+ - Tópico que não faz parte dos objectivos deste curso mas que é necessário saber
+ - Milestone, terminou um certo conjunto de tópicos
+
- {% if t['type']=='chapter' %}
-
- {{ t['name'] }}
-
- {% elif t['type']=='learn' %}
-
+
+ {% if t['ref'] not in course['goals'] %}
+
+ {% end %}
+
+ {% if t['type']=='chapter' %}
+
+ {% elif t['type']=='learn' %}
- {{ t['name'] }}
-
- {% else %}
-
+ {% else %}
- {{ t['name'] }}
-
- {% end %}
+ {% end %}
+
+ {{ t['name'] }}
+ |
@@ -100,18 +114,19 @@ |
+ {% if t['ref'] not in course['goals'] %}
+
+ {% end %}
+
{% if t['type']=='chapter' %}
- - - {{ t['name'] }} -+ {% elif t['type']=='learn' %} - {{ t['name'] }} {% else %} - {{ t['name'] }} {% end %} + + {{ t['name'] }} |
-- libgit2 0.21.2 |