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

« back to all changes in this revision

Viewing changes to ivle/worksheet/utils.py

  • Committer: William Grant
  • Date: 2010-07-28 04:13:05 UTC
  • mfrom: (1801.1.2 die-cjson-die)
  • Revision ID: grantw@unimelb.edu.au-20100728041305-xwypm3cn1l1mnki1
Port from cjson to (simple)json.

Show diffs side-by-side

added added

removed removed

Lines of Context:
308
308
    jail_path = os.path.join(config['paths']['jails']['mounts'],
309
309
                             user.login)
310
310
    working_dir = os.path.join("/home", user.login)
311
 
    cons = ivle.console.Console(config, user.unixid, jail_path,
 
311
    cons = ivle.console.Console(config, user, jail_path,
312
312
                                working_dir)
313
313
 
314
314
    # Parse the file into a exercise object using the test suite
346
346
 
347
347
 
348
348
# XXX: This really shouldn't be needed.
349
 
def create_list_of_fake_worksheets_and_stats(config, store, user, offering):
 
349
def create_list_of_fake_worksheets_and_stats(config, store, user, offering,
 
350
    as_of=None):
350
351
    """Take an offering's real worksheets, converting them into stats.
351
352
 
352
353
    The worksheet listing views expect special fake worksheet objects
373
374
        if new_worksheet.assessable:
374
375
            # Calculate the user's score for this worksheet
375
376
            mand_done, mand_total, opt_done, opt_total = (
376
 
                ivle.worksheet.utils.calculate_score(store, user, worksheet))
 
377
                ivle.worksheet.utils.calculate_score(store, user, worksheet,
 
378
                                                     as_of=as_of))
377
379
            if opt_total > 0:
378
380
                optional_message = " (excluding optional exercises)"
379
381
            else: