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

« back to all changes in this revision

Viewing changes to ivle/worksheet/utils.py

Cache worksheet and exercise rST-generated XHTML in the DB, accelerating rendering by up to 2000%.

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, jail_path,
 
311
    cons = ivle.console.Console(config, user.unixid, 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,
350
 
    as_of=None):
 
349
def create_list_of_fake_worksheets_and_stats(config, store, user, offering):
351
350
    """Take an offering's real worksheets, converting them into stats.
352
351
 
353
352
    The worksheet listing views expect special fake worksheet objects
374
373
        if new_worksheet.assessable:
375
374
            # Calculate the user's score for this worksheet
376
375
            mand_done, mand_total, opt_done, opt_total = (
377
 
                ivle.worksheet.utils.calculate_score(store, user, worksheet,
378
 
                                                     as_of=as_of))
 
376
                ivle.worksheet.utils.calculate_score(store, user, worksheet))
379
377
            if opt_total > 0:
380
378
                optional_message = " (excluding optional exercises)"
381
379
            else: