<?php
/**
 * Admin settings page template.
 *
 * @package MasterQuiz
 * @since   1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}
?>
<div class="wrap">
	<h1><?php echo esc_html( get_admin_page_title() ); ?></h1>

	<form method="post" action="options.php">
		<?php
		settings_fields( MasterQuiz_Settings::OPTION_GROUP );
		do_settings_sections( MasterQuiz_Settings::PAGE_SLUG );
		submit_button( esc_html__( 'Save Settings', 'masterquiz-ai' ) );
		?>
	</form>

	<hr />

	<h2><?php esc_html_e( 'Shortcode Usage', 'masterquiz-ai' ); ?></h2>
	<p>
		<?php esc_html_e( 'Use the following shortcode to display the quiz generator on any page or post:', 'masterquiz-ai' ); ?>
	</p>
	<code>[masterquiz_ai]</code>

	<h3><?php esc_html_e( 'Shortcode Attributes', 'masterquiz-ai' ); ?></h3>
	<table class="widefat" style="max-width: 600px;">
		<thead>
			<tr>
				<th><?php esc_html_e( 'Attribute', 'masterquiz-ai' ); ?></th>
				<th><?php esc_html_e( 'Default', 'masterquiz-ai' ); ?></th>
				<th><?php esc_html_e( 'Description', 'masterquiz-ai' ); ?></th>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td><code>title</code></td>
				<td><?php esc_html_e( 'PDF to Quiz Generator', 'masterquiz-ai' ); ?></td>
				<td><?php esc_html_e( 'Custom heading text.', 'masterquiz-ai' ); ?></td>
			</tr>
			<tr>
				<td><code>show_header</code></td>
				<td><code>true</code></td>
				<td><?php esc_html_e( 'Show or hide the header area.', 'masterquiz-ai' ); ?></td>
			</tr>
			<tr>
				<td><code>show_learndash</code></td>
				<td><code>auto</code></td>
				<td><?php esc_html_e( 'Show LearnDash option. "auto" = show if LearnDash is active.', 'masterquiz-ai' ); ?></td>
			</tr>
			<tr>
				<td><code>max_questions</code></td>
				<td><?php echo esc_html( get_option( 'masterquiz_default_num_questions', 5 ) ); ?></td>
				<td><?php esc_html_e( 'Override max number of questions.', 'masterquiz-ai' ); ?></td>
			</tr>
		</tbody>
	</table>
</div>
