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
22d83f0a
Commit
22d83f0a
authored
8 years ago
by
Diana Huang
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #905 from edx/diana/order-criterion
Order assessment parts by criteria.
parents
23deecdb
f70ec1e5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
9 deletions
+9
-9
openassessment/data.py
+1
-1
openassessment/tests/factories.py
+2
-2
openassessment/tests/test_data.py
+6
-6
No files found.
openassessment/data.py
View file @
22d83f0a
...
...
@@ -388,7 +388,7 @@ class OraAggregateData(object):
returned_string
=
u""
for
assessment
in
assessments
:
returned_string
+=
u"Assessment #{}
\n
"
.
format
(
assessment
.
id
)
for
part
in
assessment
.
parts
.
all
(
):
for
part
in
assessment
.
parts
.
order_by
(
'criterion__order_num'
):
returned_string
+=
u"-- {}"
.
format
(
part
.
criterion
.
label
)
if
part
.
option
is
not
None
and
part
.
option
.
label
is
not
None
:
option_label
=
part
.
option
.
label
...
...
This diff is collapsed.
Click to expand it.
openassessment/tests/factories.py
View file @
22d83f0a
...
...
@@ -31,7 +31,7 @@ class CriterionFactory(DjangoModelFactory):
name
=
factory
.
Sequence
(
lambda
n
:
'criterion_{}'
.
format
(
n
))
# pylint: disable=unnecessary-lambda
label
=
factory
.
Sequence
(
lambda
n
:
'label_{}'
.
format
(
n
))
# pylint: disable=unnecessary-lambda
order_num
=
0
order_num
=
factory
.
Sequence
(
lambda
n
:
n
)
prompt
=
'This is a fake prompt.'
...
...
@@ -43,7 +43,7 @@ class CriterionOptionFactory(DjangoModelFactory):
criterion
=
factory
.
SubFactory
(
CriterionFactory
)
order_num
=
0
order_num
=
factory
.
Sequence
(
lambda
n
:
n
)
points
=
4
...
...
This diff is collapsed.
Click to expand it.
openassessment/tests/test_data.py
View file @
22d83f0a
...
...
@@ -456,17 +456,17 @@ class TestOraAggregateDataIntegration(TransactionCacheResetTest):
scorer
=
self
.
assessment
[
'scorer_id'
],
feedback
=
self
.
assessment
[
'feedback'
]
),
u"Assessment #{id}
\n
-- {label}: {option_label} ({points})
\n
-- feedback: {feedback}
\n
"
.
format
(
u"Assessment #{id}
\n
-- {label}: {option_label} ({points})
\n
"
.
format
(
id
=
self
.
assessment
[
'id'
],
label
=
self
.
assessment
[
'parts'
][
1
][
'criterion'
][
'label'
],
option_label
=
self
.
assessment
[
'parts'
][
1
][
'criterion'
][
'options'
][
0
][
'label'
],
points
=
self
.
assessment
[
'parts'
][
1
][
'criterion'
][
'options'
][
0
][
'points'
],
)
+
u"-- {label}: {option_label} ({points})
\n
-- feedback: {feedback}
\n
"
.
format
(
label
=
self
.
assessment
[
'parts'
][
0
][
'criterion'
][
'label'
],
option_label
=
self
.
assessment
[
'parts'
][
0
][
'criterion'
][
'options'
][
1
][
'label'
],
points
=
self
.
assessment
[
'parts'
][
0
][
'criterion'
][
'options'
][
1
][
'points'
],
feedback
=
self
.
assessment
[
'parts'
][
0
][
'feedback'
],
)
+
u"-- {label}: {option_label} ({points})
\n
"
.
format
(
label
=
self
.
assessment
[
'parts'
][
1
][
'criterion'
][
'label'
],
option_label
=
self
.
assessment
[
'parts'
][
1
][
'criterion'
][
'options'
][
0
][
'label'
],
points
=
self
.
assessment
[
'parts'
][
1
][
'criterion'
][
'options'
][
0
][
'points'
],
),
self
.
score
[
'created_at'
],
self
.
score
[
'points_earned'
],
...
...
This diff is collapsed.
Click to expand it.
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