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
22a2bdaa
Commit
22a2bdaa
authored
Jan 22, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable student problem list caching, build out notifications
parent
4112f8ad
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
10 deletions
+12
-10
lms/djangoapps/courseware/tabs.py
+4
-4
lms/djangoapps/open_ended_grading/open_ended_notifications.py
+5
-6
lms/djangoapps/open_ended_grading/views.py
+3
-0
No files found.
lms/djangoapps/courseware/tabs.py
View file @
22a2bdaa
...
...
@@ -108,8 +108,8 @@ def _staff_grading(tab, user, course, active_page):
if
has_access
(
user
,
course
,
'staff'
):
link
=
reverse
(
'staff_grading'
,
args
=
[
course
.
id
])
tab_name
=
"Staff grading"
notifications
=
open_ended_notifications
.
staff_grading_notifications
(
course
)
notifications
=
open_ended_notifications
.
staff_grading_notifications
(
course
_id
)
pending_grading
=
notifications
[
'pending_grading'
]
img_path
=
notifications
[
'img_path'
]
...
...
@@ -122,7 +122,7 @@ def _peer_grading(tab, user, course, active_page):
link
=
reverse
(
'peer_grading'
,
args
=
[
course
.
id
])
tab_name
=
"Peer grading"
notifications
=
open_ended_notifications
.
peer_grading_notifications
(
course
,
user
)
notifications
=
open_ended_notifications
.
peer_grading_notifications
(
course
_id
,
user
)
pending_grading
=
notifications
[
'pending_grading'
]
img_path
=
notifications
[
'img_path'
]
...
...
@@ -135,7 +135,7 @@ def _combined_open_ended_grading(tab, user, course, active_page):
link
=
reverse
(
'open_ended_problems'
,
args
=
[
course
.
id
])
tab_name
=
"Open Ended Questions"
notifications
=
open_ended_notifications
.
combined_notifications
(
course
,
user
)
notifications
=
open_ended_notifications
.
combined_notifications
(
course
_id
,
user
)
pending_grading
=
notifications
[
'pending_grading'
]
img_path
=
notifications
[
'img_path'
]
...
...
lms/djangoapps/open_ended_grading/open_ended_notifications.py
View file @
22a2bdaa
...
...
@@ -7,12 +7,12 @@ from student.models import unique_id_for_user
import
open_ended_util
from
courseware.models
import
StudentModule
def
staff_grading_notifications
(
course
):
def
staff_grading_notifications
(
course
_id
):
staff_gs
=
StaffGradingService
(
settings
.
STAFF_GRADING_INTERFACE
)
pending_grading
=
False
img_path
=
""
try
:
notifications
=
json
.
loads
(
staff_gs
.
get_notifications
(
course
.
id
))
notifications
=
json
.
loads
(
staff_gs
.
get_notifications
(
course
_
id
))
if
notifications
[
'success'
]:
if
notifications
[
'staff_needs_to_grade'
]:
pending_grading
=
True
...
...
@@ -25,12 +25,12 @@ def staff_grading_notifications(course):
return
{
'pending_grading'
:
pending_grading
,
'img_path'
:
img_path
,
'response'
:
notifications
}
def
peer_grading_notifications
(
course
,
user
):
def
peer_grading_notifications
(
course
_id
,
user
):
peer_gs
=
PeerGradingService
(
settings
.
PEER_GRADING_INTERFACE
)
pending_grading
=
False
img_path
=
""
try
:
notifications
=
json
.
loads
(
peer_gs
.
get_notifications
(
course
.
id
,
unique_id_for_user
(
user
)))
notifications
=
json
.
loads
(
peer_gs
.
get_notifications
(
course
_
id
,
unique_id_for_user
(
user
)))
if
notifications
[
'success'
]:
if
notifications
[
'student_needs_to_peer_grade'
]:
pending_grading
=
True
...
...
@@ -43,11 +43,10 @@ def peer_grading_notifications(course, user):
return
{
'pending_grading'
:
pending_grading
,
'img_path'
:
img_path
,
'response'
:
notifications
}
def
combined_notifications
(
course
,
user
):
def
combined_notifications
(
course
_id
,
user
):
controller_url
=
open_ended_util
.
get_controller_url
()
controller_qs
=
ControllerQueryService
(
controller_url
)
student_id
=
unique_id_for_user
(
user
)
course_id
=
course
.
id
user_is_staff
=
has_access
(
user
,
course
,
'staff'
)
min_time_to_query
=
user
.
last_login
...
...
lms/djangoapps/open_ended_grading/views.py
View file @
22a2bdaa
...
...
@@ -163,8 +163,11 @@ def student_problem_list(request, course_id):
# Checked above
'staff_access'
:
False
,
})
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
combined_notifications
(
request
,
course_id
):
user
=
request
.
user
notifications
=
open_ended_notifications
.
combined_notifications
(
course_id
,
user
)
response
=
notifications
[
'response'
]
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