123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- //
- // NYExaminationTipsViewController.m
- // jiaPei
- //
- // Created by Ning.ge on 2024/11/5.
- // Copyright © 2024 JCZ. All rights reserved.
- //
- #import "NYExaminationTipsViewController.h"
- @interface NYExaminationTipsViewController ()
- @property (nonatomic, readwrite, strong) RQYDTJSModel *ydtJSModel;
- @property (nonatomic, assign) int type;
- @end
- @implementation NYExaminationTipsViewController
- - (void)viewDidLoad {
- [super viewDidLoad];
- // Do any additional setup after loading the view from its nib.
- self.view.layer.backgroundColor = [UIColor colorWithRed:0/255.0 green:0/255.0 blue:0/255.0 alpha:0.5].CGColor;
- }
- - (void)viewWillAppear:(BOOL)animated {
- [super viewWillAppear:animated];
- [self.navigationController.navigationBar setHidden:YES];
- }
- - (void)enterLandscapeFullScreen:(UIInterfaceOrientation)orientation animated:(BOOL)animated {
- [[UIDevice currentDevice] setValue:[NSNumber numberWithInt:UIInterfaceOrientationUnknown] forKey:@"orientation"];
- NSNumber *orientationUnknown = [NSNumber numberWithInt:UIInterfaceOrientationLandscapeLeft];
- [[UIDevice currentDevice] setValue:orientationUnknown forKey:@"orientation"];
- }
- //支持的方向
- - (UIInterfaceOrientationMask)supportedInterfaceOrientations
- {
- return UIInterfaceOrientationMaskLandscapeLeft|UIInterfaceOrientationMaskLandscapeRight;
- }
- - (UIInterfaceOrientation) preferredInterfaceOrientationForPresentation
- {
- return UIInterfaceOrientationPortrait;
- }
- //show 函数
- - (void)showTypeTipsView:(int)type invView:(UIView*)view inModel:(RQExerciseModel *)model {
- self.type = type;
- [self.view removeFromSuperview];
- [view insertSubview:self.view atIndex:999];
- [self.view mas_remakeConstraints:^(MASConstraintMaker *make) {
- make.top.left.right.bottom.mas_equalTo(view);
- }];
- [self.view setNeedsLayout];
- [self.view layoutIfNeeded];
- switch (type) {
- case 0:{
- self.ydtJSModel = [RQ_YDT_JS_Question_Module getQuestionJSWithQuestionId:model.ydtQuestionModel.ID];
- model.ydtQuestionModel.explain = self.ydtJSModel.best_explain_new;//2023.9.25
- self.t0_View.hidden = NO;
- self.t1_View.hidden = YES;
- self.t2_View.hidden = YES;
- self.t3_View.hidden = YES;
- self.title_label.text = @"错题学习";
- NSDictionary *dicts = @{
- @"1":@"A",
- @"2":@"B",
- @"3":@"C",
- @"4":@"D",
-
- @"12":@"AB",
- @"13":@"AC",
- @"14":@"AD",
- @"23":@"BC",
- @"24":@"BD",
- @"34":@"CD",
-
- @"123":@"ABC",
- @"124":@"ABD",
- @"134":@"ACD",
- @"234":@"BCD",
-
- @"1234":@"ABCD",
- };
-
- self.t0_answer_label.text = [NSString stringWithFormat:@"正确答案:%@ 您的答案:%@", dicts[model.ydtQuestionModel.AnswerTrue],model.userAnswerStr];
- self.t0_jq_label.text = model.ydtQuestionModel.explain;
- }break;
- case 1:{
- self.t0_View.hidden = YES;
- self.t1_View.hidden = NO;
- self.t2_View.hidden = YES;
- self.t3_View.hidden = YES;
- self.title_label.text = @"考试确认窗口";
- }break;
- case 2:{
- self.title_label.text = @"信息提示";
- self.t0_View.hidden = YES;
- self.t1_View.hidden = YES;
- self.t2_View.hidden = NO;
- self.t3_View.hidden = YES;
- }break;
- case 3:{
- self.title_label.text = @"温馨提示";
- self.t0_View.hidden = YES;
- self.t1_View.hidden = YES;
- self.t2_View.hidden = YES;
- self.t3_View.hidden = NO;
- }break;
- default:{
- self.t1_centont_label.text = [NSString stringWithFormat:@"你当前考试答对0题,答错0题,未答100题"];
- self.t0_View.hidden = YES;
- self.t1_View.hidden = YES;
- self.t2_View.hidden = YES;
- self.t3_View.hidden = YES;
- }break;
- }
-
- }
- //关闭
- - (IBAction)closeActiondo:(UIButton *)sender {
- if(self.type==2){//交卷-退出
- [RQNotificationCenter postNotificationName:NYExerciseOptionDTNotification object:@"3"];
- }
- [self.view removeFromSuperview];
- [self.view setNeedsLayout];
- [self.view layoutIfNeeded];
- }
- //确认交卷
- - (IBAction)submitActiondo:(UIButton *)sender {
- [RQNotificationCenter postNotificationName:NYExerciseOptionDTNotification object:@"2"];
- }
- //继续考试
- - (IBAction)continueActiondo:(UIButton *)sender {
- [self closeActiondo:sender];
- }
- //确认-退出
- - (IBAction)outInActiondo:(UIButton *)sender {
- [RQNotificationCenter postNotificationName:NYExerciseOptionDTNotification object:@"3"];
- }
- @end
|