diff --git a/services/headless-lms/models/src/course_instances.rs b/services/headless-lms/models/src/course_instances.rs index 39ee0d514c9b..2dc924cc70a9 100644 --- a/services/headless-lms/models/src/course_instances.rs +++ b/services/headless-lms/models/src/course_instances.rs @@ -491,7 +491,7 @@ WHERE id IN (SELECT * FROM UNNEST($1::uuid[])) } /// Deletes submissions, peer reviews, points and etc. for a course and user. Main purpose is for teachers who are testing their course with their own accounts. -pub async fn reset_course_instance_for_user( +pub async fn reset_progress_on_course_instance_for_user( conn: &mut PgConnection, user_id: Uuid, course_instance_id: Uuid, diff --git a/services/headless-lms/server/src/controllers/main_frontend/courses.rs b/services/headless-lms/server/src/controllers/main_frontend/courses.rs index ae3a5422212b..cd47ee11ec0f 100644 --- a/services/headless-lms/server/src/controllers/main_frontend/courses.rs +++ b/services/headless-lms/server/src/controllers/main_frontend/courses.rs @@ -1145,12 +1145,12 @@ pub async fn get_page_visit_datum_summary_by_countries( } /** -DELETE `/api/v0/main-frontend/courses/${course.id}/teacher-reset-course-for-themselves` - Allows a teacher to reset a course for themselves. Cannot be used to reset the course for others. +DELETE `/api/v0/main-frontend/courses/${course.id}/teacher-reset-course-progress-for-themselves` - Allows a teacher to reset the course progress for themselves. Cannot be used to reset the course for others. Deletes submissions, user exercise states, and peer reviews etc. for all the course instances of this course. */ #[generated_doc] -pub async fn teacher_reset_course_for_themselves( +pub async fn teacher_reset_course_progress_for_themselves( course_id: web::Path, pool: web::Data, user: AuthUser, @@ -1163,7 +1163,7 @@ pub async fn teacher_reset_course_for_themselves( let course_instances = models::course_instances::get_course_instances_for_course(&mut tx, course_id).await?; for course_instance in course_instances { - models::course_instances::reset_course_instance_for_user( + models::course_instances::reset_progress_on_course_instance_for_user( &mut tx, user.id, course_instance.id, @@ -1317,7 +1317,7 @@ pub fn _add_routes(cfg: &mut ServiceConfig) { web::get().to(get_page_visit_datum_summary_by_countries), ) .route( - "/{course_id}/teacher-reset-course-for-themselves", - web::delete().to(teacher_reset_course_for_themselves), + "/{course_id}/teacher-reset-course-progress-for-themselves", + web::delete().to(teacher_reset_course_progress_for_themselves), ); } diff --git a/services/main-frontend/src/components/page-specific/manage/courses/id/index/ManageCourse.tsx b/services/main-frontend/src/components/page-specific/manage/courses/id/index/ManageCourse.tsx index 591cabaf1b06..f1fd50493db3 100644 --- a/services/main-frontend/src/components/page-specific/manage/courses/id/index/ManageCourse.tsx +++ b/services/main-frontend/src/components/page-specific/manage/courses/id/index/ManageCourse.tsx @@ -7,7 +7,7 @@ import { useTranslation } from "react-i18next" import useCourseBreadcrumbInfoQuery from "../../../../../../hooks/useCourseBreadcrumbInfoQuery" import { deleteCourse, - teacherResetCourseForThemselves, + teacherResetCourseProgressForThemselves, } from "../../../../../../services/backend/courses" import { Course } from "../../../../../../shared-module/bindings" import Button from "../../../../../../shared-module/components/Button" @@ -48,9 +48,9 @@ const ManageCourse: React.FC> = ({ course, refetc }, ) - const teacherResetCourseForThemselvesMutation = useToastMutation( + const teacherResetCourseProgressForThemselvesMutation = useToastMutation( async () => { - await teacherResetCourseForThemselves(course.id) + await teacherResetCourseProgressForThemselves(course.id) }, { notify: true, @@ -181,7 +181,7 @@ const ManageCourse: React.FC> = ({ course, refetc t("are-you-sure-you-want-to-reset-your-own-progress-on-the-course"), ) if (sure) { - teacherResetCourseForThemselvesMutation.mutate() + teacherResetCourseProgressForThemselvesMutation.mutate() } }} > diff --git a/services/main-frontend/src/services/backend/courses.ts b/services/main-frontend/src/services/backend/courses.ts index e2ea77268d65..216bfd403037 100644 --- a/services/main-frontend/src/services/backend/courses.ts +++ b/services/main-frontend/src/services/backend/courses.ts @@ -270,8 +270,10 @@ export const postNewPageOrdering = async (courseId: string, pages: Page[]): Prom } /** Teacher can use this to delete their own submissions, points, etc but they cannot use it to delete those things for other users */ -export const teacherResetCourseForThemselves = async (courseId: string): Promise => { - await mainFrontendClient.delete(`/courses/${courseId}/teacher-reset-course-for-themselves`) +export const teacherResetCourseProgressForThemselves = async (courseId: string): Promise => { + await mainFrontendClient.delete( + `/courses/${courseId}/teacher-reset-course-progress-for-themselves`, + ) } export const postNewChapterOrdering = async ( diff --git a/shared-module/src/locales/en/course-material.json b/shared-module/src/locales/en/course-material.json index 6204de87a04f..da604ac83837 100644 --- a/shared-module/src/locales/en/course-material.json +++ b/shared-module/src/locales/en/course-material.json @@ -104,6 +104,7 @@ "n-characters-over-limit": "{{n}} characters over the limit", "no-comments-yet": "No comments yet", "no-submission-received-for-this-exercise": "No submission received for this exercise.", + "number-of-student": "Number of student", "opens-in-time": "Opens in {{ relative-time }}", "opens-now": "Opens now!", "peer-review": "Peer review", @@ -115,6 +116,7 @@ "please-wait-until-next-chapter-opens": "Please wait until the next chapter opens.", "points-label": "Points", "points-required-for-completion": "Points required for completion", + "popular-regions": "Popular Countries", "preview": "Preview", "preview-changes-or-make-more-edits": "Preview your changes or make more edits", "proceed-to-next-topic": "Proceed to the next topic", @@ -172,7 +174,5 @@ "you-have-completed-the-course-to-receive-certificate-use-following-links": "You have successfully completed the course! You can use the following links to generate your certificate.", "you-have-completed-the-course-to-receive-credits-or-certificate-use-following-links": "You have successfully completed the course! To receive ECTS credits for your completions, you can use the following links to register your completion and receive a certificate.", "youve-made-changes": "You've made changes", - "popular-regions": "Popular Countries", - "number-of-student": "Number of student", "youve-selected-material-for-editing": "You've selected material for editing" }