From: <pk...@us...> - 2008-05-23 21:12:46
|
Revision: 12955 http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=12955&view=rev Author: pkdille Date: 2008-05-23 14:12:45 -0700 (Fri, 23 May 2008) Log Message: ----------- [MOD] + [FIX] edit quiz: unduplicate code + fix some xhtml errors in order to have xhtml clean code Modified Paths: -------------- branches/1.10/templates/tiki-edit_quiz.tpl Modified: branches/1.10/templates/tiki-edit_quiz.tpl =================================================================== --- branches/1.10/templates/tiki-edit_quiz.tpl 2008-05-23 20:29:18 UTC (rev 12954) +++ branches/1.10/templates/tiki-edit_quiz.tpl 2008-05-23 21:12:45 UTC (rev 12955) @@ -23,7 +23,7 @@ <a class="link" href="tiki-objectpermissions.php?objectName={$name|escape:"url"}&objectType=quiz&permType=quizzes&objectId={$quizId}">{tr}There are individual permissions set for this quiz{/tr}</a> <br /><br /> {/if} -<! --- begin form to create/ edit quizzes --> +<!-- begin form to create/ edit quizzes --> <form action="tiki-edit_quiz.php" method="post"> <input type="hidden" name="quizId" value="{$quizId|escape}" /> <table class="normal"> @@ -66,32 +66,32 @@ </tr> <tr> <td class="formcolor"> -<label for="quiz-repeat">{tr}Quiz can be repeated{/tr}</td><td class="formcolor"><input type="checkbox" name="canRepeat" id="quiz-repeat" {if $canRepeat eq 'y'}checked="checked"{/if} /></td></tr> +<label for="quiz-repeat">{tr}Quiz can be repeated{/tr}</label></td><td class="formcolor"><input type="checkbox" name="canRepeat" id="quiz-repeat" {if $canRepeat eq 'y'}checked="checked"{/if} /></td></tr> <tr> <td class="formcolor"> -<label for="quiz-results">{tr}Store quiz results{/tr}</td> +<label for="quiz-results">{tr}Store quiz results{/tr}</label></td> <td class="formcolor"> <input type="checkbox" name="storeResults" id="quiz-results" {if $storeResults eq 'y'}checked="checked"{/if} /></td></tr> <tr> <!-- There is no immeidate feedback... the results come back as blank--> -<td class="formcolor"><label for="immediate-feedback">{tr}Immediate feedback{/tr}</td><td class="formcolor"><input type="checkbox" name="immediateFeedback" id="immediate-feedback" {if $immediateFeedback eq 'y'}checked="checked"{/if} /></td> +<td class="formcolor"><label for="immediate-feedback">{tr}Immediate feedback{/tr}</label></td><td class="formcolor"><input type="checkbox" name="immediateFeedback" id="immediate-feedback" {if $immediateFeedback eq 'y'}checked="checked"{/if} /></td> </tr> <tr> <td class="formcolor"> -<label for="show-answers">{tr}Show correct answers{/tr}</td> +<label for="show-answers">{tr}Show correct answers{/tr}</label></td> <td class="formcolor"><input type="checkbox" name="showAnswers" id="show-answers" {if $showAnswers eq 'y'}checked="checked"{/if} /></td></tr> <tr> <td class="formcolor"> -<label for="shuffle-questions">{tr}Shuffle questions{/tr}</td><td class="formcolor"> +<label for="shuffle-questions">{tr}Shuffle questions{/tr}</label></td><td class="formcolor"> <input type="checkbox" name="shuffleQuestions" id="shuffle-questions" {if $shuffleQuestions eq 'y'}checked="checked"{/if} /> </td> </tr> <tr> <td class="formcolor"> -<label for="shuffle-answers">{tr}Shuffle answers{/tr}</td><td class="formcolor"> +<label for="shuffle-answers">{tr}Shuffle answers{/tr}</label></td><td class="formcolor"> <input type="checkbox" name="shuffleAnswers" id="shuffle-answers" {if $shuffleAnswers eq 'y'}checked="checked"{/if} /></td></tr> <!--Why was this quoted out? Need to investigate -<tr><td class="formcolor"><label for="quiz-perpage">{tr}Questions per page{/tr}</td><td class="formcolor"><select name="questionsPerPage" id="quiz-perpage">{html_options values=$qpp selected=$questionsPerPage output=$qpp}</select></td></tr>--> +<tr><td class="formcolor"><label for="quiz-perpage">{tr}Questions per page{/tr}</label></td><td class="formcolor"><select name="questionsPerPage" id="quiz-perpage">{html_options values=$qpp selected=$questionsPerPage output=$qpp}</select></td></tr>--> <tr> <td class="formcolor"> <!-- quiz time limits do work--> @@ -108,20 +108,18 @@ <label for="quiz-passingperct">{tr}Passing Percentage{/tr}</label> </td> <td class="formcolor"> -<input type="text" name="passingperct" id="quiz-passingperct" size=3 maxlength=3 value="{$passingperct}" /> +<input type="text" name="passingperct" id="quiz-passingperct" size='3' maxlength='3' value="{$passingperct}" /> {tr}%{/tr}</td></tr> -<tr><td class="formcolor"> </td><td class="formcolor"><input type="submit" name="save" value="{tr}Save{/tr}" /></td></tr> +<tr><td class="formcolor"> </td><td class="formcolor"><input type="submit" name="save" value="{tr}Save{/tr}" /></td></tr> - - </table> </form> -<!-- begin form for searching quizzes ---> +<!-- begin form for searching quizzes --> <h2>{tr}Quizzes{/tr}</h2> -<div align="center"> +<div align="center"> <table class="findtable"> <tr><td class="findtable">{tr}Find{/tr}</td> <td class="findtable"> @@ -134,90 +132,66 @@ </tr> </table> -<!-- begin table for displaying quiz data ---> +<!-- begin table for displaying quiz data --> <table class="normal"> -<tr> -<td class="heading"> -<a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'quizId_desc'}quizId_asc{else}quizId_desc{/if}">{tr}ID{/tr}</a> -</td> -<td class="heading"> -<a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}Name{/tr}</a> -</td> -<td class="heading"> -<a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'description_desc'}description_asc{else}description_desc{/if}">{tr}Description{/tr}</a> -</td> -<td class="heading"> -<a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'canRepeat_desc'}canRepeat_asc{else}canRepeat_desc{/if}">{tr}canRepeat{/tr}</a> -</td> -<td class="heading"> -<a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'timeLimit_desc'}timeLimit_asc{else}timeLimit_desc{/if}">{tr}timeLimit{/tr}</a> -</td> + <tr> + <td class="heading"> + <a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'quizId_desc'}quizId_asc{else}quizId_desc{/if}">{tr}ID{/tr}</a> + </td> + <td class="heading"> + <a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'name_desc'}name_asc{else}name_desc{/if}">{tr}Name{/tr}</a> + </td> + <td class="heading"> + <a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'description_desc'}description_asc{else}description_desc{/if}">{tr}Description{/tr}</a> + </td> + <td class="heading"> + <a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'canRepeat_desc'}canRepeat_asc{else}canRepeat_desc{/if}">{tr}canRepeat{/tr}</a> + </td> + <td class="heading"> + <a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'timeLimit_desc'}timeLimit_asc{else}timeLimit_desc{/if}">{tr}timeLimit{/tr}</a> + </td> -<!-- I don't know why but these column head will not behave properly with sort --> -<td class="heading">{tr}Questions{/tr}</td> -<td class="heading">{tr}Results{/tr}</td> + <!-- I don't know why but these column head will not behave properly with sort --> + <td class="heading">{tr}Questions{/tr}</td> + <td class="heading">{tr}Results{/tr}</td> -{* still stuck on being able to sort by number of questions and results! -Results need to be sortable so as to give admin quick idea of user participation -<td><a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'results_desc'}results_asc{else}results_desc{/if}">{tr}Results{/tr}</a> -</td> -*} + {* still stuck on being able to sort by number of questions and results! + Results need to be sortable so as to give admin quick idea of user participation + <td><a class="tableheading" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={if $sort_mode eq 'results_desc'}results_asc{else}results_desc{/if}">{tr}Results{/tr}</a> + </td> + *} -<td class="heading">{tr}Action{/tr}</td> -</tr> + <td class="heading">{tr}Action{/tr}</td> + </tr> <!-- end header data --> +{cycle values="odd,even" print=false} {section name=user loop=$channels} -{if $smarty.section.user.index % 2} -<tr> -<td class="odd">{$channels[user].quizId}</td> -<td class="odd">{$channels[user].name}</td> -<td class="odd">{$channels[user].description}</td> -<td class="odd">{$channels[user].canRepeat}</td> -<td class="odd">{$channels[user].timeLimited} {if $channels[user].timeLimited eq 'y'}({$channels[user].timeLimit} mins){/if}</td> -<td class="odd">{$channels[user].questions}</td> -<td class="odd">{$channels[user].results}</td> -<td class="odd"> - <a class="link" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={$sort_mode}&quizId={$channels[user].quizId}">{icon _id='page_edit' alt='{tr}Edit{/tr}'}</a> - <a class="link" href="tiki-edit_quiz_questions.php?quizId={$channels[user].quizId}">{icon _id='help' alt='{tr}Questions{/tr}' title='{tr}Questions{/tr}'}</a> - <a class="link" href="tiki-edit_quiz_results.php?quizId={$channels[user].quizId}">{icon _id='application_form_magnify' alt='{tr}Results{/tr}' title='{tr}Results{/tr}'}</a> - <a class="link" href="tiki-objectpermissions.php?objectName={$channels[user].name|escape:"url"}&objectType=quiz&permType=quizzes&objectId={$channels[user].quizId}"> - {if $channels[user].individual eq 'y'} - {icon _id='key_active' alt='{tr}Active Perms{/tr}'} - {else} - {icon _id='key' alt='{tr}Perms{/tr}'} - {/if} - </a> - <a class="link" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].quizId}">{icon _id='cross' alt='{tr}Remove{/tr}'}</a> -</td> -</tr> -{else} -<tr> -<td class="even">{$channels[user].quizId}</td> -<td class="even">{$channels[user].name}</td> -<td class="even">{$channels[user].description}</td> -<td class="even">{$channels[user].canRepeat}</td> -<td class="even">{$channels[user].timeLimited} {if $channels[user].timeLimited eq 'y'}({$channels[user].timeLimit} mins){/if}</td> -<td class="even">{$channels[user].questions}</td> -<td class="even">{$channels[user].results}</td> -<td class="even"> - <a class="link" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={$sort_mode}&quizId={$channels[user].quizId}">{icon _id='page_edit' alt='{tr}Edit{/tr}'}</a> - <a class="link" href="tiki-edit_quiz_questions.php?quizId={$channels[user].quizId}">{icon _id='help' alt='{tr}Questions{/tr}' title='{tr}Questions{/tr}'}</a> - <a class="link" href="tiki-edit_quiz_results.php?quizId={$channels[user].quizId}">{icon _id='application_form_magnify' alt='{tr}Results{/tr}' title='{tr}Results{/tr}'}</a> - <a class="link" href="tiki-objectpermissions.php?objectName={$channels[user].name|escape:"url"}&objectType=quiz&permType=quizzes&objectId={$channels[user].quizId}"> - {if $channels[user].individual eq 'y'} - {icon _id='key_active' alt='{tr}Active Perms{/tr}'} - {else} - {icon _id='key' alt='{tr}Perms{/tr}'} - {/if} - </a> - <a class="link" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].quizId}">{icon _id='cross' alt='{tr}Remove{/tr}'}</a> -</td> -</tr> -{/if} + <tr> + <td class="{cycle advance=false}">{$channels[user].quizId}</td> + <td class="{cycle advance=false}">{$channels[user].name}</td> + <td class="{cycle advance=false}">{$channels[user].description}</td> + <td class="{cycle advance=false}">{$channels[user].canRepeat}</td> + <td class="{cycle advance=false}">{$channels[user].timeLimited} {if $channels[user].timeLimited eq 'y'}({$channels[user].timeLimit} mins){/if}</td> + <td class="{cycle advance=false}">{$channels[user].questions}</td> + <td class="{cycle advance=false}">{$channels[user].results}</td> + <td class="{cycle}"> + <a class="link" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={$sort_mode}&quizId={$channels[user].quizId}">{icon _id='page_edit' alt='{tr}Edit{/tr}'}</a> + <a class="link" href="tiki-edit_quiz_questions.php?quizId={$channels[user].quizId}">{icon _id='help' alt='{tr}Questions{/tr}' title='{tr}Questions{/tr}'}</a> + <a class="link" href="tiki-edit_quiz_results.php?quizId={$channels[user].quizId}">{icon _id='application_form_magnify' alt='{tr}Results{/tr}' title='{tr}Results{/tr}'}</a> + <a class="link" href="tiki-objectpermissions.php?objectName={$channels[user].name|escape:"url"}&objectType=quiz&permType=quizzes&objectId={$channels[user].quizId}"> + {if $channels[user].individual eq 'y'} + {icon _id='key_active' alt='{tr}Active Perms{/tr}'} + {else} + {icon _id='key' alt='{tr}Perms{/tr}'} + {/if} + </a> + <a class="link" href="tiki-edit_quiz.php?offset={$offset}&sort_mode={$sort_mode}&remove={$channels[user].quizId}">{icon _id='cross' alt='{tr}Remove{/tr}'}</a> + </td> + </tr> {/section} </table> -<! -- this is the page advance part --> +<!-- this is the page advance part --> <div class="mini"> {if $prev_offset >= 0} @@ -238,4 +212,4 @@ </div> </div> -<!- tiki-edit_quiz.tpl end -> +<!-- tiki-edit_quiz.tpl end --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |