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

« back to all changes in this revision

Viewing changes to ivle/db.py

  • Committer: Matt Giuca
  • Date: 2009-01-19 16:03:36 UTC
  • mto: This revision was merged to the branch mainline in revision 1090.
  • Revision ID: matt.giuca@gmail.com-20090119160336-28ob0uev0hnikec3
Added new module: ivle.worksheet. This will contain general functions for
    worksheets (particularly for interacting with the DB), which don't belong
    in either tutorial or tutorialservice.
    worksheet now has get_exercise_status, which is a Storm re-implementation
    of ivle.db.get_problem_status. Much cleaner!
tutorial, tutorialservice: Now use ivle.worksheet.get_exercise_status rather
    than ivle.db.get_problem_status.
ivle.db: Renamed get_problem_status to _get_problem_status. Still required,
    but only used internally now.

Show diffs side-by-side

added added

removed removed

Lines of Context:
606
606
        else:
607
607
            return None
608
608
 
609
 
    def get_problem_status(self, login, exercisename, dry=False):
 
609
    def _get_problem_status(self, login, exercisename, dry=False):
610
610
        """Given a login name and exercise name, returns information about the
611
611
        user's performance on that problem.
612
612
        Returns a tuple of:
679
679
            result = self.db.query(query)
680
680
            # Now get the student's pass/fail for each problem in this worksheet
681
681
            for problemid, optional in result.getresult():
682
 
                done, _ = self.get_problem_status(login, problemid)
 
682
                done, _ = self._get_problem_status(login, problemid)
683
683
                # done is a bool, whether this student has completed that
684
684
                # problem
685
685
                if _parse_boolean(optional):