Template:AKTOC

From Pathfinder Wiki
Revision as of 00:15, 18 March 2021 by DesignerThan (talk | contribs)


Create an Answer Key's Table of Contents.

Parameters

page
This should be the title of an honor's landing page. If omitted, the template will assume that it has been invoked from a landing page or a subpage of one and construct a page title for the landing page from the first two elements of {{PAGENAME}}. Note that language detection is based on the invoking page rather than on the {{{page}}} parameter.

Mechanics

The template starts by defining two variables to sort out the page title of the landing page and the requirements page.

After that it has three nested while loops. The outer loop is for the primary requirement numbers (1), then the secondary (1.b), and finally, the tertiary (1.b.iii)

Within each loop, it determines if the proposed requirement exists or not with this fragment:

{{#vardefineecho:req|{{#lst:{{#var:reqpage}}|req{{#var:primary}}}}}}

This snippet defines a variable and echos the definition. The echo is important, because this line of code serves as the condition for the while loop. As long as this snippet returns a non-empty string, the loop will continue. The requirement is extracted from the requirements page by transcluding a labeled section with {{#lst:...}}. The section label is simply "req" with the requirement number as a suffix.

For the two inner loops it's slightly more complex since the label will be of the form "1b" or "1biii", but the loops must operate on numeric quantities. To do this, the loop variables (primary, secondary, and tertiary) are numeric, and we rely on template:boiler to convert them to the form "1biii". For the secondary requirements this is done with this fragment:

{{#vardefine:reqnum|{{boiler|{{#var:primary}}|{{#var:secondary}}}}}}

and for the tertiary:

{{#vardefine:reqnum|{{boiler|{{#var:primary}}|{{#var:secondary}}|{{#var:tertiary}}}}}}

Once the while condition has been specified, we have the body to execute when the condition is true. This is simply:

{{reqreqlink|page={{#var:landing}}|num={{#var:reqnum}}|dispreq=<li>}}<li/>

plus the loop variable incrementer:

{{#vardefine:tertiary|{{#expr: {{#var:tertiary}} + 1 }} }}

Note that the "dispreq" parameter to reqreqlink is simply an html list element.

Each loop is nested inside an order list tag <ol>, and the tag speficies how the list elements should be rendered. For the primary loop, we rely on the default of decimal. For the secondary we specify <ol style="list-style-type:lower-alpha">, and for the tertiary <style="list-style-type:lower-roman">

template:reqreqlink returns a link to an anchor within the answer key (created by template:ansreq.

Bugs

This template has problems rendering honors with unconventional requirement numbering. It returns nothing for Abseiling, for example, and I have no intention of fixing this. It would be far easier to hand-craft the TOC for that honor if we choose to give it one.

Example

{{AKTOC|page=AY Honors/Map and Compass}}



  1. The Map
    1. Know the following:
      1. What is a topographical map?
      2. What is found on a topographical map?
      3. Give three uses of a topographical map.
    2. What is an orthophoto map?
    3. Be able to recognize twenty signs and symbols found on a topographical map, giving some in each of the following categories:
      1. Man made
      2. Water feature
      3. Vegetation feature
    4. Know and explain the following as they relate to elevation:
      1. Elevation.
      2. Contour interval.
      3. Ground formations (Valey, Ridge, Spur, Bluff or Cliff, Saddle, Sholder, Escarpment, Knoll, Brow) defined by their contour lines
    5. Know and explain the following as they relate to distance:
      1. How is distance defined
      2. The map scale
      3. How to measure linear distance
      4. How to estimate land distance
    6. Know and explain the following as they relate to a map grid system:
      1. What is the grid system?
      2. What is a six figure grid reference?
      3. Rules for reading grid references.
    7. Know and explain the following in relation to map reading:
      1. Grid North
      2. True North
      3. Magnetic North
      4. Declination
      5. Grid Magnetic Angle (G-MA or GMA)
  2. The Compass
    1. What are the eight major points of the compass and their bearings?
    2. Identify the type of compass most popular with bushwalkers.
    3. Know the parts of an orienteering compass.
    4. Know and explain the following as they relate to Grid Bearings and Magnetic Bearings:
      1. What are Bearings?
      2. How to calculate Grid Bearings from the map
      3. How to convert a Grid Bearing to a Magnetic Bearing
      4. How to convert a Magnetic Bearing to a Grid Bearing
      5. How to take and march on a Magnetic Bearing
      6. What is Slipping and how to correct for it?
      7. How to take a back bearing
    5. Know and explain the following in relation to Resection:
      1. What is resection?
      2. The two-bearing method of Resection.
      3. The three-bearing method of Resection.
    6. Know and explain how to Orient your map by:
  3. Direction without the aid of a Compass
    1. Demonstrate how to find directions without a compass using the Southern Cross (ie. Crux) method
      1. Watch.
      2. Southern Cross.
      3. Orion
      4. Shadow Stick.
  4. Practical
    1. Demonstrate how to:
      1. Read six figure Grid Refences. Refer to Requirement 1.6c.
      2. Calculate a Grid Bearing from the map. Refer to Requirement 2.4b.
      3. Convert Grid Bearing to a Magnetic Bearing. Refer to Requirement 2.4c.
      4. Take a Magnetic Bearing. Refer to Requirement 2.4c
      5. Locate a position using Resection. Refer to Requirement 2.5
    2. Navigate to a target feature using a Magnetic Bearing. Refer Requirement 2.4c
    3. Prove your ability in the use of a map and compass by following a cross-country course with at least ten given readings or control points.