DanielTCGomes's avatar

Exam Editor Not Loading After Lessons

The editor to take the exams after the lessons is not loading and gets stuck in an infinite loading screen.

0 likes
2 replies
LaryAI's avatar
Level 58

Certainly! Here's a solution you can try for the "Exam Editor Not Loading After Lessons" issue:


Solution:

This issue is often related to either a JavaScript error, a missing dependency, or a problem with your backend returning unexpected data. Here are a few steps to troubleshoot and resolve the problem:

  1. Check Browser Console for Errors

    Open your browser’s developer tools and go to the Console tab. Look for any red error messages when you try to load the exam editor page. Common issues are missing scripts, 404 errors, or JavaScript exceptions.

  2. Check Network Requests

    While in developer tools, go to the Network tab and refresh the page. See if any API request (for example, the API that loads the exam data) is failing (shows red status or error codes like 500, 404, 401, etc).

  3. Verify Your Backend

    Ensure your backend routes and controllers for the exam are returning the correct data and required relationships. In Laravel, use dd() in your controller action to verify data.

    Example:

    public function show($id)
    {
        $exam = Exam::with('questions')->findOrFail($id);
        dd($exam);
        return response()->json($exam);
    }
    

    Ensure the data matches the structure your frontend expects.

  4. Check for Missing Vue/JS Components

    If you’re using Vue or another JS framework, make sure the ExamEditor component is properly imported and registered.

    import ExamEditor from './components/ExamEditor.vue';
    
    export default {
        components: {
            ExamEditor
        },
        // ...
    }
    
  5. Clear Cache and Recompile Assets

    Sometimes, cached views or outdated JavaScript can cause this. Run these in your project root:

    php artisan config:clear
    php artisan cache:clear
    php artisan view:clear
    npm run dev
    
  6. Check for Authentication Issues

    If the exam editor requires authentication and the user is not signed in or a session has expired, the editor may never load. Confirm by checking for 401/403 errors in network requests.

  7. Update Dependencies

    Make sure all dependencies are installed and up to date:

    composer install
    npm install
    

If you’re still seeing the infinite loading spinner:
Post the console/network errors here, along with your relevant controller and front-end code, so the community can help further!

Let me know if this solves the issue or if you need more targeted help.

DanielTCGomes's avatar

Just to clarify: this is not an issue with my local project or code. The problem happens in Laracasts’ own PHP exercise editor (the editor used to complete lesson exercises). After finishing a lesson, the exercise editor gets stuck on an infinite loading screen and never loads.

This seems to be a platform/editor issue, not related to user code, browser console errors, or backend configuration.

1 like

Please or to participate in this conversation.