~azzar1/unity/add-show-desktop-key

« back to all changes in this revision

Viewing changes to ivle/worksheet/utils.py

  • Committer: David Coles
  • Date: 2009-12-10 01:18:36 UTC
  • Revision ID: coles.david@gmail.com-20091210011836-6kk2omcmr9hvphj0
Correct documentation's system diagram (console communication goes via Application Slaves)

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
from ivle.database import ExerciseAttempt, ExerciseSave, Worksheet, \
31
31
                          WorksheetExercise, Exercise
32
32
 
33
 
__all__ = ['get_exercise_status', 'get_exercise_stored_text',
34
 
           'get_exercise_attempts', 'get_exercise_attempt',
 
33
__all__ = ['ExerciseNotFound', 'get_exercise_status',
 
34
           'get_exercise_stored_text', 'get_exercise_attempts',
 
35
           'get_exercise_attempt',
35
36
          ]
36
37
 
 
38
class ExerciseNotFound(Exception):
 
39
    pass
 
40
 
37
41
def get_exercise_status(store, user, worksheet_exercise, as_of=None):
38
42
    """Given a storm.store, User and Exercise, returns information about
39
43
    the user's performance on that problem.
268
272
                Exercise.id == exerciseid
269
273
            ).one()
270
274
            if exercise is None:
271
 
                raise NotFound()
 
275
                raise ExerciseNotFound(exerciseid)
272
276
            worksheet_exercise = WorksheetExercise()
273
277
            worksheet_exercise.worksheet_id = worksheet.id
274
278
            worksheet_exercise.exercise_id = exercise.id