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
94b78ecb
Commit
94b78ecb
authored
Feb 01, 2017
by
Jesse Zoldak
Committed by
GitHub
Feb 01, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14442 from edx/revert-14439-beryl/grades-mongo-query
Revert "Fix mongo query count for Grades API"
parents
0f89af8a
b0647e7d
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
13 deletions
+7
-13
lms/djangoapps/grades/api/tests/test_views.py
+4
-11
lms/djangoapps/grades/new/course_grade.py
+2
-2
lms/djangoapps/grades/tasks.py
+1
-0
No files found.
lms/djangoapps/grades/api/tests/test_views.py
View file @
94b78ecb
...
@@ -16,7 +16,7 @@ from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory, StaffF
...
@@ -16,7 +16,7 @@ from lms.djangoapps.courseware.tests.factories import GlobalStaffFactory, StaffF
from
lms.djangoapps.grades.tests.utils
import
mock_get_score
from
lms.djangoapps.grades.tests.utils
import
mock_get_score
from
student.tests.factories
import
CourseEnrollmentFactory
,
UserFactory
from
student.tests.factories
import
CourseEnrollmentFactory
,
UserFactory
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore
import
ModuleStoreEnum
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
,
check_mongo_calls
from
xmodule.modulestore.tests.factories
import
CourseFactory
,
ItemFactory
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
,
TEST_DATA_SPLIT_MODULESTORE
from
xmodule.modulestore.tests.django_utils
import
SharedModuleStoreTestCase
,
TEST_DATA_SPLIT_MODULESTORE
...
@@ -68,7 +68,6 @@ class CurrentGradeViewTest(SharedModuleStoreTestCase, APITestCase):
...
@@ -68,7 +68,6 @@ class CurrentGradeViewTest(SharedModuleStoreTestCase, APITestCase):
super
(
CurrentGradeViewTest
,
cls
)
.
setUpClass
()
super
(
CurrentGradeViewTest
,
cls
)
.
setUpClass
()
cls
.
course
=
CourseFactory
.
create
(
display_name
=
'test course'
,
run
=
"Testing_course"
)
cls
.
course
=
CourseFactory
.
create
(
display_name
=
'test course'
,
run
=
"Testing_course"
)
with
cls
.
store
.
bulk_operations
(
cls
.
course
.
id
):
chapter
=
ItemFactory
.
create
(
chapter
=
ItemFactory
.
create
(
category
=
'chapter'
,
category
=
'chapter'
,
...
@@ -82,7 +81,7 @@ class CurrentGradeViewTest(SharedModuleStoreTestCase, APITestCase):
...
@@ -82,7 +81,7 @@ class CurrentGradeViewTest(SharedModuleStoreTestCase, APITestCase):
section
=
ItemFactory
.
create
(
section
=
ItemFactory
.
create
(
category
=
'sequential'
,
category
=
'sequential'
,
parent_location
=
chapter
.
location
,
parent_location
=
chapter
.
location
,
due
=
datetime
(
2013
,
9
,
18
,
11
,
30
,
00
,
tzinfo
=
UTC
),
due
=
datetime
(
2013
,
9
,
18
,
11
,
30
,
00
),
display_name
=
'Sequential {} {}'
.
format
(
grading_type
,
num
),
display_name
=
'Sequential {} {}'
.
format
(
grading_type
,
num
),
format
=
grading_type
,
format
=
grading_type
,
graded
=
True
,
graded
=
True
,
...
@@ -142,12 +141,6 @@ class CurrentGradeViewTest(SharedModuleStoreTestCase, APITestCase):
...
@@ -142,12 +141,6 @@ class CurrentGradeViewTest(SharedModuleStoreTestCase, APITestCase):
"""
"""
Test that a user can successfully request her own grade.
Test that a user can successfully request her own grade.
"""
"""
with
check_mongo_calls
(
6
):
resp
=
self
.
client
.
get
(
self
.
get_url
(
self
.
student
.
username
))
self
.
assertEqual
(
resp
.
status_code
,
status
.
HTTP_200_OK
)
# redo with block structure now in the cache
with
check_mongo_calls
(
3
):
resp
=
self
.
client
.
get
(
self
.
get_url
(
self
.
student
.
username
))
resp
=
self
.
client
.
get
(
self
.
get_url
(
self
.
student
.
username
))
self
.
assertEqual
(
resp
.
status_code
,
status
.
HTTP_200_OK
)
self
.
assertEqual
(
resp
.
status_code
,
status
.
HTTP_200_OK
)
...
@@ -390,8 +383,8 @@ class GradingPolicyTestMixin(object):
...
@@ -390,8 +383,8 @@ class GradingPolicyTestMixin(object):
The view should be addressable by course-keys from both module stores.
The view should be addressable by course-keys from both module stores.
"""
"""
course
=
CourseFactory
.
create
(
course
=
CourseFactory
.
create
(
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
,
tzinfo
=
UTC
),
start
=
datetime
(
2014
,
6
,
16
,
14
,
30
),
end
=
datetime
(
2015
,
1
,
16
,
tzinfo
=
UTC
),
end
=
datetime
(
2015
,
1
,
16
),
org
=
"MTD"
,
org
=
"MTD"
,
default_store
=
modulestore_type
,
default_store
=
modulestore_type
,
)
)
...
...
lms/djangoapps/grades/new/course_grade.py
View file @
94b78ecb
...
@@ -31,8 +31,8 @@ class CourseGrade(object):
...
@@ -31,8 +31,8 @@ class CourseGrade(object):
def
__init__
(
self
,
student
,
course
,
course_structure
):
def
__init__
(
self
,
student
,
course
,
course_structure
):
self
.
student
=
student
self
.
student
=
student
self
.
course
=
course
self
.
course
=
course
self
.
course_version
=
getattr
(
course
_structure
,
'course_version'
,
None
)
self
.
course_version
=
getattr
(
course
,
'course_version'
,
None
)
self
.
course_edited_timestamp
=
getattr
(
course
_structure
,
'subtree_edited_on'
,
None
)
self
.
course_edited_timestamp
=
getattr
(
course
,
'subtree_edited_on'
,
None
)
self
.
course_structure
=
course_structure
self
.
course_structure
=
course_structure
self
.
_percent
=
None
self
.
_percent
=
None
self
.
_letter_grade
=
None
self
.
_letter_grade
=
None
...
...
lms/djangoapps/grades/tasks.py
View file @
94b78ecb
...
@@ -16,6 +16,7 @@ from openedx.core.djangoapps.celery_utils.persist_on_failure import PersistOnFai
...
@@ -16,6 +16,7 @@ from openedx.core.djangoapps.celery_utils.persist_on_failure import PersistOnFai
from
opaque_keys.edx.keys
import
UsageKey
from
opaque_keys.edx.keys
import
UsageKey
from
opaque_keys.edx.locator
import
CourseLocator
from
opaque_keys.edx.locator
import
CourseLocator
from
submissions
import
api
as
sub_api
from
submissions
import
api
as
sub_api
from
student.models
import
anonymous_id_for_user
from
track.event_transaction_utils
import
(
from
track.event_transaction_utils
import
(
set_event_transaction_type
,
set_event_transaction_type
,
set_event_transaction_id
,
set_event_transaction_id
,
...
...
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