diff --git a/BUGS.md b/BUGS.md index 55a96a2..a84f87c 100644 --- a/BUGS.md +++ b/BUGS.md @@ -1,6 +1,7 @@ # BUGS +- guardar o estado a meio de um nível. - 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/questions.py b/aprendizations/questions.py index 86b2095..06df2d5 100644 --- a/aprendizations/questions.py +++ b/aprendizations/questions.py @@ -37,6 +37,7 @@ class Question(dict): 'comments': '', 'solution': '', 'files': {}, + 'max_tries': 3, }) def correct(self) -> None: @@ -78,6 +79,7 @@ class QuestionRadio(Question): 'correct': 0, 'shuffle': True, 'discount': True, + 'max_tries': (n + 3) // 4 # 1 try for each 4 options }) # convert int to list, e.g. correct: 2 --> correct: [0,0,1,0,0] @@ -157,6 +159,7 @@ class QuestionCheckbox(Question): 'shuffle': True, 'discount': True, 'choose': n, # number of options + 'max_tries': max(1, min(n - 1, 3)) }) if len(self['correct']) != n: -- libgit2 0.21.2