From 34ead0e2211fe18f320fb7994ebb715c290e15bb Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Thu, 16 Apr 2026 11:39:46 +0100 Subject: [PATCH 1/8] Added Postman collection for testing `compareExpressions` API --- postman_collection.json | 2416 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 2416 insertions(+) create mode 100644 postman_collection.json diff --git a/postman_collection.json b/postman_collection.json new file mode 100644 index 0000000..2251d1f --- /dev/null +++ b/postman_collection.json @@ -0,0 +1,2416 @@ +{ + "info": { + "_postman_id": "compareExpressions-api-test-suite", + "name": "compareExpressions API Tests", + "description": "Test suite for the compareExpressions Lambda function covering legacy eval/preview and muEd API paths.\n\n## Setup\nSet `baseUrl` to:\n- **Local (Lambda RIE):** `http://localhost:9000/2015-03-31/functions/function/invocations`\n- **Staging/Prod (API Gateway):** your deployed API Gateway URL\n\n## Helper architecture\nThe collection pre-request stores shared builder functions in `pm.globals.__helpers`. Each request pre-request calls `eval(pm.globals.get('__helpers'))` and then uses `buildLegacyEvalEvent`, `buildLegacyPreviewEvent`, or `buildMuEdEvent`. Three shared test cases (`tc_simple_correct`, `tc_simple_incorrect`, `tc_algebraic_equiv`) are stored as collection variables and referenced by both Folder 0 (muEd) and Folder 1 (legacy).", + "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" + }, + "variable": [ + { + "key": "baseUrl", + "value": "http://localhost:9001/2015-03-31/functions/function/invocations", + "type": "string", + "description": "Change to your API Gateway URL for staging/prod testing" + } + ], + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "// Shared builder functions stored in pm.globals for all request pre-request scripts.", + "// Each request calls: eval(pm.globals.get('__helpers'))", + "// then uses buildLegacyEvalEvent, buildLegacyPreviewEvent, or buildMuEdEvent.", + "var h = '';", + "h += 'function buildEvent(b,p){p=p||\"/\";return{version:\"2.0\",routeKey:\"POST \"+p,rawPath:p,rawQueryString:\"\",path:p,headers:{\"content-type\":\"application/json\"},requestContext:{http:{method:\"POST\",path:p}},body:JSON.stringify(b),isBase64Encoded:false};}';", + "h += 'function buildLegacyEvalEvent(r,a,p){return buildEvent({response:r,answer:a,params:p||{}},\"/\");}';", + "h += 'function buildLegacyPreviewEvent(r,p){var e=buildEvent({response:r,params:p||{}},\"/\");e.headers[\"command\"]=\"preview\";return e;}';", + "h += 'function buildMuEdEvent(r,a,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(a!=null){var rf={};rf[k]=a;b.task={title:o.title||\"Evaluation Task\",referenceSolution:rf};}if(p&&Object.keys(p).length)b.configuration={params:p};if(o.user)b.user=o.user;if(o.criteria)b.criteria=o.criteria;return buildEvent(b,\"/evaluate\");}';", + "h += 'function buildMuEdPreviewEvent(r,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(p&&Object.keys(p).length)b.configuration={params:p};return buildEvent(b,\"/preview\");}';", + "pm.globals.set('__helpers', h);", + "", + "// Shared test cases — referenced by Folder 0 (muEd) and Folder 1 (legacy)", + "pm.collectionVariables.set('tc_simple_correct', JSON.stringify({response:'x+1', answer:'x+1', params:{strict_syntax:false}}));", + "pm.collectionVariables.set('tc_simple_incorrect', JSON.stringify({response:'x+1', answer:'x+2', params:{strict_syntax:false}}));", + "pm.collectionVariables.set('tc_algebraic_equiv', JSON.stringify({response:'x**2-1', answer:'(x-1)*(x+1)', params:{strict_syntax:false,elementary_functions:true}}));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "pm.test('Response status is 200', function () {", + " pm.response.to.have.status(200);", + "});" + ] + } + } + ], + "item": [ + { + "name": "Chunk 1 — Health & Error Cases", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "Health check", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var evt = buildEvent({}, '/');", + "evt.headers['command'] = 'healthcheck';", + "pm.variables.set('lambdaEvent', JSON.stringify(evt));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "", + "pm.test('command is healthcheck', function () {", + " pm.expect(r.command).to.equal('healthcheck');", + "});", + "pm.test('result is present', function () {", + " pm.expect(r).to.have.property('result');", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "Health check", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildEvent({}, '/health')));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "", + "pm.test('command is healthcheck', function () {", + " pm.expect(r.command).to.equal('healthcheck');", + "});", + "pm.test('result is present', function () {", + " pm.expect(r).to.have.property('result');", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "With task title", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var tc = JSON.parse(pm.collectionVariables.get('tc_simple_correct'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent(tc.response, tc.answer, tc.params, {title:'Algebra Task'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "", + "pm.test('response is an array', function () {", + " pm.expect(r).to.be.an('array');", + "});", + "pm.test('response first item exists', function () {", + " pm.expect(r[0]).to.be.an('object');", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Missing submission → error", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildEvent({task:{title:'Some Task'}}, '/evaluate')));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "", + "pm.test('response has error key', function () {", + " pm.expect(r).to.have.property('error');", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Invalid submission type → error", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildEvent({submission:{type:'INVALID',content:{}}}, '/evaluate')));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "", + "pm.test('response has error key', function () {", + " pm.expect(r).to.have.property('error');", + "});" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + } + ] + }, + { + "name": "Chunk 2 — Basic Symbolic", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "Correct: simple equality", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var tc = JSON.parse(pm.collectionVariables.get('tc_simple_correct'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent(tc.response, tc.answer, tc.params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: simple inequality", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var tc = JSON.parse(pm.collectionVariables.get('tc_simple_incorrect'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent(tc.response, tc.answer, tc.params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: algebraically equivalent", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var tc = JSON.parse(pm.collectionVariables.get('tc_algebraic_equiv'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent(tc.response, tc.answer, tc.params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: LaTeX input", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('\\\\sin x + x^{7}', 'sin(x)+x**7', {strict_syntax:false,elementary_functions:true,is_latex:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: complex numbers", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('6*exp(5*pi/6*I)', '6*(cos(5*pi/6)+I*sin(5*pi/6))', {strict_syntax:false,complexNumbers:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "Correct: simple equality", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var tc = JSON.parse(pm.collectionVariables.get('tc_simple_correct'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent(tc.response, tc.answer, tc.params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: simple inequality", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var tc = JSON.parse(pm.collectionVariables.get('tc_simple_incorrect'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent(tc.response, tc.answer, tc.params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: algebraically equivalent", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var tc = JSON.parse(pm.collectionVariables.get('tc_algebraic_equiv'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent(tc.response, tc.answer, tc.params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: LaTeX input", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('\\\\sin x + x^{7}', 'sin(x)+x**7', {strict_syntax:false,elementary_functions:true,is_latex:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: complex numbers", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('6*exp(5*pi/6*I)', '6*(cos(5*pi/6)+I*sin(5*pi/6))', {strict_syntax:false,complexNumbers:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + } + ] + } + , + { + "name": "Chunk 3 — Tolerances", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "Correct: within absolute tolerance", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('10', 'sqrt(47)+pi', {strict_syntax:false,atol:5})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: outside absolute tolerance", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('4', 'sqrt(47)+pi', {strict_syntax:false,atol:5})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: within relative tolerance", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('10', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: outside relative tolerance", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('49', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "Correct: within absolute tolerance", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('10', 'sqrt(47)+pi', {strict_syntax:false,atol:5})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: outside absolute tolerance", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('4', 'sqrt(47)+pi', {strict_syntax:false,atol:5})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: within relative tolerance", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('10', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: outside relative tolerance", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('49', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + } + ] + } + , + { + "name": "Chunk 4 — Custom Criteria", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "Correct: custom equality criteria", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('5*x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('tag answer-response = 0_TRUE present', function () { pm.expect(r.result.tags).to.include('answer-response = 0_TRUE'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: custom equality criteria", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: derivative criteria", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('sin(x)+2', 'sin(x)', {strict_syntax:false,elementary_functions:true,criteria:'diff(response,x)=cos(x)'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: proportional to criteria", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('2*a+2*b+2*c', 'a+b+c', {strict_syntax:false,criteria:'response proportional to answer'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('tag response proportional to answer_TRUE present', function () { pm.expect(r.result.tags).to.include('response proportional to answer_TRUE'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: contains criteria", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, criteria:'sin(response)=0, response contains n', symbol_assumptions:\"('n', 'integer')\", symbols:{n:{latex:'\\\\(n\\\\)', aliases:['i','k','N','I','K']}}};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('pi*n', '0', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "Correct: custom equality criteria", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('5*x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('tag answer-response = 0_TRUE present', function () { pm.expect(r[0].tags).to.include('answer-response = 0_TRUE'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: custom equality criteria", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: derivative criteria", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('sin(x)+2', 'sin(x)', {strict_syntax:false,elementary_functions:true,criteria:'diff(response,x)=cos(x)'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: proportional to criteria", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('2*a+2*b+2*c', 'a+b+c', {strict_syntax:false,criteria:'response proportional to answer'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('tag response proportional to answer_TRUE present', function () { pm.expect(r[0].tags).to.include('response proportional to answer_TRUE'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: contains criteria", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, criteria:'sin(response)=0, response contains n', symbol_assumptions:\"('n', 'integer')\", symbols:{n:{latex:'\\\\(n\\\\)', aliases:['i','k','N','I','K']}}};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('pi*n', '0', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + } + ] + } + , + { + "name": "Chunk 5 — Syntactical Comparison", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "Correct: written as answer", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('(x-5)^2-6', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('tag response written as answer_TRUE present', function () { pm.expect(r.result.tags).to.include('response written as answer_TRUE'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: algebraically equal but different form", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('x^2-8x+11', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('tag response written as answer_FALSE present', function () { pm.expect(r.result.tags).to.include('response written as answer_FALSE'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "Correct: written as answer", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('(x-5)^2-6', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('tag response written as answer_TRUE present', function () { pm.expect(r[0].tags).to.include('response written as answer_TRUE'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: algebraically equal but different form", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('x^2-8x+11', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", + "pm.test('tag response written as answer_FALSE present', function () { pm.expect(r[0].tags).to.include('response written as answer_FALSE'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + } + ] + } + , + { + "name": "Chunk 6 — Plus/Minus Symbols", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "Correct: set notation equivalent to plus_minus", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, symbols:{plus_minus:{latex:'\\\\(\\\\pm\\\\)', aliases:['pm','+-']}}};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('{-x, x}', 'plus_minus x', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: pm/mp aliases", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, symbols:{plus_minus:{latex:'\\\\(\\\\pm\\\\)', aliases:['pm','+-']}, minus_plus:{latex:'\\\\(\\\\mp\\\\)', aliases:['mp','-+']}}};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('pm x**2 + mp y**2', 'plus_minus x**2 + minus_plus y**2', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "Correct: set notation equivalent to plus_minus", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, symbols:{plus_minus:{latex:'\\\\(\\\\pm\\\\)', aliases:['pm','+-']}}};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('{-x, x}', 'plus_minus x', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: pm/mp aliases", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, symbols:{plus_minus:{latex:'\\\\(\\\\pm\\\\)', aliases:['pm','+-']}, minus_plus:{latex:'\\\\(\\\\mp\\\\)', aliases:['mp','-+']}}};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('pm x**2 + mp y**2', 'plus_minus x**2 + minus_plus y**2', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + } + ] + } + , + { + "name": "Chunk 7 — Physical Quantities", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "Correct: identical units", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('2.00 kilometre/hour', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('tag UNIT_COMPARISON_IDENTICAL present', function () { pm.expect(r.result.tags).to.include('response matches answer_UNIT_COMPARISON_IDENTICAL'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: equivalent units", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('0.556 m/s', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('tag UNIT_COMPARISON_SIMILAR present', function () { pm.expect(r.result.tags).to.include('response matches answer_UNIT_COMPARISON_SIMILAR'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: wrong value", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('0.6 Nm', '0.5 Nm', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: missing unit", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('2.00', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('tag MISSING_UNIT present', function () { pm.expect(r.result.tags).to.include('response matches answer_MISSING_UNIT'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: wrong dimension", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('2 km', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('tag DIMENSION_MATCH_FALSE present', function () { pm.expect(r.result.tags).to.include('response matches answer_DIMENSION_MATCH_FALSE'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "Correct: identical units", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('2.00 kilometre/hour', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('tag UNIT_COMPARISON_IDENTICAL present', function () { pm.expect(r[0].tags).to.include('response matches answer_UNIT_COMPARISON_IDENTICAL'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: equivalent units", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('0.556 m/s', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('tag UNIT_COMPARISON_SIMILAR present', function () { pm.expect(r[0].tags).to.include('response matches answer_UNIT_COMPARISON_SIMILAR'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: wrong value", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('0.6 Nm', '0.5 Nm', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: missing unit", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('2.00', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", + "pm.test('tag MISSING_UNIT present', function () { pm.expect(r[0].tags).to.include('response matches answer_MISSING_UNIT'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Incorrect: wrong dimension", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('2 km', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", + "pm.test('tag DIMENSION_MATCH_FALSE present', function () { pm.expect(r[0].tags).to.include('response matches answer_DIMENSION_MATCH_FALSE'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + } + ] + } + , + { + "name": "Chunk 8 — Symbol Aliases", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "Correct: custom symbol alias", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, symbols:{epsilon_r:{latex:'\\\\(\\\\epsilon_r\\\\)', aliases:['eps','eps_r','e_r']}}};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('eps', 'epsilon_r', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: symbol assumptions", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, symbol_assumptions:\"('a','positive') ('b','positive')\"};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('sqrt(a)/sqrt(b)', 'sqrt(a/b)', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "Correct: custom symbol alias", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, symbols:{epsilon_r:{latex:'\\\\(\\\\epsilon_r\\\\)', aliases:['eps','eps_r','e_r']}}};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('eps', 'epsilon_r', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Correct: symbol assumptions", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, symbol_assumptions:\"('a','positive') ('b','positive')\"};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('sqrt(a)/sqrt(b)', 'sqrt(a/b)', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + } + ] + } + , + { + "name": "Chunk 9 — Custom Feedback", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "Incorrect: custom feedback message", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('x+1', 'x+2', {strict_syntax:false, feedback_for_incorrect_response:'Try again!'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('feedback is custom message', function () { pm.expect(r.result.feedback).to.equal('Try again!'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "Incorrect: custom feedback message", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('x+1', 'x+2', {strict_syntax:false, feedback_for_incorrect_response:'Try again!'})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", + "pm.test('message is custom feedback', function () { pm.expect(r[0].message).to.equal('Try again!'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + } + ] + } + , + { + "name": "Chunk 10 — Preview Function", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "Simple expression", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('x+1', {strict_syntax:false})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is preview', function () { pm.expect(r.command).to.equal('preview'); });", + "pm.test('preview.latex is present', function () { pm.expect(r.result.preview).to.have.property('latex'); });", + "pm.test('preview.sympy is present', function () { pm.expect(r.result.preview).to.have.property('sympy'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "LaTeX expression", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('\\\\sin x + x^{7}', {strict_syntax:false,elementary_functions:true,is_latex:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is preview', function () { pm.expect(r.command).to.equal('preview'); });", + "pm.test('preview.sympy contains sin(x)', function () { pm.expect(r.result.preview.sympy).to.include('sin(x)'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Natural log", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('ln(x)', {strict_syntax:false,elementary_functions:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is preview', function () { pm.expect(r.command).to.equal('preview'); });", + "pm.test('preview.latex is ln', function () { pm.expect(r.result.preview.latex).to.equal('\\\\ln{\\\\left(x \\\\right)}'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Empty expression", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('', {strict_syntax:false})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is preview', function () { pm.expect(r.command).to.equal('preview'); });", + "pm.test('preview.sympy is empty', function () { pm.expect(r.result.preview.sympy).to.equal(''); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Physical quantity preview", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('10 \u03bcA', {strict_syntax:false,physical_quantity:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is preview', function () { pm.expect(r.command).to.equal('preview'); });", + "pm.test('preview.latex contains microampere', function () { pm.expect(r.result.preview.latex).to.include('microampere'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "Plus/minus preview", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "var params = {strict_syntax:false, elementary_functions:true, symbols:{plus_minus:{latex:'\\\\(\\\\pm\\\\)', aliases:['pm','+-']}}};", + "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('plus_minus x', params)));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('command is preview', function () { pm.expect(r.command).to.equal('preview'); });", + "pm.test('preview.latex is set notation', function () { pm.expect(r.result.preview.latex).to.include('\\\\left\\\\{'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "Simple expression", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdPreviewEvent('x+1', {strict_syntax:false})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('preSubmissionFeedback.latex is present', function () { pm.expect(r[0].preSubmissionFeedback).to.have.property('latex'); });", + "pm.test('preSubmissionFeedback.sympy is present', function () { pm.expect(r[0].preSubmissionFeedback).to.have.property('sympy'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + }, + { + "name": "LaTeX expression", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdPreviewEvent('\\\\sin x + x^{7}', {strict_syntax:false,elementary_functions:true,is_latex:true})));" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('preSubmissionFeedback.sympy contains sin(x)', function () { pm.expect(r[0].preSubmissionFeedback.sympy).to.include('sin(x)'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + } + } + ] + } + ] + } + ] +} From 9c78e11f3428a34c0aa4e496b9208da9ab3c27f4 Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Thu, 16 Apr 2026 11:57:24 +0100 Subject: [PATCH 2/8] Switched Dockerfile to use `feature-muEd-3.8` base image --- app/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Dockerfile b/app/Dockerfile index 9f5ca25..040bafd 100755 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -1,7 +1,8 @@ # Base image that bundles AWS Lambda Python 3.8 image with some middleware functions # FROM base-eval-tmp # FROM rabidsheep55/python-base-eval-layer -FROM ghcr.io/lambda-feedback/baseevalutionfunctionlayer:main-3.8 +#FROM ghcr.io/lambda-feedback/baseevalutionfunctionlayer:main-3.8 +FROM ghcr.io/lambda-feedback/baseevalutionfunctionlayer:feature-muEd-3.8 RUN yum install -y git From d63f70b4f608b4d62fef448396cd35d9b57e5755 Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Fri, 17 Apr 2026 11:12:51 +0100 Subject: [PATCH 3/8] Refactored Postman collection to support local and cloud modes, standardized variable handling. --- postman_collection.json | 1759 ++++++++++++++++++++++++++++++++------- 1 file changed, 1467 insertions(+), 292 deletions(-) diff --git a/postman_collection.json b/postman_collection.json index 2251d1f..2a360d7 100644 --- a/postman_collection.json +++ b/postman_collection.json @@ -11,6 +11,12 @@ "value": "http://localhost:9001/2015-03-31/functions/function/invocations", "type": "string", "description": "Change to your API Gateway URL for staging/prod testing" + }, + { + "key": "mode", + "value": "local", + "type": "string", + "description": "Set to 'local' for Lambda RIE or 'cloud' for API Gateway" } ], "event": [ @@ -28,9 +34,18 @@ "h += 'function buildLegacyPreviewEvent(r,p){var e=buildEvent({response:r,params:p||{}},\"/\");e.headers[\"command\"]=\"preview\";return e;}';", "h += 'function buildMuEdEvent(r,a,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(a!=null){var rf={};rf[k]=a;b.task={title:o.title||\"Evaluation Task\",referenceSolution:rf};}if(p&&Object.keys(p).length)b.configuration={params:p};if(o.user)b.user=o.user;if(o.criteria)b.criteria=o.criteria;return buildEvent(b,\"/evaluate\");}';", "h += 'function buildMuEdPreviewEvent(r,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(p&&Object.keys(p).length)b.configuration={params:p};return buildEvent(b,\"/preview\");}';", + "h += 'var __mode=pm.collectionVariables.get(\"mode\")||\"local\";';", + "h += 'var __base=pm.collectionVariables.get(\"baseUrl\");';", + "h += 'function setLegacyEvalReq(r,a,p){if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildLegacyEvalEvent(r,a,p)));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify({response:r,answer:a,params:p||{}}));pm.variables.set(\"requestUrl\",__base);}}';", + "h += 'function setLegacyPreviewReq(r,p){if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildLegacyPreviewEvent(r,p)));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify({response:r,params:p||{}}));pm.variables.set(\"requestUrl\",__base);pm.request.headers.add({key:\"command\",value:\"preview\"});}}';", + "h += 'function setLegacyHealthReq(){if(__mode===\"local\"){var e=buildEvent({},\"/\");e.headers[\"command\"]=\"healthcheck\";pm.variables.set(\"lambdaEvent\",JSON.stringify(e));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify({}));pm.variables.set(\"requestUrl\",__base);pm.request.headers.add({key:\"command\",value:\"healthcheck\"},true);}}';", + "h += 'function setMuEdEvalReq(r,a,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(a!=null){var rf={};rf[k]=a;b.task={title:o.title||\"Evaluation Task\",referenceSolution:rf};}if(p&&Object.keys(p).length)b.configuration={params:p};if(o.user)b.user=o.user;if(o.criteria)b.criteria=o.criteria;if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildEvent(b,\"/evaluate\")));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify(b));pm.variables.set(\"requestUrl\",__base+\"/evaluate\");}}';", + "h += 'function setMuEdPreviewReq(r,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(p&&Object.keys(p).length)b.configuration={params:p};if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildEvent(b,\"/preview\")));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify(b));pm.variables.set(\"requestUrl\",__base+\"/preview\");}}';", + "h += 'function setMuEdHealthReq(){if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildEvent({},\"/evaluate/health\")));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify({}));pm.variables.set(\"requestUrl\",__base+\"/evaluate/health\");}}';", + "h += 'function setMuEdRawReq(body,path){if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildEvent(body,path)));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify(body));pm.variables.set(\"requestUrl\",__base+path);}}';", "pm.globals.set('__helpers', h);", "", - "// Shared test cases — referenced by Folder 0 (muEd) and Folder 1 (legacy)", + "// Shared test cases \u2014 referenced by Folder 0 (muEd) and Folder 1 (legacy)", "pm.collectionVariables.set('tc_simple_correct', JSON.stringify({response:'x+1', answer:'x+1', params:{strict_syntax:false}}));", "pm.collectionVariables.set('tc_simple_incorrect', JSON.stringify({response:'x+1', answer:'x+2', params:{strict_syntax:false}}));", "pm.collectionVariables.set('tc_algebraic_equiv', JSON.stringify({response:'x**2-1', answer:'(x-1)*(x+1)', params:{strict_syntax:false,elementary_functions:true}}));" @@ -51,7 +66,7 @@ ], "item": [ { - "name": "Chunk 1 — Health & Error Cases", + "name": "Chunk 1 \u2014 Health & Error Cases", "item": [ { "name": "Legacy", @@ -65,9 +80,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "var evt = buildEvent({}, '/');", - "evt.headers['command'] = 'healthcheck';", - "pm.variables.set('lambdaEvent', JSON.stringify(evt));" + "setLegacyHealthReq();" ] } }, @@ -91,9 +104,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -110,7 +141,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildEvent({}, '/health')));" + "setMuEdHealthReq();" ] } }, @@ -134,9 +165,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -149,7 +198,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var tc = JSON.parse(pm.collectionVariables.get('tc_simple_correct'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent(tc.response, tc.answer, tc.params, {title:'Algebra Task'})));" + "setMuEdEvalReq(tc.response, tc.answer, tc.params, {title:'Algebra Task'});" ] } }, @@ -173,13 +222,31 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { - "name": "Missing submission → error", + "name": "Missing submission \u2192 error", "event": [ { "listen": "prerequest", @@ -187,7 +254,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildEvent({task:{title:'Some Task'}}, '/evaluate')));" + "setMuEdRawReq({task:{title:'Some Task'}}, '/evaluate');" ] } }, @@ -208,13 +275,31 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { - "name": "Invalid submission type → error", + "name": "Invalid submission type \u2192 error", "event": [ { "listen": "prerequest", @@ -222,7 +307,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildEvent({submission:{type:'INVALID',content:{}}}, '/evaluate')));" + "setMuEdRawReq({submission:{type:'INVALID',content:{}}}, '/evaluate');" ] } }, @@ -243,9 +328,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -253,7 +356,7 @@ ] }, { - "name": "Chunk 2 — Basic Symbolic", + "name": "Chunk 2 \u2014 Basic Symbolic", "item": [ { "name": "Legacy", @@ -268,7 +371,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var tc = JSON.parse(pm.collectionVariables.get('tc_simple_correct'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent(tc.response, tc.answer, tc.params)));" + "setLegacyEvalReq(tc.response, tc.answer, tc.params);" ] } }, @@ -287,9 +390,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -302,7 +423,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var tc = JSON.parse(pm.collectionVariables.get('tc_simple_incorrect'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent(tc.response, tc.answer, tc.params)));" + "setLegacyEvalReq(tc.response, tc.answer, tc.params);" ] } }, @@ -321,9 +442,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -336,7 +475,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var tc = JSON.parse(pm.collectionVariables.get('tc_algebraic_equiv'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent(tc.response, tc.answer, tc.params)));" + "setLegacyEvalReq(tc.response, tc.answer, tc.params);" ] } }, @@ -355,9 +494,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -369,7 +526,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('\\\\sin x + x^{7}', 'sin(x)+x**7', {strict_syntax:false,elementary_functions:true,is_latex:true})));" + "setLegacyEvalReq('\\\\sin x + x^{7}', 'sin(x)+x**7', {strict_syntax:false,elementary_functions:true,is_latex:true});" ] } }, @@ -388,9 +545,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -402,7 +577,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('6*exp(5*pi/6*I)', '6*(cos(5*pi/6)+I*sin(5*pi/6))', {strict_syntax:false,complexNumbers:true})));" + "setLegacyEvalReq('6*exp(5*pi/6*I)', '6*(cos(5*pi/6)+I*sin(5*pi/6))', {strict_syntax:false,complexNumbers:true});" ] } }, @@ -421,9 +596,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -441,7 +634,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var tc = JSON.parse(pm.collectionVariables.get('tc_simple_correct'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent(tc.response, tc.answer, tc.params)));" + "setMuEdEvalReq(tc.response, tc.answer, tc.params);" ] } }, @@ -460,9 +653,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -475,7 +686,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var tc = JSON.parse(pm.collectionVariables.get('tc_simple_incorrect'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent(tc.response, tc.answer, tc.params)));" + "setMuEdEvalReq(tc.response, tc.answer, tc.params);" ] } }, @@ -494,9 +705,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -509,7 +738,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var tc = JSON.parse(pm.collectionVariables.get('tc_algebraic_equiv'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent(tc.response, tc.answer, tc.params)));" + "setMuEdEvalReq(tc.response, tc.answer, tc.params);" ] } }, @@ -528,9 +757,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -542,7 +789,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('\\\\sin x + x^{7}', 'sin(x)+x**7', {strict_syntax:false,elementary_functions:true,is_latex:true})));" + "setMuEdEvalReq('\\\\sin x + x^{7}', 'sin(x)+x**7', {strict_syntax:false,elementary_functions:true,is_latex:true});" ] } }, @@ -561,9 +808,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -575,7 +840,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('6*exp(5*pi/6*I)', '6*(cos(5*pi/6)+I*sin(5*pi/6))', {strict_syntax:false,complexNumbers:true})));" + "setMuEdEvalReq('6*exp(5*pi/6*I)', '6*(cos(5*pi/6)+I*sin(5*pi/6))', {strict_syntax:false,complexNumbers:true});" ] } }, @@ -594,18 +859,35 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] } ] - } - , + }, { - "name": "Chunk 3 — Tolerances", + "name": "Chunk 3 \u2014 Tolerances", "item": [ { "name": "Legacy", @@ -619,7 +901,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('10', 'sqrt(47)+pi', {strict_syntax:false,atol:5})));" + "setLegacyEvalReq('10', 'sqrt(47)+pi', {strict_syntax:false,atol:5});" ] } }, @@ -638,9 +920,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -652,7 +952,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('4', 'sqrt(47)+pi', {strict_syntax:false,atol:5})));" + "setLegacyEvalReq('4', 'sqrt(47)+pi', {strict_syntax:false,atol:5});" ] } }, @@ -671,9 +971,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -685,7 +1003,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('10', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5})));" + "setLegacyEvalReq('10', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5});" ] } }, @@ -704,9 +1022,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -718,7 +1054,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('49', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5})));" + "setLegacyEvalReq('49', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5});" ] } }, @@ -737,9 +1073,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -756,7 +1110,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('10', 'sqrt(47)+pi', {strict_syntax:false,atol:5})));" + "setMuEdEvalReq('10', 'sqrt(47)+pi', {strict_syntax:false,atol:5});" ] } }, @@ -775,9 +1129,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -789,7 +1161,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('4', 'sqrt(47)+pi', {strict_syntax:false,atol:5})));" + "setMuEdEvalReq('4', 'sqrt(47)+pi', {strict_syntax:false,atol:5});" ] } }, @@ -808,9 +1180,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -822,7 +1212,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('10', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5})));" + "setMuEdEvalReq('10', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5});" ] } }, @@ -841,9 +1231,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -855,7 +1263,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('49', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5})));" + "setMuEdEvalReq('49', 'sqrt(47)+pi', {strict_syntax:false,rtol:0.5});" ] } }, @@ -874,18 +1282,35 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] } ] - } - , + }, { - "name": "Chunk 4 — Custom Criteria", + "name": "Chunk 4 \u2014 Custom Criteria", "item": [ { "name": "Legacy", @@ -899,7 +1324,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('5*x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'})));" + "setLegacyEvalReq('5*x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'});" ] } }, @@ -919,9 +1344,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -933,7 +1376,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'})));" + "setLegacyEvalReq('x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'});" ] } }, @@ -952,9 +1395,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -966,7 +1427,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('sin(x)+2', 'sin(x)', {strict_syntax:false,elementary_functions:true,criteria:'diff(response,x)=cos(x)'})));" + "setLegacyEvalReq('sin(x)+2', 'sin(x)', {strict_syntax:false,elementary_functions:true,criteria:'diff(response,x)=cos(x)'});" ] } }, @@ -985,9 +1446,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -999,7 +1478,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('2*a+2*b+2*c', 'a+b+c', {strict_syntax:false,criteria:'response proportional to answer'})));" + "setLegacyEvalReq('2*a+2*b+2*c', 'a+b+c', {strict_syntax:false,criteria:'response proportional to answer'});" ] } }, @@ -1019,9 +1498,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1034,7 +1531,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, criteria:'sin(response)=0, response contains n', symbol_assumptions:\"('n', 'integer')\", symbols:{n:{latex:'\\\\(n\\\\)', aliases:['i','k','N','I','K']}}};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('pi*n', '0', params)));" + "setLegacyEvalReq('pi*n', '0', params);" ] } }, @@ -1053,9 +1550,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -1072,7 +1587,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('5*x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'})));" + "setMuEdEvalReq('5*x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'});" ] } }, @@ -1092,9 +1607,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1106,7 +1639,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'})));" + "setMuEdEvalReq('x', '5*x', {strict_syntax:false,criteria:'answer-response = 0, response/answer = 1'});" ] } }, @@ -1125,9 +1658,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1139,7 +1690,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('sin(x)+2', 'sin(x)', {strict_syntax:false,elementary_functions:true,criteria:'diff(response,x)=cos(x)'})));" + "setMuEdEvalReq('sin(x)+2', 'sin(x)', {strict_syntax:false,elementary_functions:true,criteria:'diff(response,x)=cos(x)'});" ] } }, @@ -1158,9 +1709,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1172,7 +1741,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('2*a+2*b+2*c', 'a+b+c', {strict_syntax:false,criteria:'response proportional to answer'})));" + "setMuEdEvalReq('2*a+2*b+2*c', 'a+b+c', {strict_syntax:false,criteria:'response proportional to answer'});" ] } }, @@ -1192,9 +1761,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1207,7 +1794,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, criteria:'sin(response)=0, response contains n', symbol_assumptions:\"('n', 'integer')\", symbols:{n:{latex:'\\\\(n\\\\)', aliases:['i','k','N','I','K']}}};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('pi*n', '0', params)));" + "setMuEdEvalReq('pi*n', '0', params);" ] } }, @@ -1226,18 +1813,35 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] } ] - } - , + }, { - "name": "Chunk 5 — Syntactical Comparison", + "name": "Chunk 5 \u2014 Syntactical Comparison", "item": [ { "name": "Legacy", @@ -1251,7 +1855,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('(x-5)^2-6', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true})));" + "setLegacyEvalReq('(x-5)^2-6', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true});" ] } }, @@ -1271,9 +1875,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1285,7 +1907,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('x^2-8x+11', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true})));" + "setLegacyEvalReq('x^2-8x+11', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true});" ] } }, @@ -1305,9 +1927,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -1324,7 +1964,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('(x-5)^2-6', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true})));" + "setMuEdEvalReq('(x-5)^2-6', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true});" ] } }, @@ -1344,9 +1984,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1358,7 +2016,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('x^2-8x+11', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true})));" + "setMuEdEvalReq('x^2-8x+11', '(x-4)^2-5', {strict_syntax:false,criteria:'response written as answer',detailed_feedback:true});" ] } }, @@ -1378,18 +2036,35 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] } ] - } - , + }, { - "name": "Chunk 6 — Plus/Minus Symbols", + "name": "Chunk 6 \u2014 Plus/Minus Symbols", "item": [ { "name": "Legacy", @@ -1404,7 +2079,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, symbols:{plus_minus:{latex:'\\\\(\\\\pm\\\\)', aliases:['pm','+-']}}};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('{-x, x}', 'plus_minus x', params)));" + "setLegacyEvalReq('{-x, x}', 'plus_minus x', params);" ] } }, @@ -1423,9 +2098,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1438,7 +2131,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, symbols:{plus_minus:{latex:'\\\\(\\\\pm\\\\)', aliases:['pm','+-']}, minus_plus:{latex:'\\\\(\\\\mp\\\\)', aliases:['mp','-+']}}};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('pm x**2 + mp y**2', 'plus_minus x**2 + minus_plus y**2', params)));" + "setLegacyEvalReq('pm x**2 + mp y**2', 'plus_minus x**2 + minus_plus y**2', params);" ] } }, @@ -1457,9 +2150,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -1477,7 +2188,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, symbols:{plus_minus:{latex:'\\\\(\\\\pm\\\\)', aliases:['pm','+-']}}};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('{-x, x}', 'plus_minus x', params)));" + "setMuEdEvalReq('{-x, x}', 'plus_minus x', params);" ] } }, @@ -1496,9 +2207,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1511,7 +2240,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, symbols:{plus_minus:{latex:'\\\\(\\\\pm\\\\)', aliases:['pm','+-']}, minus_plus:{latex:'\\\\(\\\\mp\\\\)', aliases:['mp','-+']}}};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('pm x**2 + mp y**2', 'plus_minus x**2 + minus_plus y**2', params)));" + "setMuEdEvalReq('pm x**2 + mp y**2', 'plus_minus x**2 + minus_plus y**2', params);" ] } }, @@ -1530,18 +2259,35 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] } ] - } - , + }, { - "name": "Chunk 7 — Physical Quantities", + "name": "Chunk 7 \u2014 Physical Quantities", "item": [ { "name": "Legacy", @@ -1555,7 +2301,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('2.00 kilometre/hour', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + "setLegacyEvalReq('2.00 kilometre/hour', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true});" ] } }, @@ -1575,9 +2321,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1589,7 +2353,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('0.556 m/s', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + "setLegacyEvalReq('0.556 m/s', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true});" ] } }, @@ -1609,9 +2373,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1623,7 +2405,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('0.6 Nm', '0.5 Nm', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + "setLegacyEvalReq('0.6 Nm', '0.5 Nm', {strict_syntax:false,elementary_functions:true,physical_quantity:true});" ] } }, @@ -1642,9 +2424,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1656,7 +2456,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('2.00', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + "setLegacyEvalReq('2.00', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true});" ] } }, @@ -1676,9 +2476,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1690,7 +2508,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('2 km', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + "setLegacyEvalReq('2 km', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true});" ] } }, @@ -1710,9 +2528,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -1729,7 +2565,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('2.00 kilometre/hour', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + "setMuEdEvalReq('2.00 kilometre/hour', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true});" ] } }, @@ -1749,9 +2585,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1763,7 +2617,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('0.556 m/s', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + "setMuEdEvalReq('0.556 m/s', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true});" ] } }, @@ -1783,9 +2637,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1797,7 +2669,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('0.6 Nm', '0.5 Nm', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + "setMuEdEvalReq('0.6 Nm', '0.5 Nm', {strict_syntax:false,elementary_functions:true,physical_quantity:true});" ] } }, @@ -1816,9 +2688,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1830,7 +2720,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('2.00', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + "setMuEdEvalReq('2.00', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true});" ] } }, @@ -1850,9 +2740,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1864,7 +2772,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('2 km', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true})));" + "setMuEdEvalReq('2 km', '2.00 km/h', {strict_syntax:false,elementary_functions:true,physical_quantity:true});" ] } }, @@ -1884,18 +2792,35 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] } ] - } - , + }, { - "name": "Chunk 8 — Symbol Aliases", + "name": "Chunk 8 \u2014 Symbol Aliases", "item": [ { "name": "Legacy", @@ -1910,7 +2835,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, symbols:{epsilon_r:{latex:'\\\\(\\\\epsilon_r\\\\)', aliases:['eps','eps_r','e_r']}}};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('eps', 'epsilon_r', params)));" + "setLegacyEvalReq('eps', 'epsilon_r', params);" ] } }, @@ -1929,9 +2854,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -1944,7 +2887,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, symbol_assumptions:\"('a','positive') ('b','positive')\"};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('sqrt(a)/sqrt(b)', 'sqrt(a/b)', params)));" + "setLegacyEvalReq('sqrt(a)/sqrt(b)', 'sqrt(a/b)', params);" ] } }, @@ -1963,9 +2906,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -1983,7 +2944,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, symbols:{epsilon_r:{latex:'\\\\(\\\\epsilon_r\\\\)', aliases:['eps','eps_r','e_r']}}};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('eps', 'epsilon_r', params)));" + "setMuEdEvalReq('eps', 'epsilon_r', params);" ] } }, @@ -2002,9 +2963,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -2017,7 +2996,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, symbol_assumptions:\"('a','positive') ('b','positive')\"};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('sqrt(a)/sqrt(b)', 'sqrt(a/b)', params)));" + "setMuEdEvalReq('sqrt(a)/sqrt(b)', 'sqrt(a/b)', params);" ] } }, @@ -2036,18 +3015,35 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] } ] - } - , + }, { - "name": "Chunk 9 — Custom Feedback", + "name": "Chunk 9 \u2014 Custom Feedback", "item": [ { "name": "Legacy", @@ -2061,7 +3057,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyEvalEvent('x+1', 'x+2', {strict_syntax:false, feedback_for_incorrect_response:'Try again!'})));" + "setLegacyEvalReq('x+1', 'x+2', {strict_syntax:false, feedback_for_incorrect_response:'Try again!'});" ] } }, @@ -2081,9 +3077,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -2100,7 +3114,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdEvent('x+1', 'x+2', {strict_syntax:false, feedback_for_incorrect_response:'Try again!'})));" + "setMuEdEvalReq('x+1', 'x+2', {strict_syntax:false, feedback_for_incorrect_response:'Try again!'});" ] } }, @@ -2120,18 +3134,35 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] } ] - } - , + }, { - "name": "Chunk 10 — Preview Function", + "name": "Chunk 10 \u2014 Preview Function", "item": [ { "name": "Legacy", @@ -2145,7 +3176,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('x+1', {strict_syntax:false})));" + "setLegacyPreviewReq('x+1', {strict_syntax:false});" ] } }, @@ -2165,9 +3196,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -2179,7 +3228,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('\\\\sin x + x^{7}', {strict_syntax:false,elementary_functions:true,is_latex:true})));" + "setLegacyPreviewReq('\\\\sin x + x^{7}', {strict_syntax:false,elementary_functions:true,is_latex:true});" ] } }, @@ -2198,9 +3247,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -2212,7 +3279,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('ln(x)', {strict_syntax:false,elementary_functions:true})));" + "setLegacyPreviewReq('ln(x)', {strict_syntax:false,elementary_functions:true});" ] } }, @@ -2231,9 +3298,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -2245,7 +3330,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('', {strict_syntax:false})));" + "setLegacyPreviewReq('', {strict_syntax:false});" ] } }, @@ -2264,9 +3349,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -2278,7 +3381,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('10 \u03bcA', {strict_syntax:false,physical_quantity:true})));" + "setLegacyPreviewReq('10 \u03bcA', {strict_syntax:false,physical_quantity:true});" ] } }, @@ -2297,9 +3400,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -2312,7 +3433,7 @@ "exec": [ "eval(pm.globals.get('__helpers'));", "var params = {strict_syntax:false, elementary_functions:true, symbols:{plus_minus:{latex:'\\\\(\\\\pm\\\\)', aliases:['pm','+-']}}};", - "pm.variables.set('lambdaEvent', JSON.stringify(buildLegacyPreviewEvent('plus_minus x', params)));" + "setLegacyPreviewReq('plus_minus x', params);" ] } }, @@ -2331,9 +3452,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -2350,7 +3489,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdPreviewEvent('x+1', {strict_syntax:false})));" + "setMuEdPreviewReq('x+1', {strict_syntax:false});" ] } }, @@ -2370,9 +3509,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -2384,7 +3541,7 @@ "type": "text/javascript", "exec": [ "eval(pm.globals.get('__helpers'));", - "pm.variables.set('lambdaEvent', JSON.stringify(buildMuEdPreviewEvent('\\\\sin x + x^{7}', {strict_syntax:false,elementary_functions:true,is_latex:true})));" + "setMuEdPreviewReq('\\\\sin x + x^{7}', {strict_syntax:false,elementary_functions:true,is_latex:true});" ] } }, @@ -2403,9 +3560,27 @@ ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{baseUrl}}", "host": ["{{baseUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -2413,4 +3588,4 @@ ] } ] -} +} \ No newline at end of file From 0636a117d2b42c9a640d114bbaa0f3dfd22290ce Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Tue, 21 Apr 2026 15:26:44 +0100 Subject: [PATCH 4/8] Switched to use on dev workflow for testing updated deployment API --- .github/workflows/staging-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/staging-deploy.yml b/.github/workflows/staging-deploy.yml index b03a9ec..ac4c312 100644 --- a/.github/workflows/staging-deploy.yml +++ b/.github/workflows/staging-deploy.yml @@ -59,7 +59,7 @@ jobs: if-no-files-found: warn deploy: needs: test - uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@deploy-request + uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@deploy-request-on-dev with: template-repository-name: "lambda-feedback/evaluation-function-boilerplate-python" build-file: "app/Dockerfile" From a5703bd275adfb9ac1ee96e5d3556a721a77e486 Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Tue, 21 Apr 2026 16:03:10 +0100 Subject: [PATCH 5/8] Enabled pre-submission feedback support in Postman collection for MuEd evaluation and preview requests. --- postman_collection.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/postman_collection.json b/postman_collection.json index 2a360d7..9826186 100644 --- a/postman_collection.json +++ b/postman_collection.json @@ -33,14 +33,14 @@ "h += 'function buildLegacyEvalEvent(r,a,p){return buildEvent({response:r,answer:a,params:p||{}},\"/\");}';", "h += 'function buildLegacyPreviewEvent(r,p){var e=buildEvent({response:r,params:p||{}},\"/\");e.headers[\"command\"]=\"preview\";return e;}';", "h += 'function buildMuEdEvent(r,a,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(a!=null){var rf={};rf[k]=a;b.task={title:o.title||\"Evaluation Task\",referenceSolution:rf};}if(p&&Object.keys(p).length)b.configuration={params:p};if(o.user)b.user=o.user;if(o.criteria)b.criteria=o.criteria;return buildEvent(b,\"/evaluate\");}';", - "h += 'function buildMuEdPreviewEvent(r,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(p&&Object.keys(p).length)b.configuration={params:p};return buildEvent(b,\"/preview\");}';", + "h += 'function buildMuEdPreviewEvent(r,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(p&&Object.keys(p).length)b.configuration={params:p};b.preSubmissionFeedback={enabled:true};return buildEvent(b,\"/evaluate\");}';", "h += 'var __mode=pm.collectionVariables.get(\"mode\")||\"local\";';", "h += 'var __base=pm.collectionVariables.get(\"baseUrl\");';", "h += 'function setLegacyEvalReq(r,a,p){if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildLegacyEvalEvent(r,a,p)));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify({response:r,answer:a,params:p||{}}));pm.variables.set(\"requestUrl\",__base);}}';", "h += 'function setLegacyPreviewReq(r,p){if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildLegacyPreviewEvent(r,p)));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify({response:r,params:p||{}}));pm.variables.set(\"requestUrl\",__base);pm.request.headers.add({key:\"command\",value:\"preview\"});}}';", "h += 'function setLegacyHealthReq(){if(__mode===\"local\"){var e=buildEvent({},\"/\");e.headers[\"command\"]=\"healthcheck\";pm.variables.set(\"lambdaEvent\",JSON.stringify(e));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify({}));pm.variables.set(\"requestUrl\",__base);pm.request.headers.add({key:\"command\",value:\"healthcheck\"},true);}}';", "h += 'function setMuEdEvalReq(r,a,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(a!=null){var rf={};rf[k]=a;b.task={title:o.title||\"Evaluation Task\",referenceSolution:rf};}if(p&&Object.keys(p).length)b.configuration={params:p};if(o.user)b.user=o.user;if(o.criteria)b.criteria=o.criteria;if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildEvent(b,\"/evaluate\")));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify(b));pm.variables.set(\"requestUrl\",__base+\"/evaluate\");}}';", - "h += 'function setMuEdPreviewReq(r,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(p&&Object.keys(p).length)b.configuration={params:p};if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildEvent(b,\"/preview\")));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify(b));pm.variables.set(\"requestUrl\",__base+\"/preview\");}}';", + "h += 'function setMuEdPreviewReq(r,p,o){o=o||{};var t=o.type||\"MATH\",m={MATH:\"expression\",TEXT:\"text\",CODE:\"code\",MODEL:\"model\"},k=m[t]||\"value\",s={type:t,content:{}};s.content[k]=r;var b={submission:s};if(p&&Object.keys(p).length)b.configuration={params:p};b.preSubmissionFeedback={enabled:true};if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildEvent(b,\"/evaluate\")));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify(b));pm.variables.set(\"requestUrl\",__base+\"/evaluate\");}}';", "h += 'function setMuEdHealthReq(){if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildEvent({},\"/evaluate/health\")));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify({}));pm.variables.set(\"requestUrl\",__base+\"/evaluate/health\");}}';", "h += 'function setMuEdRawReq(body,path){if(__mode===\"local\"){pm.variables.set(\"lambdaEvent\",JSON.stringify(buildEvent(body,path)));pm.variables.set(\"requestUrl\",__base);}else{pm.variables.set(\"lambdaEvent\",JSON.stringify(body));pm.variables.set(\"requestUrl\",__base+path);}}';", "pm.globals.set('__helpers', h);", From 6df9710ad9584d2160f4e670e07702dad97953de Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Wed, 22 Apr 2026 09:38:15 +0100 Subject: [PATCH 6/8] Updated staging deploy workflow to use `deploy-request` instead of `deploy-request-on-dev`. --- .github/workflows/staging-deploy.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/staging-deploy.yml b/.github/workflows/staging-deploy.yml index ac4c312..b03a9ec 100644 --- a/.github/workflows/staging-deploy.yml +++ b/.github/workflows/staging-deploy.yml @@ -59,7 +59,7 @@ jobs: if-no-files-found: warn deploy: needs: test - uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@deploy-request-on-dev + uses: lambda-feedback/evaluation-function-workflows/.github/workflows/deploy.yml@deploy-request with: template-repository-name: "lambda-feedback/evaluation-function-boilerplate-python" build-file: "app/Dockerfile" From 5a73f4baba6a08b500a27f47d5174b3b6413d6cc Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Wed, 22 Apr 2026 16:03:54 +0100 Subject: [PATCH 7/8] Added extensive case-matching tests and feedback handling for Chunk 11 in Postman collection --- postman_collection.json | 318 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 318 insertions(+) diff --git a/postman_collection.json b/postman_collection.json index 9826186..2a67742 100644 --- a/postman_collection.json +++ b/postman_collection.json @@ -3586,6 +3586,324 @@ ] } ] + }, + { + "name": "Chunk 11 — Matched Case", + "item": [ + { + "name": "Legacy", + "item": [ + { + "name": "No match: matched_case absent", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "setLegacyEvalReq('x+1', 'x+2', {strict_syntax:false, cases:[{answer:'x+3', feedback:'Try x+3.'}]});" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('matched_case is absent', function () { pm.expect(r.result).to.not.have.property('matched_case'); });", + "pm.test('feedback is absent', function () { pm.expect(r.result).to.not.have.property('feedback'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + } + }, + { + "name": "First case match: matched_case is 0", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "setLegacyEvalReq('x+1', 'x+2', {strict_syntax:false, cases:[{answer:'x+1', feedback:'You entered x+1.'}]});" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('matched_case is 0', function () { pm.expect(r.result.matched_case).to.equal(0); });", + "pm.test('feedback is case message', function () { pm.expect(r.result.feedback).to.equal('You entered x+1.'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + } + }, + { + "name": "Second case match: matched_case is 1", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "setLegacyEvalReq('x+1', 'x+2', {strict_syntax:false, cases:[{answer:'x+3', feedback:'Not case 0.'},{answer:'x+1', feedback:'You entered x+1.'}]});" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('matched_case is 1', function () { pm.expect(r.result.matched_case).to.equal(1); });", + "pm.test('feedback is case 1 message', function () { pm.expect(r.result.feedback).to.equal('You entered x+1.'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + } + }, + { + "name": "Case mark override: is_correct overridden to true", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "setLegacyEvalReq('x+1', 'x+2', {strict_syntax:false, cases:[{answer:'x+1', feedback:'Close!', mark:1}]});" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('matched_case is 0', function () { pm.expect(r.result.matched_case).to.equal(0); });", + "pm.test('is_correct overridden to true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('feedback is case message', function () { pm.expect(r.result.feedback).to.equal('Close!'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + } + } + ] + }, + { + "name": "muEd", + "item": [ + { + "name": "No match: matchedCase is null", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "setMuEdEvalReq('x+1', 'x+2', {strict_syntax:false, cases:[{answer:'x+3', feedback:'Try x+3.'}]});" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", + "pm.test('matchedCase is null', function () { pm.expect(r[0].matchedCase).to.be.null; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + } + }, + { + "name": "First case match: matchedCase is 0", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "setMuEdEvalReq('100+100.1(j)', '100+100.1j', {atol:0,rtol:0,strict_syntax:false,physical_quantity:false,elementary_functions:true,cases:[{answer:'100+100.1(j)',params:{atol:0,rtol:0,strict_syntax:false,physical_quantity:false,elementary_functions:true},feedback:'Hello'}]});" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", + "pm.test('matchedCase is 0', function () { pm.expect(r[0].matchedCase).to.equal(0); });", + "pm.test('message is case feedback', function () { pm.expect(r[0].message).to.equal('Hello'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + } + }, + { + "name": "Second case match: matchedCase is 1", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "setMuEdEvalReq('x+1', 'x+2', {strict_syntax:false, cases:[{answer:'x+3', feedback:'Not case 0.'},{answer:'x+1', feedback:'This is case 1.'}]});" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('matchedCase is 1', function () { pm.expect(r[0].matchedCase).to.equal(1); });", + "pm.test('message is case 1 feedback', function () { pm.expect(r[0].message).to.equal('This is case 1.'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + } + }, + { + "name": "Correct: matchedCase is null", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "setMuEdEvalReq('x+1', 'x+1', {strict_syntax:false, cases:[{answer:'x+1', feedback:'Matched but not checked.'}]});" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('matchedCase is null', function () { pm.expect(r[0].matchedCase).to.be.null; });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + } + }, + { + "name": "Case mark override: awardedPoints is 1", + "event": [ + { + "listen": "prerequest", + "script": { + "type": "text/javascript", + "exec": [ + "eval(pm.globals.get('__helpers'));", + "setMuEdEvalReq('x+1', 'x+2', {strict_syntax:false, cases:[{answer:'x+1', feedback:'Close enough!', mark:1}]});" + ] + } + }, + { + "listen": "test", + "script": { + "type": "text/javascript", + "exec": [ + "var raw = pm.response.json();", + "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", + "pm.test('matchedCase is 0', function () { pm.expect(r[0].matchedCase).to.equal(0); });", + "pm.test('awardedPoints overridden to 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('message is case feedback', function () { pm.expect(r[0].message).to.equal('Close enough!'); });" + ] + } + } + ], + "request": { + "method": "POST", + "header": [{ "key": "Content-Type", "value": "application/json" }], + "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, + "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + } + } + ] + } + ] } ] } \ No newline at end of file From 87ee0ca8dca0d7c7187c4684910a83ceafb459ac Mon Sep 17 00:00:00 2001 From: Marcus Messer Date: Thu, 23 Apr 2026 12:14:09 +0100 Subject: [PATCH 8/8] Added tests for `responseLatex` and `responseSimplified` fields in Postman collection. --- postman_collection.json | 466 ++++++++++++++++++++++++++++++++-------- 1 file changed, 376 insertions(+), 90 deletions(-) diff --git a/postman_collection.json b/postman_collection.json index 2a67742..fd25029 100644 --- a/postman_collection.json +++ b/postman_collection.json @@ -215,7 +215,9 @@ "});", "pm.test('response first item exists', function () {", " pm.expect(r[0]).to.be.an('object');", - "});" + "});", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -383,7 +385,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -435,7 +439,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });" + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -487,7 +493,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -538,7 +546,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -589,7 +599,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -646,7 +658,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -698,7 +712,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });" + "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -750,7 +766,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -801,7 +819,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -852,7 +872,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -913,7 +935,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -964,7 +988,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });" + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -1015,7 +1041,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -1066,7 +1094,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });" + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -1122,7 +1152,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -1173,7 +1205,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });" + "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -1224,7 +1258,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -1275,7 +1311,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });" + "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -1337,7 +1375,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", - "pm.test('tag answer-response = 0_TRUE present', function () { pm.expect(r.result.tags).to.include('answer-response = 0_TRUE'); });" + "pm.test('tag answer-response = 0_TRUE present', function () { pm.expect(r.result.tags).to.include('answer-response = 0_TRUE'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -1388,7 +1428,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });" + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -1439,7 +1481,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -1491,7 +1535,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", - "pm.test('tag response proportional to answer_TRUE present', function () { pm.expect(r.result.tags).to.include('response proportional to answer_TRUE'); });" + "pm.test('tag response proportional to answer_TRUE present', function () { pm.expect(r.result.tags).to.include('response proportional to answer_TRUE'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -1543,7 +1589,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -1600,7 +1648,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", - "pm.test('tag answer-response = 0_TRUE present', function () { pm.expect(r[0].tags).to.include('answer-response = 0_TRUE'); });" + "pm.test('tag answer-response = 0_TRUE present', function () { pm.expect(r[0].tags).to.include('answer-response = 0_TRUE'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -1651,7 +1701,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });" + "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -1702,7 +1754,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -1754,7 +1808,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", - "pm.test('tag response proportional to answer_TRUE present', function () { pm.expect(r[0].tags).to.include('response proportional to answer_TRUE'); });" + "pm.test('tag response proportional to answer_TRUE present', function () { pm.expect(r[0].tags).to.include('response proportional to answer_TRUE'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -1806,7 +1862,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -1868,7 +1926,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", - "pm.test('tag response written as answer_TRUE present', function () { pm.expect(r.result.tags).to.include('response written as answer_TRUE'); });" + "pm.test('tag response written as answer_TRUE present', function () { pm.expect(r.result.tags).to.include('response written as answer_TRUE'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -1920,7 +1980,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", - "pm.test('tag response written as answer_FALSE present', function () { pm.expect(r.result.tags).to.include('response written as answer_FALSE'); });" + "pm.test('tag response written as answer_FALSE present', function () { pm.expect(r.result.tags).to.include('response written as answer_FALSE'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -1977,7 +2039,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('awardedPoints is true', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", - "pm.test('tag response written as answer_TRUE present', function () { pm.expect(r[0].tags).to.include('response written as answer_TRUE'); });" + "pm.test('tag response written as answer_TRUE present', function () { pm.expect(r[0].tags).to.include('response written as answer_TRUE'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -2029,7 +2093,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('awardedPoints is false', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", - "pm.test('tag response written as answer_FALSE present', function () { pm.expect(r[0].tags).to.include('response written as answer_FALSE'); });" + "pm.test('tag response written as answer_FALSE present', function () { pm.expect(r[0].tags).to.include('response written as answer_FALSE'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -2091,7 +2157,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -2143,7 +2211,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -2200,7 +2270,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -2252,7 +2324,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -2314,7 +2388,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", - "pm.test('tag UNIT_COMPARISON_IDENTICAL present', function () { pm.expect(r.result.tags).to.include('response matches answer_UNIT_COMPARISON_IDENTICAL'); });" + "pm.test('tag UNIT_COMPARISON_IDENTICAL present', function () { pm.expect(r.result.tags).to.include('response matches answer_UNIT_COMPARISON_IDENTICAL'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -2366,7 +2442,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", - "pm.test('tag UNIT_COMPARISON_SIMILAR present', function () { pm.expect(r.result.tags).to.include('response matches answer_UNIT_COMPARISON_SIMILAR'); });" + "pm.test('tag UNIT_COMPARISON_SIMILAR present', function () { pm.expect(r.result.tags).to.include('response matches answer_UNIT_COMPARISON_SIMILAR'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -2417,7 +2495,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });" + "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -2469,7 +2549,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", - "pm.test('tag MISSING_UNIT present', function () { pm.expect(r.result.tags).to.include('response matches answer_MISSING_UNIT'); });" + "pm.test('tag MISSING_UNIT present', function () { pm.expect(r.result.tags).to.include('response matches answer_MISSING_UNIT'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -2521,7 +2603,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", - "pm.test('tag DIMENSION_MATCH_FALSE present', function () { pm.expect(r.result.tags).to.include('response matches answer_DIMENSION_MATCH_FALSE'); });" + "pm.test('tag DIMENSION_MATCH_FALSE present', function () { pm.expect(r.result.tags).to.include('response matches answer_DIMENSION_MATCH_FALSE'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -2578,7 +2662,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", - "pm.test('tag UNIT_COMPARISON_IDENTICAL present', function () { pm.expect(r[0].tags).to.include('response matches answer_UNIT_COMPARISON_IDENTICAL'); });" + "pm.test('tag UNIT_COMPARISON_IDENTICAL present', function () { pm.expect(r[0].tags).to.include('response matches answer_UNIT_COMPARISON_IDENTICAL'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -2630,7 +2716,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", - "pm.test('tag UNIT_COMPARISON_SIMILAR present', function () { pm.expect(r[0].tags).to.include('response matches answer_UNIT_COMPARISON_SIMILAR'); });" + "pm.test('tag UNIT_COMPARISON_SIMILAR present', function () { pm.expect(r[0].tags).to.include('response matches answer_UNIT_COMPARISON_SIMILAR'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -2681,7 +2769,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });" + "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -2733,7 +2823,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", - "pm.test('tag MISSING_UNIT present', function () { pm.expect(r[0].tags).to.include('response matches answer_MISSING_UNIT'); });" + "pm.test('tag MISSING_UNIT present', function () { pm.expect(r[0].tags).to.include('response matches answer_MISSING_UNIT'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -2785,7 +2877,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", - "pm.test('tag DIMENSION_MATCH_FALSE present', function () { pm.expect(r[0].tags).to.include('response matches answer_DIMENSION_MATCH_FALSE'); });" + "pm.test('tag DIMENSION_MATCH_FALSE present', function () { pm.expect(r[0].tags).to.include('response matches answer_DIMENSION_MATCH_FALSE'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -2847,7 +2941,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -2899,7 +2995,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", - "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });" + "pm.test('is_correct is true', function () { pm.expect(r.result.is_correct).to.be.true; });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -2956,7 +3054,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -3008,7 +3108,9 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", - "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });" + "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -3070,7 +3172,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('command is eval', function () { pm.expect(r.command).to.equal('eval'); });", "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", - "pm.test('feedback is custom message', function () { pm.expect(r.result.feedback).to.equal('Try again!'); });" + "pm.test('feedback is custom message', function () { pm.expect(r.result.feedback).to.equal('Try again!'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } @@ -3127,7 +3231,9 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", - "pm.test('message is custom feedback', function () { pm.expect(r[0].message).to.equal('Try again!'); });" + "pm.test('message is custom feedback', function () { pm.expect(r[0].message).to.equal('Try again!'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } @@ -3588,7 +3694,7 @@ ] }, { - "name": "Chunk 11 — Matched Case", + "name": "Chunk 11 \u2014 Matched Case", "item": [ { "name": "Legacy", @@ -3615,16 +3721,36 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", "pm.test('matched_case is absent', function () { pm.expect(r.result).to.not.have.property('matched_case'); });", - "pm.test('feedback is absent', function () { pm.expect(r.result).to.not.have.property('feedback'); });" + "pm.test('feedback is absent', function () { pm.expect(r.result).to.not.have.property('feedback'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -3649,16 +3775,36 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('is_correct is false', function () { pm.expect(r.result.is_correct).to.be.false; });", "pm.test('matched_case is 0', function () { pm.expect(r.result.matched_case).to.equal(0); });", - "pm.test('feedback is case message', function () { pm.expect(r.result.feedback).to.equal('You entered x+1.'); });" + "pm.test('feedback is case message', function () { pm.expect(r.result.feedback).to.equal('You entered x+1.'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -3682,16 +3828,36 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('matched_case is 1', function () { pm.expect(r.result.matched_case).to.equal(1); });", - "pm.test('feedback is case 1 message', function () { pm.expect(r.result.feedback).to.equal('You entered x+1.'); });" + "pm.test('feedback is case 1 message', function () { pm.expect(r.result.feedback).to.equal('You entered x+1.'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -3716,16 +3882,36 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('matched_case is 0', function () { pm.expect(r.result.matched_case).to.equal(0); });", "pm.test('is_correct overridden to true', function () { pm.expect(r.result.is_correct).to.be.true; });", - "pm.test('feedback is case message', function () { pm.expect(r.result.feedback).to.equal('Close!'); });" + "pm.test('feedback is case message', function () { pm.expect(r.result.feedback).to.equal('Close!'); });", + "pm.test('result.response_latex is a string', function () { pm.expect(r.result.response_latex).to.be.a('string'); });", + "pm.test('result.response_simplified is a string', function () { pm.expect(r.result.response_simplified).to.be.a('string'); });" ] } } ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ] @@ -3755,16 +3941,36 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('awardedPoints is 0', function () { pm.expect(r[0].awardedPoints).to.equal(0); });", - "pm.test('matchedCase is null', function () { pm.expect(r[0].matchedCase).to.be.null; });" + "pm.test('matchedCase is null', function () { pm.expect(r[0].matchedCase).to.be.null; });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -3789,16 +3995,36 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('response is an array', function () { pm.expect(r).to.be.an('array'); });", "pm.test('matchedCase is 0', function () { pm.expect(r[0].matchedCase).to.equal(0); });", - "pm.test('message is case feedback', function () { pm.expect(r[0].message).to.equal('Hello'); });" + "pm.test('message is case feedback', function () { pm.expect(r[0].message).to.equal('Hello'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -3822,16 +4048,36 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('matchedCase is 1', function () { pm.expect(r[0].matchedCase).to.equal(1); });", - "pm.test('message is case 1 feedback', function () { pm.expect(r[0].message).to.equal('This is case 1.'); });" + "pm.test('message is case 1 feedback', function () { pm.expect(r[0].message).to.equal('This is case 1.'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -3855,16 +4101,36 @@ "var raw = pm.response.json();", "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('awardedPoints is 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", - "pm.test('matchedCase is null', function () { pm.expect(r[0].matchedCase).to.be.null; });" + "pm.test('matchedCase is null', function () { pm.expect(r[0].matchedCase).to.be.null; });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } }, { @@ -3889,16 +4155,36 @@ "var r = (raw.body !== undefined) ? JSON.parse(raw.body) : raw;", "pm.test('matchedCase is 0', function () { pm.expect(r[0].matchedCase).to.equal(0); });", "pm.test('awardedPoints overridden to 1', function () { pm.expect(r[0].awardedPoints).to.equal(1); });", - "pm.test('message is case feedback', function () { pm.expect(r[0].message).to.equal('Close enough!'); });" + "pm.test('message is case feedback', function () { pm.expect(r[0].message).to.equal('Close enough!'); });", + "pm.test('responseLatex is a string', function () { pm.expect(r[0].responseLatex).to.be.a('string'); });", + "pm.test('responseSimplified is a string', function () { pm.expect(r[0].responseSimplified).to.be.a('string'); });" ] } } ], "request": { "method": "POST", - "header": [{ "key": "Content-Type", "value": "application/json" }], - "body": { "mode": "raw", "raw": "{{lambdaEvent}}", "options": { "raw": { "language": "json" } } }, - "url": { "raw": "{{requestUrl}}", "host": ["{{requestUrl}}"] } + "header": [ + { + "key": "Content-Type", + "value": "application/json" + } + ], + "body": { + "mode": "raw", + "raw": "{{lambdaEvent}}", + "options": { + "raw": { + "language": "json" + } + } + }, + "url": { + "raw": "{{requestUrl}}", + "host": [ + "{{requestUrl}}" + ] + } } } ]