Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-ora2
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-ora2
Commits
2b396453
Commit
2b396453
authored
Dec 23, 2014
by
Usman Khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed xml tests.
TNL-708:wq
parent
e6e75978
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
15 deletions
+4
-15
openassessment/xblock/test/data/parse_rubric_xml.json
+0
-13
openassessment/xblock/test/data/serialize.json
+0
-0
openassessment/xblock/test/test_xml.py
+4
-2
No files found.
openassessment/xblock/test/data/parse_rubric_xml.json
View file @
2b396453
...
...
@@ -2,7 +2,6 @@
"simple"
:
{
"xml"
:
[
"<rubric>"
,
"<prompt>Test prompt</prompt>"
,
"<criterion>"
,
"<name>Test criterion</name>"
,
"<prompt>Test criterion prompt</prompt>"
,
...
...
@@ -11,7 +10,6 @@
"</criterion>"
,
"</rubric>"
],
"prompt"
:
"Test prompt"
,
"feedbackprompt"
:
null
,
"criteria"
:
[
{
...
...
@@ -43,7 +41,6 @@
"feedback_prompt"
:
{
"xml"
:
[
"<rubric>"
,
"<prompt>Test prompt</prompt>"
,
"<criterion>"
,
"<name>Test criterion</name>"
,
"<prompt>Test criterion prompt</prompt>"
,
...
...
@@ -53,7 +50,6 @@
"<feedbackprompt>This is the feedback prompt</feedbackprompt>"
,
"</rubric>"
],
"prompt"
:
"Test prompt"
,
"feedbackprompt"
:
"This is the feedback prompt"
,
"criteria"
:
[
{
...
...
@@ -93,7 +89,6 @@
"</criterion>"
,
"</rubric>"
],
"prompt"
:
null
,
"feedbackprompt"
:
null
,
"criteria"
:
[
{
...
...
@@ -125,7 +120,6 @@
"empty_prompt"
:
{
"xml"
:
[
"<rubric>"
,
"<prompt></prompt>"
,
"<criterion>"
,
"<name>Test criterion</name>"
,
"<prompt>Test criterion prompt</prompt>"
,
...
...
@@ -134,7 +128,6 @@
"</criterion>"
,
"</rubric>"
],
"prompt"
:
""
,
"feedbackprompt"
:
null
,
"criteria"
:
[
{
...
...
@@ -166,7 +159,6 @@
"unicode"
:
{
"xml"
:
[
"<rubric>"
,
"<prompt>ՇєรՇ קг๏๓קՇ</prompt>"
,
"<criterion>"
,
"<name>𝓣𝓮𝓼𝓽 𝓬𝓻𝓲𝓽𝓮𝓻𝓲𝓸𝓷</name>"
,
"<prompt>Ŧɇsŧ ȼɍɨŧɇɍɨøn ꝑɍømꝑŧ</prompt>"
,
...
...
@@ -175,7 +167,6 @@
"</criterion>"
,
"</rubric>"
],
"prompt"
:
"ՇєรՇ קг๏๓קՇ"
,
"feedbackprompt"
:
null
,
"criteria"
:
[
{
...
...
@@ -207,7 +198,6 @@
"multiple_criteria"
:
{
"xml"
:
[
"<rubric>"
,
"<prompt>Test prompt</prompt>"
,
"<criterion>"
,
"<name>Test criterion</name>"
,
"<prompt>Test criterion prompt</prompt>"
,
...
...
@@ -221,7 +211,6 @@
"</criterion>"
,
"</rubric>"
],
"prompt"
:
"Test prompt"
,
"feedbackprompt"
:
null
,
"criteria"
:
[
{
...
...
@@ -269,7 +258,6 @@
"criterion_feedback_optional"
:
{
"xml"
:
[
"<rubric>"
,
"<prompt>Test prompt</prompt>"
,
"<criterion>"
,
"<name>Test criterion</name>"
,
"<prompt>Test criterion prompt</prompt>"
,
...
...
@@ -283,7 +271,6 @@
"</criterion>"
,
"</rubric>"
],
"prompt"
:
"Test prompt"
,
"feedbackprompt"
:
null
,
"criteria"
:
[
{
...
...
openassessment/xblock/test/data/serialize.json
View file @
2b396453
This diff is collapsed.
Click to expand it.
openassessment/xblock/test/test_xml.py
View file @
2b396453
...
...
@@ -10,6 +10,8 @@ import pytz
import
dateutil.parser
from
django.test
import
TestCase
import
ddt
from
openassessment.xblock.data_conversion
import
create_prompts_dict
from
openassessment.xblock.openassessmentblock
import
OpenAssessmentBlock
from
openassessment.xblock.xml
import
(
serialize_content
,
parse_from_xml_str
,
parse_rubric_xml
,
...
...
@@ -99,6 +101,7 @@ class TestSerializeContent(TestCase):
def
_configure_xblock
(
self
,
data
):
self
.
oa_block
.
title
=
data
.
get
(
'title'
,
''
)
self
.
oa_block
.
prompt
=
data
.
get
(
'prompt'
)
self
.
oa_block
.
prompts
=
create_prompts_dict
(
data
.
get
(
'prompt'
))
self
.
oa_block
.
rubric_feedback_prompt
=
data
.
get
(
'rubric_feedback_prompt'
)
self
.
oa_block
.
rubric_feedback_default_text
=
data
.
get
(
'rubric_feedback_default_text'
)
self
.
oa_block
.
start
=
_parse_date
(
data
.
get
(
'start'
))
...
...
@@ -361,7 +364,6 @@ class TestParseRubricFromXml(TestCase):
xml
=
etree
.
fromstring
(
""
.
join
(
data
[
'xml'
]))
rubric
=
parse_rubric_xml
(
xml
)
self
.
assertEqual
(
rubric
[
'prompt'
],
data
[
'prompt'
])
self
.
assertEqual
(
rubric
[
'feedbackprompt'
],
data
[
'feedbackprompt'
])
self
.
assertEqual
(
rubric
[
'criteria'
],
data
[
'criteria'
])
...
...
@@ -401,7 +403,7 @@ class TestParseFromXml(TestCase):
# Check that the contents of the modified XBlock are correct
expected_fields
=
[
'title'
,
'prompt'
,
'prompt
s
'
,
'start'
,
'due'
,
'submission_start'
,
...
...
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