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
2e2bf13e
Commit
2e2bf13e
authored
Jun 01, 2012
by
ichuang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
untabify lib/dogfood/check.py
parent
7fbc4d7f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
lib/dogfood/check.py
+6
-7
No files found.
lib/dogfood/check.py
View file @
2e2bf13e
...
...
@@ -21,7 +21,7 @@ def check_problem_code(ans,the_lcp,correct_answers,false_answers):
returns dict {'ok':is_ok,'msg': message with iframe}
"""
pfn
=
"dog
%
s"
%
randomid
pfn
+=
the_lcp
.
problem_id
.
replace
(
'filename'
,
''
)
# add problem ID to dogfood problem name
pfn
+=
the_lcp
.
problem_id
.
replace
(
'filename'
,
''
)
# add problem ID to dogfood problem name
update_problem
(
pfn
,
ans
,
filestore
=
the_lcp
.
system
.
filestore
)
msg
=
'<hr width="100
%
"/>'
msg
+=
'<iframe src="
%
s/dogfood/filename
%
s" width="95
%%
" frameborder="1">No iframe support!</iframe>'
%
(
settings
.
MITX_ROOT_URL
,
pfn
)
...
...
@@ -31,20 +31,20 @@ def check_problem_code(ans,the_lcp,correct_answers,false_answers):
try
:
# check correctness
fp
=
the_lcp
.
system
.
filestore
.
open
(
'problems/
%
s.xml'
%
pfn
)
test_lcp
=
lcp
.
LoncapaProblem
(
fp
,
'1'
,
system
=
the_lcp
.
system
)
test_lcp
=
lcp
.
LoncapaProblem
(
fp
,
'1'
,
system
=
the_lcp
.
system
)
if
not
(
test_lcp
.
grade_answers
(
correct_answers
)[
'1_2_1'
]
==
'correct'
):
if
not
(
test_lcp
.
grade_answers
(
correct_answers
)[
'1_2_1'
]
==
'correct'
):
is_ok
=
False
if
(
test_lcp
.
grade_answers
(
false_answers
)[
'1_2_1'
]
==
'correct'
):
if
(
test_lcp
.
grade_answers
(
false_answers
)[
'1_2_1'
]
==
'correct'
):
is_ok
=
False
except
Exception
,
err
:
is_ok
=
False
msg
+=
"<p>Error:
%
s</p>"
%
str
(
err
)
.
replace
(
'<'
,
'<'
)
msg
+=
"<p><pre>
%
s</pre></p>"
%
traceback
.
format_exc
()
.
replace
(
'<'
,
'<'
)
msg
+=
"<p><pre>
%
s</pre></p>"
%
traceback
.
format_exc
()
.
replace
(
'<'
,
'<'
)
ret
=
{
'ok'
:
is_ok
,
'msg'
:
msg
,
}
return
ret
\ No newline at end of file
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