{title help="Quiz"}{tr}Stats for quiz:{/tr} {$quiz_info.name}{/title}
{button href="tiki-list_quizzes.php" class="btn btn-info" _text="{tr}List Quizzes{/tr}"} {button href="tiki-quiz_stats.php" class="btn btn-info" _text="{tr}Quiz Stats{/tr}"} {button href="tiki-quiz_stats_quiz.php?quizId=$quizId" class="btn btn-info" _text="{tr}This Quiz Stats{/tr}"} {button href="tiki-edit_quiz.php?quizId=$quizId" class="btn btn-primary" _text="{tr}Edit this Quiz{/tr}"} {if $tiki_p_admin_quizzes eq 'y'} {button href="tiki-quiz_stats_quiz.php?quizId=$quizId&clear=$quizId" class="btn btn-primary" _text="{tr}Clear Stats{/tr}"} {/if} {button href="tiki-edit_quiz.php" _text="{tr}Admin Quizzes{/tr}"}

{tr}Quiz stats{/tr}

{* Set the names of the table headings to reflect the names of the db *} {section name=user loop=$channels} {/section}
{tr}User{/tr} {tr}Date{/tr} {tr}time taken{/tr} {tr}points{/tr} {tr}Result{/tr} {tr}Pass/Fail{/tr}
{$channels[user].user|userlink} {$channels[user].timestamp|tiki_short_datetime} {$channels[user].timeTaken} {tr}secs{/tr} {$channels[user].points} ({$channels[user].avgavg|string_format:"%.2f"}%) {if $tiki_p_view_user_results eq 'y'} {icon name='chart'} {if $channels[user].hasDetails eq 'y'}({tr}Details{/tr}){/if} {/if} {if $tiki_p_admin_quizzes eq 'y'} {icon name='remove'} {/if} {if $channels[user].ispassing}{tr}Passed{/tr}{else}{tr}Failed{/tr}{/if}
{pagination_links cant=$cant_pages step=$prefs.maxRecords offset=$offset}{/pagination_links}

{tr}Stats for this quiz Questions {/tr}

{*first section beginning *} {section name=ix loop=$questions} {tr}Question:{/tr} {$questions[ix].question|escape}
{* I'd like to have every table heading sorted for immediate analysis *} {*second section beginning *} {section name=jx loop=$questions[ix].options} {/section} {*second section end *}
{tr}Options{/tr}
{tr}Option{/tr} {tr}Votes{/tr} {tr}Average{/tr}
{$questions[ix].options[jx].optionText|escape} {$questions[ix].options[jx].votes} {$questions[ix].options[jx].avg|string_format:"%.2f"}%

{/section} {*first section end *}