Merge branch 'master' of github.com:MITx/mitx into stable-edx4edx
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
|
||||
import logging
|
||||
|
||||
log = logging.getLogger("mitx.common.lib.mitxmako")
|
||||
log = logging.getLogger("mitx." + __name__)
|
||||
|
||||
from django.template import Context
|
||||
from django.http import HttpResponse
|
||||
|
||||
@@ -223,7 +223,7 @@ def get_module(tree, module, id_tag, module_id, sections_dirname, options):
|
||||
result_set = tree.xpath(xpath_search)
|
||||
if len(result_set) < 1:
|
||||
# Not found in main tree. Let's look in the section files.
|
||||
section_list = (s[:-4] for s in os.listdir(sections_dirname) if s[-4:]=='.xml')
|
||||
section_list = (s[:-4] for s in os.listdir(sections_dirname) if s.endswith('.xml'))
|
||||
for section in section_list:
|
||||
try:
|
||||
s = get_section(section, options, sections_dirname)
|
||||
|
||||
@@ -176,11 +176,13 @@ def get_score(user, problem, cache, coursename=None):
|
||||
## HACK 2: Backwards-compatibility: This should be written when a grade is saved, and removed from the system
|
||||
# TODO: These are no longer correct params for I4xSystem -- figure out what this code
|
||||
# does, clean it up.
|
||||
from module_render import I4xSystem
|
||||
system = I4xSystem(None, None, None, coursename=coursename)
|
||||
total=float(xmodule.capa_module.Module(system, etree.tostring(problem), "id").max_score())
|
||||
response.max_grade = total
|
||||
response.save()
|
||||
# from module_render import I4xSystem
|
||||
# system = I4xSystem(None, None, None, coursename=coursename)
|
||||
# total=float(xmodule.capa_module.Module(system, etree.tostring(problem), "id").max_score())
|
||||
# response.max_grade = total
|
||||
# response.save()
|
||||
total = 1
|
||||
# For a temporary fix, we just assume a problem is worth 1 point if we haven't seen it before. This is totally incorrect
|
||||
|
||||
#Now we re-weight the problem, if specified
|
||||
weight = problem.get("weight", None)
|
||||
|
||||
@@ -15,7 +15,7 @@ middleware.MakoMiddleware()
|
||||
|
||||
def check_names(user, course):
|
||||
'''
|
||||
Complain if any problems have alphanumeric names.
|
||||
Complain if any problems have non alphanumeric names.
|
||||
TODO (vshnayder): there are some in 6.002x that don't. Is that actually a problem?
|
||||
'''
|
||||
all_ok = True
|
||||
|
||||
Reference in New Issue
Block a user