Move open ended module file
This commit is contained in:
@@ -12,6 +12,7 @@ import sys
|
||||
from pkg_resources import resource_string
|
||||
|
||||
from .capa_module import only_one, ComplexEncoder
|
||||
from common.lib.xmodule.xmodule import open_ended_module
|
||||
from .editing_module import EditingDescriptor
|
||||
from .html_checker import check_html
|
||||
from progress import Progress
|
||||
@@ -20,7 +21,6 @@ from .x_module import XModule
|
||||
from .xml_module import XmlDescriptor
|
||||
from xmodule.modulestore import Location
|
||||
import self_assessment_module
|
||||
import open_ended_module
|
||||
|
||||
log = logging.getLogger("mitx.courseware")
|
||||
|
||||
@@ -122,7 +122,7 @@ class CombinedOpenEndedModule(XModule):
|
||||
else:
|
||||
self.current_task=self_assessment_module.SelfAssessmentModule(self.system, self.location, self.current_task_parsed_xml, self.current_task_descriptor, instance_state=current_task_state)
|
||||
elif current_task_type=="openended":
|
||||
self.current_task_descriptor=open_ended_module.OpenEndedDescriptor(self.system)
|
||||
self.current_task_descriptor= open_ended_module.OpenEndedDescriptor(self.system)
|
||||
self.current_task_parsed_xml=self.current_task_descriptor.definition_from_xml(etree.fromstring(self.current_task_xml),self.system)
|
||||
if current_task_state is None and self.current_task_number==0:
|
||||
self.current_task=open_ended_module.OpenEndedModule(self.system, self.location, self.current_task_parsed_xml, self.current_task_descriptor)
|
||||
|
||||
@@ -544,18 +544,17 @@ class OpenEndedModule():
|
||||
})
|
||||
return json.dumps(d, cls=ComplexEncoder)
|
||||
|
||||
def get_problem:
|
||||
def get_problem(self, get):
|
||||
return self.get_html()
|
||||
|
||||
def reset_problem:
|
||||
def reset_problem(self, get):
|
||||
self.change_state(self.INITIAL)
|
||||
return {'success': True}
|
||||
|
||||
|
||||
def save_problem:
|
||||
def save_problem(self, get):
|
||||
pass
|
||||
|
||||
def update_score:
|
||||
def update_score(self, get):
|
||||
"""
|
||||
Delivers grading response (e.g. from asynchronous code checking) to
|
||||
the capa problem, so its score can be updated
|
||||
@@ -602,10 +601,10 @@ class OpenEndedModule():
|
||||
return html
|
||||
|
||||
def change_state(self, new_state):
|
||||
"""
|
||||
A centralized place for state changes--allows for hooks. If the
|
||||
current state matches the old state, don't run any hooks.
|
||||
"""
|
||||
"""
|
||||
A centralized place for state changes--allows for hooks. If the
|
||||
current state matches the old state, don't run any hooks.
|
||||
"""
|
||||
if self.state == new_state:
|
||||
return
|
||||
|
||||
@@ -639,7 +638,7 @@ class OpenEndedDescriptor(XmlDescriptor, EditingDescriptor):
|
||||
|
||||
stores_state = True
|
||||
has_score = True
|
||||
template_dir_name = openended"
|
||||
template_dir_name = "openended"
|
||||
|
||||
js = {'coffee': [resource_string(__name__, 'js/src/html/edit.coffee')]}
|
||||
js_module_name = "HTMLEditingDescriptor"
|
||||
Reference in New Issue
Block a user