diff --git a/BUGS.md b/BUGS.md index 85d7255..55a96a2 100644 --- a/BUGS.md +++ b/BUGS.md @@ -1,7 +1,6 @@ # BUGS -- testar se perguntas regex funcionam com yaml.safe_load. - safari as vezes envia dois gets no inicio do topico. nesses casos, a segunda pergunta não é actualizada no browser... o topico tem de ser gerado qd se escolhe o topico em main_topics. O get nao deve alterar o estado. - click numa opcao checkbox fora da checkbox+label não está a funcionar. - shift-enter não está a funcionar diff --git a/aprendizations/knowledge.py b/aprendizations/knowledge.py index 1adc8f0..43935e4 100644 --- a/aprendizations/knowledge.py +++ b/aprendizations/knowledge.py @@ -71,13 +71,14 @@ class StudentKnowledge(object): # ------------------------------------------------------------------------ # FIXME async mas nao tem awaits... do not allow restart same topic async def start_topic(self, topic): - logger.debug(f'StudentKnowledge.start_topic({topic})') + logger.debug('StudentKnowledge.start_topic()') if self.current_topic == topic: + logger.debug(' Restarting current topic is not allowed.') return False # do not allow locked topics if self.is_locked(topic): - logger.debug(f'Topic {topic} is locked') + logger.debug(f' Topic {topic} is locked') return False # starting new topic diff --git a/aprendizations/questions.py b/aprendizations/questions.py index 0bd37f7..cf6d9c3 100644 --- a/aprendizations/questions.py +++ b/aprendizations/questions.py @@ -6,17 +6,9 @@ from os import path import logging import asyncio -# user installed libraries -import yaml - # this project from aprendizations.tools import run_script - -# regular expressions in yaml files, e.g. correct: !regex '[aA]zul' -yaml.add_constructor('!regex', lambda l, n: re.compile(l.construct_scalar(n))) - - # setup logger for this module logger = logging.getLogger(__name__) diff --git a/demo/solar_system/questions.yaml b/demo/solar_system/questions.yaml index 57f2772..17a0094 100644 --- a/demo/solar_system/questions.yaml +++ b/demo/solar_system/questions.yaml @@ -44,7 +44,7 @@ ref: saturn title: Sistema solar text: O planeta do sistema solar conhecido por ter aneis é o planeta... - correct: !regex '[Ss]aturno' + correct: '[Ss]aturno' solution: | O planeta Saturno é famoso pelos seus anéis. É o segundo maior planeta do Sistema Solar, a seguir a Júpiter. -- libgit2 0.21.2