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
42cef5b7
Commit
42cef5b7
authored
Jul 03, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of references to self.filename in capa_module, as it no longer exists
parent
68c155b2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
common/lib/xmodule/xmodule/capa_module.py
+7
-7
No files found.
common/lib/xmodule/xmodule/capa_module.py
View file @
42cef5b7
...
...
@@ -141,7 +141,7 @@ class CapaModule(XModule):
msg
=
'<p>
%
s</p>'
%
msg
.
replace
(
'<'
,
'<'
)
msg
+=
'<p><pre>
%
s</pre></p>'
%
traceback
.
format_exc
()
.
replace
(
'<'
,
'<'
)
# create a dummy problem with error message instead of failing
problem_text
=
'<problem><text><font color="red" size="+2">Problem
file
%
s has an error:</font>
%
s</text></problem>'
%
(
self
.
filename
,
msg
)
problem_text
=
'<problem><text><font color="red" size="+2">Problem
%
s has an error:</font>
%
s</text></problem>'
%
(
self
.
location
.
url
()
,
msg
)
self
.
lcp
=
LoncapaProblem
(
problem_text
,
self
.
location
.
html_id
(),
instance_state
,
seed
=
seed
,
system
=
self
.
system
)
else
:
raise
...
...
@@ -368,7 +368,7 @@ class CapaModule(XModule):
'''
event_info
=
dict
()
event_info
[
'state'
]
=
self
.
lcp
.
get_state
()
event_info
[
'
filename'
]
=
self
.
filename
event_info
[
'
problem_id'
]
=
self
.
location
.
url
()
answers
=
self
.
make_dict_of_responses
(
get
)
...
...
@@ -394,13 +394,13 @@ class CapaModule(XModule):
correct_map
=
self
.
lcp
.
grade_answers
(
answers
)
except
StudentInputError
as
inst
:
# TODO (vshnayder): why is this line here?
self
.
lcp
=
LoncapaProblem
(
self
.
system
.
filestore
.
open
(
self
.
filename
)
.
read
()
,
self
.
lcp
=
LoncapaProblem
(
self
.
definition
[
'data'
]
,
id
=
lcp_id
,
state
=
old_state
,
system
=
self
.
system
)
traceback
.
print_exc
()
return
{
'success'
:
inst
.
message
}
except
:
# TODO: why is this line here?
self
.
lcp
=
LoncapaProblem
(
self
.
system
.
filestore
.
open
(
self
.
filename
)
.
read
()
,
self
.
lcp
=
LoncapaProblem
(
self
.
definition
[
'data'
]
,
id
=
lcp_id
,
state
=
old_state
,
system
=
self
.
system
)
traceback
.
print_exc
()
raise
Exception
(
"error in capa_module"
)
...
...
@@ -434,7 +434,7 @@ class CapaModule(XModule):
'''
event_info
=
dict
()
event_info
[
'state'
]
=
self
.
lcp
.
get_state
()
event_info
[
'
filename'
]
=
self
.
filename
event_info
[
'
problem_id'
]
=
self
.
location
.
url
()
answers
=
self
.
make_dict_of_responses
(
get
)
event_info
[
'answers'
]
=
answers
...
...
@@ -468,7 +468,7 @@ class CapaModule(XModule):
'''
event_info
=
dict
()
event_info
[
'old_state'
]
=
self
.
lcp
.
get_state
()
event_info
[
'
filename'
]
=
self
.
filename
event_info
[
'
problem_id'
]
=
self
.
location
.
url
()
if
self
.
closed
():
event_info
[
'failure'
]
=
'closed'
...
...
@@ -485,7 +485,7 @@ class CapaModule(XModule):
# reset random number generator seed (note the self.lcp.get_state() in next line)
self
.
lcp
.
seed
=
None
self
.
lcp
=
LoncapaProblem
(
self
.
system
.
filestore
.
open
(
self
.
filename
)
.
read
()
,
self
.
lcp
=
LoncapaProblem
(
self
.
definition
[
'data'
]
,
self
.
location
.
html_id
(),
self
.
lcp
.
get_state
(),
system
=
self
.
system
)
event_info
[
'new_state'
]
=
self
.
lcp
.
get_state
()
...
...
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