AI Quiz Generation System

The AI Quiz feature automates the creation of assessment questions based on course content, significantly reducing the workload for instructors and administrators.

1. User Interface Integration

The action is initiated via the "Make AI Quiz" button found in both the Admin and Instructor panels.

  • Admin Panel: resources/views/admin/webinars/create.blade.php (Line 1325)
  • Instructor Panel: resources/views/design_1/panel/webinars/create/steps/step_7.blade.php (Line 28)

2. Technical Workflow

Step A: Event Trigger

A jQuery click listener captures the event on the #makeAiQuiz ID. It retrieves the data-webinar-id to identify the target course.

Step B: Backend Communication

The system sends an asynchronous POST request to the AI generation engine:

  • Admin Endpoint: /admin/webinar-quiz/ai-quiz/generate
  • Panel Endpoint: /panel/quizzes/ai-quiz/generate
Step C: UI Feedback & Processing

During the request, the button is disabled and assigned a loadingbar class. Feedback is handled via SweetAlert2:

  • Success: Displays "AI Quiz Generated Successfully!" and reloads the page.
  • Failure: Displays an error alert and re-enables the button.

3. Implementation Notes

  • Dependencies: SweetAlert2 and jQuery.
  • Logic: Uses the Webinar ID to parse course text and generate relevant MCQs via the AI model.