<h3><strong>Overview of Shortcodes</strong></h3>
<ol>
 	<li><strong><code>[results_calculation_sheet]</code></strong>
<ul>
 	<li>This shortcode calculates specific results based on input parameters like event ID, player ID, run ID, lap count, calculation type, etc.</li>
 	<li>Supports different calculation types such as fetching individual scores or averages.</li>
</ul>
</li>
 	<li><strong><code>[results_calculation_sheet_total]</code></strong>
<ul>
 	<li>This shortcode calculates the average of the two highest scores across multiple laps.</li>
 	<li>It uses the first shortcode <code>[results_calculation_sheet]</code> internally to fetch individual scores for each lap.</li>
</ul>
</li>
</ol>

<hr />

<h3><strong>How to Use the Shortcodes</strong></h3>
<h4><strong>1. Using <code>[results_calculation_sheet]</code></strong></h4>
This shortcode retrieves results for a specific combination of parameters. Here’s how to use it:
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">php</div>
<div class="sticky top-9 md:top-[5.75rem]">
<div class="absolute bottom-0 right-2 flex h-9 items-center">
<div class="flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary"><span class="" data-state="closed"><button class="flex gap-1 items-center select-none px-4 py-1" aria-label="Copy">Copy</button></span><span class="" data-state="closed"><button class="flex select-none items-center gap-1">Edit</button></span></div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-php">[results_calculation_sheet 
    event_id=<span class="hljs-string">"123"</span> 
    player_id=<span class="hljs-string">"456"</span> 
    run_id=<span class="hljs-string">"1"</span> 
    lap_count=<span class="hljs-string">"2"</span> 
    gate_id=<span class="hljs-string">"3"</span> 
    calc_type=<span class="hljs-string">"avarage"</span> 
    render_type=<span class="hljs-string">"score"</span>
]
</code></div>
</div>
<strong>Attributes:</strong>
<ul>
 	<li><code>event_id</code> (Required): ID of the event.</li>
 	<li><code>player_id</code> (Required): Player's unique ID or BIB number.</li>
 	<li><code>run_id</code> (Required): ID of the heat/run.</li>
 	<li><code>lap_count</code> (Optional): Specifies the lap number (e.g., 1, 2, 3).</li>
 	<li><code>gate_id</code> (Optional): ID of the gate/judge stand.</li>
 	<li><code>calc_type</code>:
<ul>
 	<li><code>one</code>: Fetches a single result based on filters.</li>
 	<li><code>avarage</code>: Calculates the average of scores matching the criteria.</li>
</ul>
</li>
 	<li><code>render_type</code>:
<ul>
 	<li><code>score</code>: Returns the numeric score.</li>
 	<li><code>scoretype</code>: Returns the score type.</li>
 	<li>Default: Returns the score.</li>
</ul>
</li>
</ul>

<hr />

<h4><strong>2. Using <code>[results_calculation_sheet_total]</code></strong></h4>
This shortcode calculates the <strong>average of the two highest scores</strong> across multiple laps. Example:
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">php</div>
<div class="sticky top-9 md:top-[5.75rem]">
<div class="absolute bottom-0 right-2 flex h-9 items-center">
<div class="flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary"><span class="" data-state="closed"><button class="flex gap-1 items-center select-none px-4 py-1" aria-label="Copy">Copy</button></span><span class="" data-state="closed"><button class="flex select-none items-center gap-1">Edit</button></span></div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-php">[results_calculation_sheet_total 
    event_id=<span class="hljs-string">"123"</span> 
    player_id=<span class="hljs-string">"456"</span> 
    run_id=<span class="hljs-string">"1"</span> 
    lap_count=<span class="hljs-string">"3"</span> 
    calc_type=<span class="hljs-string">"avarage"</span>
]
</code></div>
</div>
<strong>Attributes:</strong>
<ul>
 	<li>Same as <code>[results_calculation_sheet]</code>, with additional functionality:
<ul>
 	<li>Aggregates scores from up to 9 laps (if defined).</li>
 	<li>Returns both the two highest scores and their average.</li>
</ul>
</li>
</ul>
<strong>Output Example:</strong>
<ul>
 	<li><code>H:89|85|A:87</code>: Highest scores are 89 and 85, with an average of 87.</li>
</ul>

<hr />

<h3><strong>Practical Use Cases</strong></h3>
<ol>
 	<li><strong>Display Individual Scores:</strong>
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">php</div>
<div class="sticky top-9 md:top-[5.75rem]">
<div class="absolute bottom-0 right-2 flex h-9 items-center">
<div class="flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary"><span class="" data-state="closed"><button class="flex gap-1 items-center select-none px-4 py-1" aria-label="Copy">Copy</button></span><span class="" data-state="closed"><button class="flex select-none items-center gap-1">Edit</button></span></div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-php">[results_calculation_sheet event_id=<span class="hljs-string">"1"</span> player_id=<span class="hljs-string">"101"</span> run_id=<span class="hljs-string">"3"</span> lap_count=<span class="hljs-string">"1"</span> calc_type=<span class="hljs-string">"one"</span>]
</code></div>
</div>
This will display a single result for the specified parameters.</li>
 	<li><strong>Display Average Score for a Lap:</strong>
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">php</div>
<div class="sticky top-9 md:top-[5.75rem]">
<div class="absolute bottom-0 right-2 flex h-9 items-center">
<div class="flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary"><span class="" data-state="closed"><button class="flex gap-1 items-center select-none px-4 py-1" aria-label="Copy">Copy</button></span><span class="" data-state="closed"><button class="flex select-none items-center gap-1">Edit</button></span></div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-php">[results_calculation_sheet event_id=<span class="hljs-string">"1"</span> player_id=<span class="hljs-string">"101"</span> run_id=<span class="hljs-string">"3"</span> lap_count=<span class="hljs-string">"2"</span> calc_type=<span class="hljs-string">"avarage"</span>]
</code></div>
</div></li>
 	<li><strong>Show Highest Scores and Average Across Multiple Laps:</strong>
<div class="contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950">
<div class="flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary select-none">php</div>
<div class="sticky top-9 md:top-[5.75rem]">
<div class="absolute bottom-0 right-2 flex h-9 items-center">
<div class="flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary"><span class="" data-state="closed"><button class="flex gap-1 items-center select-none px-4 py-1" aria-label="Copy">Copy</button></span><span class="" data-state="closed"><button class="flex select-none items-center gap-1">Edit</button></span></div>
</div>
</div>
<div class="overflow-y-auto p-4" dir="ltr"><code class="!whitespace-pre hljs language-php">[results_calculation_sheet_total event_id=<span class="hljs-string">"1"</span> player_id=<span class="hljs-string">"101"</span> run_id=<span class="hljs-string">"3"</span> lap_count=<span class="hljs-string">"3"</span> calc_type=<span class="hljs-string">"avarage"</span>]
</code></div>
</div></li>
</ol>

<hr />

<h3><strong>Tips for Using the Shortcodes</strong></h3>
<ul>
 	<li><strong>Default Render Behavior:</strong> If <code>render_type</code> or <code>calc_type</code> is not set, the shortcode will default to basic score calculation.</li>
 	<li><strong>Error Handling:</strong> If parameters like <code>event_id</code> or <code>player_id</code> are missing, the shortcode may not return meaningful results.</li>
 	<li><strong>Integration in GravityView:</strong> Use these shortcodes in GravityView fields or templates to display dynamic scores.</li>
</ul>