@edx/edx-proctoring
Advanced tools
Comparing version 3.7.9 to 3.7.10
@@ -84,2 +84,3 @@ // This dropdown component was borrowed from | ||
}); | ||
event.stopPropagation(); | ||
}; | ||
@@ -86,0 +87,0 @@ |
@@ -301,2 +301,3 @@ edx = edx || {}; | ||
var accordionRow, isExpanded, $toggleChevron, $contentPanel; | ||
event.preventDefault(); | ||
accordionRow = event.currentTarget; | ||
@@ -322,2 +323,3 @@ if (accordionRow.classList.contains('accordion-trigger')) { | ||
var key = event.which || event.keyCode || 0; | ||
event.preventDefault(); | ||
@@ -324,0 +326,0 @@ if (key === 13) { |
@@ -114,2 +114,6 @@ (function(Backbone, $) { | ||
$el.find('.action-disabled').css({ | ||
background: '#b4b6bd' | ||
}); | ||
$el.find('.action-info-link').css({ | ||
@@ -143,2 +147,4 @@ border: '1px solid #0d4e6c' | ||
var statusText = {}; | ||
var releaseDate; | ||
var now = new Date(); | ||
var data = this.model.toJSON(); | ||
@@ -152,2 +158,3 @@ if (this.template) { | ||
statusText = this.getExamAttemptText(this.status); | ||
releaseDate = new Date(data.onboarding_release_date); | ||
data = { | ||
@@ -157,4 +164,6 @@ onboardingStatus: statusText.status, | ||
showOnboardingReminder: !['verified', 'other_course_approved'].includes(data.onboarding_status), | ||
onboardingNotReleased: releaseDate > now, | ||
showOnboardingExamLink: this.shouldShowExamLink(data.onboarding_status), | ||
onboardingLink: data.onboarding_link | ||
onboardingLink: data.onboarding_link, | ||
onboardingReleaseDate: releaseDate.toLocaleDateString() | ||
}; | ||
@@ -161,0 +170,0 @@ |
@@ -710,2 +710,3 @@ describe('ProctoredExamAttemptView', function() { | ||
+ '.actions-item .action')[1].text).toContain('Reset'); | ||
expect(this.proctored_exam_attempt_view.$el.find('.accordion-panel').hasClass('is-hidden')).toEqual(true); | ||
@@ -712,0 +713,0 @@ // trigger the resume attempt event. |
@@ -11,3 +11,8 @@ /* global LearnerOnboardingModel:false */ | ||
function expectedProctoredExamInfoJson(status) { | ||
function expectedProctoredExamInfoJson(status, examReleaseDate) { | ||
var releaseDate = examReleaseDate; | ||
if (!examReleaseDate) { // default to released a week ago | ||
releaseDate = new Date(); | ||
releaseDate.setDate(new Date().getDate() - 7); | ||
} | ||
return ( | ||
@@ -17,2 +22,3 @@ { | ||
onboarding_link: 'onboarding_link', | ||
onboarding_release_date: releaseDate, | ||
expiration_date: null | ||
@@ -60,5 +66,10 @@ } | ||
'<% if (showOnboardingExamLink) { %>' + | ||
'<% if (onboardingNotReleased) { %>' + | ||
'<a class="action action-onboarding action-disabled">' + | ||
'<%= gettext("Onboarding Opens") %> <%= onboardingReleaseDate %></a>' + | ||
'<%} else { %>' + | ||
'<a href="<%= onboardingLink %>" class="action action-onboarding">' + | ||
'<%= gettext("Complete Onboarding") %></a>' + | ||
'<%} %>' + | ||
'<%} %>' + | ||
'<a href="https://support.edx.org/hc/en-us/articles/207249428-How-do-proctored-exams-work" ' + | ||
@@ -197,2 +208,33 @@ 'class="action action-info-link">' + | ||
it('should render proctoring info panel correctly for exam that has yet to be released', function() { | ||
var tomorrow = new Date(); | ||
tomorrow.setDate(new Date().getDate() + 1); | ||
this.server.respondWith('GET', '/api/edx_proctoring/v1/user_onboarding/status?course_id=test_course_id', | ||
[ | ||
200, | ||
{ | ||
'Content-Type': 'application/json' | ||
}, | ||
JSON.stringify(expectedProctoredExamInfoJson('', tomorrow)) | ||
] | ||
); | ||
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('.proctoring-info').css('border-top')) | ||
.toEqual('5px solid rgb(178, 6, 16)'); | ||
expect(this.proctored_exam_info.$el.find('.onboarding-status').html()) | ||
.toContain('Not Started'); | ||
expect(this.proctored_exam_info.$el.find('.onboarding-status-message').text()) | ||
.toHaveLength(0); | ||
expect(this.proctored_exam_info.$el.find('.onboarding-reminder').html()) | ||
.toContain('You must complete the onboarding process'); | ||
expect(this.proctored_exam_info.$el.find('.action-onboarding').html()) | ||
.toContain('Onboarding Opens ' + tomorrow.toLocaleDateString()); | ||
}); | ||
it('should render proctoring info panel correctly for created exam', function() { | ||
@@ -199,0 +241,0 @@ this.server.respondWith('GET', '/api/edx_proctoring/v1/user_onboarding/status?course_id=test_course_id', |
@@ -5,4 +5,7 @@ { | ||
"//": "Note that the version format is slightly different than that of the Python version when using prereleases.", | ||
"version": "3.7.9", | ||
"version": "3.7.10", | ||
"main": "edx_proctoring/static/index.js", | ||
"scripts":{ | ||
"test":"gulp test" | ||
}, | ||
"repository": { | ||
@@ -9,0 +12,0 @@ "type": "git", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
995043
18254