Skip to content

Commit

Permalink
Merge pull request #828 from edx/bseverino/onboarding-status-username
Browse files Browse the repository at this point in the history
[MST-738] Add username to proctoring info panel view
  • Loading branch information
bseverino authored Apr 7, 2021
2 parents 3879a42 + 07c903c commit 17d5a0b
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ Change Log
Unreleased
~~~~~~~~~~

[3.8.4] - 2021-04-05
~~~~~~~~~~~~~~~~~~~~~
* Add the request username to the proctoring info panel, allowing course staff to masquerade as
a specific user.

[3.8.3] - 2021-04-05
~~~~~~~~~~~~~~~~~~~~~
* Use exam due_date or course end date to evaluate the visibility of the onboarding status panel
Expand Down
2 changes: 1 addition & 1 deletion edx_proctoring/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"""

# Be sure to update the version number in edx_proctoring/package.json
__version__ = '3.8.3'
__version__ = '3.8.4'

default_app_config = 'edx_proctoring.apps.EdxProctoringConfig' # pylint: disable=invalid-name
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,11 @@
edx.courseware.proctored_exam.ProctoredExamInfo = Backbone.View.extend({
initialize: function() {
this.course_id = this.$el.data('course-id');
this.username = this.$el.data('username');
this.model.url = this.model.url + '?course_id=' + encodeURIComponent(this.course_id);
if (this.username) {
this.model.url = this.model.url + '&username=' + encodeURIComponent(this.username);
}
this.template_url = '/static/proctoring/templates/proctored-exam-info.underscore';
this.status = '';

Expand Down
27 changes: 27 additions & 0 deletions edx_proctoring/static/proctoring/spec/proctored_exam_info_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,33 @@ describe('ProctoredExamInfo', function() {
.toHaveLength(0);
});

it('should render if username is provided', function() {
setFixtures(
'<div class="proctoring-info-panel" data-course-id="test_course_id" ' +
'data-username="test_username"></div>'
);
this.server.respondWith(
'GET',
'/api/edx_proctoring/v1/user_onboarding/status?course_id=test_course_id&username=test_username',
[
200,
{
'Content-Type': 'application/json'
},
JSON.stringify(expectedProctoredExamInfoJson('verified'))
]
);

this.proctored_exam_info = new edx.courseware.proctored_exam.ProctoredExamInfo({
el: $('.proctoring-info-panel'),
model: new LearnerOnboardingModel()
});
this.server.respond();
this.server.respond();
expect(this.proctored_exam_info.$el.find('.onboarding-status').html())
.toContain('Verified');
});

it('should not render proctoring info panel for exam with 404 response', function() {
this.server.respondWith('GET', '/api/edx_proctoring/v1/user_onboarding/status?course_id=test_course_id',
[
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "@edx/edx-proctoring",
"//": "Be sure to update the version number in edx_proctoring/__init__.py",
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.",
"version": "3.8.3",
"version": "3.8.4",
"main": "edx_proctoring/static/index.js",
"scripts":{
"test":"gulp test"
Expand Down

0 comments on commit 17d5a0b

Please sign in to comment.