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
8602e159
Commit
8602e159
authored
Jan 22, 2013
by
Vik Paruchuri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Pass proper parameters, fix templating
parent
0f212cc8
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
22 deletions
+30
-22
lms/djangoapps/open_ended_grading/open_ended_notifications.py
+4
-2
lms/djangoapps/open_ended_grading/open_ended_util.py
+1
-1
lms/djangoapps/open_ended_grading/views.py
+6
-1
lms/templates/open_ended_problems/combined_notifications.html
+19
-18
No files found.
lms/djangoapps/open_ended_grading/open_ended_notifications.py
View file @
8602e159
...
...
@@ -73,14 +73,16 @@ def combined_notifications(course, user):
img_path
=
""
try
:
notifications
=
json
.
loads
(
controller_qs
.
get_notifications
(
course
.
id
,
student_id
,
user_is_staff
,
last_time_viewed
))
controller_response
=
controller_qs
.
check_combined_notifications
(
course
.
id
,
student_id
,
user_is_staff
,
last_time_viewed
)
log
.
debug
(
controller_response
)
notifications
=
json
.
loads
(
controller_response
)
if
notifications
[
'success'
]:
if
notifications
[
'overall_need_to_check'
]:
pending_grading
=
True
except
:
#Non catastrophic error, so no real action
notifications
=
{}
log
.
info
(
"Problem with getting notifications from controller query service."
)
log
.
exception
(
"Problem with getting notifications from controller query service."
)
if
pending_grading
:
img_path
=
"/static/images/slider-handle.png"
...
...
lms/djangoapps/open_ended_grading/open_ended_util.py
View file @
8602e159
...
...
@@ -7,6 +7,6 @@ def get_controller_url():
peer_grading_url
=
settings
.
PEER_GRADING_INTERFACE
[
'url'
]
split_url
=
peer_grading_url
.
split
(
"/"
)
controller_url
=
"http://"
+
split_url
[
2
]
+
"/grading_controller"
controller_settings
=
settings
.
PEER_GRADING_INTERFACE
controller_settings
=
settings
.
PEER_GRADING_INTERFACE
.
copy
()
controller_settings
[
'url'
]
=
controller_url
return
controller_settings
lms/djangoapps/open_ended_grading/views.py
View file @
8602e159
...
...
@@ -168,10 +168,10 @@ def combined_notifications(request, course_id):
course
=
get_course_with_access
(
request
.
user
,
course_id
,
'load'
)
user
=
request
.
user
notifications
=
open_ended_notifications
.
combined_notifications
(
course
,
user
)
log
.
debug
(
notifications
)
response
=
notifications
[
'response'
]
notification_tuples
=
open_ended_notifications
.
NOTIFICATION_TYPES
notification_list
=
[]
for
response_num
in
xrange
(
0
,
len
(
notification_tuples
)):
tag
=
notification_tuples
[
response_num
][
0
]
...
...
@@ -190,12 +190,17 @@ def combined_notifications(request, course_id):
}
notification_list
.
append
(
notification_item
)
ajax_url
=
_reverse_with_slash
(
'open_ended_notifications'
,
course_id
)
combined_dict
=
{
'error_text'
:
""
,
'notification_list'
:
notification_list
,
'course'
:
course
,
'success'
:
True
,
'ajax_url'
:
ajax_url
,
}
log
.
debug
(
combined_dict
)
return
render_to_response
(
'open_ended_problems/combined_notifications.html'
,
combined_dict
)
...
...
lms/templates/open_ended_problems/combined_notifications.html
View file @
8602e159
...
...
@@ -18,24 +18,24 @@
<h2>
Instructions
</h2>
<p>
Here are items that could potentially need your attention.
</p>
% if success:
% if len(notification_list) == 0:
<div
class=
"message-container"
>
No items require attention at the moment.
</div>
%else:
<ul
class=
"notification-list"
>
%for notification in notification_list:
<li>
<a
href=
"${notification['url']}"
>
{notification['name']}
% if notification['has_img'] == True:
<img
src=
"${notification['img']}"
/>
%endif
</a>
</li>
%endfor
</ul>
%endif
% if len(notification_list) == 0:
<div
class=
"message-container"
>
No items require attention at the moment.
</div>
%else:
<ul
class=
"notification-list"
>
%for notification in notification_list:
<li>
<a
href=
"${notification['url']}"
>
{notification['name']}
% if notification['has_img'] == True:
<img
src=
"${notification['img']}"
/>
%endif
</a>
</li>
%endfor
</ul>
%endif
%endif
</div>
</section>
\ No newline at end of file
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