Commit c61266a9 authored by 曹云霄's avatar 曹云霄

修改项说明:

parent 81f157cd
......@@ -249,7 +249,7 @@
}else {
WS(weakSelf);
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(GETINTEGRAL) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(GETINTEGRAL),@"studyScore"] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
AssessmentQualifiedViewController *qualified = [[[weakSelf class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentQualifiedViewController"];
......
......@@ -8,9 +8,15 @@
#import "BaseViewController.h"
@interface AnswerViewController : BaseViewController
@protocol DismissDelegate <NSObject>
@optional
- (void)dismissController;
@end
@interface AnswerViewController : BaseViewController
@property (nonatomic,weak) id<DismissDelegate>delegate;
@property (weak, nonatomic) IBOutlet UITableView *answerTableView;
/**
......
......@@ -14,7 +14,7 @@
#import "EmigratedFinishViewController.h"
@interface AnswerViewController ()<UITableViewDelegate,UITableViewDataSource,WYPopoverControllerDelegate>
@interface AnswerViewController ()<UITableViewDelegate,UITableViewDataSource,WYPopoverControllerDelegate,CompeteDelegate>
@property (nonatomic,strong) WYPopoverController *popover;
......@@ -150,6 +150,9 @@
#pragma mark - 提交答案
- (void)submitAnswer
{
if ([self.delegate respondsToSelector:@selector(dismissController)]) {
[self.delegate dismissController];
}
TOPassLevelResultEntity *studyResult = [[TOPassLevelResultEntity alloc]init];
studyResult.passLevelId = self.passLevelId;
studyResult.submitTime = [[self class] getTimeby:0];
......@@ -228,7 +231,7 @@
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
[weakSelf determineIsQualified:[studyResult.grade integerValue]];
[weakSelf determineIsQualified:[studyResult.grade integerValue] passResult:[studyResult.passResult integerValue]];
}else{
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
......@@ -239,21 +242,28 @@
}
#pragma mark - 判断得分是否及格
- (void)determineIsQualified:(NSInteger)allScore
- (void)determineIsQualified:(NSInteger)allScore passResult:(NSInteger)state
{
EmigratedFinishViewController *finish = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"EmigratedFinishViewController"];
finish.delegate = self;
finish.preferredContentSize = CGSizeMake(520, 400);
if (self.emigrated.passGrade > allScore) {
EmigratedFinishViewController *finish = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"EmigratedFinishViewController"];
finish.preferredContentSize = CGSizeMake(520, 400);
finish.state = state;
finish.score = [NSString stringWithFormat:@"%ld",allScore];
[self showPopoverView:finish];
}else {
WS(weakSelf);
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(GETINTEGRAL) WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(GETINTEGRAL),@"passLevelScore"];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
finish.state = state;
finish.score = [NSString stringWithFormat:@"%ld",allScore];
finish.integral = [NSString stringWithFormat:@"+%@",returnValue[@"data"][@"optionValue"]];
[weakSelf showPopoverView:finish];
}else {
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
......@@ -265,6 +275,12 @@
}
}
#pragma mark - 完成
- (void)finish
{
[self.popover dismissPopoverAnimated:YES];
}
#pragma mark - 弹出框
- (void)showPopoverView:(BaseViewController *)controller
{
......
......@@ -8,15 +8,49 @@
#import "BaseViewController.h"
@interface EmigratedFinishViewController : BaseViewController
@protocol CompeteDelegate <NSObject>
- (void)finish;
@end
/**
闯关结果
- NotThrough: 未通过
- Through: 已通过
- Audit: 待审核
*/
typedef NS_ENUM(NSInteger,RESULT_STATE){
NotThrough = 0,
Through,
Audit
};
@interface EmigratedFinishViewController : BaseViewController
@property (nonatomic,weak) id<CompeteDelegate>delegate;
@property (nonatomic,assign) RESULT_STATE state;
/**
闯关结果
*/
@property (weak, nonatomic) IBOutlet UILabel *emigratedResultLabel;
//@property (nonatomic,assign)
/**
得分
*/
@property (nonatomic,copy) NSString *score;
/**
积分
*/
@property (weak, nonatomic) IBOutlet UILabel *integralLabel;
/**
积分
*/
@property (nonatomic,copy) NSString *integral;
@end
......@@ -16,12 +16,48 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
switch (self.state) {
case NotThrough:
{
NSString *string = [NSString stringWithFormat:@"您的得分为%@\n\n闯关失败!",self.score];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:string];
NSRange range = NSMakeRange(5, [self.score length]);
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:range];
[attributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:35] range:range];
self.emigratedResultLabel.attributedText = attributedString;
}
break;
case Through:
{
NSString *string = [NSString stringWithFormat:@"您的得分为%@\n\n恭喜您,闯关成功!",self.score];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc]initWithString:string];
NSRange range = NSMakeRange(5, [self.score length]);
[attributedString addAttribute:NSForegroundColorAttributeName value:[UIColor redColor] range:range];
[attributedString addAttribute:NSFontAttributeName value:[UIFont fontWithName:@"HelveticaNeue-Bold" size:35] range:range];
self.integralLabel.text = [NSString stringWithFormat:@"+%@",self.integral];
self.emigratedResultLabel.attributedText = attributedString;
}
break;
case Audit:
{
self.emigratedResultLabel.text = @"您的回答已提交\n\n请等待反馈!";
}
break;
default:
break;
}
}
#pragma mark - 完成
- (IBAction)finishButtonClickAction:(UIButton *)sender {
if ([self.delegate respondsToSelector:@selector(finish)]) {
[self.delegate finish];
}
}
......
......@@ -11,7 +11,7 @@
#import "InstructionsViewController.h"
#import "AnswerViewController.h"
@interface EmigratedMainViewController ()<WYPopoverControllerDelegate>
@interface EmigratedMainViewController ()<WYPopoverControllerDelegate,DismissDelegate>
@property (nonatomic,strong) WYPopoverController *popover;
......@@ -87,11 +87,18 @@
{
TOPassLevelEntity *entity = self.emigratedResponse.passLevelEntity[sender.view.tag];
AnswerViewController *answer = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AnswerViewController"];
answer.delegate = self;
answer.passLevelId = entity.fid;
answer.preferredContentSize = CGSizeMake(520, 400);
[self showPopoverView:answer];
}
#pragma mark - 做题完成
- (void)dismissController
{
[self.popover dismissPopoverAnimated:YES];
}
#pragma mark - 闯关说明
- (IBAction)instructionsButtonClickAction:(UIButton *)sender {
......
This diff is collapsed.
......@@ -350,7 +350,7 @@ NSString *const SUBMITANSWER = @"/study/submitStudyResult";
/**
* 获取相应分数对应的积分
*/
NSString *const GETINTEGRAL = @"/option/get/studyScore";
NSString *const GETINTEGRAL = @"/option/get/%@";
/**
* 获取闯关详情
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment