shubhamgoyal

Untitled

Sep 2nd, 2018
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.19 KB | None | 0 0
  1. <!-- [[893,995,231,266,162],[245,343,991,339,726],[817,856,588,50,236],[490,861,107,926,940]] -->
  2. <html>
  3. <div id = "question-content">
  4. </div>
  5. <div id = "hint-content">
  6. </div>
  7. <div id = "solution-content">
  8. </div>
  9. <div id = "question-content2">
  10. </div>
  11. <div id = "hint-content2">
  12. </div>
  13. <div id = "solution-content2">
  14. </div>
  15. <div id = "question-content3">
  16. </div>
  17. <div id = "solution-content3">
  18. </div>
  19. <div id = "question-content4">
  20. </div>
  21. <div id = "hint-content4">
  22. </div>
  23. <div id = "solution-content4">
  24. </div>
  25. <script src = "parser.bundle.js">
  26. </script>
  27. <script type = "text/javascript">
  28. const questionText = `A shop sells chocolate and vanilla cookies, in small and large boxes. The cost of a small box and a large box are $5 and $8 respectively. The table shows the number of boxes of each type of cookies sold on Monday.`
  29. const configString = `[matrices(M),matrices(N),matrices_elements(M,[[32,25],[16,10]]),matrices_elements(N,[[5],[8]]),matrices_addition(M,N,s),matrices(s),table(corner(),row_labels(Chocolate cookies,Vanilla cookies),col_labels(Small box,Large box),values([[32,25],[16,10]]))]`
  30. const questionString = ''
  31. const subparts = [
  32. {
  33. id: '100',
  34. questionString: 'find MN,',
  35. solutionString: `[matrix_solution(MN = [[32,25],[16,10]][[5],[8]]
  36. = [[32 * 5 + 25 * 8],[16 * 5 + 10 * 8]]
  37. = [[360],[160]])]`,
  38. }, {
  39. id: '101',
  40. questionString: 'explain what your answer represents.',
  41. solutionString: `The total sale of chocolate cookies is $360 and the total sale of vanilla cookies is $160.`,
  42. }
  43. ]
  44. const hintString = `Add corresponding elements in matrices`
  45. const solutionString = ''
  46. const questionHtml = parser.parseQuestion(questionText, configString, questionString, subparts)
  47. const hintHtml = parser.parseHint(hintString)
  48. const solutionHtml = parser.parseSolution(solutionString, subparts)
  49. document.getElementById('question-content').innerHTML = questionHtml
  50. document.getElementById('hint-content').innerHTML = hintHtml
  51. document.getElementById('solution-content').innerHTML = solutionHtml
  52. const questionText2 = `Two brands of toothpaste are sold at three shops. The table shows the price for each brand of toothpaste at each shop in 2006 and 2007.`
  53. const configString2 = `[matrices(P),matrices(Q),matrices_elements(P,[[1.50,1.70,1.60],[1.20,1.10,1.40]]),matrices_elements(Q,[[1.60,1.90,1.70],[1.20,1.30,1.40]]),matrices_addition(M,N,s),matrices(s),table(corner(2006),row_labels(Sparkle,Fresh),col_labels(Shop A,Shop B,Shop C),values([[1.50,1.70,1.60],[1.20,1.10,1.40]])),table(corner(2007),row_labels(Sparkle,Fresh),col_labels(Shop A,Shop B,Shop C),values([[1.60,1.90,1.70],[1.20,1.30,1.40]]))]`
  54. const questionString2 = ''
  55. const subparts2 = [
  56. {
  57. id: '100',
  58. questionString: 'Evaluate Q - P.',
  59. solutionString: `Q - P = [[1.60,1.90,1.70],[1.20,1.30,1.70]] - [[1.50,1.70,1.60],[1.20,1.10,1.40]]
  60. = [[0.10,0.20,0.10],[0,0.20,0.30]]`,
  61. }, {
  62. id: '101',
  63. questionString: 'Explain what your answer represents.',
  64. solutionString: `The difference in prices of the tubes of toothpastes between the shops in 2006 and 2007.`,
  65. }, {
  66. id: '102',
  67. questionString: 'Write down the matrix M such that the product QM will give for each brand of toothpaste, the total cost of buying 20 tubes of toothpaste in 2007.',
  68. solutionString: `M = [[20],[20],[20]]`,
  69. },
  70. ]
  71. const solutionString2 = ''
  72. const questionHtml2 = parser.parseQuestion(questionText2, configString2, questionString2, subparts2)
  73. const solutionHtml2 = parser.parseSolution(solutionString2, subparts2)
  74. document.getElementById('question-content2').innerHTML = questionHtml2
  75. document.getElementById('solution-content2').innerHTML = solutionHtml2
  76. const questionText3 = `A gift shop sells three different hampers for Valentine's day.
  77. Hamper A contains 3 bottles of wine and 5 boxes of chocolates.
  78. Hamper B contains 2 bottles of wine, 1 box of chocolates and 10 stalks of roses.
  79. Hamper C contains 1 bottle of wine and 24 stalks of roses.
  80. The prices of a bottle of wine is $18, a box of chocolates is $7 and a stalk of rose is $5.`
  81. const configString3 = ``
  82. const questionString3 = ''
  83. const subparts3 = [
  84. {
  85. id: '100',
  86. questionString: 'Write down two matrices such that the product will give the cost price of each type of hamper. Evaluate this product.',
  87. solutionString: `[[3,5,0],[2,1,10],[1,0,24]][[18],[7],[5]] = [[3 * 18 + 5 * 7 + 0 * 5],[2 * 18 + 1 * 7 + 10 * 5],[1 * 18 + 0 * 7 + 24 * 5]]
  88. = [[89],[93],[138]]`,
  89. }, {
  90. id: '101',
  91. questionString: 'The shop received an order of 62 Hamper A, 88 Hamper B and 126 Hamper C. Form two matrices such that the product will give the total cost of the hampers ordered. Evaluate this product.',
  92. solutionString: `[[62,88,126]][[89],[93],[138]] = (62 * 89 + 88 * 93 + 126 * 138)
  93. = (31090)`,
  94. }, {
  95. id: '102',
  96. questionString: 'The shop intends to make a profit of 15% on each Hamper A, 20% on each Hamper B and 30% on each Hamper C. Form two matrices such that the product will give the selling price of each hamper. Evaluate this product.',
  97. solutionString: `[[1.15,0,0],[0,1.20,0],[0,0,1.30]][[89],[93],[138]] = [[102.35],[111.60],[179.40]]`,
  98. },
  99. ]
  100. const solutionString3 = ''
  101. const questionHtml3 = parser.parseQuestion(questionText3, configString3, questionString3, subparts3)
  102. const solutionHtml3 = parser.parseSolution(solutionString3, subparts3)
  103. document.getElementById('question-content3').innerHTML = questionHtml3
  104. document.getElementById('solution-content3').innerHTML = solutionHtml3
  105. const questionText4 = `Write down the next two terms in the following number sequence.`
  106. const configString4 = `[list([1,21,41,61]),ap_series([1,21,41,61])]`
  107. const questionString4 = ''
  108. const subparts4 = []
  109. const questionHtml4 = parser.parseQuestion(questionText4, configString4, questionString4, subparts4)
  110. document.getElementById('question-content4').innerHTML = questionHtml4
  111. const solutionString4 = '[sequence_difference_underneath(list([1,21,41,61]),new_terms([81,101]),differences([+3,+3,+3,+3,+3])),statement([symbol(therefore),string(The next two terms are 14 and 17)])]'
  112. const solutionHtml4 = parser.parseSolution(solutionString4, subparts4)
  113. document.getElementById('solution-content4').innerHTML = solutionHtml4
  114. const questionText5 = `Write down for the following number sequence`
  115. const configString5 = `[list([7,9,11,13,15,17])]`
  116. const questionString5 = ''
  117. const subparts5 = [{
  118. id: '100',
  119. questionString: 'a formula for the nth term',
  120. solutionString: `[[1.15,0,0],[0,1.20,0],[0,0,1.30]][[89],[93],[138]] = [[102.35],[111.60],[179.40]]`,
  121. }]
  122. const questionHtml4 = parser.parseQuestion(questionText4, configString4, questionString4, subparts4)
  123. document.getElementById('question-content4').innerHTML = questionHtml4
  124. const solutionString4 = '[sequence_difference_underneath(list([1,21,41,61]),new_terms([81,101]),differences([+3,+3,+3,+3,+3])),statement([symbol(therefore),string(The next two terms are 14 and 17)])]'
  125. const solutionHtml4 = parser.parseSolution(solutionString4, subparts4)
  126. document.getElementById('solution-content4').innerHTML = solutionHtml4
  127. </script>
  128. </html>
Add Comment
Please, Sign In to add comment