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
d4ed0599
Commit
d4ed0599
authored
Jan 23, 2013
by
Diana Huang
Committed by
Vik Paruchuri
Jan 29, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do some better error checking for items.
parent
a2db72e1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
12 deletions
+23
-12
lms/djangoapps/open_ended_grading/views.py
+23
-12
No files found.
lms/djangoapps/open_ended_grading/views.py
View file @
d4ed0599
...
...
@@ -51,6 +51,16 @@ def _reverse_without_slash(url_name, course_id):
ajax_url
=
reverse
(
url_name
,
kwargs
=
{
'course_id'
:
course_id
})
return
ajax_url
DESCRIPTION_DICT
=
{
'Peer Grading'
:
"View all problems that require peer assessment in this particular course."
,
'Staff Grading'
:
"View ungraded submissions submitted by students for the open ended problems in the course."
,
'Problems you have submitted'
:
"View open ended problems that you have previously submitted for grading."
}
ALERT_DICT
=
{
'Peer Grading'
:
"New submissions to grade"
,
'Staff Grading'
:
"New submissions to grade"
,
'Problems you have submitted'
:
"New grades have been returned"
}
@cache_control
(
no_cache
=
True
,
no_store
=
True
,
must_revalidate
=
True
)
def
staff_grading
(
request
,
course_id
):
"""
...
...
@@ -193,16 +203,6 @@ def combined_notifications(request, course_id):
notification_tuples
=
open_ended_notifications
.
NOTIFICATION_TYPES
notification_list
=
[]
description_dict
=
{
'Peer Grading'
:
"View all problems that require peer assessment in this particular course."
,
'Staff Grading'
:
"View ungraded submissions submitted by students for the open ended problems in the course."
,
'Problems you have submitted'
:
"View open ended problems that you have previously submitted for grading."
}
alert_dict
=
{
'Peer Grading'
:
"New submissions to grade"
,
'Staff Grading'
:
"New submissions to grade"
,
'Problems you have submitted'
:
"New grades have been returned"
}
for
response_num
in
xrange
(
0
,
len
(
notification_tuples
)):
tag
=
notification_tuples
[
response_num
][
0
]
if
tag
in
response
:
...
...
@@ -211,12 +211,23 @@ def combined_notifications(request, course_id):
url
=
_reverse_without_slash
(
url_name
,
course_id
)
has_img
=
response
[
tag
]
# check to make sure we have descriptions and alert messages
if
human_name
in
DESCRIPTION_DICT
:
description
=
DESCRIPTION_DICT
[
human_name
]
else
:
description
=
""
if
human_name
in
ALERT_DICT
:
alert_message
=
ALERT_DICT
[
human_name
]
else
:
alert_message
=
""
notification_item
=
{
'url'
:
url
,
'name'
:
human_name
,
'alert'
:
has_img
,
'description'
:
description
_dict
[
human_name
]
,
'alert_message'
:
alert_
dict
[
human_name
]
'description'
:
description
,
'alert_message'
:
alert_
message
}
notification_list
.
append
(
notification_item
)
...
...
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