145
141
return _get_exercise_attempts(store, user, exercise, worksheet, as_of,
148
def save_exercise(store, user, exercise, worksheet, text, date):
144
def save_exercise(store, user, worksheet_exercise, text, date):
149
145
"""Save an exercise for a user.
151
Given a store, User, Exercise and text and date, save the text to the
147
Given a store, User, WorksheetExercise, text and date, save the text to the
152
148
database. This will create the ExerciseSave if needed.
154
150
saved = store.find(ivle.database.ExerciseSave,
155
151
ivle.database.ExerciseSave.user_id == user.id,