Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!-- [[893,995,231,266,162],[245,343,991,339,726],[817,856,588,50,236],[490,861,107,926,940]] -->
- <html>
- <div id = "question-content">
- </div>
- <div id = "hint-content">
- </div>
- <div id = "solution-content">
- </div>
- <div id = "question-content2">
- </div>
- <div id = "hint-content2">
- </div>
- <div id = "solution-content2">
- </div>
- <div id = "question-content3">
- </div>
- <div id = "solution-content3">
- </div>
- <div id = "question-content4">
- </div>
- <div id = "hint-content4">
- </div>
- <div id = "solution-content4">
- </div>
- <script src = "parser.bundle.js">
- </script>
- <script type = "text/javascript">
- 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.`
- 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]]))]`
- const questionString = ''
- const subparts = [
- {
- id: '100',
- questionString: 'find MN,',
- solutionString: `[matrix_solution(MN = [[32,25],[16,10]][[5],[8]]
- = [[32 * 5 + 25 * 8],[16 * 5 + 10 * 8]]
- = [[360],[160]])]`,
- }, {
- id: '101',
- questionString: 'explain what your answer represents.',
- solutionString: `The total sale of chocolate cookies is $360 and the total sale of vanilla cookies is $160.`,
- }
- ]
- const hintString = `Add corresponding elements in matrices`
- const solutionString = ''
- const questionHtml = parser.parseQuestion(questionText, configString, questionString, subparts)
- const hintHtml = parser.parseHint(hintString)
- const solutionHtml = parser.parseSolution(solutionString, subparts)
- document.getElementById('question-content').innerHTML = questionHtml
- document.getElementById('hint-content').innerHTML = hintHtml
- document.getElementById('solution-content').innerHTML = solutionHtml
- 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.`
- 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]]))]`
- const questionString2 = ''
- const subparts2 = [
- {
- id: '100',
- questionString: 'Evaluate Q - P.',
- 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]]
- = [[0.10,0.20,0.10],[0,0.20,0.30]]`,
- }, {
- id: '101',
- questionString: 'Explain what your answer represents.',
- solutionString: `The difference in prices of the tubes of toothpastes between the shops in 2006 and 2007.`,
- }, {
- id: '102',
- 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.',
- solutionString: `M = [[20],[20],[20]]`,
- },
- ]
- const solutionString2 = ''
- const questionHtml2 = parser.parseQuestion(questionText2, configString2, questionString2, subparts2)
- const solutionHtml2 = parser.parseSolution(solutionString2, subparts2)
- document.getElementById('question-content2').innerHTML = questionHtml2
- document.getElementById('solution-content2').innerHTML = solutionHtml2
- const questionText3 = `A gift shop sells three different hampers for Valentine's day.
- Hamper A contains 3 bottles of wine and 5 boxes of chocolates.
- Hamper B contains 2 bottles of wine, 1 box of chocolates and 10 stalks of roses.
- Hamper C contains 1 bottle of wine and 24 stalks of roses.
- The prices of a bottle of wine is $18, a box of chocolates is $7 and a stalk of rose is $5.`
- const configString3 = ``
- const questionString3 = ''
- const subparts3 = [
- {
- id: '100',
- questionString: 'Write down two matrices such that the product will give the cost price of each type of hamper. Evaluate this product.',
- 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]]
- = [[89],[93],[138]]`,
- }, {
- id: '101',
- 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.',
- solutionString: `[[62,88,126]][[89],[93],[138]] = (62 * 89 + 88 * 93 + 126 * 138)
- = (31090)`,
- }, {
- id: '102',
- 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.',
- solutionString: `[[1.15,0,0],[0,1.20,0],[0,0,1.30]][[89],[93],[138]] = [[102.35],[111.60],[179.40]]`,
- },
- ]
- const solutionString3 = ''
- const questionHtml3 = parser.parseQuestion(questionText3, configString3, questionString3, subparts3)
- const solutionHtml3 = parser.parseSolution(solutionString3, subparts3)
- document.getElementById('question-content3').innerHTML = questionHtml3
- document.getElementById('solution-content3').innerHTML = solutionHtml3
- const questionText4 = `Write down the next two terms in the following number sequence.`
- const configString4 = `[list([1,21,41,61]),ap_series([1,21,41,61])]`
- const questionString4 = ''
- const subparts4 = []
- const questionHtml4 = parser.parseQuestion(questionText4, configString4, questionString4, subparts4)
- document.getElementById('question-content4').innerHTML = questionHtml4
- 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)])]'
- const solutionHtml4 = parser.parseSolution(solutionString4, subparts4)
- document.getElementById('solution-content4').innerHTML = solutionHtml4
- const questionText5 = `Write down for the following number sequence`
- const configString5 = `[list([7,9,11,13,15,17])]`
- const questionString5 = ''
- const subparts5 = [{
- id: '100',
- questionString: 'a formula for the nth term',
- solutionString: `[[1.15,0,0],[0,1.20,0],[0,0,1.30]][[89],[93],[138]] = [[102.35],[111.60],[179.40]]`,
- }]
- const questionHtml4 = parser.parseQuestion(questionText4, configString4, questionString4, subparts4)
- document.getElementById('question-content4').innerHTML = questionHtml4
- 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)])]'
- const solutionHtml4 = parser.parseSolution(solutionString4, subparts4)
- document.getElementById('solution-content4').innerHTML = solutionHtml4
- </script>
- </html>
Add Comment
Please, Sign In to add comment