Skip to content

Commit a5703bd

Browse files
committed
Enabled pre-submission feedback support in Postman collection for MuEd evaluation and preview requests.
1 parent 0636a11 commit a5703bd

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

postman_collection.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,14 @@
3333
"h += 'function buildLegacyEvalEvent(r,a,p){return buildEvent({response:r,answer:a,params:p||{}},\"/\");}';",
3434
"h += 'function buildLegacyPreviewEvent(r,p){var e=buildEvent({response:r,params:p||{}},\"/\");e.headers[\"command\"]=\"preview\";return e;}';",
3535
"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\");}';",
36-
"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\");}';",
36+
"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\");}';",
3737
"h += 'var __mode=pm.collectionVariables.get(\"mode\")||\"local\";';",
3838
"h += 'var __base=pm.collectionVariables.get(\"baseUrl\");';",
3939
"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);}}';",
4040
"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\"});}}';",
4141
"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);}}';",
4242
"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\");}}';",
43-
"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\");}}';",
43+
"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\");}}';",
4444
"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\");}}';",
4545
"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);}}';",
4646
"pm.globals.set('__helpers', h);",

0 commit comments

Comments
 (0)