MCPcopy Create free account
hub / github.com/0010aor/FlashNotes / create_practice_cards

Function create_practice_cards

backend/tests/stats/utils.py:31–43  ·  view source on GitHub ↗
(db, sessions, cards)

Source from the content-addressed store, hash-verified

29
30
31def create_practice_cards(db, sessions, cards):
32 practice_cards = [
33 PracticeCard(
34 session_id=session.id,
35 card_id=card.id,
36 is_practiced=True,
37 is_correct=(card_idx % 2 == 0),
38 )
39 for session in sessions
40 for card_idx, card in enumerate(cards)
41 ]
42 db.add_all(practice_cards)
43 db.commit()

Callers 2

_createFunction · 0.90
_createFunction · 0.90

Calls 1

PracticeCardClass · 0.90

Tested by 2

_createFunction · 0.72
_createFunction · 0.72