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
bb4cfaba
Commit
bb4cfaba
authored
Sep 17, 2014
by
lduarte1991
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Annotation Tools: Adding Try-Catch for anonyous_student_id issue in staging
- changed message and added i18n
parent
3943bbd7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
5 deletions
+14
-5
common/lib/xmodule/xmodule/imageannotation_module.py
+6
-3
common/lib/xmodule/xmodule/textannotation_module.py
+4
-1
common/lib/xmodule/xmodule/videoannotation_module.py
+4
-1
No files found.
common/lib/xmodule/xmodule/imageannotation_module.py
View file @
bb4cfaba
...
...
@@ -108,12 +108,15 @@ class ImageAnnotationModule(AnnotatableFields, XModule):
self
.
instructions
=
self
.
_extract_instructions
(
xmltree
)
self
.
openseadragonjson
=
html_to_text
(
etree
.
tostring
(
xmltree
.
find
(
'json'
),
encoding
=
'unicode'
))
self
.
user
=
""
self
.
user
_email
=
""
self
.
is_course_staff
=
False
if
self
.
runtime
.
get_user_role
()
in
[
'instructor'
,
'staff'
]:
self
.
is_course_staff
=
True
if
self
.
runtime
.
get_real_user
is
not
None
:
self
.
user
=
self
.
runtime
.
get_real_user
(
self
.
runtime
.
anonymous_student_id
)
.
email
try
:
self
.
user_email
=
self
.
runtime
.
get_real_user
(
self
.
runtime
.
anonymous_student_id
)
.
email
except
:
# pylint: disable=broad-except
self
.
user_email
=
_
(
"No email address found."
)
def
_extract_instructions
(
self
,
xmltree
):
""" Removes <instructions> from the xmltree and returns them as a string, otherwise None. """
...
...
@@ -124,7 +127,7 @@ class ImageAnnotationModule(AnnotatableFields, XModule):
context
=
{
'display_name'
:
self
.
display_name_with_default
,
'instructions_html'
:
self
.
instructions
,
'token'
:
retrieve_token
(
self
.
user
,
self
.
annotation_token_secret
),
'token'
:
retrieve_token
(
self
.
user
_email
,
self
.
annotation_token_secret
),
'tag'
:
self
.
instructor_tags
,
'openseadragonjson'
:
self
.
openseadragonjson
,
'annotation_storage'
:
self
.
annotation_storage_url
,
...
...
common/lib/xmodule/xmodule/textannotation_module.py
View file @
bb4cfaba
...
...
@@ -107,7 +107,10 @@ class TextAnnotationModule(AnnotatableFields, XModule):
if
self
.
runtime
.
get_user_role
()
in
[
'instructor'
,
'staff'
]:
self
.
is_course_staff
=
True
if
self
.
runtime
.
get_real_user
is
not
None
:
self
.
user_email
=
self
.
runtime
.
get_real_user
(
self
.
runtime
.
anonymous_student_id
)
.
email
try
:
self
.
user_email
=
self
.
runtime
.
get_real_user
(
self
.
runtime
.
anonymous_student_id
)
.
email
except
:
# pylint: disable=broad-except
self
.
user_email
=
_
(
"No email address found."
)
def
_extract_instructions
(
self
,
xmltree
):
""" Removes <instructions> from the xmltree and returns them as a string, otherwise None. """
...
...
common/lib/xmodule/xmodule/videoannotation_module.py
View file @
bb4cfaba
...
...
@@ -107,7 +107,10 @@ class VideoAnnotationModule(AnnotatableFields, XModule):
if
self
.
runtime
.
get_user_role
()
in
[
'instructor'
,
'staff'
]:
self
.
is_course_staff
=
True
if
self
.
runtime
.
get_real_user
is
not
None
:
self
.
user_email
=
self
.
runtime
.
get_real_user
(
self
.
runtime
.
anonymous_student_id
)
.
email
try
:
self
.
user_email
=
self
.
runtime
.
get_real_user
(
self
.
runtime
.
anonymous_student_id
)
.
email
except
:
# pylint: disable=broad-except
self
.
user_email
=
_
(
"No email address found."
)
def
_extract_instructions
(
self
,
xmltree
):
""" Removes <instructions> from the xmltree and returns them as a string, otherwise None. """
...
...
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