Commit fd3ba7db by Calen Pennington

Don't make cms.djangoapps a python module

parent fb8352e2
...@@ -13,7 +13,7 @@ import copy ...@@ -13,7 +13,7 @@ import copy
from json import loads from json import loads
from django.contrib.auth.models import User from django.contrib.auth.models import User
from cms.djangoapps.contentstore.utils import get_modulestore from contentstore.utils import get_modulestore
from utils import ModuleStoreTestCase, parse_json from utils import ModuleStoreTestCase, parse_json
from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory from xmodule.modulestore.tests.factories import CourseFactory, ItemFactory
......
...@@ -10,16 +10,16 @@ from django.core.urlresolvers import reverse ...@@ -10,16 +10,16 @@ from django.core.urlresolvers import reverse
from django.utils.timezone import UTC from django.utils.timezone import UTC
from xmodule.modulestore import Location from xmodule.modulestore import Location
from cms.djangoapps.models.settings.course_details import (CourseDetails, from models.settings.course_details import (CourseDetails,
CourseSettingsEncoder) CourseSettingsEncoder)
from cms.djangoapps.models.settings.course_grading import CourseGradingModel from models.settings.course_grading import CourseGradingModel
from cms.djangoapps.contentstore.utils import get_modulestore from contentstore.utils import get_modulestore
from django.test import TestCase from django.test import TestCase
from utils import ModuleStoreTestCase from utils import ModuleStoreTestCase
from xmodule.modulestore.tests.factories import CourseFactory from xmodule.modulestore.tests.factories import CourseFactory
from cms.djangoapps.models.settings.course_metadata import CourseMetadata from models.settings.course_metadata import CourseMetadata
from xmodule.modulestore.xml_importer import import_from_xml from xmodule.modulestore.xml_importer import import_from_xml
from xmodule.modulestore.django import modulestore from xmodule.modulestore.django import modulestore
......
from cms.djangoapps.contentstore.tests.test_course_settings import CourseTestCase from contentstore.tests.test_course_settings import CourseTestCase
from django.core.urlresolvers import reverse from django.core.urlresolvers import reverse
import json import json
......
from cms.djangoapps.contentstore import utils from contentstore import utils
import mock import mock
from django.test import TestCase from django.test import TestCase
......
...@@ -8,7 +8,7 @@ import json ...@@ -8,7 +8,7 @@ import json
from fs.osfs import OSFS from fs.osfs import OSFS
import copy import copy
from cms.djangoapps.contentstore.utils import get_modulestore from contentstore.utils import get_modulestore
from xmodule.modulestore import Location from xmodule.modulestore import Location
from xmodule.modulestore.store_utilities import clone_course from xmodule.modulestore.store_utilities import clone_course
......
...@@ -58,12 +58,12 @@ from contentstore.course_info_model import get_course_updates,\ ...@@ -58,12 +58,12 @@ from contentstore.course_info_model import get_course_updates,\
from cache_toolbox.core import del_cached_content from cache_toolbox.core import del_cached_content
from xmodule.timeparse import stringify_time from xmodule.timeparse import stringify_time
from contentstore.module_info_model import get_module_info, set_module_info from contentstore.module_info_model import get_module_info, set_module_info
from cms.djangoapps.models.settings.course_details import CourseDetails,\ from models.settings.course_details import CourseDetails,\
CourseSettingsEncoder CourseSettingsEncoder
from cms.djangoapps.models.settings.course_grading import CourseGradingModel from models.settings.course_grading import CourseGradingModel
from cms.djangoapps.contentstore.utils import get_modulestore from contentstore.utils import get_modulestore
from django.shortcuts import redirect from django.shortcuts import redirect
from cms.djangoapps.models.settings.course_metadata import CourseMetadata from models.settings.course_metadata import CourseMetadata
# to install PIL on MacOSX: 'easy_install http://dist.repoze.org/PIL-1.1.6.tar.gz' # to install PIL on MacOSX: 'easy_install http://dist.repoze.org/PIL-1.1.6.tar.gz'
......
...@@ -7,8 +7,8 @@ from json.encoder import JSONEncoder ...@@ -7,8 +7,8 @@ from json.encoder import JSONEncoder
import time import time
from contentstore.utils import get_modulestore from contentstore.utils import get_modulestore
from util.converters import jsdate_to_time, time_to_date from util.converters import jsdate_to_time, time_to_date
from cms.djangoapps.models.settings import course_grading from models.settings import course_grading
from cms.djangoapps.contentstore.utils import update_item from contentstore.utils import update_item
import re import re
import logging import logging
......
...@@ -231,16 +231,14 @@ class LoncapaResponse(object): ...@@ -231,16 +231,14 @@ class LoncapaResponse(object):
# hint specified by function? # hint specified by function?
hintfn = hintgroup.get('hintfn') hintfn = hintgroup.get('hintfn')
if hintfn: if hintfn:
''' # Hint is determined by a function defined in the <script> context; evaluate
Hint is determined by a function defined in the <script> context; evaluate # that function to obtain list of hint, hintmode for each answer_id.
that function to obtain list of hint, hintmode for each answer_id.
The function should take arguments (answer_ids, student_answers, new_cmap, old_cmap) # The function should take arguments (answer_ids, student_answers, new_cmap, old_cmap)
and it should modify new_cmap as appropriate. # and it should modify new_cmap as appropriate.
We may extend this in the future to add another argument which provides a # We may extend this in the future to add another argument which provides a
callback procedure to a social hint generation system. # callback procedure to a social hint generation system.
'''
if not hintfn in self.context: if not hintfn in self.context:
msg = 'missing specified hint function %s in script context' % hintfn msg = 'missing specified hint function %s in script context' % hintfn
msg += "\nSee XML source line %s" % getattr(self.xml, 'sourceline', '<unavailable>') msg += "\nSee XML source line %s" % getattr(self.xml, 'sourceline', '<unavailable>')
...@@ -329,7 +327,7 @@ class LoncapaResponse(object): ...@@ -329,7 +327,7 @@ class LoncapaResponse(object):
""" Render a <div> for a message that applies to the entire response. """ Render a <div> for a message that applies to the entire response.
*response_msg* is a string, which may contain XHTML markup *response_msg* is a string, which may contain XHTML markup
Returns an etree element representing the response message <div> """ Returns an etree element representing the response message <div> """
# First try wrapping the text in a <div> and parsing # First try wrapping the text in a <div> and parsing
# it as an XHTML tree # it as an XHTML tree
...@@ -1104,7 +1102,7 @@ def sympy_check2(): ...@@ -1104,7 +1102,7 @@ def sympy_check2():
# the form: # the form:
# {'overall_message': STRING, # {'overall_message': STRING,
# 'input_list': [{ 'ok': BOOLEAN, 'msg': STRING }, ...] } # 'input_list': [{ 'ok': BOOLEAN, 'msg': STRING }, ...] }
# #
# This allows the function to return an 'overall message' # This allows the function to return an 'overall message'
# that applies to the entire problem, as well as correct/incorrect # that applies to the entire problem, as well as correct/incorrect
# status and messages for individual inputs # status and messages for individual inputs
...@@ -1988,7 +1986,7 @@ class AnnotationResponse(LoncapaResponse): ...@@ -1988,7 +1986,7 @@ class AnnotationResponse(LoncapaResponse):
for inputfield in self.inputfields: for inputfield in self.inputfields:
option_scoring = dict([(option['id'], { option_scoring = dict([(option['id'], {
'correctness': choices.get(option['choice']), 'correctness': choices.get(option['choice']),
'points': scoring.get(option['choice']) 'points': scoring.get(option['choice'])
}) for option in self._find_options(inputfield) ]) }) for option in self._find_options(inputfield) ])
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment