|
@@ -40,14 +40,14 @@
|
|
|
|
|
|
@property (nonatomic, assign) BOOL cancleAlert;
|
|
|
|
|
|
-@property (nonatomic, assign) BOOL isQuitRoom; // 是否正在退出房间
|
|
|
-
|
|
|
@property (nonatomic, assign) BOOL hasShowAlert;
|
|
|
|
|
|
@property (nonatomic, assign) BOOL isSwitchLine; // 是否线路切换
|
|
|
|
|
|
@property (nonatomic, strong) KSTipsView *tipsView;
|
|
|
|
|
|
+@property (nonatomic, assign) BOOL isKick; // 老师踢出学生
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation ClassroomViewController
|
|
@@ -95,12 +95,11 @@
|
|
|
[self.view addGestureRecognizer:tapGes];
|
|
|
tapGes.delegate = self;
|
|
|
[self showRoleHud];
|
|
|
- self.isQuitRoom = NO;
|
|
|
+ self.isKick = NO;
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(backgroundQuitRoomAction) name:@"backgroundQuit" object:nil];
|
|
|
}
|
|
|
|
|
|
- (void)backgroundQuitRoomAction {
|
|
|
- self.isQuitRoom = YES;
|
|
|
self.isSwitchLine = NO;
|
|
|
[[RoomLoginHelper sharedInstance] logout:^{
|
|
|
} error:^(RongRTCCode code) {
|
|
@@ -111,7 +110,6 @@
|
|
|
#pragma mark ----- 账号异地登陆
|
|
|
- (void)leaveRoomAction {
|
|
|
[self.tipsView showTipsMessage:@"该账号在其他地方登录" inView:self.view];
|
|
|
- self.isQuitRoom = YES;
|
|
|
self.isSwitchLine = NO;
|
|
|
[[RoomLoginHelper sharedInstance] logout:^{
|
|
|
} error:^(RongRTCCode code) {
|
|
@@ -215,7 +213,6 @@
|
|
|
{
|
|
|
[KSNormalAlertView ks_showAlertWithTitle:@"确认退出课堂吗?" leftTitle:@"取消" rightTitle:@"确认" cancel:^{
|
|
|
} confirm:^{
|
|
|
- self.isQuitRoom = YES;
|
|
|
SealClassLog(@"ActionTagHangup");
|
|
|
self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
[[RoomLoginHelper sharedInstance] logout:^{
|
|
@@ -317,6 +314,14 @@
|
|
|
}];
|
|
|
}
|
|
|
}
|
|
|
+ else if (_isKick) { // 退出房间,但是不dismiss
|
|
|
+ [[KSRemoteUserManager shareInstance] removeAllUser];
|
|
|
+ if ([RTCService sharedInstance].rtcRoom) {
|
|
|
+ [[RTCService sharedInstance] leaveRongRTCRoom:[ClassroomService sharedService].currentRoom.roomId success:^{
|
|
|
+ } error:^(RongRTCCode code) {
|
|
|
+ }];
|
|
|
+ }
|
|
|
+ }
|
|
|
else {
|
|
|
[[KSRemoteUserManager shareInstance] removeAllUser];
|
|
|
if ([RTCService sharedInstance].rtcRoom) {
|
|
@@ -361,8 +366,12 @@
|
|
|
RoomMember *curMember = [ClassroomService sharedService].currentRoom.currentMember;
|
|
|
[[ClassroomService sharedService].currentRoom removeMemeber:member];
|
|
|
if ([curMember.userId isEqualToString:member.userId]) {
|
|
|
+ self.isKick = YES;
|
|
|
+ [[RoomLoginHelper sharedInstance] logout:^{
|
|
|
+ } error:^(RongRTCCode code) {
|
|
|
+ }];
|
|
|
[KSNormalAlertView ks_showAlertWithTitle:@"恭喜您,考试已结束,请耐心等待考试结果。" confirmTitle:@"退出考场" confirm:^{
|
|
|
- [self roomDidLeave];
|
|
|
+ [self dismissClassroom];
|
|
|
}];
|
|
|
return;
|
|
|
}
|
|
@@ -383,23 +392,17 @@
|
|
|
NSLog(@"memberRecordAction %@", member);
|
|
|
RoomMember *curMember = [ClassroomService sharedService].currentRoom.currentMember;
|
|
|
if ([curMember.userId isEqualToString:member.userId]) {
|
|
|
+ self.isKick = YES;
|
|
|
+ [[RoomLoginHelper sharedInstance] logout:^{
|
|
|
+ } error:^(RongRTCCode code) {
|
|
|
+ }];
|
|
|
// 弹窗提示去录播
|
|
|
[KSNormalAlertView ks_showAlertWithTitle:@"当前在线直播考试无法正常完成\n主考官建议您使用录播进行考试" leftTitle:@"取消" rightTitle:@"去录播" cancel:^{
|
|
|
// 离开教室
|
|
|
- self.isQuitRoom = YES;
|
|
|
- self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
- [[RoomLoginHelper sharedInstance] logout:^{
|
|
|
- } error:^(RongRTCCode code) {
|
|
|
- [self.hud hideAnimated:YES];
|
|
|
- }];
|
|
|
+ [self dismissClassroom];
|
|
|
} confirm:^{
|
|
|
// 去录播
|
|
|
- self.isQuitRoom = YES;
|
|
|
- self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
- [[RoomLoginHelper sharedInstance] logout:^{
|
|
|
- } error:^(RongRTCCode code) {
|
|
|
- [self.hud hideAnimated:YES];
|
|
|
- }];
|
|
|
+ [self dismissClassroom];
|
|
|
[[NSNotificationCenter defaultCenter] postNotificationName:RecordExamNotification object:nil];
|
|
|
}];
|
|
|
}
|
|
@@ -417,14 +420,12 @@
|
|
|
NSLog(@"memberRecordAction %@", member);
|
|
|
RoomMember *curMember = [ClassroomService sharedService].currentRoom.currentMember;
|
|
|
if ([curMember.userId isEqualToString:member.userId]) {
|
|
|
+ [[RoomLoginHelper sharedInstance] logout:^{
|
|
|
+ } error:^(RongRTCCode code) {
|
|
|
+ }];
|
|
|
[KSNormalAlertView ks_showAlertWithTitle:@"考官已将你移出教室,请检查设备及网络状态正常后再次签到考试" confirmTitle:@"确定" confirm:^{
|
|
|
// 离开教室
|
|
|
- self.isQuitRoom = YES;
|
|
|
- self.hud = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
|
|
|
- [[RoomLoginHelper sharedInstance] logout:^{
|
|
|
- } error:^(RongRTCCode code) {
|
|
|
- [self.hud hideAnimated:YES];
|
|
|
- }];
|
|
|
+ [self dismissClassroom];
|
|
|
}];
|
|
|
}
|
|
|
}
|