Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
Opple-iOS
Commits
c61266a9
Commit
c61266a9
authored
Dec 08, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改项说明:
parent
81f157cd
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
139 additions
and
32 deletions
+139
-32
AssessmentViewController.m
.../LearningCenter/OnlineLearning/AssessmentViewController.m
+1
-1
AnswerViewController.h
Class/LearningCenter/SkillsAssessment/AnswerViewController.h
+7
-1
AnswerViewController.m
Class/LearningCenter/SkillsAssessment/AnswerViewController.m
+24
-8
EmigratedFinishViewController.h
...ngCenter/SkillsAssessment/EmigratedFinishViewController.h
+36
-2
EmigratedFinishViewController.m
...ngCenter/SkillsAssessment/EmigratedFinishViewController.m
+37
-1
EmigratedMainViewController.m
...ningCenter/SkillsAssessment/EmigratedMainViewController.m
+8
-1
LearningCenter.storyboard
Lighting/LearningCenter.storyboard
+25
-17
CYConstManager.m
Tools/CYConstManager.m
+1
-1
No files found.
Class/LearningCenter/OnlineLearning/AssessmentViewController.m
View file @
c61266a9
...
@@ -249,7 +249,7 @@
...
@@ -249,7 +249,7 @@
}
else
{
}
else
{
WS
(
weakSelf
);
WS
(
weakSelf
);
[
XBLoadingView
showHUDViewWithDefault
];
[
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
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
AssessmentQualifiedViewController
*
qualified
=
[[[
weakSelf
class
]
getLearningCenterStoryboardClass
]
instantiateViewControllerWithIdentifier
:
@"AssessmentQualifiedViewController"
];
AssessmentQualifiedViewController
*
qualified
=
[[[
weakSelf
class
]
getLearningCenterStoryboardClass
]
instantiateViewControllerWithIdentifier
:
@"AssessmentQualifiedViewController"
];
...
...
Class/LearningCenter/SkillsAssessment/AnswerViewController.h
View file @
c61266a9
...
@@ -8,9 +8,15 @@
...
@@ -8,9 +8,15 @@
#import "BaseViewController.h"
#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
;
@property
(
weak
,
nonatomic
)
IBOutlet
UITableView
*
answerTableView
;
/**
/**
...
...
Class/LearningCenter/SkillsAssessment/AnswerViewController.m
View file @
c61266a9
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
#import "EmigratedFinishViewController.h"
#import "EmigratedFinishViewController.h"
@interface
AnswerViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
WYPopoverControllerDelegate
>
@interface
AnswerViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
WYPopoverControllerDelegate
,
CompeteDelegate
>
@property
(
nonatomic
,
strong
)
WYPopoverController
*
popover
;
@property
(
nonatomic
,
strong
)
WYPopoverController
*
popover
;
...
@@ -150,6 +150,9 @@
...
@@ -150,6 +150,9 @@
#pragma mark - 提交答案
#pragma mark - 提交答案
-
(
void
)
submitAnswer
-
(
void
)
submitAnswer
{
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
dismissController
)])
{
[
self
.
delegate
dismissController
];
}
TOPassLevelResultEntity
*
studyResult
=
[[
TOPassLevelResultEntity
alloc
]
init
];
TOPassLevelResultEntity
*
studyResult
=
[[
TOPassLevelResultEntity
alloc
]
init
];
studyResult
.
passLevelId
=
self
.
passLevelId
;
studyResult
.
passLevelId
=
self
.
passLevelId
;
studyResult
.
submitTime
=
[[
self
class
]
getTimeby
:
0
];
studyResult
.
submitTime
=
[[
self
class
]
getTimeby
:
0
];
...
@@ -228,7 +231,7 @@
...
@@ -228,7 +231,7 @@
[
XBLoadingView
hideHUDViewWithDefault
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
weakSelf
determineIsQualified
:[
studyResult
.
grade
integerValue
]];
[
weakSelf
determineIsQualified
:[
studyResult
.
grade
integerValue
]
passResult
:[
studyResult
.
passResult
integerValue
]
];
}
else
{
}
else
{
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
}
}
...
@@ -239,21 +242,28 @@
...
@@ -239,21 +242,28 @@
}
}
#pragma mark - 判断得分是否及格
#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
)
{
if
(
self
.
emigrated
.
passGrade
>
allScore
)
{
EmigratedFinishViewController
*
finish
=
[[[
self
class
]
getLearningCenterStoryboardClass
]
instantiateViewControllerWithIdentifier
:
@"EmigratedFinishViewController"
]
;
finish
.
state
=
state
;
finish
.
preferredContentSize
=
CGSizeMake
(
520
,
400
)
;
finish
.
score
=
[
NSString
stringWithFormat
:
@"%ld"
,
allScore
]
;
[
self
showPopoverView
:
finish
];
[
self
showPopoverView
:
finish
];
}
else
{
}
else
{
WS
(
weakSelf
);
WS
(
weakSelf
);
[
XBLoadingView
showHUDViewWithDefault
];
[
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
];
[
XBLoadingView
hideHUDViewWithDefault
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
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
{
}
else
{
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
[
XBLoadingView
showHUDViewWithText
:
returnValue
[
@"message"
]];
...
@@ -265,6 +275,12 @@
...
@@ -265,6 +275,12 @@
}
}
}
}
#pragma mark - 完成
-
(
void
)
finish
{
[
self
.
popover
dismissPopoverAnimated
:
YES
];
}
#pragma mark - 弹出框
#pragma mark - 弹出框
-
(
void
)
showPopoverView
:
(
BaseViewController
*
)
controller
-
(
void
)
showPopoverView
:
(
BaseViewController
*
)
controller
{
{
...
...
Class/LearningCenter/SkillsAssessment/EmigratedFinishViewController.h
View file @
c61266a9
...
@@ -8,15 +8,49 @@
...
@@ -8,15 +8,49 @@
#import "BaseViewController.h"
#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
(
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
@end
Class/LearningCenter/SkillsAssessment/EmigratedFinishViewController.m
View file @
c61266a9
...
@@ -16,12 +16,48 @@
...
@@ -16,12 +16,48 @@
-
(
void
)
viewDidLoad
{
-
(
void
)
viewDidLoad
{
[
super
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 - 完成
#pragma mark - 完成
-
(
IBAction
)
finishButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
finishButtonClickAction
:
(
UIButton
*
)
sender
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
finish
)])
{
[
self
.
delegate
finish
];
}
}
}
...
...
Class/LearningCenter/SkillsAssessment/EmigratedMainViewController.m
View file @
c61266a9
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#import "InstructionsViewController.h"
#import "InstructionsViewController.h"
#import "AnswerViewController.h"
#import "AnswerViewController.h"
@interface
EmigratedMainViewController
()
<
WYPopoverControllerDelegate
>
@interface
EmigratedMainViewController
()
<
WYPopoverControllerDelegate
,
DismissDelegate
>
@property
(
nonatomic
,
strong
)
WYPopoverController
*
popover
;
@property
(
nonatomic
,
strong
)
WYPopoverController
*
popover
;
...
@@ -87,11 +87,18 @@
...
@@ -87,11 +87,18 @@
{
{
TOPassLevelEntity
*
entity
=
self
.
emigratedResponse
.
passLevelEntity
[
sender
.
view
.
tag
];
TOPassLevelEntity
*
entity
=
self
.
emigratedResponse
.
passLevelEntity
[
sender
.
view
.
tag
];
AnswerViewController
*
answer
=
[[[
self
class
]
getLearningCenterStoryboardClass
]
instantiateViewControllerWithIdentifier
:
@"AnswerViewController"
];
AnswerViewController
*
answer
=
[[[
self
class
]
getLearningCenterStoryboardClass
]
instantiateViewControllerWithIdentifier
:
@"AnswerViewController"
];
answer
.
delegate
=
self
;
answer
.
passLevelId
=
entity
.
fid
;
answer
.
passLevelId
=
entity
.
fid
;
answer
.
preferredContentSize
=
CGSizeMake
(
520
,
400
);
answer
.
preferredContentSize
=
CGSizeMake
(
520
,
400
);
[
self
showPopoverView
:
answer
];
[
self
showPopoverView
:
answer
];
}
}
#pragma mark - 做题完成
-
(
void
)
dismissController
{
[
self
.
popover
dismissPopoverAnimated
:
YES
];
}
#pragma mark - 闯关说明
#pragma mark - 闯关说明
-
(
IBAction
)
instructionsButtonClickAction
:
(
UIButton
*
)
sender
{
-
(
IBAction
)
instructionsButtonClickAction
:
(
UIButton
*
)
sender
{
...
...
Lighting/LearningCenter.storyboard
View file @
c61266a9
This diff is collapsed.
Click to expand it.
Tools/CYConstManager.m
View file @
c61266a9
...
@@ -350,7 +350,7 @@ NSString *const SUBMITANSWER = @"/study/submitStudyResult";
...
@@ -350,7 +350,7 @@ NSString *const SUBMITANSWER = @"/study/submitStudyResult";
/**
/**
* 获取相应分数对应的积分
* 获取相应分数对应的积分
*/
*/
NSString
*
const
GETINTEGRAL
=
@"/option/get/
studyScore
"
;
NSString
*
const
GETINTEGRAL
=
@"/option/get/
%@
"
;
/**
/**
* 获取闯关详情
* 获取闯关详情
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment