'--all', action='store_const', const=True, default=False,
help=('ask all questions '
'(not just never-correctly-answered leaf questions)'))
+ parser.add_argument(
+ '-t', '--tag', action='append',
+ help='limit original questions to those matching at least one tag')
parser.add_argument(
'quiz', metavar='QUIZ',
help='path to a quiz file')
answers.load()
except IOError:
pass
- stack = None
+ stack = answers.get_never_correctly_answered(
+ questions=quiz.leaf_questions())
if args.all:
stack = [question for question in quiz]
+ if args.tag:
+ stack = [q for q in stack if q.tags.intersection(args.tag)]
ui = _cli.CommandLineInterface(quiz=quiz, answers=answers, stack=stack)
ui.run()
ui.answers.save()
'multiline',
'help',
'dependencies',
+ 'tags',
]
def __init__(self, **kwargs):
state['multiline'] = False
if 'dependencies' not in state:
state['dependencies'] = []
+ if 'tags' not in state:
+ state['tags'] = set()
+ else:
+ state['tags'] = set(state['tags'])
for attr in self._state_attributes:
if attr not in state:
state[attr] = None