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
bbf87d8f
Commit
bbf87d8f
authored
Aug 04, 2015
by
Jonathan Piacenti
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix workgroup grade posting.
parent
52b741fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
11 deletions
+9
-11
lms/djangoapps/gradebook/models.py
+1
-1
lms/djangoapps/projects/views.py
+8
-10
No files found.
lms/djangoapps/gradebook/models.py
View file @
bbf87d8f
...
...
@@ -62,7 +62,7 @@ class StudentGradebook(TimeStampedModel):
data
[
'course_count'
]
=
0
data
[
'queryset'
]
=
[]
enrolled_users_not_excluded
=
CourseEnrollment
.
users_enrolled_in
(
course_key
)
.
exclude
(
id__in
=
exclude_users
)
enrolled_users_not_excluded
=
CourseEnrollment
.
objects
.
users_enrolled_in
(
course_key
)
.
exclude
(
id__in
=
exclude_users
)
total_user_count
=
enrolled_users_not_excluded
.
count
()
if
total_user_count
:
...
...
lms/djangoapps/projects/views.py
View file @
bbf87d8f
...
...
@@ -11,6 +11,7 @@ from rest_framework import status
from
rest_framework.response
import
Response
from
xblock.fields
import
Scope
from
courseware.models
import
StudentModule
from
openedx.core.djangoapps.course_groups.models
import
CourseCohort
from
xblock.runtime
import
KeyValueStore
...
...
@@ -303,17 +304,14 @@ class WorkgroupsViewSet(viewsets.ModelViewSet):
users
=
User
.
objects
.
filter
(
workgroups
=
pk
)
for
user
in
users
:
key
=
KeyValueStore
.
Key
(
scope
=
Scope
.
user_state
,
user_id
=
user
.
id
,
block_scope_id
=
content_key
,
field_name
=
'grade'
module
,
created
=
StudentModule
.
objects
.
get_or_create
(
student_id
=
user
.
id
,
module_state_key
=
content_key
,
course_id
=
course_key
,
)
field_data_cache
=
FieldDataCache
([
course_descriptor
],
course_key
,
user
)
student_module
=
field_data_cache
.
find_or_create
(
key
)
student_module
.
grade
=
grade
student_module
.
max_grade
=
max_grade
student_module
.
save
()
module
.
grade
=
grade
module
.
max_grade
=
max_grade
module
.
save
()
return
Response
({},
status
=
status
.
HTTP_201_CREATED
)
...
...
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