Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
8d6a5c45
Commit
8d6a5c45
authored
Jan 07, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try to render without module system
parent
146e0919
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
5 deletions
+17
-5
common/lib/xmodule/xmodule/combined_open_ended_module.py
+13
-3
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
+4
-2
No files found.
common/lib/xmodule/xmodule/combined_open_ended_module.py
View file @
8d6a5c45
...
@@ -22,6 +22,8 @@ from xmodule.modulestore import Location
...
@@ -22,6 +22,8 @@ from xmodule.modulestore import Location
import
self_assessment_module
import
self_assessment_module
import
open_ended_module
import
open_ended_module
from
mitxmako.shortcuts
import
render_to_string
log
=
logging
.
getLogger
(
"mitx.courseware"
)
log
=
logging
.
getLogger
(
"mitx.courseware"
)
# Set the default number of max attempts. Should be 1 for production
# Set the default number of max attempts. Should be 1 for production
...
@@ -162,7 +164,7 @@ class CombinedOpenEndedModule(XModule):
...
@@ -162,7 +164,7 @@ class CombinedOpenEndedModule(XModule):
log
.
debug
(
self
.
get_instance_state
())
log
.
debug
(
self
.
get_instance_state
())
return
True
return
True
def
get_
html
(
self
):
def
get_
context
(
self
):
task_html
=
self
.
get_html_base
()
task_html
=
self
.
get_html_base
()
#set context variables and render template
#set context variables and render template
...
@@ -176,9 +178,17 @@ class CombinedOpenEndedModule(XModule):
...
@@ -176,9 +178,17 @@ class CombinedOpenEndedModule(XModule):
'status'
:
self
.
get_status
(),
'status'
:
self
.
get_status
(),
}
}
return
context
def
get_html
(
self
):
context
=
self
.
get_context
()
html
=
self
.
system
.
render_template
(
'combined_open_ended.html'
,
context
)
html
=
self
.
system
.
render_template
(
'combined_open_ended.html'
,
context
)
return
html
return
html
def
get_html_nonsystem
(
self
):
context
=
self
.
get_context
()
html
=
render_to_string
(
'combined_open_ended.html'
,
context
)
return
html
def
get_html_base
(
self
):
def
get_html_base
(
self
):
self
.
update_task_states
()
self
.
update_task_states
()
...
@@ -255,7 +265,7 @@ class CombinedOpenEndedModule(XModule):
...
@@ -255,7 +265,7 @@ class CombinedOpenEndedModule(XModule):
def
next_problem
(
self
,
get
):
def
next_problem
(
self
,
get
):
self
.
update_task_states
()
self
.
update_task_states
()
return
{
'success'
:
True
,
'html'
:
self
.
get_html
()}
return
{
'success'
:
True
,
'html'
:
self
.
get_html
_nonsystem
()}
def
reset
(
self
,
get
):
def
reset
(
self
,
get
):
"""
"""
...
@@ -280,7 +290,7 @@ class CombinedOpenEndedModule(XModule):
...
@@ -280,7 +290,7 @@ class CombinedOpenEndedModule(XModule):
self
.
task_states
[
self
.
current_task_number
]
=
self
.
current_task
.
get_instance_state
()
self
.
task_states
[
self
.
current_task_number
]
=
self
.
current_task
.
get_instance_state
()
self
.
current_task_number
=
0
self
.
current_task_number
=
0
self
.
setup_next_task
()
self
.
setup_next_task
()
return
{
'success'
:
True
}
return
{
'success'
:
True
,
'html'
:
self
.
get_html_nonsystem
()
}
def
get_instance_state
(
self
):
def
get_instance_state
(
self
):
"""
"""
...
...
common/lib/xmodule/xmodule/js/src/combinedopenended/display.coffee
View file @
8d6a5c45
...
@@ -4,6 +4,7 @@ class @CombinedOpenEnded
...
@@ -4,6 +4,7 @@ class @CombinedOpenEnded
@
reinitialize
(
element
)
@
reinitialize
(
element
)
reinitialize
:
(
element
)
->
reinitialize
:
(
element
)
->
@
wrapper
=
$
(
element
).
find
(
'section.xmodule_CombinedOpenEndedModule'
)
@
el
=
$
(
element
).
find
(
'section.combined-open-ended'
)
@
el
=
$
(
element
).
find
(
'section.combined-open-ended'
)
@
combined_open_ended
=
$
(
element
).
find
(
'section.combined-open-ended'
)
@
combined_open_ended
=
$
(
element
).
find
(
'section.combined-open-ended'
)
@
id
=
@
el
.
data
(
'id'
)
@
id
=
@
el
.
data
(
'id'
)
...
@@ -153,9 +154,10 @@ class @CombinedOpenEnded
...
@@ -153,9 +154,10 @@ class @CombinedOpenEnded
@
hint_wrapper
.
html
(
''
)
@
hint_wrapper
.
html
(
''
)
@
message_wrapper
.
html
(
''
)
@
message_wrapper
.
html
(
''
)
@
child_state
=
'initial'
@
child_state
=
'initial'
@
combined_open_ended
.
after
(
response
.
html
).
remove
()
@
reinitialize
(
@
element
)
@
rebind
()
@
rebind
()
@
reset_button
.
hide
()
@
reset_button
.
hide
()
location
.
reload
()
else
else
@
errors_area
.
html
(
response
.
error
)
@
errors_area
.
html
(
response
.
error
)
else
else
...
@@ -170,7 +172,7 @@ class @CombinedOpenEnded
...
@@ -170,7 +172,7 @@ class @CombinedOpenEnded
@
hint_wrapper
.
html
(
''
)
@
hint_wrapper
.
html
(
''
)
@
message_wrapper
.
html
(
''
)
@
message_wrapper
.
html
(
''
)
@
child_state
=
'initial'
@
child_state
=
'initial'
@
combined_open_ended
.
html
(
response
.
html
)
@
combined_open_ended
.
after
(
response
.
html
).
remove
(
)
@
reinitialize
(
@
element
)
@
reinitialize
(
@
element
)
@
rebind
()
@
rebind
()
@
next_problem_button
.
hide
()
@
next_problem_button
.
hide
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment