\define showSelectedCards(subfilter, finalLink:'')
<!-- Creates a linked list to quiz on -->
<!-- for the n many cards, we return n-1 -->
<$formula-vars counter="count([$subfilter$])-1">
<!-- iter goes from 0 to n-2 -->
<$list filter="[range<counter>butlast[]]" variable="iter">
<!-- arrays need to be accessed from 1 to n -->
<$formula-vars current="nth([$subfilter$], <<iter>> + 1)" next="nth([$subfilter$], <<iter>> + 2)">
<$action-setfield $tiddler=<<current>> $field="next" $value=<<next>>/>
<!--<Current: <<current>>, Next: <<next>> <br/> -->
</$formula-vars>
</$list>
<!-- take last element with no forward link -->
<$list filter="[range<counter>last[]]" variable="iter">
<$formula-vars current="nth([$subfilter$], <<iter>> + 1)">
<$action-setfield $tiddler=<<current>> next=$finalLink$/>
</$formula-vars>
</$list>
</$formula-vars>
\end
<$button>
Quiz!
<$macrocall $name="showSelectedCards" subfilter="tag[Test]!sort[created]" finalLink='Home'/>
</$button>
<span class="slideshow-next">
<$list filter="[all[current]next[$:/StoryList]]">
<$link to={{!!title}} tooltip="next">
{{$:/core/images/down-arrow}}
</$link>
</$list>
</span>
<span class="slideshow-prev">
<$list filter="[all[current]previous[$:/StoryList]]">
<$link to={{!!title}} tooltip="previous">
{{$:/core/images/up-arrow}}
</$link>
</$list>
</span>
<$list filter="[all[current]tag[HelloThere]]">
<$button>
<$action-listops $tiddler="HelloThere" $subfilter="+[move:-1{!!title}]"/>
<< Move back
</$button>
<$button>
<$action-listops $tiddler="HelloThere" $subfilter="+[move:1{!!title}]"/>
Move forward >>
</$button>
</$list>