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

Function create_sessions

backend/tests/stats/utils.py:14–28  ·  view source on GitHub ↗
(db, user_id, collection, num_sessions, num_cards)

Source from the content-addressed store, hash-verified

12
13
14def create_sessions(db, user_id, collection, num_sessions, num_cards):
15 sessions = [
16 PracticeSession(
17 user_id=user_id,
18 collection_id=collection.id,
19 total_cards=num_cards,
20 cards_practiced=num_cards,
21 correct_answers=3,
22 is_completed=True,
23 )
24 for _ in range(num_sessions)
25 ]
26 db.add_all(sessions)
27 db.flush()
28 return sessions
29
30
31def create_practice_cards(db, sessions, cards):

Callers 2

_createFunction · 0.90
_createFunction · 0.90

Calls 1

PracticeSessionClass · 0.90

Tested by 2

_createFunction · 0.72
_createFunction · 0.72