-
Notifications
You must be signed in to change notification settings - Fork 74
Show instructors in Admin Reports and populate user full names in DB #1058
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
NOTE: This commit changes the database schema, but does include a migration. In order to update the database to match the new commit, go to Docker desktop and click on the |
mbusch3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've tested this out, and it works beautifully on my system, and the code looks clean and readable.
There is one issue, however, and that's when I'm on the Courses page and choose to scan a course. After the scan returns with data, it rewrites that data and I no longer have the instructor name(s). One fix I've done on my end is in AdminApp, I've tried to preserve any instructors.
const handleCourseUpdate = (courseData) => {
let tempCourses = Object.assign({}, courses)
let tempInstructors = (tempCourses[courseData.id]?.instructors) ? tempCourses[courseData.id].instructors : []
tempCourses[courseData.id] = courseData
tempCourses[courseData.id].instructors = tempInstructors
setCourses(tempCourses)
}
This works, but is a little unsatisfying. If you could double check the handleScanClick function in CoursesPage.js. It uses api.scanCourse. Maybe that API call can be updated to return the instructor names similar to how you've done it in AdminController.php (using getInstructorNamesForCourse).
|
This is wonderful work and seems to be working for the most part. I have a couple issues that I'm seeing when I run it on my end:
That said, I haven't found any other major issues, and the report screen updates data immediately. Good work and well done! |
|
dmols
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good and the admin page works as intended! Great work!
Summary
Users
User.nameis populated; no more nulls).Admin Reports
Key Changes
Configuration
privacy_level = name_only).User.nameis set during user creation.Backend
course_userjoin table (Course↔Usermapping) to cache instructors:course_id(FK),user_id(nullable FK),lms_user_id,display_name,fetched_at.course_id,lms_user_id); indexed oncourse_id,user_id.course_user.instructors: string[]for:GET /api/admin/courses/account/{account}/term/{term}GET /api/admin/courses/{course}/reports/fullFrontend