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
7e48de1e
Commit
7e48de1e
authored
Feb 27, 2013
by
Will Daly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reset responsetypes.py to version on master
parent
043d316d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
15 deletions
+10
-15
common/lib/capa/capa/responsetypes.py
+10
-15
No files found.
common/lib/capa/capa/responsetypes.py
View file @
7e48de1e
...
...
@@ -1048,24 +1048,19 @@ def sympy_check2():
correct
=
[
'correct'
]
*
len
(
idset
)
if
ret
[
'ok'
]
else
[
'incorrect'
]
*
len
(
idset
)
msg
=
ret
[
'msg'
]
def
_cleanup_msg_html
(
msg_html
):
cleaned
=
msg_html
if
1
:
# try to clean up message html
cleaned
=
'<html>'
+
cleaned
+
'</html>'
cleaned
=
cleaned
.
replace
(
'<'
,
'<'
)
cleaned
=
etree
.
tostring
(
fromstring_bs
(
cleaned
,
convertEntities
=
None
),
msg
=
'<html>'
+
msg
+
'</html>'
msg
=
msg
.
replace
(
'<'
,
'<'
)
#msg = msg.replace('<','<')
msg
=
etree
.
tostring
(
fromstring_bs
(
msg
,
convertEntities
=
None
),
pretty_print
=
True
)
cleaned
=
cleaned
.
replace
(
' '
,
''
)
cleaned
=
re
.
sub
(
'(?ms)<html>(.*)</html>'
,
'
\\
1'
,
cleaned
)
return
cleaned
#msg = etree.tostring(fromstring_bs(msg),pretty_print=True
)
msg
=
msg
.
replace
(
' '
,
''
)
#msg = re.sub('<html>(.*)</html>','\\1',msg,flags=re.M|re.DOTALL) # python 2.7
msg
=
re
.
sub
(
'(?ms)<html>(.*)</html>'
,
'
\\
1'
,
msg
)
if
type
(
msg
)
==
str
:
messages
[
0
]
=
_cleanup_msg_html
(
msg
)
elif
type
(
msg
)
==
list
:
for
i
in
range
(
0
,
len
(
msg
)):
messages
[
i
]
=
_cleanup_msg_html
(
msg
[
i
])
messages
[
0
]
=
msg
else
:
correct
=
[
'correct'
]
*
len
(
idset
)
if
ret
else
[
'incorrect'
]
*
len
(
idset
)
...
...
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