Guest User

Untitled

a guest
Jun 22nd, 2018
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
ASP 2.33 KB | None | 0 0
  1. <!--#include virtual="6th/incs_wb/wb_toolbar.inc" -->
  2. <!--#include virtual="6th/incs_ca/answertables_rand.inc" -->
  3. <%
  4. randomize
  5. dim ans(4)
  6. dim panswer
  7.  
  8. srand = int(rnd * 2)
  9.     if srand = 0 then sex = "he"
  10.     if srand = 1 then sex = "she"
  11.  
  12. drand1 = (int(rnd * 2) + 1)
  13.     if drand1 = 1 then decimal1 = (int(rnd * 9) * .1)
  14. drand2 = (int(rnd * 2) + 1)
  15.     if drand2 = 2 then decimal2 = (int(rnd * 9) * .1)
  16.  
  17. lunch = int(rnd * 30 + 1) + 24
  18. tip = int(rnd * 2 + 1) * 10
  19.  
  20. if tip = 10 then newtip = 1.15
  21. if tip = 20 then newtip = 1.20
  22. if tip = 10 then tip = 15
  23.  
  24. answer = lunch * newtip
  25.  
  26. dl1 = lunch * (newtip - .05)
  27. dl2 = dl1 - (int(rnd * 4) + 2) - decimal1
  28. dl3 = lunch - newtip
  29. if dl3 > dl2 then dl3 = dl2 - (int(rnd * 4) + 2) - decimal2
  30.  
  31. dh1 = lunch * (newtip + .05)
  32. dh2 = dh1 + (int(rnd * 4) + 2) + decimal1
  33. dh3 = lunch + newtip
  34. if dh3 < dh2 then dh3 = dh2 + (int(rnd * 4) + 2) + decimal2
  35.  
  36.  
  37. qu = "The vice president of sales took a client out to lunch. If the lunch was $"& lunch &" and "& sex &" gave a "& tip &"% tip, how much money did "& sex &" spend on lunch?"
  38.  
  39.  
  40.     rand = int(rnd * 4) + 1
  41.     if rand = 1 then
  42.     ans1 = "$"& answer
  43.     ans2 = "$"& dh1
  44.     ans3 = "$"& dh2
  45.     ans4 = "$"& dh3
  46.     panswer = "A"
  47.     end if
  48.  
  49.     if rand = 2 then
  50.     ans1 = "$"& dl1
  51.     ans2 = "$"& answer
  52.     ans3 = "$"& dh1
  53.     ans4 = "$"& dh2
  54.     panswer = "B"
  55.     end if
  56.  
  57.     if rand = 3 then
  58.     ans1 = "$"& dl2
  59.     ans2 = "$"& dl1
  60.     ans3 = "$"& answer
  61.     ans4 = "$"& dh1
  62.     panswer = "C"
  63.     end if
  64.  
  65.     if rand = 4 then
  66.     ans1 = "$"& dl3
  67.     ans2 = "$"& dl2
  68.     ans3 = "$"& dl1
  69.     ans4 = "$"& answer
  70.     panswer = "D"
  71.     end if
  72.    
  73. d1 = ans1
  74. d2 = ans2
  75. d3 = ans3
  76. d4 = ans4
  77.  
  78.     session("qu") = qu
  79.     session("qu2") = qu2
  80.     session("d1") = d1
  81.     session("d2") = d2  
  82.     session("d3") = d3  
  83.     session("d4") = d4
  84.     session("tanswer") = panswer
  85.     session("ns1_4canswer1")=panswer
  86.     session("ns1_4cstand")="NS 1.4"
  87.     session("standard")="NS 1.4c"
  88.     session("panswer")=panswer
  89.  
  90. %><head>
  91. <script type="text/javascript" src="../../js/jquery.js"></script>
  92. <script type="text/javascript" src="../../js/hide.js"></script>
  93.  
  94. <link rel="stylesheet" type="text/css" title="CSS" href="../../styles/incstyle.css" />
  95. <title>NS 1.4</title>
  96. </head>
  97.  
  98.  
  99. <% call wb_toolbar
  100. toolbar=session("toolbar") %>
  101. <%=toolbar%>
  102.  
  103. <p class="q2nd"><%=qu%></p>
  104.  
  105. <% call answertables_rand
  106. newtable=session("newtable") %>
  107. <%=newtable%>
Add Comment
Please, Sign In to add comment