Skip to main content

How to leave a flexible classroom?

In Flexible Classroom, the teacher can click Leave Classroom to temporarily exit the session without changing the room status. To officially end the class, follow these steps:

  1. The teacher calls the leaveClassroom method to exit the classroom:


    _1
    this.classroomStore.connectionStore.leaveClassroom(LeaveReason.leave);

    The ClassState reflects the following states:


    _6
    ClassState {
    _6
    beforeClass: 0, // Class has not started
    _6
    ongoing: 1, // Class is ongoing
    _6
    afterClass: 2, // Class has ended, but the classroom still exists
    _6
    close: 3 // Classroom is closed
    _6
    }

  2. To actively end the room, call the room status update interface RoomStore:updateClassState:


    _2
    // End the room
    _2
    this.classroomStore.roomStore.updateClassState(ClassState.close);

  3. To end the course without direct interaction, call Flexible Classroom backend RESTful interface Set Classroom Status. Set the class status to one of the following values:

    • 0: Not started
    • 1: In progress
    • 2: Ended. The class time has elapsed, but users can join and remain during the extended time.
    • 3: Closed. The class is closed after the extended time, and all users are removed and cannot rejoin.
vundefined