feat: Implement admin user and course management, instructor course and quiz management
This commit is contained in:
parent
8edc3770eb
commit
a65ded02f9
7 changed files with 156 additions and 7 deletions
|
|
@ -589,9 +589,40 @@ export const instructorService = {
|
|||
`/api/instructors/courses/${courseId}/announcements/${announcementId}/attachments/${attachmentId}`,
|
||||
{ method: 'DELETE' }
|
||||
);
|
||||
},
|
||||
async getCourseApprovalHistory(courseId: number): Promise<ApprovalHistory[]> {
|
||||
const response = await authRequest<{
|
||||
code: number;
|
||||
message: string;
|
||||
data: {
|
||||
approval_history: ApprovalHistory[];
|
||||
current_status: string;
|
||||
course_title: { en: string; th: string };
|
||||
course_id: number;
|
||||
}
|
||||
}>(`/api/instructors/courses/${courseId}/approval-history`);
|
||||
return response.data.approval_history;
|
||||
}
|
||||
};
|
||||
|
||||
// Approval History Interface
|
||||
export interface ApprovalHistory {
|
||||
id: number;
|
||||
action: string;
|
||||
comment: string | null;
|
||||
created_at: string;
|
||||
submitter: {
|
||||
id: number;
|
||||
username: string;
|
||||
email: string;
|
||||
};
|
||||
reviewer: {
|
||||
id: number;
|
||||
username: string;
|
||||
email: string;
|
||||
} | null;
|
||||
}
|
||||
|
||||
// Create course request
|
||||
export interface CreateCourseRequest {
|
||||
category_id: number;
|
||||
|
|
@ -678,6 +709,7 @@ export interface QuizResponse {
|
|||
shuffle_choices: boolean;
|
||||
show_answers_after_completion: boolean;
|
||||
is_skippable: boolean;
|
||||
allow_multiple_attempts: boolean;
|
||||
created_at?: string;
|
||||
updated_at?: string;
|
||||
questions?: QuizQuestionResponse[];
|
||||
|
|
@ -692,6 +724,7 @@ export interface UpdateQuizSettingsRequest {
|
|||
shuffle_choices: boolean;
|
||||
show_answers_after_completion: boolean;
|
||||
is_skippable: boolean;
|
||||
allow_multiple_attempts: boolean;
|
||||
}
|
||||
|
||||
export interface CreateChapterRequest {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue