MCPcopy Create free account
hub / github.com/codecombat/codecombat / putSession

Function putSession

ozaria/site/api/interactive.js:79–95  ·  view source on GitHub ↗
(idOrSlug, options = {})

Source from the content-addressed store, hash-verified

77 * @param {'javascript'|'python'} options.json.codeLanguage - session language
78 */
79export const putSession = (idOrSlug, options = {}) => {
80 if (!idOrSlug) {
81 throw new Error('No slug/id supplied')
82 }
83 if (!(options.json || {}).codeLanguage) {
84 throw new Error('CodeLanguage required to post interactive submission')
85 }
86 if (!(options.json || {}).submission) {
87 throw new Error('Need to post a submission')
88 }
89
90 return fetchJson(`/db/interactive/${idOrSlug}/submission`, {
91 method: 'POST',
92
93 ...options
94 })
95}
96
97export const fetchInteractiveSessionForAllClassroomMembers = (classroom, options = {}) => {
98 const limit = 10

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected