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
29e270a1
Commit
29e270a1
authored
Dec 29, 2014
by
Usman Khalid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
More tests for editing prompts field.
TNL-708
parent
3f5f7c1d
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
234 additions
and
25 deletions
+234
-25
openassessment/xblock/test/data/invalid_rubric.json
+70
-21
openassessment/xblock/test/data/invalid_rubrics.json
+53
-0
openassessment/xblock/test/data/valid_rubrics.json
+104
-0
openassessment/xblock/test/test_studio.py
+5
-2
openassessment/xblock/test/test_validation.py
+2
-2
No files found.
openassessment/xblock/test/data/invalid_rubric.json
View file @
29e270a1
{
{
"missing_feedback"
:
{
"missing_feedback"
:
{
"rubric"
:
{
"criteria"
:
[
"prompt"
:
"Test Prompt"
,
{
"criteria"
:
[
"order_num"
:
0
,
{
"name"
:
"Test criterion"
,
"order_num"
:
0
,
"label"
:
"Test criterion label"
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
"options"
:
[
{
{
"order_num"
:
0
,
"order_num"
:
0
,
"points"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"name"
:
"No"
,
"label"
:
"No label"
,
"explanation"
:
"No explanation"
"explanation"
:
"No explanation"
}
}
]
]
}
}
]
],
},
"prompts"
:
[{
"description"
:
"My new prompt."
}],
"prompt"
:
"My new prompt."
,
"submission_due"
:
"4014-02-27T09:46:28"
,
"submission_due"
:
"4014-02-27T09:46:28"
,
"submission_start"
:
"4014-02-10T09:46:28"
,
"submission_start"
:
"4014-02-10T09:46:28"
,
"title"
:
"My new title."
,
"title"
:
"My new title."
,
...
@@ -36,9 +35,59 @@
...
@@ -36,9 +35,59 @@
"start"
:
""
,
"start"
:
""
,
"due"
:
""
"due"
:
""
}
}
]
},
"prompts_is_string"
:
{
"title"
:
"Foo"
,
"prompts"
:
"My new prompt."
,
"feedback_prompt"
:
"Test Feedback Prompt"
,
"feedback_default_text"
:
"Test default text..."
,
"submission_start"
:
null
,
"submission_due"
:
null
,
"allow_file_upload"
:
true
,
"leaderboard_show"
:
true
,
"allow_latex"
:
false
,
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"label"
:
"Test criterion label"
,
"prompt"
:
"Test criterion prompt"
,
"feedback"
:
"optional"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"label"
:
"No label"
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"label"
:
"Yes label"
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
],
"assessments"
:
[
{
"name"
:
"peer-assessment"
,
"start"
:
"2014-02-27T09:46:28"
,
"due"
:
"2014-03-01T00:00:00"
,
"must_grade"
:
5
,
"must_be_graded_by"
:
3
},
{
"name"
:
"self-assessment"
,
"start"
:
"2014-04-01T00:00:00"
,
"due"
:
"2014-06-01T00:00:00"
}
],
],
"expected-assessment"
:
"peer-assessment"
,
"editor_assessments_order"
:
[
"student-training"
,
"peer-assessment"
,
"self-assessment"
]
"expected-criterion-prompt"
:
"Test criterion prompt"
}
}
}
}
openassessment/xblock/test/data/invalid_rubrics.json
View file @
29e270a1
...
@@ -88,6 +88,59 @@
...
@@ -88,6 +88,59 @@
}
}
},
},
"change_prompts_number_after_release"
:
{
"rubric"
:
{
"prompts"
:
[{
"description"
:
"Test Prompt 1."
},
{
"description"
:
"Test Prompt 2."
},
{
"description"
:
"Test Prompt 3."
}],
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
]
},
"current_rubric"
:
{
"prompts"
:
[{
"description"
:
"Test Prompt 3."
},
{
"description"
:
"Test Prompt 4."
}],
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
]
},
"is_released"
:
true
},
"change_points_after_release"
:
{
"change_points_after_release"
:
{
"rubric"
:
{
"rubric"
:
{
"prompts"
:
[{
"description"
:
"Test Prompt 1."
},
{
"description"
:
"Test Prompt 2."
}],
"prompts"
:
[{
"description"
:
"Test Prompt 1."
},
{
"description"
:
"Test Prompt 2."
}],
...
...
openassessment/xblock/test/data/valid_rubrics.json
View file @
29e270a1
...
@@ -53,6 +53,58 @@
...
@@ -53,6 +53,58 @@
}
}
},
},
"change_prompts_number_before_release"
:
{
"rubric"
:
{
"prompts"
:
[{
"description"
:
"Test Prompt 1."
},
{
"description"
:
"Test Prompt 2."
},
{
"description"
:
"Test Prompt 3."
}],
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
]
},
"current_rubric"
:
{
"prompts"
:
[{
"description"
:
"Test Prompt 3."
},
{
"description"
:
"Test Prompt 4."
}],
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
]
},
"is_released"
:
false
},
"change_points_before_release"
:
{
"change_points_before_release"
:
{
"rubric"
:
{
"rubric"
:
{
"prompts"
:
[{
"description"
:
"Test Prompt 1."
},
{
"description"
:
"Test Prompt 2."
}],
"prompts"
:
[{
"description"
:
"Test Prompt 1."
},
{
"description"
:
"Test Prompt 2."
}],
...
@@ -390,6 +442,58 @@
...
@@ -390,6 +442,58 @@
"is_released"
:
false
"is_released"
:
false
},
},
"change_prompts_description_after_release"
:
{
"rubric"
:
{
"prompts"
:
[{
"description"
:
"Test Prompt 3."
},
{
"description"
:
"Test Prompt 4."
}],
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
]
},
"current_rubric"
:
{
"prompts"
:
[{
"description"
:
"Test Prompt 3."
},
{
"description"
:
"Test Prompt 4."
}],
"criteria"
:
[
{
"order_num"
:
0
,
"name"
:
"Test criterion"
,
"prompt"
:
"Test criterion prompt"
,
"options"
:
[
{
"order_num"
:
0
,
"points"
:
0
,
"name"
:
"No"
,
"explanation"
:
"No explanation"
},
{
"order_num"
:
1
,
"points"
:
2
,
"name"
:
"Yes"
,
"explanation"
:
"Yes explanation"
}
]
}
]
},
"is_released"
:
true
},
"change_criteria_prompt_after_release"
:
{
"change_criteria_prompt_after_release"
:
{
"rubric"
:
{
"rubric"
:
{
"prompts"
:
[{
"description"
:
"Test Prompt 1."
},
{
"description"
:
"Test Prompt 2."
}],
"prompts"
:
[{
"description"
:
"Test Prompt 1."
},
{
"description"
:
"Test Prompt 2."
}],
...
...
openassessment/xblock/test/test_studio.py
View file @
29e270a1
...
@@ -205,10 +205,13 @@ class StudioViewTest(XBlockHandlerTestCase):
...
@@ -205,10 +205,13 @@ class StudioViewTest(XBlockHandlerTestCase):
# Store old XBlock fields for later verification
# Store old XBlock fields for later verification
old_title
=
xblock
.
title
old_title
=
xblock
.
title
old_prompt
=
xblock
.
prompt
old_prompt
s
=
xblock
.
prompts
old_assessments
=
xblock
.
rubric_assessments
old_assessments
=
xblock
.
rubric_assessments
old_criteria
=
xblock
.
rubric_criteria
old_criteria
=
xblock
.
rubric_criteria
xblock
.
runtime
.
modulestore
=
MagicMock
()
xblock
.
runtime
.
modulestore
.
has_published_version
.
return_value
=
False
# Verify the response fails
# Verify the response fails
resp
=
self
.
request
(
xblock
,
'update_editor_context'
,
request
,
response_format
=
'json'
)
resp
=
self
.
request
(
xblock
,
'update_editor_context'
,
request
,
response_format
=
'json'
)
self
.
assertFalse
(
resp
[
'success'
])
self
.
assertFalse
(
resp
[
'success'
])
...
@@ -218,7 +221,7 @@ class StudioViewTest(XBlockHandlerTestCase):
...
@@ -218,7 +221,7 @@ class StudioViewTest(XBlockHandlerTestCase):
# We don't need to be exhaustive here, because we have other unit tests
# We don't need to be exhaustive here, because we have other unit tests
# that verify this extensively.
# that verify this extensively.
self
.
assertEqual
(
xblock
.
title
,
old_title
)
self
.
assertEqual
(
xblock
.
title
,
old_title
)
self
.
assertEqual
(
xblock
.
prompt
,
old_prompt
)
self
.
assertEqual
(
xblock
.
prompt
s
,
old_prompts
)
self
.
assertItemsEqual
(
xblock
.
rubric_assessments
,
old_assessments
)
self
.
assertItemsEqual
(
xblock
.
rubric_assessments
,
old_assessments
)
self
.
assertItemsEqual
(
xblock
.
rubric_criteria
,
old_criteria
)
self
.
assertItemsEqual
(
xblock
.
rubric_criteria
,
old_criteria
)
...
...
openassessment/xblock/test/test_validation.py
View file @
29e270a1
...
@@ -81,7 +81,7 @@ class AssessmentValidationTest(TestCase):
...
@@ -81,7 +81,7 @@ class AssessmentValidationTest(TestCase):
class
RubricValidationTest
(
TestCase
):
class
RubricValidationTest
(
TestCase
):
@ddt.file_data
(
'data/valid_rubrics.json'
)
@ddt.file_data
(
'data/valid_rubrics.json'
)
def
test_valid_
assessment
(
self
,
data
):
def
test_valid_
rubric
(
self
,
data
):
current_rubric
=
data
.
get
(
'current_rubric'
)
current_rubric
=
data
.
get
(
'current_rubric'
)
is_released
=
data
.
get
(
'is_released'
,
False
)
is_released
=
data
.
get
(
'is_released'
,
False
)
is_example_based
=
data
.
get
(
'is_example_based'
,
False
)
is_example_based
=
data
.
get
(
'is_example_based'
,
False
)
...
@@ -92,7 +92,7 @@ class RubricValidationTest(TestCase):
...
@@ -92,7 +92,7 @@ class RubricValidationTest(TestCase):
self
.
assertEqual
(
msg
,
u''
)
self
.
assertEqual
(
msg
,
u''
)
@ddt.file_data
(
'data/invalid_rubrics.json'
)
@ddt.file_data
(
'data/invalid_rubrics.json'
)
def
test_invalid_
assessment
(
self
,
data
):
def
test_invalid_
rubric
(
self
,
data
):
current_rubric
=
data
.
get
(
'current_rubric'
)
current_rubric
=
data
.
get
(
'current_rubric'
)
is_released
=
data
.
get
(
'is_released'
,
False
)
is_released
=
data
.
get
(
'is_released'
,
False
)
is_example_based
=
data
.
get
(
'is_example_based'
,
False
)
is_example_based
=
data
.
get
(
'is_example_based'
,
False
)
...
...
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