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

Function getCurrentClassroom

app/core/store/modules/teacherDashboard.js:183–196  ·  view source on GitHub ↗
(state, _getters, _rootState, rootGetters)

Source from the content-addressed store, hash-verified

181 ]
182 },
183 getCurrentClassroom (state, _getters, _rootState, rootGetters) {
184 if (state.teacherId && state.classroomId) {
185 const classrooms = [
186 ...(rootGetters['classrooms/getActiveClassroomsByTeacher'](state.teacherId) || []),
187 ...(rootGetters['classrooms/getSharedClassroomsByTeacher'](state.teacherId) || []),
188 ]
189 if (!classrooms || classrooms.length === 0) {
190 return rootGetters['classrooms/getClassroomById'](state.classroomId) || {}
191 }
192 return classrooms.find((c) => c._id === state.classroomId) || {}
193 } else {
194 return {}
195 }
196 },
197 getCoursesCurrentClassroom (state, getters, _rootState, rootGetters) {
198 if (state.classroomId) {
199 const classroom = getters.getCurrentClassroom

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected