// Numbas version: finer_feedback_settings {"name": "1 Funciones, tranformacion vertical", "extensions": ["jsxgraph"], "custom_part_types": [], "resources": [], "navigation": {"allowregen": true, "showfrontpage": false, "preventleave": false, "typeendtoleave": false}, "question_groups": [{"pickingStrategy": "all-ordered", "questions": [{"variable_groups": [], "variablesTest": {"maxRuns": 100, "condition": ""}, "advice": "", "extensions": ["jsxgraph"], "statement": "

La gráfica de la función $y=f(x)$ se muestra en color Negro.

\n

Mueva o escriba las coordenadas de los puntos de color Rojo, de forma que estén sobre la gráfica de la función $y=\\simplify[fractionNumbers,all]{{vsc}f({hsc}x+{hsh})+{vsh}}$.

", "tags": [], "parts": [{"showFeedbackIcon": true, "gaps": [{"showFeedbackIcon": true, "minValue": "xn[0]", "correctAnswerFraction": false, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": "5", "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "variableReplacements": [], "maxValue": "xn[0]", "type": "numberentry", "allowFractions": true}, {"showFeedbackIcon": true, "minValue": "yn[0]", "correctAnswerFraction": false, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": "5", "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "variableReplacements": [], "maxValue": "yn[0]", "type": "numberentry", "allowFractions": true}, {"showFeedbackIcon": true, "minValue": "xn[1]", "correctAnswerFraction": false, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": "5", "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "variableReplacements": [], "maxValue": "xn[1]", "type": "numberentry", "allowFractions": true}, {"showFeedbackIcon": true, "minValue": "yn[1]", "correctAnswerFraction": false, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": "5", "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "variableReplacements": [], "maxValue": "yn[1]", "type": "numberentry", "allowFractions": true}, {"showFeedbackIcon": true, "minValue": "xn[2]", "correctAnswerFraction": false, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": "5", "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "variableReplacements": [], "maxValue": "xn[2]", "type": "numberentry", "allowFractions": true}, {"showFeedbackIcon": true, "minValue": "yn[2]", "correctAnswerFraction": false, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": "5", "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "variableReplacements": [], "maxValue": "yn[2]", "type": "numberentry", "allowFractions": true}, {"showFeedbackIcon": true, "minValue": "xn[3]", "correctAnswerFraction": false, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": "5", "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "variableReplacements": [], "maxValue": "xn[3]", "type": "numberentry", "allowFractions": true}, {"showFeedbackIcon": true, "minValue": "yn[3]", "correctAnswerFraction": false, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": "5", "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "variableReplacements": [], "maxValue": "yn[3]", "type": "numberentry", "allowFractions": true}, {"showFeedbackIcon": true, "minValue": "xn[4]", "correctAnswerFraction": false, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": "5", "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "variableReplacements": [], "maxValue": "xn[4]", "type": "numberentry", "allowFractions": true}, {"showFeedbackIcon": true, "minValue": "yn[4]", "correctAnswerFraction": false, "mustBeReduced": false, "notationStyles": ["plain", "en", "si-en"], "showCorrectAnswer": true, "marks": "5", "correctAnswerStyle": "plain", "scripts": {}, "variableReplacementStrategy": "originalfirst", "mustBeReducedPC": 0, "variableReplacements": [], "maxValue": "yn[4]", "type": "numberentry", "allowFractions": true}], "prompt": "
\n

El punto $A$  $(-2,\\var{yo0})$ se debe mover a $\\big($[[0]],[[1]]$\\big)$.
El punto $B$  $(-1,\\var{yo1})$ se debe mover a $\\big($[[2]],[[3]]$\\big)$.
El punto $C$  $(0,\\var{yo2})$ se debe mover a $\\big($[[4]],[[5]]$\\big)$.
El punto $D$  $(1,\\var{yo3})$ se debe mover a $\\big($[[6]],[[7]]$\\big)$.
El punto $E$  $(2,\\var{yo4})$ se debe mover a $\\big($[[8]],[[9]]$\\big)$.

", "steps": [{"showFeedbackIcon": true, "prompt": "

La gráfica de $y=\\simplify[fractionNumbers,all]{{vsc}f({hsc}x+{hsh})+{vsh}}$ tiene idéntica forma que la de $f(x)$, excepto que el valor de $y$ se desplaza verticalmente $\\var{abs(vsh)}$ unidades  arriba      abajo, es decir,  el nuevo gráfico se mueve   $\\var{vsh}$ unidades  en dirección vertical con relación al gráfico $y=f(x)$.

\n

\n

", "scripts": {}, "variableReplacements": [], "type": "information", "variableReplacementStrategy": "originalfirst", "marks": 0, "showCorrectAnswer": true}], "scripts": {}, "variableReplacements": [], "stepsPenalty": "0", "type": "gapfill", "variableReplacementStrategy": "originalfirst", "marks": 0, "showCorrectAnswer": true}], "functions": {}, "rulesets": {"std": ["all", "fractionNumbers"]}, "ungrouped_variables": ["selector", "vsh", "hsh", "vsc", "hsc", "yo", "yn", "xo", "xn", "yo0", "yo1", "yo2", "yo3", "yo4", "maxx", "maxy"], "name": "1 Funciones, tranformacion vertical", "preamble": {"css": "table#values th {\n background: none;\n text-align: center;\n}", "js": "function dragpoint_board() {\n var scope = question.scope;\n \n // var a = scope.variables.a.value;\n// var c = scope.variables.c.value;\n\n var yo0 = scope.variables.yo0.value;\n var yo1 = scope.variables.yo1.value;\n var yo2 = scope.variables.yo2.value;\n var yo3 = scope.variables.yo3.value; \n var yo4 = scope.variables.yo4.value;\n \n var maxx = scope.variables.maxx.value;\n var maxy = scope.variables.maxy.value;\n \n var div = Numbas.extensions.jsxgraph.makeBoard('500px','500px',{boundingBox:[-maxx,maxy,maxx,-maxy],grid:true});\n $(question.display.html).find('#dragpoint').append(div);\n \n var board = div.board;\n \n \n //create stationary points\n \n var op0 = board.create('point',[-2,yo0],{name:'',fixed:true,size:2,color:'black'});\n var op1 = board.create('point',[-1,yo1],{name:'',fixed:true,size:2,color:'black'});\n var op2 = board.create('point',[0,yo2],{name:'',fixed:true,size:2,color:'black'});\n var op3 = board.create('point',[1,yo3],{name:'',fixed:true,size:2,color:'black'});\n var op4 = board.create('point',[2,yo4],{name:'',fixed:true,size:2,color:'black'});\n \n \n //create draggable points\n //why are there are a cloine under each one?\n var np0 = board.create('point',[-2,yo0],{name:'A',size:2,snapSizeX: 0.25,snapSizeY: 0.25,snapToGrid: true});\n var np1 = board.create('point',[-1,yo1],{name:'B',size:2,snapSizeX: 0.25,snapSizeY: 0.25,snapToGrid: true});\n var np2 = board.create('point',[0,yo2],{name:'C',size:2,snapSizeX: 0.25,snapSizeY: 0.25,snapToGrid: true});\n var np3 = board.create('point',[1,yo3],{name:'D',size:2,snapSizeX: 0.25,snapSizeY: 0.25,snapToGrid: true});\n var np4 = board.create('point',[2,yo4],{name:'E',size:2,snapSizeX: 0.25,snapSizeY: 0.25,snapToGrid: true});\n \n \n \n \n //shorthand to evaluate a mathematical expression to a number\n function evaluate(expression) {\n try {\n var val = Numbas.jme.evaluate(expression,question.scope);\n return Numbas.jme.unwrapValue(val);\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 = 5;\n var points = [np0, np1, np2, np3, np4];\n \n \n // this function sets up the i^th point\n function make_point(i) {\n \n // calculate initial coordinates\n // var x = i-(num_points-1)/2;\n \n // create an invisible vertical line for the point to slide along\n // var line = board.create('line',[[x,0],[x,1]],{visible: false});\n \n // create the point\n // var point = points[i] = board.create(\n // 'point',\n // [i-(num_points-1)/2,0],\n // {\n // name:'',\n // size:2,\n // snapSizeY: 0.25, // the point will snap to y-coordinates which are multiples of 0.1\n // snapSizeX: 0.25,\n // snapToGrid: true\n // }\n // );\n \n var point = points[i];\n \n var x=point[0];\n var y=point[1];\n \n // the contents of the input box for this point\n var xstudentAnswer = question.parts[0].gaps[2*i].display.studentAnswer;\n var ystudentAnswer = question.parts[0].gaps[2*i+1].display.studentAnswer;\n \n // watch the student's input and reposition the point when it changes. \n ko.computed(function() {\n x = evaluate(xstudentAnswer());\n y = evaluate(ystudentAnswer());\n if(!(isNaN(x)) && !(isNaN(y)) && board.mode!=board.BOARD_MODE_DRAG) {\n point.moveTo([x,y],100);\n }\n });\n \n // when the student drags the point, update the gapfill input\n point.on('drag',function(){\n var x = Numbas.math.niceNumber(point.X());\n var y = Numbas.math.niceNumber(point.Y());\n xstudentAnswer(x);\n ystudentAnswer(y);\n });\n \n }\n \n // create each point\n for(var i=0;ithe (random) original y values which relate to the x values

"}, "hsh": {"group": "Ungrouped variables", "definition": "if(selector='hsh',random(-3..3 except 0),0)", "templateType": "anything", "name": "hsh", "description": "

horizontal shift

"}, "yo1": {"group": "Ungrouped variables", "definition": "yo[1]", "templateType": "anything", "name": "yo1", "description": ""}, "yo4": {"group": "Ungrouped variables", "definition": "yo[4]", "templateType": "anything", "name": "yo4", "description": ""}, "yo3": {"group": "Ungrouped variables", "definition": "yo[3]", "templateType": "anything", "name": "yo3", "description": ""}, "hsc": {"group": "Ungrouped variables", "definition": "if(selector='hsc',random(-2,-1,-0.5,0.5,2),1)", "templateType": "anything", "name": "hsc", "description": ""}, "maxy": {"group": "Ungrouped variables", "definition": "max(map(abs(a),a,yn)+5)+1", "templateType": "anything", "name": "maxy", "description": ""}, "maxx": {"group": "Ungrouped variables", "definition": "max(map(abs(a),a,xn)+5)+1", "templateType": "anything", "name": "maxx", "description": ""}, "yn": {"group": "Ungrouped variables", "definition": "map(vsc*y+vsh,y,yo)", "templateType": "anything", "name": "yn", "description": "

new y values after the transformation

"}, "xo": {"group": "Ungrouped variables", "definition": "list(-2..2)", "templateType": "anything", "name": "xo", "description": "

original x values

"}, "yo2": {"group": "Ungrouped variables", "definition": "yo[2]", "templateType": "anything", "name": "yo2", "description": ""}, "vsc": {"group": "Ungrouped variables", "definition": "if(selector='vsc',random(-2,-1,-0.5,0.5,2),1)", "templateType": "anything", "name": "vsc", "description": ""}, "xn": {"group": "Ungrouped variables", "definition": "map((x-hsh)/hsc,x,xo)", "templateType": "anything", "name": "xn", "description": "

new transformed x values

"}, "vsh": {"group": "Ungrouped variables", "definition": "if(selector='vsh',random(-3..3#0.5 except 0),0)\n", "templateType": "anything", "name": "vsh", "description": "

vertical shift

"}, "selector": {"group": "Ungrouped variables", "definition": "'vsh'", "templateType": "anything", "name": "selector", "description": ""}, "yo0": {"group": "Ungrouped variables", "definition": "yo[0]", "templateType": "anything", "name": "yo0", "description": ""}}, "metadata": {"licence": "All rights reserved", "description": "

aleatorio de función cubica

"}, "type": "question", "contributors": [{"name": "Marlon Arcila", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/321/"}]}]}], "contributors": [{"name": "Marlon Arcila", "profile_url": "https://numbas.mathcentre.ac.uk/accounts/profile/321/"}]}