|
aku nak wat simple calculation utk wap kuiz...just tambah result1,2,3,4,5 and display kat user phone. pakai wml script...function lain dah settle..tggal nak calculate je.. dah banyak kali try nie. hope somebody here bleh tlg.
welcome.wml
<!--View result-->
<card id="check" title="CheckResult">
<do type="accept" label="Home">
<go href="#loggedin"/>
</do>
<p>
<b>Hello, $user!</b><br/>
Your Result is :</br>
<!--Result display in table format-->
<table border="1" align="center" columns ="2">
<tr>
<td><b>Number of Question</b></td>
<td><b>Points</b></td>
</tr>
<tr>
<td>Question 1</td>
<td>$(result1)</td>
</tr>
<tr>
<td>Question 2</td>
<td>$(result2)</td>
</tr>
<tr>
<td>Question 3</td>
<td>$(result3)</td>
</tr>
<tr>
<td>Question 4</td>
<td>$(result4)</td>
</tr>
<tr>
<td>Question 5</td>
<td>$(result4)</td>
</tr>
</table>
<do type="button" label="Total Point">
<go href="WMLScript.wmls#addittion($(result1),$(result2),$(result3),$(result4),$(result5)">
</do>
</p>
</card>
<card id="total" title="total point">
<do type="accept" label="Check Result">
<go href="#check"/>
</do>
<p>
Total point is :
</p>
WMLScript.wmls
extern function addition (result1,result2,result3,result4,result5)
{
WMLBrowser.setVar("Total Point is:",result1+result2+result3+result4+result5);
WMLBrowser.go("welcome.wml#point");
} |
|
|
|
|
|
|
| |
|