BJLRoomVM.h 30.5 KB
Newer Older
root's avatar
1.0.0  
root committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14
//
//  BJLRoomVM.h
//  BJLiveCore
//
//  Created by MingLQ on 2016-12-05.
//  Copyright © 2016 BaijiaYun. All rights reserved.
//

#import "BJLBaseVM.h"

#import "BJLRoomInfo.h"
#import "BJLUser.h"
#import "BJLNotice.h"
#import "BJLSurvey.h"
戴曦嘉's avatar
戴曦嘉 committed
15
#import "BJLQuestion.h"
huangjie's avatar
source  
huangjie committed
16 17 18
#import "BJLAnswerSheet.h"
#import "BJLQuiz.h"
#import "BJLEnvelopeResult.h"
戴曦嘉's avatar
2.3.0  
戴曦嘉 committed
19
#import "BJLLamp.h"
20
#import "BJLLottery.h"
root's avatar
1.0.0  
root committed
21 22 23

NS_ASSUME_NONNULL_BEGIN

huangjie's avatar
注释  
huangjie committed
24
/** 专业版小班课教室布局 */
戴曦嘉's avatar
戴曦嘉 committed
25
typedef NS_ENUM(NSInteger, BJLRoomLayout) {
huangjie's avatar
注释  
huangjie committed
26 27 28 29
    /** 画廊布局 */
    BJLRoomLayout_gallary = 1,
    /** 板书布局 */
    BJLRoomLayout_blackboard = 2
戴曦嘉's avatar
戴曦嘉 committed
30 31
};

root's avatar
1.0.0  
root committed
32 33 34 35 36 37
/** ### 教室信息、状态,用户信息,公告等 */
@interface BJLRoomVM : BJLBaseVM

/** 进入教室时间 */
@property (nonatomic, readonly) NSTimeInterval enteringTimeInterval; // seconds since 1970

戴曦嘉's avatar
戴曦嘉 committed
38 39 40 41 42 43
/**
 大班课 - 视频与 PPT 切换位置
 #param videoInMainPosition 视频是否切换到主位
 */
- (BJLObservable)didVideoExchangePositonWithPPT:(BOOL)videoInMainPosition;

戴曦嘉's avatar
2.5.0  
戴曦嘉 committed
44 45
- (nullable BJLError *)exchangeVideoPositonWithPPT:(BOOL)videoInMainPosition;

root's avatar
1.0.0  
root committed
46 47 48 49 50
#pragma mark - 上课状态

/** 上课状态 */
@property (nonatomic, readonly) BOOL liveStarted;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
51 52
/**
 老师: 设置上课状态
root's avatar
1.0.0  
root committed
53 54
 #discussion 设置成功后修改 `liveStarted`
 #param liveStarted YES:上课,NO:下课
root's avatar
update  
root committed
55
 #return BJLError:
root's avatar
1.0.0  
root committed
56 57 58 59
 BJLErrorCode_invalidUserRole   错误权限,要求老师权限
 */
- (nullable BJLError *)sendLiveStarted:(BOOL)liveStarted;

戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
60
/** 实际上课开始时间(单位: 毫秒) */
戴曦嘉's avatar
戴曦嘉 committed
61 62
@property (nonatomic, readonly) NSTimeInterval classStartTimeMillisecond;

戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
63
/** 理论排课开始时间(单位: 秒) */
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
64 65
@property (nonatomic, readonly) NSTimeInterval classStartTimesecond;

huangjie's avatar
source  
huangjie committed
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94
#pragma mark - 助教权限

/** 助教上麦权限 */
- (BOOL)getAssistantaAuthorityWithSpeak;

/** 助教画笔权限 */
- (BOOL)getAssistantaAuthorityWithPainter;

/** 助教文档操作权限 */
- (BOOL)getAssistantaAuthorityWithDocumentControl;

/** 助教上传文档权限 */
- (BOOL)getAssistantaAuthorityWithDocumentUpload;

/** 助教发布公告权限 */
- (BOOL)getAssistantaAuthorityWithNotice;

/** 助教禁言与踢出房间权限 */
- (BOOL)getAssistantaAuthorityWithForbidandKick;

/** 助教上下课权限 */
- (BOOL)getAssistantaAuthorityWithClassStartEnd;

/** 助教云端录制权限 */
- (BOOL)getAssistantaAuthorityWithCloudRecord;

/** 收到助教权限变化 */
- (BJLObservable)didReceiveAssistantaAuthorityChanged;

root's avatar
1.0.0  
root committed
95 96 97 98 99
#pragma mark - 公告

/** 教室公告 */
@property (nonatomic, readonly, copy, nullable) BJLNotice *notice;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
100 101
/**
 获取教室公告
root's avatar
1.0.0  
root committed
102 103 104 105
 #discussion 连接教室后、掉线重新连接后自动调用加载
 #discussion 获取成功后修改 `notice`
 */
- (void)loadNotice;
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
106 107
/**
 老师: 设置教室公告
root's avatar
1.0.0  
root committed
108 109 110 111 112
 #discussion 最多 BJLTextMaxLength_notice 个字符
 #discussion `noticeText` = `noticeText.length` ? `noticeText` : `linkURL.absoluteString`
 #discussion 设置成功后修改 `notice`
 #param noticeText 公告文字内容
 #param linkURL 公告跳转链接
root's avatar
update  
root committed
113
 #return BJLError:
root's avatar
1.0.0  
root committed
114 115 116
 BJLErrorCode_invalidArguments  错误参数,如字数超过 `BJLTextMaxLength_notice`;
 BJLErrorCode_invalidUserRole   错误权限,要求老师或助教权限。
 */
戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
117 118
- (nullable BJLError *)sendNoticeWithText:(nullable NSString *)noticeText
                                  linkURL:(nullable NSURL *)linkURL;
root's avatar
1.0.0  
root committed
119

root's avatar
1.3.3  
root committed
120 121
#pragma mark - 跑马灯

戴曦嘉's avatar
2.3.0  
戴曦嘉 committed
122 123 124
/** 跑马灯内容 <包括文本内容,文本颜色,字体大小, 透明度> */
@property (nonatomic, readonly, copy, nullable) BJLLamp *lamp;

root's avatar
1.3.3  
root committed
125
/** 跑马灯内容 */
戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
126
@property (nonatomic, readonly, copy, nullable) NSString *lampContent DEPRECATED_MSG_ATTRIBUTE("use `lamp.content` instead");;
root's avatar
1.3.3  
root committed
127

戴曦嘉's avatar
2.3.0  
戴曦嘉 committed
128 129 130 131
#pragma mark - 课后评价

- (nullable NSURLRequest *)evaluationRequest;

root's avatar
1.0.0  
root committed
132 133
#pragma mark - 点名

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
134 135
/**
 点名倒计时
root's avatar
1.0.0  
root committed
136 137 138 139
 #discussion 每秒更新
 */
@property (nonatomic, readonly) NSTimeInterval rollcallTimeRemaining;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
140 141
/**
 学生: 收到点名
root's avatar
1.0.0  
root committed
142 143 144 145 146 147
 #discussion 学生需要在规定时间内 `timeout` 答到 - 调用 `answerToRollcall`
 #discussion 参考 `rollcallTimeRemaining`
 #param timeout 超时时间
 */
- (BJLObservable)didReceiveRollcallWithTimeout:(NSTimeInterval)timeout;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
148 149
/**
 学生: 收到点名取消
root's avatar
1.0.0  
root committed
150 151 152 153 154
 #discussion 可能是老师取消、或者倒计时结束
 #discussion 参考 `rollcallTimeRemaining`
 */
- (BJLObservable)rollcallDidFinish;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
155 156
/**
 学生: 答到
root's avatar
update  
root committed
157
 #return BJLError:
root's avatar
1.0.0  
root committed
158
 BJLErrorCode_invalidCalling    错误调用,如老师没有点名或者点名已过期;
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
159
 BJLErrorCode_invalidUserRole   错误权限,要求非试听学生权限。
root's avatar
1.0.0  
root committed
160 161 162
 */
- (nullable BJLError *)answerToRollcall;

戴曦嘉's avatar
2.7.0  
戴曦嘉 committed
163 164 165 166
#pragma mark - 专注度检测

- (BJLObservable)didReceiveAttentionWarning:(NSString *)warning;

戴曦嘉's avatar
戴曦嘉 committed
167 168
#pragma mark - 点赞

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
169 170
/**
 个人点赞数据
戴曦嘉's avatar
戴曦嘉 committed
171 172 173 174 175
 #discussion key --> userNumber
 #discussion value --> 点赞数
 */
@property (nonatomic, readonly, nullable) NSDictionary<NSString *, NSNumber *> *likeList;

戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
176 177 178 179 180 181 182 183 184 185 186 187
/**
 个人点赞数据-多种奖励方式
 #discussion key --> userNumber
 #discussion value --> dic, { "key" : "key对应类型的奖励数目" }
*/
@property (nonatomic, readonly, nullable) NSDictionary<NSString *, NSDictionary *> *mutableAwardsInfo;

/**
  个人点赞数据-多种奖励方式, 具体的奖励方式的key值.  奖励方式由后台配置, 参考 BJLAward
 */
@property (nonatomic, readonly) NSString *awardKey;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
188 189 190 191 192 193 194
/**
 分组点赞数据
 #discussion key --> groupID
 #discussion value --> 点赞数
 */
@property (nonatomic, readonly, nullable) NSDictionary<NSNumber *, NSNumber *> *grouplikeList;

戴曦嘉's avatar
戴曦嘉 committed
195 196 197 198 199
/**
 点赞
 #param userNumber userNumber
 #return error:
 BJLErrorCode_invalidCalling    错误调用,如用户不在线;
戴曦嘉's avatar
戴曦嘉 committed
200
 BJLErrorCode_invalidUserRole   错误权限,如点赞用户不能是学生,被点赞用户不能是老师,助教。
戴曦嘉's avatar
戴曦嘉 committed
201 202 203
 */
- (nullable BJLError *)sendLikeForUserNumber:(NSString *)userNumber;

戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
204 205 206 207 208 209 210 211 212 213
/**
 多种点赞方式
 #param userNumber userNumber
 #param key 多种奖励方式对应的key
 #return error:
 BJLErrorCode_invalidCalling    错误调用,如用户不在线;
 BJLErrorCode_invalidUserRole   错误权限,如点赞用户不能是学生,被点赞用户不能是老师,助教。
*/
- (nullable BJLError *)sendLikeForUserNumber:(NSString *)userNumber key:(nullable NSString *)key;

戴曦嘉's avatar
戴曦嘉 committed
214
/**
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
215
 个人点赞覆盖更新
戴曦嘉's avatar
戴曦嘉 committed
216 217
 #discussion 覆盖更新时调用,增量更新时不调用
 #discussion 首次连接 server,断开重连,下课,会导致覆盖更新
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
218
 #discussion 下课不会清空所有点赞
戴曦嘉's avatar
戴曦嘉 committed
219 220 221 222 223
 #param records 点赞记录 key --> user number, value --> 点赞数
 */
- (BJLObservable)likeRecordsDidOverwrite:(NSDictionary<NSString *, NSNumber *> *)records;

/**
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
224
 收到个人点赞
戴曦嘉's avatar
戴曦嘉 committed
225
 #discussion 收到的所有点赞都在点赞记录中,包括本次收到的点赞
戴曦嘉's avatar
戴曦嘉 committed
226
 #param userNumber userNumber
戴曦嘉's avatar
戴曦嘉 committed
227
 #param records 点赞记录 key --> userNumber,value --> 点赞数
戴曦嘉's avatar
戴曦嘉 committed
228 229 230
 */
- (BJLObservable)didReceiveLikeForUserNumber:(NSString *)userNumber records:(NSDictionary<NSString *, NSNumber *> *)records;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
231
/**
戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
232 233 234
 收到一次分组点赞/台上用户点赞
 #discussion groupID 为 0 表示台上成员的点赞,非0表示分组点赞,非 0 时 groupName 为分组名
 #param groupID = 0 时,表示给台上成员的点赞,计入台上个人点赞数量,同时触发`likeRecordsDidOverwrite:`
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
235 236 237 238 239 240 241 242 243 244
 */
- (BJLObservable)didReceiveLikeForGroupID:(NSInteger)groupID groupName:(nullable NSString *)groupName;

/**
 批量点赞数据更新
 #discussion 批量点赞的数据不包含个人点赞数据
 #param groupInfo 分组点赞的记录 key -> groupID, value -> 该组点赞数
 */
- (BJLObservable)likeRecordsDidOverwriteWithGoupLikeInfos:(NSDictionary<NSNumber *, NSNumber *> *)groupInfo;

huangjie's avatar
source  
huangjie committed
245 246 247 248 249 250 251 252 253 254
#pragma mark - 红包雨

/**
 创建红包雨
 #param amount 红包总数
 #param score 学分总数
 #param duration 红包雨时长
 #param completion 红包雨活动ID
 #return task
 */
戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
255 256 257 258
- (nullable NSURLSessionDataTask *)createEnvelopeRainWithAmount:(NSInteger)amount
                                                          score:(NSInteger)score
                                                       duration:(NSInteger)duration
                                                     completion:(nullable void (^)(NSInteger envelopeID, BJLError * _Nullable error))completion;
huangjie's avatar
source  
huangjie committed
259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277

/**
 抢红包
 #discussion 活动结束时,completion 也返回 0,并且没有 task
 #param envelopeID 红包雨活动ID
 #param completion 抢到的学分
 #return task
 */
- (nullable NSURLSessionDataTask *)grapEnvelopeWithID:(NSInteger)envelopeID completion:(nullable void (^)(NSInteger score, BJLError * _Nullable error))completion;

/**
 获取学生抢到的学分总数
 #param userNumber user number
 #param completion 学分总数
 #return task
 */
- (nullable NSURLSessionDataTask *)requestTotalScoreWithUserNumber:(NSString *)userNumber completion:(nullable void (^)(NSInteger totalScore, BJLError * _Nullable error))completion;

/**
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
278
 获取指定红包雨活动的最终结果
huangjie's avatar
source  
huangjie committed
279 280 281 282 283 284 285
 #param envelopeID 红包雨活动ID
 #param completion completion 红包雨活动结果
 #return task
 */
- (nullable NSURLSessionDataTask *)requestResultWithEnvelopeID:(NSInteger)envelopeID completion:(nullable void (^)(BJLEnvelopeResult * _Nullable result, BJLError * _Nullable error))completion;

/**
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
286
 获取指定红包雨活动的排行榜
huangjie's avatar
source  
huangjie committed
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307
 #param envelopeID envelopeID
 #param completion completion 排行榜数据
 #return task
 */
- (nullable NSURLSessionDataTask *)requestRankListWithEnvelopeID:(NSInteger)envelopeID completion:(nullable void (^)(NSArray<BJLEnvelopeRank *> * _Nullable, BJLError * _Nullable))completion;

/**
 开始红包雨
 #param envelopeID 红包雨活动ID
 #param duration 红包雨时长
 #return error
 */
- (nullable BJLError *)startEnvelopRainWithID:(NSInteger)envelopeID duration:(NSInteger)duration;

/**
 收到红包雨
 #param envelopeID 红包雨活动ID
 #param duration 红包雨时长
 */
- (BJLObservable)didStartEnvelopRainWithID:(NSInteger)envelopeID duration:(NSInteger)duration;

308 309 310
/** 红包雨结束 */
- (BJLObservable)didFinishEnvelopRainWithID:(NSInteger)envelopeID;

root's avatar
1.0.0  
root committed
311 312
#pragma mark - 测验

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
313 314
/**
 请求历史题目
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
315 316 317
 BJLErrorCode_invalidUserRole   错误权限,要求非试听学生权限。
 */
- (nullable BJLError *)loadSurveyHistory;
root's avatar
1.0.0  
root committed
318

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
319 320
/**
 收到历史题目以及当前用户的答题情况
root's avatar
1.0.0  
root committed
321 322 323 324 325 326 327 328
 #param surveyHistory 历史题目
 #param rightCount 回答正确个数
 #param wrongCount 回答错误个数
 */
- (BJLObservable)didReceiveSurveyHistory:(NSArray<BJLSurvey *> *)surveyHistory
                              rightCount:(NSInteger)rightCount
                              wrongCount:(NSInteger)wrongCount;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
329 330
/**
 老师: 发送题目 - 暂未实现
root's avatar
update  
root committed
331
 #return BJLError:
root's avatar
1.0.0  
root committed
332 333 334 335
 BJLErrorCode_invalidArguments  错误参数;
 BJLErrorCode_invalidUserRole   错误权限,要求老师或助教权限。
 - (nullable BJLError *)sendSurvey:(BJLSurvey *)survey; */

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
336 337
/**
 学生: 收到新题目
root's avatar
1.0.0  
root committed
338 339 340 341 342 343 344 345 346
 #param survey 题目
 */
- (BJLObservable)didReceiveSurvey:(BJLSurvey *)survey;

/**
 学生: 答题
 #param answers `BJLSurveyOption` 的 `key`
 #param result   与每个 `BJLSurveyOption` 的 `isAnswer` 比对得出,如果一个题目下所有 `BJLSurveyOption` 的 `isAnswer` 都是 NO 表示此题目没有标准答案
 #param order   `BJLSurvey` 的 `order`
root's avatar
update  
root committed
347
 #return BJLError:
root's avatar
1.0.0  
root committed
348 349 350 351 352 353 354
 BJLErrorCode_invalidArguments  错误参数;
 BJLErrorCode_invalidUserRole   错误权限,要求老师或助教权限。
 */
- (nullable BJLError *)sendSurveyAnswers:(NSArray<NSString *> *)answers
                                  result:(BJLSurveyResult)result
                                   order:(NSInteger)order;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
355 356
/**
 收到答题统计
root's avatar
1.0.0  
root committed
357 358 359 360 361 362
 #param results `NSDictionary` 的 key-value 分别是 `BJLSurveyOption` 的 `key` 和选择该选项的人数
 #param order   `BJLSurvey` 的 `order`
 */
- (BJLObservable)didReceiveSurveyResults:(NSDictionary<NSString *, NSNumber *> *)results
                                   order:(NSInteger)order;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
363 364
/**
 老师: 收到答题用户统计 - 暂未实现
root's avatar
1.0.0  
root committed
365 366 367 368 369
 #param results `NSDictionary` 的 key-value 分别是 `BJLSurveyOption` 的 `key` 和选择该选项的名单
 #param order   `BJLSurvey` 的 `order`
- (BJLObservable)didReceiveSurveyUserResults:(NSDictionary<NSString *, NSArray<NSString *> *> *)results
                                       order:(NSInteger)order; */

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
370
/** 学生: 收到答题结束 */
root's avatar
1.3.8  
root committed
371 372
- (BJLObservable)didFinishSurvey;

huangjie's avatar
source  
huangjie committed
373
#pragma mark - 测验 V2 h5 方式
root's avatar
1.0.0  
root committed
374 375

/**
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
376
 测验 V2 h5 方式
root's avatar
1.0.0  
root committed
377
 #return BJLError:
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
378
 BJLErrorCode_invalidUserRole   试听学生不能使用测验
root's avatar
1.0.0  
root committed
379 380 381 382
 BJLErrorCode_invalidCalling    错误调用
 */
- (nullable BJLError *)sendQuizMessage:(NSDictionary<NSString *, id> *)message;
- (BJLObservable)didReceiveQuizMessage:(NSDictionary<NSString *, id> *)message;
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
383
- (nullable NSURLRequest *)quizRequestWithID:(NSString *)quizID error:(NSError *__autoreleasing *)error;
戴曦嘉's avatar
戴曦嘉 committed
384 385
// customView: h5定制版测验
- (nullable NSURLRequest *)quizRequestWithID:(NSString *)quizID customView:(nullable NSString *)customView error:(NSError *__autoreleasing *)error;
root's avatar
1.0.0  
root committed
386

huangjie's avatar
source  
huangjie committed
387 388
#pragma mark - 测验 V2 native 方式

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
389 390 391 392
/**
 当前的新版测验状态列表
 #discussion key -> 测验 ID,value -> 测验状态(参考 `BJLQuizState`),测验的先后根据测验 ID 从小到大对应
 */
huangjie's avatar
source  
huangjie committed
393 394
@property (nonatomic, readonly, nullable) NSDictionary<NSString *, NSNumber *> *quizStateList;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
395 396 397 398
/**
 正在进行的测验
 #discussion 至多只有一个测验正在进行,如果没有正在进行的测验,值为空
 */
huangjie's avatar
source  
huangjie committed
399 400 401 402 403 404 405 406 407 408 409 410
@property (nonatomic, readonly, nullable) NSString *currentQuizID;

/**
 加载测验列表
 #param completion quizList 仅 quiz ID,title,state 可用
 #return task
 */
- (nullable NSURLSessionDataTask *)loadQuizListWithCompletion:(nullable void (^)(NSArray<BJLQuiz *> * _Nullable quizList, BJLError * _Nullable error))completion;

/**
 新建,更新测验,老师或助教身份
 #discussion 创建新测验,测验 ID 使用 0,否则更新测验
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
411 412
 #param quiz 测验内容,参考 `BJLQuiz`
 #param completion 测验 ID
huangjie's avatar
source  
huangjie committed
413 414 415 416 417 418
 #return task
 */
- (nullable NSURLSessionDataTask *)updateQuiz:(BJLQuiz *)quiz completion:(nullable void (^)(NSString *_Nullable quizID, BJLError * _Nullable error))completion;

/**
 删除测验,老师或助教身份
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
419 420
 #param quizID 测验 ID
 #param completion 测验 ID
huangjie's avatar
source  
huangjie committed
421 422 423 424 425 426 427
 #return task
 */
- (nullable NSURLSessionDataTask *)deleteQuizWithID:(NSString *)quizID completion:(nullable void (^)(NSString * _Nullable quizID, BJLError * _Nullable error))completion;

/**
 加载测验详细内容
 #discussion 所有角色,对于老师或助教,如果测验结束了,有答题情况了,会返回测验的答题情况,对于学生,不会返回答题情况
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
428
 #param quizID 测验 ID
huangjie's avatar
source  
huangjie committed
429 430 431 432 433 434 435 436 437 438 439 440 441
 #param completion BJLQuiz,测验详细信息
 #return task
 */
- (nullable NSURLSessionDataTask *)loadQuizDetailWithID:(NSString *)quizID completion:(nullable void (^)(BJLQuiz * _Nullable quiz, BJLError * _Nullable error))completion;

/**
 开始测验,老师或助教身份
 #param quizID quizID
 #param force 是否强制参加
 #return BJLError
 */
- (nullable BJLError *)startQuizWithID:(NSString *)quizID force:(BOOL)force;
- (BJLObservable)didStartQuizWithID:(NSString *)quizID force:(BOOL)force;
root's avatar
1.3.3  
root committed
442 443

/**
huangjie's avatar
source  
huangjie committed
444 445 446
 结束测验,老师或助教身份
 #param quizID quizID
 #return BJLError
root's avatar
1.3.3  
root committed
447
 */
huangjie's avatar
source  
huangjie committed
448 449
- (nullable BJLError *)endQuizWithID:(NSString *)quizID;
- (BJLObservable)didEndQuizWithID:(NSString *)quizID;
root's avatar
1.3.3  
root committed
450

huangjie's avatar
source  
huangjie committed
451 452 453 454 455 456 457 458 459 460 461
/**
 发布测验答案,老师或助教身份
 #param quiz 需要发布答案的测验 ID
 #return BJLError
 */
- (nullable BJLError *)publishQuizSolutionWithID:(NSString *)quizID;
- (BJLObservable)didReceiveQuizWithID:(NSString *)quizID solution:(NSDictionary<NSString *, id> *)solutions;

/**
 加载当前测验
 #discussion 学生身份如果回答过,将返回回答的结果
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
462
 #return BJLError
huangjie's avatar
source  
huangjie committed
463 464 465
 */
- (nullable BJLError *)loadCurrentQuiz;
- (BJLObservable)didLoadCurrentQuiz:(BJLQuiz *)quiz;
凡义's avatar
凡义 committed
466 467

/**
huangjie's avatar
source  
huangjie committed
468
 提交测验,学生身份,此方法无提交完成的回调
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
469 470 471
 #param quizID 测验 ID
 #param solutions 测验回答 key -> 问题 ID,value -> 问题回答,对于 value,Radio 类型的问题的值为选项 ID,Checkbox 类型的问题的值为选项 ID 数组,ShortAnswer 类型的问题值为简答的关键内容
 #return BJLError
凡义's avatar
凡义 committed
472
 */
huangjie's avatar
source  
huangjie committed
473
- (nullable BJLError *)submitQuizWithID:(NSString *)quizID solution:(NSDictionary<NSString *, id> *)solutions;
root's avatar
1.3.3  
root committed
474 475

/**
huangjie's avatar
source  
huangjie committed
476 477
 收到学生提交测验,老师或助教身份
 #param quizID 测验ID
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
478
 #param solutions 学生答题情况
root's avatar
1.3.3  
root committed
479
 */
huangjie's avatar
source  
huangjie committed
480 481 482 483
- (BJLObservable)didSubmitQuizWithID:(NSString *)quizID solution:(NSDictionary<NSString *, id> *)solutions;

/**
 位于小班,加载大班的已经结束的测验列表
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
484
 #return BJLError
huangjie's avatar
source  
huangjie committed
485 486 487 488 489
 */
- (nullable BJLError *)loadParentRoomFinishedQuizList;

/**
 收到大班结束的测验信息
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
490
 #param quizList 测验列表
huangjie's avatar
source  
huangjie committed
491 492
 */
- (BJLObservable)didLoadParentRoomFinishedQuizList:(nullable NSArray<BJLQuiz *> *)quizList;
root's avatar
1.3.3  
root committed
493

戴曦嘉's avatar
戴曦嘉 committed
494 495
#pragma mark - 问答

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
496 497 498 499
/**
 禁止提出问答的 userNumber 列表
 #discussion 列表包含禁止提出问答的 userNumber
 */
戴曦嘉's avatar
2.7.0  
戴曦嘉 committed
500 501
@property (nonatomic, readonly, nullable) NSSet<NSString *> *forbidQuestionList;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
502 503
/**
 禁止提出问答的 userNumber 列表
戴曦嘉's avatar
戴曦嘉 committed
504 505 506 507
 #discussion 列表仅包含禁止提出问答的 userNumber
 #discussion key --> userNumber
 #discussion value --> forbid
 */
戴曦嘉's avatar
2.7.0  
戴曦嘉 committed
508
@property (nonatomic, readonly, nullable) NSDictionary<NSString *, NSNumber *> *fobidQuestionUserNumberList DEPRECATED_MSG_ATTRIBUTE("use `forbidQuestionList` instead");
戴曦嘉's avatar
戴曦嘉 committed
509 510

/**
戴曦嘉's avatar
戴曦嘉 committed
511 512
 请求指定页码的问答
 请求的state: 老师为BJLQuestionAllState, 学生为BJLQuestionPublished
戴曦嘉's avatar
戴曦嘉 committed
513 514 515 516
 #param page 页码,从0开始计数
 #param count 每一页的数据量
 #return error
 */
凡义's avatar
凡义 committed
517
- (nullable BJLError *)loadQuestionHistoryWithPage:(NSInteger)page countPerPage:(NSInteger)count;
戴曦嘉's avatar
戴曦嘉 committed
518 519

/**
戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
520
 收到指定页码的问答数据
戴曦嘉's avatar
戴曦嘉 committed
521 522
 #param history 问答数据,可能为空列表
 #param currentPage 当前页码,从0开始计数
戴曦嘉's avatar
戴曦嘉 committed
523
 #param totalPage 最大页码,从0开始计数
戴曦嘉's avatar
戴曦嘉 committed
524 525 526
 */
- (BJLObservable)didLoadQuestionHistory:(NSArray<BJLQuestion *> *)history currentPage:(NSInteger)currentPage totalPage:(NSInteger)totalPage;

戴曦嘉's avatar
戴曦嘉 committed
527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545
/**
 请求指定页码的问答
 #param page 页码,从0开始计数
 #param count 每一页的数据量
 #param state 请求对应state的question
 #param isSelf  yes: 返回当前登录用户的question, no: 返回所有人
 #return error
*/
- (nullable BJLError *)loadQuestionHistoryWithPage:(NSInteger)page countPerPage:(NSInteger)count state:(BJLQuestionState)state isSelf:(BOOL)isSelf;

/**
 收到指定页码的问答数据
 #param history 问答数据,可能为空列表
 #param currentPage 当前页码,从0开始计数
 #param questionCount 各状态问答的数目
 #param state 列表里面question的state
 */
- (BJLObservable)didLoadQuestionHistory:(NSArray<BJLQuestion *> *)history  currentPage:(NSInteger)currentPage questionCount:(BJLQuestionCount *)questionCount state:(BJLQuestionState)state;

戴曦嘉's avatar
戴曦嘉 committed
546 547 548 549
/**
 创建问答
 #param question 问题内容
 */
huangjie's avatar
注释  
huangjie committed
550
- (nullable BJLError *)sendQuestion:(NSString *)question;
戴曦嘉's avatar
戴曦嘉 committed
551 552 553 554 555 556 557 558 559 560 561

/**
 创建问答成功
 #param question 问答,包括问答 ID
 */
- (BJLObservable)didSendQuestion:(BJLQuestion *)question;

/**
 发布问答,需要先成功创建问答
 #param questionID 问答 ID
 */
huangjie's avatar
注释  
huangjie committed
562
- (nullable BJLError *)publishQuestionWithQuestionID:(NSString *)questionID;
戴曦嘉's avatar
戴曦嘉 committed
563 564 565 566 567 568 569 570 571 572 573 574

/**
 问答发布成功
 #discussion 只有在发布没有回答的问答时才会回调此方法
 #param question 问答全部内容
 */
- (BJLObservable)didPublishQuestion:(BJLQuestion *)question;

/**
 取消发布问答
 #param questionID 问答 ID
 */
huangjie's avatar
注释  
huangjie committed
575
- (nullable BJLError *)unpublishQuestionWithQuestionID:(NSString *)questionID;
戴曦嘉's avatar
戴曦嘉 committed
576 577 578 579 580 581

/**
 取消发布问答成功
 #discussion 任何有回答或者没有回答的问题取消发布成功都回调此方法
 #param questionID 问答 ID
 */
戴曦嘉's avatar
戴曦嘉 committed
582 583 584 585 586 587 588
- (BJLObservable)didUnpublishQuestionWithQuestionID:(NSString *)questionID DEPRECATED_MSG_ATTRIBUTE("use `didUnpublishQuestion:` instead");

/**
 取消发布问答成功
 #param question 问答全部内容
 */
- (BJLObservable)didUnpublishQuestion:(BJLQuestion *)question;
戴曦嘉's avatar
戴曦嘉 committed
589 590 591 592

/**
 回复问答
 #param questionID 问答 ID
戴曦嘉's avatar
戴曦嘉 committed
593
 #param state 该ID的问答的state
戴曦嘉's avatar
戴曦嘉 committed
594 595
 #param reply 回复内容
 */
戴曦嘉's avatar
戴曦嘉 committed
596 597
- (nullable BJLError *)replyQuestionWithQuestionID:(NSString *)questionID reply:(NSString *)reply DEPRECATED_MSG_ATTRIBUTE("use `replyQuestionWithID:state:reply:` instead");
- (nullable BJLError *)replyQuestionWithID:(NSString *)questionID state:(BJLQuestionState)state reply:(NSString *)reply;
戴曦嘉's avatar
戴曦嘉 committed
598 599 600 601 602 603 604 605 606 607 608 609 610

/**
 收到问答回复
 #discussion 问答如果已经有了回复,取消发布之后重新发布的情况,只回调此方法,不回调发布成功
 #param question 问答全部内容
 */
- (BJLObservable)didReplyQuestion:(BJLQuestion *)question;

/**
 改变问答状态
 #param user user
 #param forbid 是否禁止问答
 */
huangjie's avatar
注释  
huangjie committed
611
- (nullable BJLError *)switchQuestionForbidForUser:(BJLUser *)user forbid:(BOOL)forbid;
戴曦嘉's avatar
戴曦嘉 committed
612 613 614 615 616 617 618 619

/**
 问答状态被改变
 #param user user
 #param forbid 禁止问答状态
 */
- (BJLObservable)didSwitchQuestionForbidForUser:(BJLUser *)user forbid:(BOOL)forbid;

root's avatar
1.0.0  
root committed
620 621
#pragma mark - 定制信令

root's avatar
update  
root committed
622
/**
root's avatar
root committed
623
 发送定制广播信令
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
624
 #discussion 发送定制广播信令
root's avatar
update  
root committed
625 626 627 628 629
 #param key     信令类型
 #param value   信令内容,合法的 JSON 数据类型 - #see `[NSJSONSerialization isValidJSONObject:]`,序列化成字符串后不能过长,一般不超过 1024 个字符
 #param cache   是否缓存,缓存的信令可以通过 `requestCustomizedBroadcastCache:` 方法重新请求
 #return BJLError:
 BJLErrorCode_invalidArguments  不支持的 key,内容为空或者内容过长
630
 BJLErrorCode_areYouRobot       发送频率过快,要求每秒不超过 5 条、并且每分钟不超过 60 条
root's avatar
update  
root committed
631 632 633
 */
- (nullable BJLError *)sendCustomizedBroadcast:(NSString *)key value:(id)value cache:(BOOL)cache;

root's avatar
1.0.0  
root committed
634
/**
root's avatar
root committed
635
 收到定制广播信令
root's avatar
1.0.0  
root committed
636 637 638 639
 #param key     信令类型
 #param value   信令内容,类型可能是字符串或者字典等 JSON 数据类型
 #param isCache 是否为缓存
 */
root's avatar
update  
root committed
640
- (BJLObservable)didReceiveCustomizedBroadcast:(NSString *)key value:(nullable id)value isCache:(BOOL)isCache;
root's avatar
1.0.0  
root committed
641

root's avatar
update  
root committed
642
/**
戴曦嘉's avatar
戴曦嘉 committed
643 644
 获取定制广播信令缓存
 #discussion 进教室后调用此方法可以获取定制广播信令的缓存,结果回调 `didReceiveCustomizedBroadcast:value:isCache:`
root's avatar
update  
root committed
645
 #param key     信令类型
root's avatar
update  
root committed
646 647
 #return BJLError:
 BJLErrorCode_invalidArguments  不支持的 key
648
 BJLErrorCode_areYouRobot       发送频率过快,要求每秒不超过 5 条、并且每分钟不超过 60 条
root's avatar
update  
root committed
649
 */
root's avatar
update  
root committed
650 651
- (nullable BJLError *)requestCustomizedBroadcastCache:(NSString *)key;

戴曦嘉's avatar
戴曦嘉 committed
652
#pragma mark - interactive class 专业版小班课 API
root's avatar
root committed
653

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
654
/** 专业版小班课 - 网页课件 URL */
戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
655
@property (nonatomic, readonly) NSString *webPageURLString DEPRECATED_ATTRIBUTE;
戴曦嘉's avatar
戴曦嘉 committed
656

戴曦嘉's avatar
戴曦嘉 committed
657 658 659 660 661 662 663 664 665 666 667 668
/**
 专业版小班课 - 更新教室布局请求
 #param roomLayout 窗口布局类型
 #return BJLError: 错误码参考 BJLErrorCode
 */
- (nullable BJLError *)updateRoomLayout:(BJLRoomLayout)roomLayout;

/**
 专业版小班课 - 教室布局更新通知
 #param roomLayout 窗口布局类型
 */
- (BJLObservable)didUpdateRoomLayout:(BJLRoomLayout)roomLayout;
root's avatar
update  
root committed
669

戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
670 671
#pragma mark - 网页

戴曦嘉's avatar
戴曦嘉 committed
672 673
/**
 更新网页信息
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
674 675 676
 #param urlString 网址
 #param open YES:打开,NO:关闭
 #return BJLError
戴曦嘉's avatar
戴曦嘉 committed
677 678 679 680 681
 */
- (nullable BJLError *)updateWebPageWithURLString:(nullable NSString *)urlString open:(BOOL)open;

/**
 收到网页信息更新
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
682 683 684
 #param urlString 网址
 #param open YES:打开,NO:关闭
 #param isCache 是否是缓存
戴曦嘉's avatar
戴曦嘉 committed
685 686 687
 */
- (BJLObservable)didUpdateWebPageWithURLString:(nullable NSString *)urlString open:(BOOL)open isCache:(BOOL)isCache;

戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
688
#pragma mark - 学情报告
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
689 690

/**
戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
691
 生成学情报告,老师身份
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
692 693
 #param completion ID 表情报告任务 ID
 #return error
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
694 695 696 697
 */
- (nullable BJLError *)generateExpressReportWithCompletion:(void (^)(NSString * _Nullable ID, BJLError * _Nullable error))completion;

/**
戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
698
 获取学情报告进程状态
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
699 700
 #param completion 进程状态,参考`BJLTaskStatus`
 #return error
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
701 702 703 704
 */
- (nullable BJLError *)requestExpressReportProgressWithCompletion:(void (^)(BJLTaskStatus status, BJLError * _Nullable error))completion;

/**
戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
705
 课后学情报告
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
706 707
 #param userNumber 用户 number
 #return NSURLRequest
戴曦嘉's avatar
2.2.0  
戴曦嘉 committed
708 709 710
 */
- (nullable NSURLRequest *)expressReportRequestWithUserNumber:(NSString *)userNumber;

huangjie's avatar
source  
huangjie committed
711 712 713 714
#pragma mark - 计时器

/**
 发布计时器信息
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
715 716 717
 #param time 倒计时时间
 #param open YES:发布,NO:关闭
 #return BJLError
huangjie's avatar
source  
huangjie committed
718 719 720 721 722 723
*/
- (nullable BJLError *)requestUpdateCountDownTimerWithTime:(NSTimeInterval)time
                                                      open:(BOOL)open;

/**
 收到计时器信息更新
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
724 725
 #param time 倒计时时间
 #param open YES:发布,NO:关闭
huangjie's avatar
source  
huangjie committed
726 727 728 729 730
 */
- (BJLObservable)didUpdateCountDownTimerWithTime:(NSTimeInterval)time
                                            open:(BOOL)open;

/**
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
731 732
 撤回计时器
 #return BJLError
huangjie's avatar
source  
huangjie committed
733 734 735
 */
- (nullable BJLError *)requestRevokeCountDownTimer;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
736
/** 收到计时器撤回信息 */
huangjie's avatar
source  
huangjie committed
737 738
- (BJLObservable)didReceiveRevokeCountDownTimer;

huangjie's avatar
source  
huangjie committed
739 740 741 742
#pragma mark - 计时器 V2 支持正计时/倒计时

/**
 发布计时器
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
743 744 745 746
 #param totalTime 计时总时长,单位 秒
 #param countDownTime 当前计时剩余计时时长,单位 秒
 #param isDecrease 是否为倒计时,NO表示正计时
 #return BJLError
huangjie's avatar
source  
huangjie committed
747 748 749 750 751 752 753 754 755 756 757
 */
- (nullable BJLError *)requestPublishTimerWithTotalTime:(NSInteger)totalTime
                                          countDownTime:(NSInteger)countDownTime
                                             isDecrease:(BOOL)isDecrease;

- (BJLObservable)didReceiveTimerWithTotalTime:(NSInteger)totalTime
                                countDownTime:(NSInteger)countDownTime
                                   isDecrease:(BOOL)isDecrease;

/**
 暂停计时器
758 759 760
 #param totalTime 计时总时长,单位 秒
 #param countDownTime 当前计时剩余计时时长,单位 秒
 #param isDecrease 是否为倒计时,NO表示正计时
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
761
 #return BJLError
huangjie's avatar
source  
huangjie committed
762
 */
763 764 765 766
- (nullable BJLError *)requestPauseTimerWithTotalTime:(NSInteger)totalTime
                                    leftCountDownTime:(NSInteger)countDownTime
                                           isDecrease:(BOOL)isDecrease;
- (nullable BJLError *)requestPauseTimer DEPRECATED_MSG_ATTRIBUTE("use `requestPauseTimerWithTotalTime:leftCountDownTime:isDecrease:` instead");
huangjie's avatar
source  
huangjie committed
767

768 769 770
- (BJLObservable)didReceivePauseTimerWithTotalTime:(NSInteger)totalTime
                                 leftCountDownTime:(NSInteger)countDownTime
                                        isDecrease:(BOOL)isDecrease;
huangjie's avatar
source  
huangjie committed
771 772 773

/**
 结束计时器
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
774
 #return BJLError
huangjie's avatar
source  
huangjie committed
775 776 777 778 779
 */
- (nullable BJLError *)requestStopTimer;

- (BJLObservable)didReceiveStopTimer;

huangjie's avatar
source  
huangjie committed
780 781 782 783
#pragma mark - 抢答器

/**
 请求发布抢答器
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
784 785
 #param time 抢答器倒计时
 #return BJLError
huangjie's avatar
source  
huangjie committed
786 787 788 789 790
 */
- (nullable BJLError *)requestPublishQuestionResponderWithTime:(NSInteger)time;

/**
 收到抢答器开始信息
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
791
 #param time 抢答器倒计时
huangjie's avatar
source  
huangjie committed
792 793 794 795 796 797
 */
- (BJLObservable)didReceiveQuestionResponderWithTime:(NSInteger)time;

/**
 请求结束抢答器
 #discussion 由老师发送抢答结束信令
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
798
 #return BJLError
huangjie's avatar
source  
huangjie committed
799 800 801 802 803
 */
- (nullable BJLError *)endQuestionResponderWithShouldCloseWindow:(BOOL)shouldCloseWindow;

/**
 收到抢答器结束信息
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
804
 #param winner 抢答成功的用户, 为空则表示无人抢答
huangjie's avatar
source  
huangjie committed
805 806 807 808 809
 */
- (BJLObservable)didReceiveEndQuestionResponderWithWinner:(nullable BJLUser *)winner;

/**
 请求撤销抢答器信息
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
810
 #return BJLError
huangjie's avatar
source  
huangjie committed
811 812 813
 */
- (nullable BJLError *)requestRevokeQuestionResponder;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
814
/** 收到抢答器撤销信息 */
huangjie's avatar
source  
huangjie committed
815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831
- (BJLObservable)didReceiveRevokeQuestionResponder;

/**
 关闭抢答器窗口
 #discussion 用来同步助教和老师之前的关闭状态
 */
- (nullable BJLError *)requestCloseQuestionResponder;

/**
 收到关闭抢答器信息
 #discussion 用来同步助教和老师之前的关闭状态
 */
- (BJLObservable)didReceiveCloseQuestionResponder;

/**
 学生提交抢答
 #discussion 学生在抢答界面, 抢答后可发送提交抢答信令
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
832
 #return BJLError
huangjie's avatar
source  
huangjie committed
833
 */
huangjie's avatar
source  
huangjie committed
834
- (nullable BJLError *)submitQuestionResponder;
huangjie's avatar
source  
huangjie committed
835

huangjie's avatar
source  
huangjie committed
836
#pragma mark - 答题器
huangjie's avatar
source  
huangjie committed
837 838 839

/**
 请求发布答题
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
840 841
 #param answerSheet 请求发布的答题内容,参数请参考`answerSheet`的属性内容
 #return BJLError
huangjie's avatar
source  
huangjie committed
842
 */
huangjie's avatar
source  
huangjie committed
843
- (nullable BJLError *)requestPublishQuestionAnswerSheet:(BJLAnswerSheet *)answerSheet;
huangjie's avatar
source  
huangjie committed
844

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
845
/** 收到答题器开始信息 */
huangjie's avatar
source  
huangjie committed
846
- (BJLObservable)didReceiveQuestionAnswerSheet:(BJLAnswerSheet *)answerSheet;
huangjie's avatar
source  
huangjie committed
847 848 849

/**
 请求结束答题
huangjie's avatar
source  
huangjie committed
850
 #discussion 由老师发送答题结束信令
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
851 852
 #param shouldSyncCloseWindow 结束答题器的同时是否需要同步关闭其他端的答题器窗口,若为YES则会收到`didReceiveCloseQuestionResponder`
 #return BJLError
huangjie's avatar
source  
huangjie committed
853
 */
huangjie's avatar
source  
huangjie committed
854
- (nullable BJLError *)requestEndQuestionAnswerWithShouldSyncCloseWindow:(BOOL)shouldSyncCloseWindow;
huangjie's avatar
source  
huangjie committed
855 856 857

/**
 收到答题结束信息
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
858
 #param endTime 答题结束时间戳
huangjie's avatar
source  
huangjie committed
859 860 861 862 863
 */
- (BJLObservable)didReceiveEndQuestionAnswerWithEndTime:(NSTimeInterval)endTime;

/**
 请求撤销答题
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
864
 #return BJLError
huangjie's avatar
source  
huangjie committed
865 866 867 868 869
 */
- (nullable BJLError *)requestRevokeQuestionAnswer;

/**
 收到答题器撤销信息
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
870
 #param endTime 答题结束时间戳
huangjie's avatar
source  
huangjie committed
871 872 873 874 875
 */
- (BJLObservable)didReceiveRevokeQuestionAnswerWithEndTime:(NSTimeInterval)endTime;

/**
 学生提交答题
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
876
 #return BJLError
huangjie's avatar
source  
huangjie committed
877
 */
huangjie's avatar
source  
huangjie committed
878
- (nullable BJLError *)submitQuestionAnswer:(BJLAnswerSheet *)answer;
huangjie's avatar
source  
huangjie committed
879

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
880
/** 收到学生答题信息 */
huangjie's avatar
source  
huangjie committed
881
- (BJLObservable)didReceiveQuestionAnswerSubmited:(BJLAnswerSheet *)res;
huangjie's avatar
source  
huangjie committed
882 883 884 885 886 887 888 889 890 891 892 893 894 895 896

/**
 关闭答题器窗口
 #discussion 用来同步助教和老师之前的关闭状态
 */
- (nullable BJLError *)requestCloseQuestionAnswer;

/**
 收到答题器关闭信息
 #discussion 用来同步助教和老师之间的窗口关闭状态
 */
- (BJLObservable)didReceiveCloseQuestionAnswer;

/**
 请求答题数据
戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
897
 #param ID 某一次答题ID,参数为空则表示请求当前教室所有的历史答题数据
huangjie's avatar
source  
huangjie committed
898 899 900
 */
- (nullable BJLError *)requestQuestionAnswerDetailInfoWithAnswerSheetID:(nullable NSString *)ID;

戴曦嘉's avatar
2.9.2  
戴曦嘉 committed
901
/** 收到答题数据 */
huangjie's avatar
source  
huangjie committed
902
- (BJLObservable)didReceiveQuestionAnswerDetailInfo:(NSArray<BJLAnswerSheet *> *)answerSheetArray;
戴曦嘉's avatar
戴曦嘉 committed
903

戴曦嘉's avatar
2.9.3  
戴曦嘉 committed
904 905 906 907
#pragma mark - 随机选人

- (BJLObservable)didReceiveRandomSelectCandidateList:(nullable NSArray <NSString *> *)candidateList choosenUser:(BJLUser *)user;

908 909
#pragma mark - 标准抽奖 和 口令抽奖

戴曦嘉's avatar
2.10.1  
戴曦嘉 committed
910 911 912
/** 抽奖结果
 #param lottery lottery
 */
913 914
- (BJLObservable)didReceiveLotteryResult:(BJLLottery *)lottery;

戴曦嘉's avatar
2.10.1  
戴曦嘉 committed
915 916 917 918 919 920 921
/**
 提交中奖信息
 #param userName name
 #param mobile mobile description
 #param beginTime beginTime description
 #param completion completion description
 */
922 923
- (void)submitLotteryUserName:(NSString *)userName mobile:(NSString *)mobile beginTime:(NSTimeInterval)beginTime completion:(nullable void (^)(BOOL success))completion;

戴曦嘉's avatar
2.10.1  
戴曦嘉 committed
924 925 926 927
/**
 口令抽奖 - 开始
 #param commandLotteryBegin commandLotteryBegin
 */
928 929
- (BJLObservable)didReceiveBeginCommandLottery:(BJLCommandLotteryBegin *)commandLotteryBegin;

戴曦嘉's avatar
2.10.1  
戴曦嘉 committed
930 931 932 933
/**
 口令抽奖 - 当学生发送的聊天信息匹配口令时,需要发送此请求
 身份为老师 / 助教 / 游客 调用此接口无效
 */
934 935
- (nullable BJLError *)requestHitCommandLottery;

戴曦嘉's avatar
2.10.1  
戴曦嘉 committed
936
/** 口令抽奖 - 发送口令请求的res */
937 938 939
- (BJLObservable)didReceiveHitCommandLottery:(NSDictionary *)res;


root's avatar
1.0.0  
root committed
940 941 942
@end

NS_ASSUME_NONNULL_END