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

« back to all changes in this revision

Viewing changes to ivle/webapp/tutorial/service.py

  • Committer: Nick Chadwick
  • Date: 2009-02-25 16:36:02 UTC
  • mto: (1099.1.227 exercise-ui)
  • mto: This revision was merged to the branch mainline in revision 1162.
  • Revision ID: chadnickbok@gmail.com-20090225163602-vr6mym3wsa6bxa8d
tutorials can now use RST

Show diffs side-by-side

added added

removed removed

Lines of Context:
31
31
import ivle.worksheet
32
32
import ivle.conf
33
33
import ivle.webapp.tutorial.test
34
 
 
 
34
from ivle.webapp.tutorial.rst import rst as rstfunc
35
35
from ivle.webapp.base.rest import (JSONRESTView, named_operation,
36
36
                                   require_permission)
37
37
from ivle.webapp.errors import NotFound
353
353
        # This call is added for clarity, as the worksheet is implicitly added.        
354
354
        req.store.add(new_worksheet)
355
355
        
356
 
        generate_exerciselist(new_worksheet, req, data)
 
356
        if new_worksheet.format == u'rst':
 
357
            ws_data = '<worksheet>' + rstfunc(unicode(data)) + '</worksheet>'
 
358
            generate_exerciselist(new_worksheet, req, ws_data)
 
359
        else:
 
360
            generate_exerciselist(new_worksheet, req, data)
357
361
        
358
362
        return {"result": "ok"}
359
363