Skip to content

Commit

Permalink
feat: update proctoring info panel api call
Browse files Browse the repository at this point in the history
  • Loading branch information
alangsto committed Jan 29, 2025
1 parent 8a6fa93 commit 700ca0a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
14 changes: 11 additions & 3 deletions src/course-home/data/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,9 +289,17 @@ export async function getProgressTabData(courseId, targetUserId) {
}

export async function getProctoringInfoData(courseId, username) {
let url = `${getConfig().LMS_BASE_URL}/api/edx_proctoring/v1/user_onboarding/status?is_learning_mfe=true&course_id=${encodeURIComponent(courseId)}`;
if (username) {
url += `&username=${encodeURIComponent(username)}`;
let url;
if (!getConfig().EXAMS_BASE_URL) {
url = `${getConfig().LMS_BASE_URL}/api/edx_proctoring/v1/user_onboarding/status?is_learning_mfe=true&course_id=${encodeURIComponent(courseId)}`;

Check warning on line 294 in src/course-home/data/api.js

View check run for this annotation

Codecov / codecov/patch

src/course-home/data/api.js#L294

Added line #L294 was not covered by tests
if (username) {
url += `&username=${encodeURIComponent(username)}`;

Check warning on line 296 in src/course-home/data/api.js

View check run for this annotation

Codecov / codecov/patch

src/course-home/data/api.js#L296

Added line #L296 was not covered by tests
}
} else {
url = `${getConfig().EXAMS_BASE_URL}/api/v1/student/course_id/${encodeURIComponent(courseId)}/onboarding`;
if (username) {
url += `?username=${encodeURIComponent(username)}`;
}
}
try {
const { data } = await getAuthenticatedHttpClient().get(url);
Expand Down
2 changes: 1 addition & 1 deletion src/course-home/outline-tab/OutlineTab.test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ describe('Outline Tab', () => {
const goalUrl = `${getConfig().LMS_BASE_URL}/api/course_home/save_course_goal`;
const masqueradeUrl = `${getConfig().LMS_BASE_URL}/courses/${courseId}/masquerade`;
const outlineUrl = `${getConfig().LMS_BASE_URL}/api/course_home/outline/${courseId}`;
const proctoringInfoUrl = `${getConfig().LMS_BASE_URL}/api/edx_proctoring/v1/user_onboarding/status?is_learning_mfe=true&course_id=${encodeURIComponent(courseId)}&username=MockUser`;
const proctoringInfoUrl = `${getConfig().EXAMS_BASE_URL}/api/v1/student/course_id/${encodeURIComponent(courseId)}/onboarding?username=MockUser`;

const store = initializeStore();
const defaultMetadata = Factory.build('courseHomeMetadata');
Expand Down

0 comments on commit 700ca0a

Please sign in to comment.