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
0a573a17
Commit
0a573a17
authored
Jul 28, 2014
by
gradyward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changed the way that Zero Option Criteria are found in order to reduce query counts.
parent
49cad1fa
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
openassessment/assessment/models/base.py
+14
-8
openassessment/assessment/test/test_peer.py
+1
-1
No files found.
openassessment/assessment/models/base.py
View file @
0a573a17
...
...
@@ -243,10 +243,19 @@ class RubricIndex(object):
criterion
.
name
:
criterion
for
criterion
in
criteria
}
self
.
_option_index
=
{
(
option
.
criterion
.
name
,
option
.
name
):
option
for
option
in
options
}
# Finds the set of all criteria which have options by traversing through the options, and adding all of
# the options' associated criteria to an expanding set.
criteria_with_options
=
set
()
option_index
=
{}
for
option
in
options
:
option_index
[(
option
.
criterion
.
name
,
option
.
name
)]
=
option
criteria_with_options
.
add
(
option
.
criterion
)
# Anything not in the above mentioned set is a zero option criteria, and we save it here for future reference.
self
.
_criteria_without_options
=
set
(
self
.
_criteria_index
.
values
())
-
criteria_with_options
self
.
_option_index
=
option_index
# By convention, if multiple options in the same criterion have the
# same point value, we return the *first* option.
...
...
@@ -379,10 +388,7 @@ class RubricIndex(object):
set of `Criterion`
"""
return
set
(
criterion
for
criterion
in
self
.
_criteria_index
.
values
()
if
criterion
.
options
.
count
()
==
0
)
return
self
.
_criteria_without_options
class
Assessment
(
models
.
Model
):
...
...
openassessment/assessment/test/test_peer.py
View file @
0a573a17
...
...
@@ -151,7 +151,7 @@ class TestPeerApi(CacheResetTest):
Tests for the peer assessment API functions.
"""
CREATE_ASSESSMENT_NUM_QUERIES
=
63
CREATE_ASSESSMENT_NUM_QUERIES
=
59
def
test_create_assessment_points
(
self
):
self
.
_create_student_and_submission
(
"Tim"
,
"Tim's answer"
)
...
...
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