RQYDTQuestionModule.m 42 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044
  1. //
  2. // RQYDTQuestionModule.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/3/28.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQYDTQuestionModule.h"
  9. #import "RQYDTXCQuestionModule.h"
  10. #import "RQYDTHCQuestionModule.h"
  11. #import "RQYDTKCQuestionModule.h"
  12. #import "RQYDTMTCQuestionModule.h"
  13. #import "RQYDTZGZJLYQuestionModule.h"
  14. #import "RQYDTZGZKYQuestionModule.h"
  15. #import "RQYDTZGZHYQuestionModule.h"
  16. #import "RQYDTZGZWXPQuestionModule.h"
  17. #import "RQYDTZGZCZCQuestionModule.h"
  18. #import "RQYDTZGZWYCQuestionModule.h"
  19. NSString * const RQCarTypeChangeNotification = @"RQCarTypeChangeNotification";
  20. /// 正式环境key
  21. static NSString * const RQYDTQuestionCarTypeKey = @"RQYDTQuestionCarTypeKey";
  22. @interface RQYDTQuestionModule ()
  23. /// 科目一顺序练习
  24. @property (nonatomic, readwrite, copy) NSArray *subjectOneArr;
  25. /// 科目四顺序练习
  26. @property (nonatomic, readwrite, copy) NSArray *subjectFourArr;
  27. @property (nonatomic, readwrite, strong) NSString *downloadUrl;
  28. @property (nonatomic, readwrite, strong) NSString *jsDownloadUrl;
  29. @property (nonatomic, readwrite, strong) NSString *jqDownloadUrl;
  30. @end
  31. @implementation RQYDTQuestionModule
  32. static id rq_ydtQuestionModule = nil;
  33. #pragma mark - init
  34. + (instancetype)sharedInstance {
  35. static dispatch_once_t onceToken;
  36. dispatch_once(&onceToken, ^{
  37. rq_ydtQuestionModule = [[self alloc] init];
  38. });
  39. return rq_ydtQuestionModule;
  40. }
  41. - (instancetype)init {
  42. if (self = [super init]) {
  43. NSInteger userVersion = [RQ_YDT_USER_Question_Module getQuestionVersion];
  44. NSLog(@"用户题库版本号:%ld",userVersion);
  45. NSInteger xcVersion = [RQ_YDT_XC_Question_Module getQuestionVersion];
  46. NSLog(@"小车题库版本号:%ld",xcVersion);
  47. NSInteger hcVersion = [RQ_YDT_HC_Question_Module getQuestionVersion];
  48. NSLog(@"货车题库版本号:%ld",hcVersion);
  49. NSInteger kcVersion = [RQ_YDT_KC_Question_Module getQuestionVersion];
  50. NSLog(@"客车题库版本号:%ld",kcVersion);
  51. NSInteger mtcVersion = [RQ_YDT_MTC_Question_Module getQuestionVersion];
  52. NSLog(@"摩托车题库版本号:%ld",mtcVersion);
  53. NSInteger zgzJlyVersion = [RQ_YDT_ZGZ_JLY_Question_Module getQuestionVersion];
  54. NSLog(@"资格证教练员题库版本号:%ld",zgzJlyVersion);
  55. }
  56. return self;
  57. }
  58. - (void)saveQuestionsWithSubjectOneArr:(NSArray *)subjectOneArr {
  59. self.subjectOneArr = subjectOneArr;
  60. }
  61. - (void)saveQuestionsWithSubjectFourArr:(NSArray *)subjectFourArr {
  62. self.subjectFourArr = subjectFourArr;
  63. }
  64. - (void)setCarType:(RQHomePageCarType)carType {
  65. NSString *carTypeStr = [NSString stringWithFormat:@"%@",[NSNumber numberWithInteger:carType]];
  66. [[NSUserDefaults standardUserDefaults] setObject:carTypeStr forKey:RQYDTQuestionCarTypeKey];
  67. [[NSUserDefaults standardUserDefaults] synchronize];
  68. }
  69. - (RQHomePageCarType)carType {
  70. NSString *carTypeStr = [[NSUserDefaults standardUserDefaults] objectForKey:RQYDTQuestionCarTypeKey];
  71. carTypeStr = [carTypeStr rq_stringValueExtension];
  72. return carTypeStr.integerValue;
  73. }
  74. - (NSString *)carTypeStr {
  75. return [self getCarTypeNameWithCarType:self.carType];
  76. }
  77. - (NSString *)carTypeStrNew {
  78. switch (self.carType) {
  79. case RQHomePageCarType_Car:
  80. return @"cart";
  81. case RQHomePageCarType_Bus:
  82. return @"bus";
  83. case RQHomePageCarType_Truck:
  84. return @"truck";
  85. case RQHomePageCarType_Motorcycle:
  86. return @"mtc";
  87. case RQHomePageCarType_ZGZ_JLY:
  88. return @"zgzjl";
  89. case RQHomePageCarType_ZGZ_KY:
  90. return @"zgzky";
  91. case RQHomePageCarType_ZGZ_HY:
  92. return @"zgzhy";
  93. case RQHomePageCarType_ZGZ_WXP:
  94. return @"zgzwxp";
  95. case RQHomePageCarType_ZGZ_CZC:
  96. return @"zgzcz";
  97. case RQHomePageCarType_ZGZ_WYC:
  98. return @"zgzwyc";
  99. default:
  100. return @"cart";
  101. }
  102. }
  103. - (NSString *)subjectStr {
  104. return [self getSubjectNameWithSubject:self.subject];
  105. }
  106. #pragma mark - PublicMethods
  107. /// 更新题库
  108. - (void)rq_updateQuestion {
  109. @weakify(self)
  110. [[[RQ_HTTP_Service getUpdateQuestion] deliverOnMainThread] subscribeNext:^(NSArray *arr) {
  111. [[arr.rac_sequence.signal filter:^BOOL(RQDictInfoModel *dictInfoModel) {
  112. return [dictInfoModel.dictLabel isEqualToString:[RQ_YDTQuestion_Module getCarTypeCNTiKuUpdateNameWithCarType:RQ_YDTQuestion_Module.carType]];
  113. }] subscribeNext:^(RQDictInfoModel *dictInfoModel) {
  114. @strongify(self)
  115. NSInteger netVersion = dictInfoModel.remark.integerValue;
  116. NSInteger localVersion = [RQ_YDTQuestion_Module getQuestionVersion];
  117. self.downloadUrl = dictInfoModel.dictValue;
  118. if (netVersion > localVersion) {
  119. NSLog(@"题库需要更新!");
  120. [self rq_showDBUpdateView];
  121. } else {
  122. NSLog(@"题库不需要更新!");
  123. }
  124. }];
  125. [[arr.rac_sequence.signal filter:^BOOL(RQDictInfoModel *dictInfoModel) {
  126. return [dictInfoModel.dictLabel isEqualToString:@"题库解释"];
  127. }] subscribeNext:^(RQDictInfoModel *dictInfoModel) {
  128. @strongify(self)
  129. NSInteger netVersion = dictInfoModel.remark.integerValue;
  130. NSInteger localVersion = [RQ_YDT_JS_Question_Module getQuestionVersion];
  131. self.jsDownloadUrl = dictInfoModel.dictValue;
  132. if (netVersion > localVersion) {
  133. NSLog(@"解释题库需要更新!");
  134. [self rq_showJSUpdateView];
  135. } else {
  136. NSLog(@"解释题库不需要更新!");
  137. }
  138. }];
  139. [[arr.rac_sequence.signal filter:^BOOL(RQDictInfoModel *dictInfoModel) {
  140. return [dictInfoModel.dictLabel isEqualToString:@"快通解释"];
  141. }] subscribeNext:^(RQDictInfoModel *dictInfoModel) {
  142. @strongify(self)
  143. NSInteger netVersion = dictInfoModel.remark.integerValue;
  144. NSInteger localVersion = [YN_YDT_JQ_Question_Module getQuestionVersion];
  145. self.jqDownloadUrl = dictInfoModel.dictValue;
  146. if (netVersion > localVersion) {
  147. NSLog(@"快通解释题库需要更新!");
  148. [self rq_showJQUpdateView];
  149. } else {
  150. NSLog(@"快通解释题库不需要更新!");
  151. }
  152. }];
  153. }];
  154. }
  155. - (NSInteger)getQuestionVersion {
  156. switch (self.carType) {
  157. case RQHomePageCarType_Car:
  158. return [RQ_YDT_XC_Question_Module getQuestionVersion];
  159. case RQHomePageCarType_Truck:
  160. return [RQ_YDT_HC_Question_Module getQuestionVersion];
  161. case RQHomePageCarType_Bus:
  162. return [RQ_YDT_KC_Question_Module getQuestionVersion];
  163. case RQHomePageCarType_Motorcycle:
  164. return [RQ_YDT_MTC_Question_Module getQuestionVersion];
  165. case RQHomePageCarType_ZGZ_JLY:
  166. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionVersion];
  167. case RQHomePageCarType_ZGZ_KY:
  168. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionVersion];
  169. case RQHomePageCarType_ZGZ_HY:
  170. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionVersion];
  171. case RQHomePageCarType_ZGZ_WXP:
  172. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionVersion];
  173. case RQHomePageCarType_ZGZ_CZC:
  174. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionVersion];
  175. case RQHomePageCarType_ZGZ_WYC:
  176. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionVersion];
  177. default:
  178. return [RQ_YDT_XC_Question_Module getQuestionVersion];
  179. }
  180. }
  181. - (NSString *)getSubjectNameWithSubject:(RQHomePageSubjectType)subject {
  182. switch (subject) {
  183. case RQHomePageSubjectType_SubjectOne:
  184. return @"1";
  185. case RQHomePageSubjectType_SubjectTwo:
  186. return @"2";
  187. case RQHomePageSubjectType_SubjectThree:
  188. return @"3";
  189. case RQHomePageSubjectType_SubjectFour:
  190. return @"4";
  191. default:
  192. return @"1";
  193. }
  194. }
  195. - (RQHomePageSubjectType)getSubjectWithSubjectName:(NSString *)subjectName {
  196. if ([subjectName isEqualToString:@"1"]) {
  197. return RQHomePageSubjectType_SubjectOne;
  198. } else if ([subjectName isEqualToString:@"2"]) {
  199. return RQHomePageSubjectType_SubjectTwo;
  200. } else if ([subjectName isEqualToString:@"3"]) {
  201. return RQHomePageSubjectType_SubjectThree;
  202. } else if ([subjectName isEqualToString:@"4"]) {
  203. return RQHomePageSubjectType_SubjectFour;
  204. } else {
  205. return RQHomePageSubjectType_SubjectOne;
  206. }
  207. }
  208. - (RQHomePageCarType)getCarTypeWithCarTypeName:(NSString *)carTypeName {
  209. if ([carTypeName isEqualToString:@"C1"]) {
  210. return RQHomePageCarType_Car;
  211. } else if ([carTypeName isEqualToString:@"A2"]) {
  212. return RQHomePageCarType_Truck;
  213. } else if ([carTypeName isEqualToString:@"A1"]) {
  214. return RQHomePageCarType_Bus;
  215. } else if ([carTypeName isEqualToString:@"D"]) {
  216. return RQHomePageCarType_Motorcycle;
  217. } else if ([carTypeName isEqualToString:@"4"]) {
  218. return RQHomePageCarType_ZGZ_JLY;
  219. } else if ([carTypeName isEqualToString:@"1"]) {
  220. return RQHomePageCarType_ZGZ_KY;
  221. } else if ([carTypeName isEqualToString:@"2"]) {
  222. return RQHomePageCarType_ZGZ_HY;
  223. } else if ([carTypeName isEqualToString:@"3"]) {
  224. return RQHomePageCarType_ZGZ_WXP;
  225. } else if ([carTypeName isEqualToString:@"5"]) {
  226. return RQHomePageCarType_ZGZ_CZC;
  227. } else if ([carTypeName isEqualToString:@"6"]) {
  228. return RQHomePageCarType_ZGZ_WYC;
  229. } else {
  230. return RQHomePageCarType_Car;
  231. }
  232. }
  233. - (NSString *)getCarTypeCNNameWithCarType:(RQHomePageCarType)carType {
  234. switch (carType) {
  235. case RQHomePageCarType_Car:
  236. return @"小车";
  237. case RQHomePageCarType_Truck:
  238. return @"货车";
  239. case RQHomePageCarType_Bus:
  240. return @"客车";
  241. case RQHomePageCarType_Motorcycle:
  242. return @"摩托车";
  243. case RQHomePageCarType_ZGZ_JLY:
  244. return @"教练员";
  245. case RQHomePageCarType_ZGZ_HY:
  246. return @"货运";
  247. case RQHomePageCarType_ZGZ_WXP:
  248. return @"危险品";
  249. case RQHomePageCarType_ZGZ_KY:
  250. return @"客运";
  251. case RQHomePageCarType_ZGZ_CZC:
  252. return @"出租车";
  253. case RQHomePageCarType_ZGZ_WYC:
  254. return @"网约车";
  255. default:
  256. return @"小车";
  257. }
  258. }
  259. - (NSString *)getCarTypeCNTiKuUpdateNameWithCarType:(RQHomePageCarType)carType {
  260. switch (carType) {
  261. case RQHomePageCarType_Car:
  262. return @"小车";
  263. case RQHomePageCarType_Truck:
  264. return @"货车";
  265. case RQHomePageCarType_Bus:
  266. return @"客车";
  267. case RQHomePageCarType_Motorcycle:
  268. return @"摩托车";
  269. case RQHomePageCarType_ZGZ_JLY:
  270. return @"教练员资格证";
  271. case RQHomePageCarType_ZGZ_HY:
  272. return @"货运资格证";
  273. case RQHomePageCarType_ZGZ_WXP:
  274. return @"危险品资格证";
  275. case RQHomePageCarType_ZGZ_KY:
  276. return @"客运资格证";
  277. case RQHomePageCarType_ZGZ_CZC:
  278. return @"出租车资格证";
  279. case RQHomePageCarType_ZGZ_WYC:
  280. return @"网约车资格证";
  281. default:
  282. return @"小车";
  283. }
  284. }
  285. - (NSString *)getCarTypeExamNameWithCarType:(RQHomePageCarType)carType {
  286. switch (carType) {
  287. case RQHomePageCarType_Car:
  288. return @"小车C1/C2/C3";
  289. case RQHomePageCarType_Bus:
  290. return @"客车A1/A3/B1";
  291. case RQHomePageCarType_Truck:
  292. return @"货车A2/B2";
  293. case RQHomePageCarType_Motorcycle:
  294. return @"摩托车D/E/F";
  295. case RQHomePageCarType_ZGZ_JLY:
  296. return @"教练员";
  297. case RQHomePageCarType_ZGZ_KY:
  298. return @"客运";
  299. case RQHomePageCarType_ZGZ_HY:
  300. return @"货运";
  301. case RQHomePageCarType_ZGZ_WXP:
  302. return @"危险品";
  303. case RQHomePageCarType_ZGZ_CZC:
  304. return @"出租车";
  305. case RQHomePageCarType_ZGZ_WYC:
  306. return @"网约车";
  307. default:
  308. return @"小车";
  309. }
  310. }
  311. - (NSString *)getCar_TypeNameWithCarType:(RQHomePageCarType)carType {
  312. switch (carType) {
  313. case RQHomePageCarType_Car:
  314. return @"C1";
  315. case RQHomePageCarType_Truck:
  316. return @"A2";
  317. case RQHomePageCarType_Bus:
  318. return @"A1";
  319. case RQHomePageCarType_Motorcycle:
  320. return @"D";
  321. case RQHomePageCarType_ZGZ_JLY:
  322. return @"4";
  323. case RQHomePageCarType_ZGZ_HY:
  324. return @"2";
  325. case RQHomePageCarType_ZGZ_WXP:
  326. return @"3";
  327. case RQHomePageCarType_ZGZ_KY:
  328. return @"1";
  329. case RQHomePageCarType_ZGZ_CZC:
  330. return @"5";
  331. case RQHomePageCarType_ZGZ_WYC:
  332. return @"6";
  333. default:
  334. return @"C1";
  335. }
  336. }
  337. - (NSArray *)getQuestionWithExerciseType:(RQExerciseType)exerciseType questionIds:(NSString*)questionIds {
  338. switch (self.carType) {
  339. case RQHomePageCarType_Car:
  340. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType questionIds:questionIds];
  341. default:
  342. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  343. }
  344. return @[];
  345. }
  346. - (NSArray *)getQuestionWithExerciseType:(RQExerciseType)exerciseType code:(NSInteger)code {
  347. switch (self.carType) {
  348. case RQHomePageCarType_Car:
  349. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType code:code];
  350. default:
  351. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  352. }
  353. return @[];
  354. }
  355. - (NSArray *)getQuestionWithExerciseType:(RQExerciseType)exerciseType {
  356. switch (self.carType) {
  357. case RQHomePageCarType_Car:
  358. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  359. case RQHomePageCarType_Truck:
  360. return [RQ_YDT_HC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  361. case RQHomePageCarType_Bus:
  362. return [RQ_YDT_KC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  363. case RQHomePageCarType_Motorcycle:
  364. return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  365. case RQHomePageCarType_ZGZ_JLY:
  366. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  367. case RQHomePageCarType_ZGZ_KY:
  368. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  369. case RQHomePageCarType_ZGZ_HY:
  370. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  371. case RQHomePageCarType_ZGZ_WXP:
  372. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  373. case RQHomePageCarType_ZGZ_CZC:
  374. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  375. case RQHomePageCarType_ZGZ_WYC:
  376. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  377. default:
  378. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:self.subject exerciseType:exerciseType];
  379. }
  380. }
  381. - (NSArray *)getQuestionWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType {
  382. switch (self.carType) {
  383. case RQHomePageCarType_Car:
  384. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  385. case RQHomePageCarType_Truck:
  386. return [RQ_YDT_HC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  387. case RQHomePageCarType_Bus:
  388. return [RQ_YDT_KC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  389. case RQHomePageCarType_Motorcycle:
  390. return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  391. case RQHomePageCarType_ZGZ_JLY:
  392. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  393. case RQHomePageCarType_ZGZ_KY:
  394. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  395. case RQHomePageCarType_ZGZ_HY:
  396. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  397. case RQHomePageCarType_ZGZ_WXP:
  398. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  399. case RQHomePageCarType_ZGZ_CZC:
  400. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  401. case RQHomePageCarType_ZGZ_WYC:
  402. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  403. default:
  404. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  405. }
  406. }
  407. - (NSArray *)getQuestionWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType isNeedMediaData:(BOOL)isNeedMediaData {
  408. switch (self.carType) {
  409. case RQHomePageCarType_Car:
  410. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  411. case RQHomePageCarType_Truck:
  412. return [RQ_YDT_HC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  413. case RQHomePageCarType_Bus:
  414. return [RQ_YDT_KC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  415. case RQHomePageCarType_Motorcycle:
  416. return [RQ_YDT_MTC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  417. case RQHomePageCarType_ZGZ_JLY:
  418. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  419. case RQHomePageCarType_ZGZ_KY:
  420. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  421. case RQHomePageCarType_ZGZ_HY:
  422. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  423. case RQHomePageCarType_ZGZ_WXP:
  424. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  425. case RQHomePageCarType_ZGZ_CZC:
  426. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  427. case RQHomePageCarType_ZGZ_WYC:
  428. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType ];
  429. default:
  430. return [RQ_YDT_XC_Question_Module getQuestionWithSubject:subject exerciseType:exerciseType];
  431. }
  432. }
  433. - (NSInteger)getQuestionNumWithWithSubject:(RQHomePageSubjectType)subject exerciseType:(RQExerciseType)exerciseType {
  434. switch (self.carType) {
  435. case RQHomePageCarType_Car:
  436. return [RQ_YDT_XC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  437. case RQHomePageCarType_Truck:
  438. return [RQ_YDT_HC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  439. case RQHomePageCarType_Bus:
  440. return [RQ_YDT_KC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  441. case RQHomePageCarType_Motorcycle:
  442. return [RQ_YDT_MTC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  443. case RQHomePageCarType_ZGZ_JLY:
  444. return [RQ_YDT_ZGZ_JLY_Question_Module getQuestionNumWithExerciseType:exerciseType];
  445. case RQHomePageCarType_ZGZ_KY:
  446. return [RQ_YDT_ZGZ_KY_Question_Module getQuestionNumWithExerciseType:exerciseType];
  447. case RQHomePageCarType_ZGZ_HY:
  448. return [RQ_YDT_ZGZ_HY_Question_Module getQuestionNumWithExerciseType:exerciseType];
  449. case RQHomePageCarType_ZGZ_WXP:
  450. return [RQ_YDT_ZGZ_WXP_Question_Module getQuestionNumWithExerciseType:exerciseType];
  451. case RQHomePageCarType_ZGZ_CZC:
  452. return [RQ_YDT_ZGZ_CZC_Question_Module getQuestionNumWithExerciseType:exerciseType];
  453. case RQHomePageCarType_ZGZ_WYC:
  454. return [RQ_YDT_ZGZ_WYC_Question_Module getQuestionNumWithExerciseType:exerciseType];
  455. default:
  456. return [RQ_YDT_XC_Question_Module getQuestionNumWithWithSubject:subject exerciseType:exerciseType];
  457. }
  458. }
  459. - (NSArray *)getChapterArr {
  460. switch (self.carType) {
  461. case RQHomePageCarType_Car:
  462. return [RQ_YDT_XC_Question_Module getChapter];
  463. case RQHomePageCarType_Truck:
  464. return [RQ_YDT_HC_Question_Module getChapter];
  465. case RQHomePageCarType_Bus:
  466. return [RQ_YDT_KC_Question_Module getChapter];
  467. case RQHomePageCarType_Motorcycle:
  468. return [RQ_YDT_MTC_Question_Module getChapter];
  469. case RQHomePageCarType_ZGZ_JLY:
  470. return [RQ_YDT_ZGZ_JLY_Question_Module getChapter];
  471. case RQHomePageCarType_ZGZ_KY:
  472. return [RQ_YDT_ZGZ_KY_Question_Module getChapter];
  473. case RQHomePageCarType_ZGZ_HY:
  474. return [RQ_YDT_ZGZ_HY_Question_Module getChapter];
  475. case RQHomePageCarType_ZGZ_WXP:
  476. return [RQ_YDT_ZGZ_WXP_Question_Module getChapter];
  477. case RQHomePageCarType_ZGZ_CZC:
  478. return [RQ_YDT_ZGZ_CZC_Question_Module getChapter];
  479. case RQHomePageCarType_ZGZ_WYC:
  480. return [RQ_YDT_ZGZ_WYC_Question_Module getChapter];
  481. default:
  482. return [RQ_YDT_XC_Question_Module getChapter];
  483. }
  484. }
  485. - (NSArray *)getChapterQuestionWithChapterName:(NSString *)chapterName {
  486. switch (self.carType) {
  487. case RQHomePageCarType_Car:
  488. return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName];
  489. case RQHomePageCarType_Truck:
  490. return [RQ_YDT_HC_Question_Module getChapterQuestionWithChapterName:chapterName];
  491. case RQHomePageCarType_Bus:
  492. return [RQ_YDT_KC_Question_Module getChapterQuestionWithChapterName:chapterName];
  493. case RQHomePageCarType_Motorcycle:
  494. return [RQ_YDT_MTC_Question_Module getChapterQuestionWithChapterName:chapterName];
  495. case RQHomePageCarType_ZGZ_JLY:
  496. return [RQ_YDT_ZGZ_JLY_Question_Module getChapterQuestionWithChapterName:chapterName];
  497. case RQHomePageCarType_ZGZ_KY:
  498. return [RQ_YDT_ZGZ_KY_Question_Module getChapterQuestionWithChapterName:chapterName];
  499. case RQHomePageCarType_ZGZ_HY:
  500. return [RQ_YDT_ZGZ_HY_Question_Module getChapterQuestionWithChapterName:chapterName];
  501. case RQHomePageCarType_ZGZ_WXP:
  502. return [RQ_YDT_ZGZ_WXP_Question_Module getChapterQuestionWithChapterName:chapterName];
  503. case RQHomePageCarType_ZGZ_CZC:
  504. return [RQ_YDT_ZGZ_CZC_Question_Module getChapterQuestionWithChapterName:chapterName];
  505. case RQHomePageCarType_ZGZ_WYC:
  506. return [RQ_YDT_ZGZ_WYC_Question_Module getChapterQuestionWithChapterName:chapterName];
  507. default:
  508. return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName];
  509. }
  510. }
  511. - (NSArray *)getChapterQuestionWithChapterName:(NSString *)chapterName exerciseType:(RQExerciseType)exerciseType {
  512. return [RQ_YDT_XC_Question_Module getChapterQuestionWithChapterName:chapterName exerciseType:exerciseType];
  513. }
  514. - (NSArray *)getPoint {
  515. switch (self.carType) {
  516. case RQHomePageCarType_Car:
  517. return [RQ_YDT_XC_Question_Module getPoint];
  518. case RQHomePageCarType_Truck:
  519. return [RQ_YDT_HC_Question_Module getPoint];
  520. case RQHomePageCarType_Bus:
  521. return [RQ_YDT_KC_Question_Module getPoint];
  522. case RQHomePageCarType_Motorcycle:
  523. return [RQ_YDT_MTC_Question_Module getPoint];
  524. case RQHomePageCarType_ZGZ_JLY:
  525. return [RQ_YDT_ZGZ_JLY_Question_Module getPoint];
  526. case RQHomePageCarType_ZGZ_KY:
  527. return [RQ_YDT_ZGZ_KY_Question_Module getPoint];
  528. case RQHomePageCarType_ZGZ_HY:
  529. return [RQ_YDT_ZGZ_HY_Question_Module getPoint];
  530. case RQHomePageCarType_ZGZ_WXP:
  531. return [RQ_YDT_ZGZ_WXP_Question_Module getPoint];
  532. case RQHomePageCarType_ZGZ_CZC:
  533. return [RQ_YDT_ZGZ_CZC_Question_Module getPoint];
  534. case RQHomePageCarType_ZGZ_WYC:
  535. return [RQ_YDT_ZGZ_WYC_Question_Module getPoint];
  536. default:
  537. return [RQ_YDT_XC_Question_Module getPoint];
  538. }
  539. }
  540. - (NSArray *)getPointQuestionWithPointID:(NSInteger)pointId {
  541. switch (self.carType) {
  542. case RQHomePageCarType_Car:
  543. return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId];
  544. case RQHomePageCarType_Truck:
  545. return [RQ_YDT_HC_Question_Module getPointQuestionWithPointId:pointId];
  546. case RQHomePageCarType_Bus:
  547. return [RQ_YDT_KC_Question_Module getPointQuestionWithPointId:pointId];
  548. case RQHomePageCarType_Motorcycle:
  549. return [RQ_YDT_MTC_Question_Module getPointQuestionWithPointId:pointId];
  550. case RQHomePageCarType_ZGZ_JLY:
  551. return [RQ_YDT_ZGZ_JLY_Question_Module getPointQuestionWithPointId:pointId];
  552. case RQHomePageCarType_ZGZ_KY:
  553. return [RQ_YDT_ZGZ_KY_Question_Module getPointQuestionWithPointId:pointId];
  554. case RQHomePageCarType_ZGZ_HY:
  555. return [RQ_YDT_ZGZ_HY_Question_Module getPointQuestionWithPointId:pointId];
  556. case RQHomePageCarType_ZGZ_WXP:
  557. return [RQ_YDT_ZGZ_WXP_Question_Module getPointQuestionWithPointId:pointId];
  558. case RQHomePageCarType_ZGZ_CZC:
  559. return [RQ_YDT_ZGZ_CZC_Question_Module getPointQuestionWithPointId:pointId];
  560. case RQHomePageCarType_ZGZ_WYC:
  561. return [RQ_YDT_ZGZ_WYC_Question_Module getPointQuestionWithPointId:pointId];
  562. default:
  563. return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId];
  564. }
  565. }
  566. - (NSArray *)getPointQuestionWithPointID:(NSInteger)pointId exerciseType:(RQExerciseType)exerciseType {
  567. return [RQ_YDT_XC_Question_Module getPointQuestionWithPointId:pointId exerciseType:exerciseType];
  568. }
  569. - (BOOL)isNewRuleQuestionWithQuestionId:(NSInteger)questionId {
  570. switch (self.carType) {
  571. case RQHomePageCarType_Car:
  572. return [RQ_YDT_XC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  573. case RQHomePageCarType_Truck:
  574. return [RQ_YDT_HC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  575. case RQHomePageCarType_Bus:
  576. return [RQ_YDT_KC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  577. case RQHomePageCarType_Motorcycle:
  578. return [RQ_YDT_MTC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  579. case RQHomePageCarType_ZGZ_JLY:
  580. return [RQ_YDT_ZGZ_JLY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  581. case RQHomePageCarType_ZGZ_KY:
  582. return [RQ_YDT_ZGZ_KY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  583. case RQHomePageCarType_ZGZ_HY:
  584. return [RQ_YDT_ZGZ_HY_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  585. case RQHomePageCarType_ZGZ_WXP:
  586. return [RQ_YDT_ZGZ_WXP_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  587. case RQHomePageCarType_ZGZ_CZC:
  588. return [RQ_YDT_ZGZ_CZC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  589. case RQHomePageCarType_ZGZ_WYC:
  590. return [RQ_YDT_ZGZ_WYC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  591. default:
  592. return [RQ_YDT_XC_Question_Module isNewRuleQuestionWithQuestionId:questionId];
  593. }
  594. }
  595. - (NSData *)getMediaDataWithMediaName:(NSString *)mediaName {
  596. switch (self.carType) {
  597. case RQHomePageCarType_Car:
  598. return [RQ_YDT_XC_Question_Module getMediaDataWithMediaName:mediaName];
  599. case RQHomePageCarType_Truck:
  600. return [RQ_YDT_HC_Question_Module getMediaDataWithMediaName:mediaName];
  601. case RQHomePageCarType_Bus:
  602. return [RQ_YDT_KC_Question_Module getMediaDataWithMediaName:mediaName];
  603. case RQHomePageCarType_Motorcycle:
  604. return [RQ_YDT_MTC_Question_Module getMediaDataWithMediaName:mediaName];
  605. case RQHomePageCarType_ZGZ_JLY:
  606. return [RQ_YDT_ZGZ_JLY_Question_Module getMediaDataWithMediaName:mediaName];
  607. case RQHomePageCarType_ZGZ_KY:
  608. return [RQ_YDT_ZGZ_KY_Question_Module getMediaDataWithMediaName:mediaName];
  609. case RQHomePageCarType_ZGZ_HY:
  610. return [RQ_YDT_ZGZ_HY_Question_Module getMediaDataWithMediaName:mediaName];
  611. case RQHomePageCarType_ZGZ_WXP:
  612. return [RQ_YDT_ZGZ_WXP_Question_Module getMediaDataWithMediaName:mediaName];
  613. case RQHomePageCarType_ZGZ_CZC:
  614. return [RQ_YDT_ZGZ_CZC_Question_Module getMediaDataWithMediaName:mediaName];
  615. case RQHomePageCarType_ZGZ_WYC:
  616. return [RQ_YDT_ZGZ_WYC_Question_Module getMediaDataWithMediaName:mediaName];
  617. default:
  618. return [RQ_YDT_XC_Question_Module getMediaDataWithMediaName:mediaName];
  619. }
  620. }
  621. /// 做到哪一题
  622. - (NSInteger)getHistoryQuestionNum {
  623. NSString *key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0"];
  624. if ((RQ_Exercise_Module.currentExerciseType == RQExerciseType_Point || RQ_Exercise_Module.currentExerciseType == RQExerciseType_Chapter) && RQStringIsNotEmpty(RQ_Exercise_Module.otherStr)) {
  625. key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0", RQ_Exercise_Module.otherStr];
  626. }else if(RQ_Exercise_Module.currentExerciseType == RQExerciseType_Block_List) {
  627. key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@-%@-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0", RQ_Exercise_Module.otherStr,RQ_Exercise_Module.codeStr];
  628. }
  629. id object = [RQ_COMMON_MANAGER getObjectWithKey:key];
  630. if (RQObjectIsNil(object)) {
  631. return 0;
  632. } else {
  633. NSInteger historyQuestionNum = [object integerValue];
  634. return historyQuestionNum;
  635. }
  636. }
  637. - (void)saveHistoryQuestionNumWithQuestionId:(NSInteger)questionId {
  638. if(RQ_Exercise_Module.currentExerciseType == RQExerciseType_Error_Special_List){//易错题不记录
  639. return;
  640. }
  641. NSString *key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0"];
  642. if ((RQ_Exercise_Module.currentExerciseType == RQExerciseType_Point || RQ_Exercise_Module.currentExerciseType == RQExerciseType_Chapter) && RQStringIsNotEmpty(RQ_Exercise_Module.otherStr)) {
  643. key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0", RQ_Exercise_Module.otherStr];
  644. }else if(RQ_Exercise_Module.currentExerciseType == RQExerciseType_Block_List) {
  645. key = [NSString stringWithFormat:@"HistoryQuestionNum%ld-%ld-%ld-%@-%@-%@",self.subject,self.carType,RQ_Exercise_Module.currentExerciseType,RQStringIsNotEmpty(RQ_USER_MANAGER.currentUser.loginCode)? RQ_USER_MANAGER.currentUser.loginCode : @"0", RQ_Exercise_Module.otherStr,RQ_Exercise_Module.codeStr];
  646. }
  647. [RQ_SHARE_FUNCTION saveObjectWithObject:@(questionId) ForKey:key];
  648. }
  649. - (NSString *)isWelcomed {
  650. id object = [RQ_SHARE_FUNCTION getObjectWithKey:@"isWelcomed"];
  651. if (RQObjectIsNil(object)) {
  652. return @"";
  653. } else {
  654. NSString *isWelcomed = (NSString *)object;
  655. return isWelcomed;
  656. }
  657. }
  658. - (void)setIsWelcomed:(NSString *)isWelcomed {
  659. [RQ_SHARE_FUNCTION saveObjectWithObject:isWelcomed ForKey:@"isWelcomed"];
  660. }
  661. - (NSString *)car_type {
  662. return [self getCar_TypeNameWithCarType:self.carType];
  663. }
  664. - (NSString *)userSubj1Index {
  665. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"userSubj1Index"];
  666. if (RQObjectIsNil(object)) {
  667. return @"";
  668. } else {
  669. NSString *userSubj1Index = (NSString *)object;
  670. return userSubj1Index;
  671. }
  672. }
  673. - (void)setUserSubj1Index:(NSString *)userSubj1Index {
  674. [RQ_COMMON_MANAGER saveObjectWithObject:userSubj1Index ForKey:@"userSubj1Index"];
  675. }
  676. - (NSString *)userSubj4Index {
  677. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"userSubj4Index"];
  678. if (RQObjectIsNil(object)) {
  679. return @"";
  680. } else {
  681. NSString *userSubj4Index = (NSString *)object;
  682. return userSubj4Index;
  683. }
  684. }
  685. - (void)setUserSubj4Index:(NSString *)userSubj4Index {
  686. [RQ_COMMON_MANAGER saveObjectWithObject:userSubj4Index ForKey:@"userSubj4Index"];
  687. }
  688. - (NSString *)user1Index {
  689. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"user1Index"];
  690. if (RQObjectIsNil(object)) {
  691. return @"";
  692. } else {
  693. NSString *user1Index = (NSString *)object;
  694. return user1Index;
  695. }
  696. }
  697. - (void)setUser1Index:(NSString *)user1Index {
  698. [RQ_COMMON_MANAGER saveObjectWithObject:user1Index ForKey:@"user1Index"];
  699. }
  700. - (NSString *)user4Index {
  701. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"user4Index"];
  702. if (RQObjectIsNil(object)) {
  703. return @"";
  704. } else {
  705. NSString *user4Index = (NSString *)object;
  706. return user4Index;
  707. }
  708. }
  709. - (void)setUser4Index:(NSString *)user4Index {
  710. [RQ_COMMON_MANAGER saveObjectWithObject:user4Index ForKey:@"user4Index"];
  711. }
  712. - (NSString *)A2Subj1Index {
  713. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Subj1Index"];
  714. if (RQObjectIsNil(object)) {
  715. return @"";
  716. } else {
  717. NSString *A2Subj1Index = (NSString *)object;
  718. return A2Subj1Index;
  719. }
  720. }
  721. - (void)setA2Subj1Index:(NSString *)A2Subj1Index{
  722. [RQ_COMMON_MANAGER saveObjectWithObject:A2Subj1Index ForKey:@"A2Subj1Index"];
  723. }
  724. - (NSString *)A2Subj4Index {
  725. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Subj4Index"];
  726. if (RQObjectIsNil(object)) {
  727. return @"";
  728. } else {
  729. NSString *A2Subj4Index = (NSString *)object;
  730. return A2Subj4Index;
  731. }
  732. }
  733. - (void)setA2Subj4Index:(NSString *)A2Subj4Index {
  734. [RQ_COMMON_MANAGER saveObjectWithObject:A2Subj4Index ForKey:@"A2Subj4Index"];
  735. }
  736. - (NSString *)A1Subj1Index {
  737. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Subj1Index"];
  738. if (RQObjectIsNil(object)) {
  739. return @"";
  740. } else {
  741. NSString *A1Subj1Index = (NSString *)object;
  742. return A1Subj1Index;
  743. }
  744. }
  745. - (void)setA1Subj1Index:(NSString *)A1Subj1Index {
  746. [RQ_COMMON_MANAGER saveObjectWithObject:A1Subj1Index ForKey:@"A1Subj1Index"];
  747. }
  748. - (NSString *)A1Subj4Index {
  749. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Subj4Index"];
  750. if (RQObjectIsNil(object)) {
  751. return @"";
  752. } else {
  753. NSString *A1Subj4Index = (NSString *)object;
  754. return A1Subj4Index;
  755. }
  756. }
  757. - (void)setA1Subj4Index:(NSString *)A1Subj4Index {
  758. [RQ_COMMON_MANAGER saveObjectWithObject:A1Subj4Index ForKey:@"A1Subj4Index"];
  759. }
  760. - (NSString *)DSubj1Index {
  761. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"DSubj1Index"];
  762. if (RQObjectIsNil(object)) {
  763. return @"";
  764. } else {
  765. NSString *DSubj1Index = (NSString *)object;
  766. return DSubj1Index;
  767. }
  768. }
  769. - (void)setDSubj1Index:(NSString *)DSubj1Index {
  770. [RQ_COMMON_MANAGER saveObjectWithObject:DSubj1Index ForKey:@"DSubj1Index"];
  771. }
  772. - (NSString *)DSubj4Index {
  773. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"DSubj4Index"];
  774. if (RQObjectIsNil(object)) {
  775. return @"";
  776. } else {
  777. NSString *DSubj4Index = (NSString *)object;
  778. return DSubj4Index;
  779. }
  780. }
  781. - (void)setDSubj4Index:(NSString *)DSubj4Index {
  782. [RQ_COMMON_MANAGER saveObjectWithObject:DSubj4Index ForKey:@"DSubj4Index"];
  783. }
  784. - (NSString *)coachIndex {
  785. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"coachIndex"];
  786. if (RQObjectIsNil(object)) {
  787. return @"";
  788. } else {
  789. NSString *coachIndex = (NSString *)object;
  790. return coachIndex;
  791. }
  792. }
  793. - (void)setCoachIndex:(NSString *)coachIndex {
  794. [RQ_COMMON_MANAGER saveObjectWithObject:coachIndex ForKey:@"coachIndex"];
  795. }
  796. - (NSString *)A1Index {
  797. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A1Index"];
  798. if (RQObjectIsNil(object)) {
  799. return @"";
  800. } else {
  801. NSString *A1Index = (NSString *)object;
  802. return A1Index;
  803. }
  804. }
  805. - (void)setA1Index:(NSString *)A1Index {
  806. [RQ_COMMON_MANAGER saveObjectWithObject:A1Index ForKey:@"A1Index"];
  807. }
  808. - (NSString *)A2Index {
  809. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"A2Index"];
  810. if (RQObjectIsNil(object)) {
  811. return @"";
  812. } else {
  813. NSString *A2Index = (NSString *)object;
  814. return A2Index;
  815. }
  816. }
  817. - (void)setA2Index:(NSString *)A2Index {
  818. [RQ_COMMON_MANAGER saveObjectWithObject:A2Index ForKey:@"A2Index"];
  819. }
  820. - (NSString *)dangerIndex {
  821. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"dangerIndex"];
  822. if (RQObjectIsNil(object)) {
  823. return @"";
  824. } else {
  825. NSString *dangerIndex = (NSString *)object;
  826. return dangerIndex;
  827. }
  828. }
  829. - (void)setDangerIndex:(NSString *)dangerIndex {
  830. [RQ_COMMON_MANAGER saveObjectWithObject:dangerIndex ForKey:@"dangerIndex"];
  831. }
  832. - (NSString *)texiIndex {
  833. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"texiIndex"];
  834. if (RQObjectIsNil(object)) {
  835. return @"";
  836. } else {
  837. NSString *texiIndex = (NSString *)object;
  838. return texiIndex;
  839. }
  840. }
  841. - (void)setTexiIndex:(NSString *)texiIndex {
  842. [RQ_COMMON_MANAGER saveObjectWithObject:texiIndex ForKey:@"texiIndex"];
  843. }
  844. - (NSString *)wycIndex {
  845. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"wycIndex"];
  846. if (RQObjectIsNil(object)) {
  847. return @"";
  848. } else {
  849. NSString *wycIndex = (NSString *)object;
  850. return wycIndex;
  851. }
  852. }
  853. - (void)setWycIndex:(NSString *)wycIndex {
  854. [RQ_COMMON_MANAGER saveObjectWithObject:wycIndex ForKey:@"wycIndex"];
  855. }
  856. - (NSString *)isZhiGeZheng {
  857. id object = [RQ_COMMON_MANAGER getObjectWithKey:@"isZhiGeZheng"];
  858. if (RQObjectIsNil(object)) {
  859. return @"NO";
  860. } else {
  861. NSString *isZhiGeZheng = (NSString *)object;
  862. return isZhiGeZheng;
  863. }
  864. }
  865. - (void)setIsZhiGeZheng:(NSString *)isZhiGeZheng {
  866. [RQ_COMMON_MANAGER saveObjectWithObject:isZhiGeZheng ForKey:@"isZhiGeZheng"];
  867. }
  868. #pragma mark - PrivateMethods
  869. - (NSString *)getCarTypeNameWithCarType:(RQHomePageCarType)carType {
  870. switch (carType) {
  871. case RQHomePageCarType_Car:
  872. return @"xc";
  873. case RQHomePageCarType_Bus:
  874. return @"kc";
  875. case RQHomePageCarType_Truck:
  876. return @"hc";
  877. case RQHomePageCarType_Motorcycle:
  878. return @"mtc";
  879. case RQHomePageCarType_ZGZ_JLY:
  880. return @"zgzjl";
  881. case RQHomePageCarType_ZGZ_KY:
  882. return @"zgzky";
  883. case RQHomePageCarType_ZGZ_HY:
  884. return @"zgzhy";
  885. case RQHomePageCarType_ZGZ_WXP:
  886. return @"zgzwxp";
  887. case RQHomePageCarType_ZGZ_CZC:
  888. return @"zgzcz";
  889. case RQHomePageCarType_ZGZ_WYC:
  890. return @"zgzwyc";
  891. default:
  892. return @"xc";
  893. }
  894. }
  895. - (void)rq_showDBUpdateView {
  896. @weakify(self)
  897. dispatch_async(dispatch_get_main_queue(), ^{
  898. @strongify(self)
  899. RQUpdateView *dbUpdateView = [RQUpdateView updateView];
  900. dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_LibDownload;
  901. dbUpdateView.downloadUrl = self.downloadUrl;
  902. QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
  903. dbModalViewController.contentView = dbUpdateView;
  904. dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
  905. dbModalViewController.modal = YES;
  906. dbUpdateView.modalViewController = dbModalViewController;
  907. [dbModalViewController showWithAnimated:YES completion:nil];
  908. });
  909. }
  910. - (void)rq_showJSUpdateView {
  911. @weakify(self)
  912. dispatch_async(dispatch_get_main_queue(), ^{
  913. @strongify(self)
  914. RQUpdateView *dbUpdateView = [RQUpdateView updateView];
  915. dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_ExplainDownload;
  916. dbUpdateView.jsDownloadUrl = self.jsDownloadUrl;
  917. QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
  918. dbModalViewController.contentView = dbUpdateView;
  919. dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
  920. dbModalViewController.modal = YES;
  921. dbUpdateView.modalViewController = dbModalViewController;
  922. [dbModalViewController showWithAnimated:YES completion:nil];
  923. });
  924. }
  925. - (void)rq_showJQUpdateView {
  926. @weakify(self)
  927. dispatch_async(dispatch_get_main_queue(), ^{
  928. @strongify(self)
  929. RQUpdateView *dbUpdateView = [RQUpdateView updateView];
  930. dbUpdateView.questionUpdateViewType = RQQuestionUpdateViewType_ExplainDownload;
  931. dbUpdateView.jsDownloadUrl = self.jqDownloadUrl;
  932. QMUIModalPresentationViewController *dbModalViewController = [[QMUIModalPresentationViewController alloc] init];
  933. dbModalViewController.contentView = dbUpdateView;
  934. dbModalViewController.contentViewMargins = UIEdgeInsetsMake(0, 0, 0, 0);
  935. dbModalViewController.modal = YES;
  936. dbUpdateView.modalViewController = dbModalViewController;
  937. [dbModalViewController showWithAnimated:YES completion:nil];
  938. });
  939. }
  940. @end