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
7d0938a3
Commit
7d0938a3
authored
Jun 06, 2012
by
Calen Pennington
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Adding logging to symmath, and skipping a test that currently fails due to environment issues
parent
8d9b242e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
1 deletions
+10
-1
djangoapps/courseware/tests.py
+2
-0
lib/symmath/formula.py
+4
-1
lib/symmath/symmath_check.py
+4
-0
No files found.
djangoapps/courseware/tests.py
View file @
7d0938a3
...
...
@@ -16,6 +16,7 @@ import courseware.capa.capa_problem as lcp
import
courseware.graders
as
graders
from
courseware.graders
import
Score
,
CourseGrader
,
WeightedSubsectionsGrader
,
SingleSectionGrader
,
AssignmentFormatGrader
from
courseware.grades
import
aggregate_scores
from
nose.plugins.skip
import
SkipTest
class
I4xSystem
(
object
):
'''
...
...
@@ -136,6 +137,7 @@ class ImageResponseTest(unittest.TestCase):
class
SymbolicResponseTest
(
unittest
.
TestCase
):
def
test_sr_grade
(
self
):
raise
SkipTest
()
# This test fails due to dependencies on a local copy of snuggletex-webapp. Until we have figured that out, we'll just skip this test
symbolicresponse_file
=
os
.
path
.
dirname
(
__file__
)
+
"/test_files/symbolicresponse.xml"
test_lcp
=
lcp
.
LoncapaProblem
(
open
(
symbolicresponse_file
),
'1'
,
system
=
i4xs
)
correct_answers
=
{
'1_2_1'
:
'cos(theta)*[[1,0],[0,1]] + i*sin(theta)*[[0,1],[1,0]]'
,
...
...
lib/symmath/formula.py
View file @
7d0938a3
...
...
@@ -10,6 +10,7 @@
# Provides sympy representation.
import
os
,
sys
,
string
,
re
import
logging
import
operator
import
sympy
from
sympy.printing.latex
import
LatexPrinter
...
...
@@ -30,7 +31,9 @@ from lxml import etree
import
requests
from
copy
import
deepcopy
print
"[lib.symmath.formula] Warning: Dark code. Needs review before enabling in prod."
log
=
logging
.
getLogger
(
__name__
)
log
.
warning
(
"Dark code. Needs review before enabling in prod."
)
os
.
environ
[
'PYTHONIOENCODING'
]
=
'utf-8'
...
...
lib/symmath/symmath_check.py
View file @
7d0938a3
...
...
@@ -11,6 +11,9 @@
import
os
,
sys
,
string
,
re
import
traceback
from
formula
import
*
import
logging
log
=
logging
.
getLogger
(
__name__
)
#-----------------------------------------------------------------------------
# check function interface
...
...
@@ -195,6 +198,7 @@ def symmath_check(expect,ans,dynamath=None,options=None,debug=None):
fsym
=
f
.
sympy
msg
+=
'<p>You entered:
%
s</p>'
%
to_latex
(
f
.
sympy
)
except
Exception
,
err
:
log
.
exception
(
"Error evaluating expression '
%
s' as a valid equation"
%
ans
)
msg
+=
"<p>Error
%
s in evaluating your expression '
%
s' as a valid equation</p>"
%
(
str
(
err
)
.
replace
(
'<'
,
'<'
),
ans
)
if
DEBUG
:
...
...
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