// Numbas version: finer_feedback_settings
{"name": "1: Linear Graph - Time vs. Orogen Elevation", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"tags": [], "functions": {"lngrph": {"definition": "\n var m = Numbas.jme.unwrapValue(scope.variables.m);\n var c = Numbas.jme.unwrapValue(scope.variables.c);\n var y1 = Numbas.jme.unwrapValue(scope.variables.y1);\n\n var ymax = Numbas.jme.unwrapValue(scope.variables.ymax);\n var div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',\n {boundingBox:[-10,ymax,5,-3],\n axis:true,\n showNavigation:true,\n grid:true});\n var brd = div.board;\n var xaxis = brd.create('line',[[0,0],[1,0]], { strokeWidth: 0, fixed: true, withlabel: true, name: function () {return \"Time from the present (Ma)\"}, label: {offset:[110,-20]}});\n var yaxis = brd.create('line',[[0,0],[0,1]], { strokeWidth: 0, fixed: true, withlabel: true, name: function () {return \"Elevation above sea-level (km)\"}, label: {offset:[20,570]} }); \n\n/*\n var xas = brd.create('line',[[0,0],[1,0]], { strokeColor: 'black',fixed:true});\n var xticks = brd.create('ticks',[xas,2],{\n drawLabels: true,\n label: {offset: [-4, -10]},\n minorTicks: 0\n });\n var yas = brd.create('line',[[0,0],[0,1]], { strokeColor: 'black',fixed:true});\n var yticks = brd.create('ticks',[yas,2],{\n drawLabels: true,\n label: {offset: [-20, 0]},\n minorTicks: 0\n });\n\n*/\n\n\n // var li1=brd.create('line',[[0,b],[1,a+b]],{fixed:true});\n // var p1=brd.create('point',[0,c],{fixed:true,size:1,name:''});\n // brd.create('text', [0.25, c, function(){ return '(' + p1.X()+','+p1.Y()+')'; }],{fontsize:15,isLabel:true});\n // var p2=brd.create('point',[-1,c-m],{fixed:true,size:1,name:''});\n // brd.create('text', [-0.75, c-m, function(){ return '(' + p2.X()+','+p2.Y()+')'; }],{fontsize:15,isLabel:true});\n // var point = brd.create('point',[-10,y1],{fixed:true,size:1,name:'',color:'brown'})\n\n var tree;\n //x is the variable in the equation to be input\n var nscope = new Numbas.jme.Scope([scope,{variables:{t:new Numbas.jme.types.TNum(0)}}]);\n //create a functiongraph from the student input\n var curve = brd.create('functiongraph', [function(t){\n if(tree) {\n try {\n nscope.variables.t.value = t;\n //the user input is evaluated at x=t\n var val = Numbas.jme.evaluate(tree,nscope).value;\n return val;\n }\n catch(e) {\n return 0;\n }\n }\n else\n return 0;\n },-10,10],{strokeColor:'black',strokeWidth:1.5});\n //pick up the student answer and is parsed\n question.signals.on('HTMLAttached',function(e) {\n ko.computed(function(){\n var expr = question.parts[2].gaps[0].display.studentAnswer();\n try {\n tree = Numbas.jme.compile(expr,scope);\n }\n catch(e) {\n tree = null;\n }\n curve.updateCurve();\n brd.update();\n });\n }); \n\n/*\n\n// DRAGPOINT CODE\n \n\nfunction dragpoint_board() {\n \n var scope = question.scope;\n var m = scope.variables.m.value;\n var ymax = scope.variables.ymax.value;\n var c = scope.variables.c.value;\n \n var div = Numbas.extensions.jsxgraph.makeBoard('600px','600px',{boundingBox:[-11,ymax,5,-3],grid:true});\n $(question.display.html).find('#dragpoint').append(div);\n \n var board = div.board;\n \n //shorthand to evaluate a mathematical expression to a number\n function evaluate(expression) {\n try {\n var vale = Numbas.jme.evaluate(expression,question.scope);\n return Numbas.jme.unwrapValue(vale);\n }\n catch(e) {\n // if there's an error, return no number\n return NaN;\n }\n }\n \n // set up points array\n var num_points = 10;\n var points = [];\n \n // this function sets up the i^th point\n function make_point(i) {\n \n // calculate initial coordinates\n var p = i-10;\n \n // create an invisible vertical line for the point to slide along\n var line = board.create('line',[[p,0],[p,1]],{visible: false});\n \n // create the point\n var point = points[i] = board.create(\n 'glider',\n [i-1,0,line],\n {\n name:'',\n size:2,\n snapSizeY: 0.1, // the point will snap to y-coordinates which are multiples of 0.1\n snapToGrid: true\n }\n );\n \n // the contents of the input box for this point\n var studentAnswer = question.parts[1].gaps[i].display.studentAnswer;\n \n/* // watch the student's input and reposition the point when it changes. \n ko.computed(function() {\n y = evaluate(studentAnswer());\n if(!(isNaN(y)) && board.mode!=board.BOARD_MODE_DRAG) {\n point.moveTo([x,y],100);\n }\n });\n \n\n \n // when the student drags the point, update the gapfill input\n point.on('drag',function(){\n var y = Numbas.math.niceNumber(point.Y());\n studentAnswer(y);\n });\n }\n\n // create each point\n for(var i=0;i
| Time from the present (Ma) | \n$-10$ | \n$-9$ | \n$-8$ | \n$-7$ | \n$-6$ | \n$-5$ | \n$-4$ | \n$-3$ | \n$-2$ | \n$-1$ | \n
| Elevation above sea-level (km) | \n{{graphplot}[0]} | \n{{graphplot}[1]} | \n{{graphplot}[2]} | \n{{graphplot}[3]} | \n{{graphplot}[4]} | \n{{graphplot}[5]} | \n{{graphplot}[6]} | \n{{graphplot}[7]} | \n{{graphplot}[8]} | \n\n {{graphplot}[9]} \n | \n
A question to practise the following skills in the context of Earth Sciences:
\nClick 'Try another question like this one' and re-do the question as many times as you wish until you are comfortable with the concepts and methods.
", "name": "1: Linear Graph - Time vs. Orogen Elevation", "variablesTest": {"maxRuns": 100, "condition": ""}, "ungrouped_variables": ["x1", "y1", "m", "c", "graphplot", "xext", "yext", "ymax", "y2", "y3", "y4", "y5", "y6", "y7", "y8", "y9", "y10"], "extensions": ["jsxgraph"], "variable_groups": [], "rulesets": {}, "parts": [{"variableReplacementStrategy": "originalfirst", "stepsPenalty": 0, "steps": [{"variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "variableReplacements": [], "prompt": "Due to the linearity of orogenic growth, the two variables of elevation $h$ and time $t$ can be set to cartesian coordinates on the y-axis and x-axis, respectively (see Part c). The rate of growth, therefore, is synonymous with the line's gradient.
\nLinearity is typically expressed in the form: $y=mx+c$, where $x$ is the independent variable and $y$ is the dependent variable. In this case, time $t$ is independent and elevation $h$ is dependent. The relationship is therefore modelled as:
\n$h=mt+c$, where $m$ is the gradient of the line and $c$ is the y-intercept.
\nThe gradient can therefore be determined by reading two data points on the graph and using the following formula:
\n$Gradient=\\Big(\\frac{h_{2} - h_{1}}{t_{2} - t_{1}}\\Big)$
\n", "marks": 1, "scripts": {}, "type": "extension", "showCorrectAnswer": true}], "gaps": [{"allowFractions": true, "maxValue": "m+0.05", "showFeedbackIcon": true, "variableReplacements": [], "correctAnswerFraction": false, "minValue": "m-0.05", "marks": 1, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "numberentry"}], "variableReplacements": [], "prompt": "Using the data points tabulated above, plot the graph of the levation of sea level against the time, calculate the rate of orogen 'growth'.
\n$\\big(\\frac{dh}{dt}\\big)=\\;$[[0]] km per Ma.
\n", "showFeedbackIcon": true, "marks": 0, "scripts": {}, "type": "gapfill", "showCorrectAnswer": true}, {"variableReplacementStrategy": "originalfirst", "stepsPenalty": 0, "steps": [{"variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "variableReplacements": [], "prompt": "The present height is when the t=0. Extend the graph to find the y-intercept. This is called extrapolate.
", "marks": 1, "scripts": {}, "type": "extension", "showCorrectAnswer": true}], "gaps": [{"allowFractions": true, "maxValue": "c*1.1", "showFeedbackIcon": true, "variableReplacements": [], "correctAnswerFraction": false, "minValue": "c*0.9", "marks": 1, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "type": "numberentry"}], "variableReplacements": [], "prompt": "The present height of the studied orogen has been omitted from the data set. Using the values provided, calculate the orogen height today:
\n[[0]] km
", "showFeedbackIcon": true, "marks": 0, "scripts": {}, "type": "gapfill", "showCorrectAnswer": true}, {"variableReplacementStrategy": "originalfirst", "stepsPenalty": 0, "steps": [{"variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "variableReplacements": [], "prompt": "This is the final form of the linear equation which models the relationship between time (Ma) and orogen elevation above sea-level (km). The values for the gradient, $m$, and the y-intercept, $c$, which were found using the graph can now be written into the equation:
\n$h=mt+c$
", "marks": 1, "scripts": {}, "type": "extension", "showCorrectAnswer": true}], "gaps": [{"answersimplification": "!basic", "showpreview": true, "checkvariablenames": false, "showFeedbackIcon": true, "variableReplacements": [{"variable": "m", "must_go_first": true, "part": "p0g0"}, {"variable": "c", "must_go_first": true, "part": "p1g0"}], "vsetrangepoints": 5, "vsetrange": [0, 1], "marks": 1, "scripts": {}, "showCorrectAnswer": true, "expectedvariablenames": [], "answer": "{m}*t+{c}", "checkingtype": "absdiff", "variableReplacementStrategy": "alwaysreplace", "type": "jme", "checkingaccuracy": 0.001}], "variableReplacements": [], "prompt": "Using the tabulated data points and the answers to Part a) and Part b), write the linear equation relating time $t$ (Ma) and orogen elevation $h$ (km).
\n$h=\\;$[[0]]
\n\n{lngrph()}
", "showFeedbackIcon": true, "marks": 0, "scripts": {}, "type": "gapfill", "showCorrectAnswer": true}, {"variableReplacementStrategy": "originalfirst", "stepsPenalty": 0, "steps": [{"variableReplacementStrategy": "originalfirst", "showFeedbackIcon": true, "variableReplacements": [], "prompt": "This can be found in two ways.
\n1. Once Part c) is complete, the line will appear on the graph. You can find the elevation by finding the point on the line where $t=\\var{xext}$ and reading the corresponding value from the y-axis.
\n2. Alternatively, you can input the value of $t=\\var{xext}$ into the linear equation and solve for $h$.
\ni.e. $h=-m*(\\var{xext})+c$, there is a '-' sign because the time is negative (see the table).
\nYou are encouraged to the second method beacuse this is more accurate.
", "marks": 1, "scripts": {}, "type": "extension", "showCorrectAnswer": true}], "gaps": [{"allowFractions": false, "maxValue": "-{m}*{xext}+{c}", "precision": "2", "showFeedbackIcon": true, "variableReplacements": [], "precisionType": "sigfig", "strictPrecision": true, "scripts": {}, "marks": 1, "minValue": "-{m}*{xext}+{c}", "showCorrectAnswer": true, "precisionPartialCredit": 0, "precisionMessage": "You have not given your answer to the correct precision.
", "notationStyles": ["plain", "en", "si-en"], "correctAnswerStyle": "plain", "variableReplacementStrategy": "originalfirst", "correctAnswerFraction": false, "type": "numberentry", "showPrecisionHint": false}], "variableReplacements": [], "prompt": "Assuming the orogenic growth rate remains constant, use Part c) to make a prediction for the elevation in $\\var{xext}$ million years from the present:
\n[[0]] km
\nGive your answer correct to two significant figures.
", "showFeedbackIcon": true, "marks": 0, "scripts": {}, "type": "gapfill", "showCorrectAnswer": true}], "preamble": {"css": "", "js": ""}, "type": "question", "contributors": [{"name": "Luke Park", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/826/"}], "resources": []}]}], "contributors": [{"name": "Luke Park", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/826/"}]}