Anonymizing & Hiding Annotations
Intro
DocViewer allows you to anonymize or hide annotations. This is done by specifying user ids on session launch. In order to anonymize an annotation, it must have been created with an Anonymous User ID provided. There is also an option to leave annotations that will be permanently anonymous.
How to anonymize annotations
In order for an annotation to be anonymized, it must have been created in a session that had an Anonymous User ID and User Role provided.
- Launch a session with
user_anonymous_id: {ID_HERE}
anduser_role: {ROLE_HERE}
- Leave annotations. Those annotations will be saved with the Anonymous User ID
- When launching a session where you want those annotations to be anonymized, specify
the Anonymous User ID in the user_filter as follows:
Example:user_filter: [ { id: {ANONYMOUS_ID}, type: 'anonymous', role: {USER_ROLE}, name: {Specify the name to be displayed on the annotation, instead of the real user_name} } ]
user_filter: [ { id: 'asd89asd0f', type: 'anonymous', role: 'teacher', name: 'Grader 1' } ]
- Annotations created with the specified
user_anonymous_id
will be displayed with thename
specified
How to hide annotations
If a user_filter is specified, only annotations created by users specified will be shown. All other annotations will be hidden. For each user_id that you want to show annotations for, include an entry in the user filter. Users are matched by ID and Role. So a "Teacher" with ID "4gs0fg" will be considered different than a "Student" with ID "4gs0fg".
user_filter: [
{
id: {USER_ID},
type: 'real',
role: {USER_ROLE},
name: {unnecessary}
}
]
Example:
user_filter: [
{
id: 's0f8asd09f09jf09sd0fasdf',
type: 'real',
role: 'teacher',
name: 'John Doe'
},
{
id: 'b0f9xfas0dfsv0szdv098zv9',
type: 'real',
role: 'student',
name: 'Susan Smith'
}
]
The user filter can be used to specify that some annotations should be shown anonymized, and others should be shown with real IDs.
user_filter: [
{
id: {ANONYMOUS_ID},
type: 'anonymous',
role: {USER_ROLE},
name: {Specify the name to be displayed on the annotation, instead of the real user_name}
},
{
id: {USER_ID},
type: 'real',
role: {USER_ROLE},
name: {unnecessary}
}
]
If you want to use the user_filter
(i.e. to anonymize annotations) but not restrict annotations
to only those listed in the user_filter
, include restrict_annotations_to_user_filter: false
in
the session launch request. This will cause any annotations listed
as anonymous in the user_filter
to be anonymized, and all other annotations on the document will be
shown with their real IDs.
Permanently Anonymous Annotations
If you wish to leave annotations that are permanently anonymous (there is no way to de-anonymize them),
on session launch specify anonymous_instructor_annotations: true
and user_role
. When these annotations are viewed, the name will be replaced with the user_role
.
(e.g. 'Created by Teacher')