$(document).ready(function() {
    // Add more question fields dynamically in form_create.php
    $('#add-question').click(function() {
        let questionHtml = `
            <div class="form-group question">
                <label>Question Text</label>
                <input type="text" name="questions[]" class="form-control" required>
                <label>Question Type</label>
                <select name="question_types[]" class="form-control" required>
                    <option value="text">Text</option>
                    <option value="single_choice">Single Choice</option>
                    <option value="multiple_choice">Multiple Choice</option>
                    <option value="yes_no">Yes/No</option>
                </select>
                <label>Options (comma-separated, for single/multiple choice)</label>
                <input type="text" name="options[]" class="form-control">
            </div>`;
        $('#questions-container').append(questionHtml);
    });
});