NYExaminationTipsViewController.m 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. //
  2. // NYExaminationTipsViewController.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2024/11/5.
  6. // Copyright © 2024 JCZ. All rights reserved.
  7. //
  8. #import "NYExaminationTipsViewController.h"
  9. @interface NYExaminationTipsViewController ()
  10. @property (nonatomic, readwrite, strong) RQYDTJSModel *ydtJSModel;
  11. @property (nonatomic, assign) int type;
  12. @end
  13. @implementation NYExaminationTipsViewController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. // Do any additional setup after loading the view from its nib.
  17. self.view.layer.backgroundColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.5].CGColor;
  18. }
  19. - (void)viewWillAppear:(BOOL)animated {
  20. [super viewWillAppear:animated];
  21. [self.navigationController.navigationBar setHidden:YES];
  22. }
  23. - (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
  24. [[UIDevice currentDevice] setValue:[NSNumber numberWithInt:UIInterfaceOrientationUnknown] forKey:@"orientation"];
  25. NSNumber *orientationUnknown = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];
  26. [[UIDevice currentDevice] setValue:orientationUnknown forKey:@"orientation"];
  27. }
  28. //支持的方向
  29. - (UIInterfaceOrientationMask)supportedInterfaceOrientations
  30. {
  31. return UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskLandscapeRight;
  32. }
  33. - (UIInterfaceOrientation) preferredInterfaceOrientationForPresentation
  34. {
  35. return UIInterfaceOrientationPortrait;
  36. }
  37. //show 函数
  38. - (void)showTypeTipsView:(int)type invView:(UIView*)view inModel:(RQExerciseModel *)model {
  39. self.type = type;
  40. [self.view removeFromSuperview];
  41. [view insertSubview:self.view atIndex:999];
  42. [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
  43. make.top.left.right.bottom.mas_equalTo(view);
  44. }];
  45. [self.view setNeedsLayout];
  46. [self.view layoutIfNeeded];
  47. switch (type) {
  48. case 0:{
  49. self.ydtJSModel = [RQ_YDT_JS_Question_Module getQuestionJSWithQuestionId:model.ydtQuestionModel.ID];
  50. model.ydtQuestionModel.explain = self.ydtJSModel.best_explain_new;//2023.9.25
  51. self.t0_View.hidden = NO;
  52. self.t1_View.hidden = YES;
  53. self.t2_View.hidden = YES;
  54. self.t3_View.hidden = YES;
  55. self.title_label.text = @"错题学习";
  56. NSDictionary *dicts = @{
  57. @"1":@"A",
  58. @"2":@"B",
  59. @"3":@"C",
  60. @"4":@"D",
  61. @"12":@"AB",
  62. @"13":@"AC",
  63. @"14":@"AD",
  64. @"23":@"BC",
  65. @"24":@"BD",
  66. @"34":@"CD",
  67. @"123":@"ABC",
  68. @"124":@"ABD",
  69. @"134":@"ACD",
  70. @"234":@"BCD",
  71. @"1234":@"ABCD",
  72. };
  73. self.t0_answer_label.text = [NSString stringWithFormat:@"正确答案:%@ 您的答案:%@", dicts[model.ydtQuestionModel.AnswerTrue],model.userAnswerStr];
  74. self.t0_jq_label.text = model.ydtQuestionModel.explain;
  75. }break;
  76. case 1:{
  77. self.t0_View.hidden = YES;
  78. self.t1_View.hidden = NO;
  79. self.t2_View.hidden = YES;
  80. self.t3_View.hidden = YES;
  81. self.title_label.text = @"考试确认窗口";
  82. }break;
  83. case 2:{
  84. self.title_label.text = @"信息提示";
  85. self.t0_View.hidden = YES;
  86. self.t1_View.hidden = YES;
  87. self.t2_View.hidden = NO;
  88. self.t3_View.hidden = YES;
  89. }break;
  90. case 3:{
  91. self.title_label.text = @"温馨提示";
  92. self.t0_View.hidden = YES;
  93. self.t1_View.hidden = YES;
  94. self.t2_View.hidden = YES;
  95. self.t3_View.hidden = NO;
  96. }break;
  97. default:{
  98. self.t1_centont_label.text = [NSString stringWithFormat:@"你当前考试答对0题,答错0题,未答100题"];
  99. self.t0_View.hidden = YES;
  100. self.t1_View.hidden = YES;
  101. self.t2_View.hidden = YES;
  102. self.t3_View.hidden = YES;
  103. }break;
  104. }
  105. }
  106. //关闭
  107. - (IBAction)closeActiondo:(UIButton *)sender {
  108. if(self.type==2){//交卷-退出
  109. [RQNotificationCenter postNotificationName:NYExerciseOptionDTNotification object:@"3"];
  110. }
  111. [self.view removeFromSuperview];
  112. [self.view setNeedsLayout];
  113. [self.view layoutIfNeeded];
  114. }
  115. //确认交卷
  116. - (IBAction)submitActiondo:(UIButton *)sender {
  117. [RQNotificationCenter postNotificationName:NYExerciseOptionDTNotification object:@"2"];
  118. }
  119. //继续考试
  120. - (IBAction)continueActiondo:(UIButton *)sender {
  121. [self closeActiondo:sender];
  122. }
  123. //确认-退出
  124. - (IBAction)outInActiondo:(UIButton *)sender {
  125. [RQNotificationCenter postNotificationName:NYExerciseOptionDTNotification object:@"3"];
  126. }
  127. @end