Commit b5bec041 authored by Sandy's avatar Sandy

1.学习完成增加是否学习完成接口。2.列表页增加答题按钮

parent 6bbcfab2
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
三次重考机会 三次重考机会
*/ */
@property (nonatomic,assign) NSInteger retakeCount; @property (nonatomic,assign) NSInteger retakeCount;
@property (strong, nonatomic) TOStudyResultEntity *studyResult;
@end @end
...@@ -52,6 +53,7 @@ ...@@ -52,6 +53,7 @@
self.retakeCount = 3; self.retakeCount = 3;
[self getExaminationQuestions]; [self getExaminationQuestions];
[self httpGetAnswerId];
} }
#pragma mark - 获取考题 #pragma mark - 获取考题
...@@ -156,9 +158,9 @@ ...@@ -156,9 +158,9 @@
#pragma mark - 提交考核结果 #pragma mark - 提交考核结果
- (void)submitAnswer - (void)submitAnswer
{ {
TOStudyResultEntity *studyResult = [[TOStudyResultEntity alloc]init]; TOStudyResultEntity *studyResult = self.studyResult;
studyResult.taskId = self.taskId; // studyResult.taskId = self.taskId;
studyResult.employeeId = [Shoppersmanager manager].shoppers.employee.fid; // studyResult.employeeId = [Shoppersmanager manager].shoppers.employee.fid;
studyResult.submitTime = [[NSDate date] httpParameterString]; studyResult.submitTime = [[NSDate date] httpParameterString];
NSArray *answerArray = self.taskDetails.topics; NSArray *answerArray = self.taskDetails.topics;
NSMutableArray *submitAnswerArray = [NSMutableArray array]; NSMutableArray *submitAnswerArray = [NSMutableArray array];
...@@ -244,6 +246,17 @@ ...@@ -244,6 +246,17 @@
}]; }];
} }
- (void)httpGetAnswerId {
WS(weakSelf);
NSString *url = [NSString stringWithFormat:@"/study/startExam/%@/%@", self.taskId, [Shoppersmanager manager].shoppers.employee.fid];
[HTTP networkRequestWithURL:SERVERREQUESTURL(url) withRequestType:(GET) withParameter:nil withReturnValueBlock:^(id returnValue) {
NSLog(@"%@", returnValue);
weakSelf.studyResult = [[TOStudyResultEntity alloc] initWithDictionary:RESPONSE(returnValue) error:nil];
} withFailureBlock:^(NSError *error) {
}];
}
#pragma mark - 判断得分是否及格 #pragma mark - 判断得分是否及格
- (void)determineIsQualified:(NSInteger)allScore - (void)determineIsQualified:(NSInteger)allScore
......
...@@ -13,10 +13,10 @@ ...@@ -13,10 +13,10 @@
#import "LearningCompleteViewController.h" #import "LearningCompleteViewController.h"
#import "AssessmentViewController.h" #import "AssessmentViewController.h"
@interface OnlineLearningDetailViewController ()<SelectStudyItemDelegate,VideoPlayerDelegate,BeginAssessmentDelegate,InspectionStateDelegate> @interface OnlineLearningDetailViewController ()<SelectStudyItemDelegate,VideoPlayerDelegate,BeginAssessmentDelegate,InspectionStateDelegate>
@property (nonatomic,strong) WYPopoverController *settingsPopoverController; @property (nonatomic,strong) WYPopoverController *settingsPopoverController;
@property (nonatomic, assign) BOOL isNotFirstIn;
@end @end
...@@ -31,9 +31,11 @@ ...@@ -31,9 +31,11 @@
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) { if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO; self.navigationController.interactivePopGestureRecognizer.enabled = NO;
} }
if (!self.isNotFirstIn) {
//播放进入选中的视频 //播放进入选中的视频
[self seleStudyItemCellIndex:self.interIndex]; self.isNotFirstIn = YES;
[self seleStudyItemCellIndex:self.interIndex];
}
} }
#pragma mark -视图即将消失 #pragma mark -视图即将消失
...@@ -195,6 +197,7 @@ ...@@ -195,6 +197,7 @@
pptVc.type = Study; pptVc.type = Study;
pptVc.indexPath = indexPath; pptVc.indexPath = indexPath;
videoVc.learningItem = nil; videoVc.learningItem = nil;
pptVc.studyId = studyList.fid;
[pptVc setScrollViewEndBottomBlock:^(NSIndexPath *indexPath){ [pptVc setScrollViewEndBottomBlock:^(NSIndexPath *indexPath){
[weakSelf dismissViewControllerAnimated:YES completion:^{ [weakSelf dismissViewControllerAnimated:YES completion:^{
[weakSelf videoPlayFinish:studyList withIndexPath:indexPath]; [weakSelf videoPlayFinish:studyList withIndexPath:indexPath];
...@@ -226,10 +229,21 @@ ...@@ -226,10 +229,21 @@
}]; }];
} }
#pragma mark - 学习完成,告诉服务器学习完成
- (void)httpStudyCompleteTaskId:(NSString *)taskId {
NSString *url = [NSString stringWithFormat:@"/study/finishStudy/%@/%@", taskId, [Shoppersmanager manager].shoppers.employee.fid];
[HTTP networkRequestWithURL:SERVERREQUESTURL(url) withRequestType:(GET) withParameter:nil withReturnValueBlock:^(id returnValue) {
NSLog(@"%@", returnValue);
} withFailureBlock:^(NSError *error) {
}];
}
#pragma mark - 视频播放完成 #pragma mark - 视频播放完成
- (void)videoPlayFinish:(CustomStudyEntity *)studyEntity withIndexPath:(NSIndexPath *)indexPath - (void)videoPlayFinish:(CustomStudyEntity *)studyEntity withIndexPath:(NSIndexPath *)indexPath
{ {
[self httpStudyCompleteTaskId:studyEntity.fid];
WS(weakSelf); WS(weakSelf);
[self studyFinishGetIntegral:^(NSString *integral) { [self studyFinishGetIntegral:^(NSString *integral) {
LearningCompleteViewController *assessmentVc = [[[weakSelf class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"LearningCompleteViewController"]; LearningCompleteViewController *assessmentVc = [[[weakSelf class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"LearningCompleteViewController"];
...@@ -299,6 +313,7 @@ ...@@ -299,6 +313,7 @@
videoWindow.playerLayer.frame = CGRectMake(0, 0, ScreenWidth*2/3, ScreenHeight/2); videoWindow.playerLayer.frame = CGRectMake(0, 0, ScreenWidth*2/3, ScreenHeight/2);
}completion:^(BOOL finished) { }completion:^(BOOL finished) {
[weakSelf assessment:studyEntity.fid withIndexPath:indexPath]; [weakSelf assessment:studyEntity.fid withIndexPath:indexPath];
}]; }];
}else { }else {
[weakSelf assessment:studyEntity.fid withIndexPath:indexPath]; [weakSelf assessment:studyEntity.fid withIndexPath:indexPath];
......
...@@ -169,7 +169,7 @@ ...@@ -169,7 +169,7 @@
}else if (self.type == VideoViewTypeList){ }else if (self.type == VideoViewTypeList){
OnlineLearningDetailViewController *studyDetail = [[[self class] getLearningCenterStoryboardClass]instantiateViewControllerWithIdentifier:@"OnlineLearningDetailViewController"]; OnlineLearningDetailViewController *studyDetail = [[[self class] getLearningCenterStoryboardClass]instantiateViewControllerWithIdentifier:@"OnlineLearningDetailViewController"];
studyDetail.studyResult = self.studyTypeEntity; studyDetail.studyResult = self.studyTypeEntity;
studyDetail.interIndex = indexPath; studyDetail.interIndex = indexPath;
[self.navigationController pushViewController:studyDetail animated:YES]; [self.navigationController pushViewController:studyDetail animated:YES];
} }
......
...@@ -36,4 +36,9 @@ ...@@ -36,4 +36,9 @@
*/ */
@property (nonatomic,strong) CustomStudyEntity *model; @property (nonatomic,strong) CustomStudyEntity *model;
/**
开始答题按钮
*/
@property (weak, nonatomic) IBOutlet UIButton *btnStartAnswer;
@end @end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "PPTListItemTableViewCell.h" #import "PPTListItemTableViewCell.h"
#import "AssessmentViewController.h"
@implementation PPTListItemTableViewCell @implementation PPTListItemTableViewCell
- (void)awakeFromNib { - (void)awakeFromNib {
...@@ -20,11 +20,26 @@ ...@@ -20,11 +20,26 @@
{ {
_model = model; _model = model;
self.studyItemTitleLabel.text = _model.title; self.studyItemTitleLabel.text = _model.title;
//考核状态 //考核状态
if ([BaseViewController isBlankString:_model.examResult] || [_model.examResult isEqualToString:@"0"]) { if ([BaseViewController isBlankString:_model.examResult] || [_model.examResult isEqualToString:@"0"]) {
self.examResultImageView.hidden = YES; self.examResultImageView.hidden = YES;
if (model.studyComplete == nil || !model.hasStudyTopic) {
self.btnStartAnswer.hidden = YES;
}else{
self.btnStartAnswer.hidden = NO;
}
}else { }else {
self.examResultImageView.hidden = NO; self.examResultImageView.hidden = NO;
self.btnStartAnswer.hidden = YES;
} }
} }
- (IBAction)actionStartAnswer:(id)sender {
AssessmentViewController *assessmentVc = [[AssessmentViewController getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentViewController"];
assessmentVc.taskId = _model.fid;
// assessmentVc.indexPath = indexPath;
// assessmentVc.delegate = weakSelf;
[self.viewController.navigationController pushViewController:assessmentVc animated:YES];
}
@end @end
...@@ -47,5 +47,9 @@ ...@@ -47,5 +47,9 @@
*/ */
@property (weak, nonatomic) IBOutlet UIImageView *examResultImageView; @property (weak, nonatomic) IBOutlet UIImageView *examResultImageView;
/**
开始答题按钮
*/
@property (weak, nonatomic) IBOutlet UIButton *btnStartAnswer;
@end @end
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
// //
#import "VideoListItemTableViewCell.h" #import "VideoListItemTableViewCell.h"
#import "AssessmentViewController.h"
@implementation VideoListItemTableViewCell @implementation VideoListItemTableViewCell
- (void)awakeFromNib { - (void)awakeFromNib {
...@@ -32,9 +32,23 @@ ...@@ -32,9 +32,23 @@
//考核状态 //考核状态
if ([BaseViewController isBlankString:_model.examResult] || [_model.examResult isEqualToString:@"0"]) { if ([BaseViewController isBlankString:_model.examResult] || [_model.examResult isEqualToString:@"0"]) {
self.examResultImageView.hidden = YES; self.examResultImageView.hidden = YES;
if (model.studyComplete == nil || !model.hasStudyTopic) {
self.btnStartAnswer.hidden = YES;
}else{
self.btnStartAnswer.hidden = NO;
}
}else { }else {
self.examResultImageView.hidden = NO; self.examResultImageView.hidden = NO;
self.btnStartAnswer.hidden = YES;
} }
} }
- (IBAction)actionStartAnswer:(id)sender {
AssessmentViewController *assessmentVc = [[AssessmentViewController getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentViewController"];
assessmentVc.taskId = _model.fid;
// assessmentVc.indexPath = indexPath;
// assessmentVc.delegate = weakSelf;
[self.viewController.navigationController pushViewController:assessmentVc animated:YES];
}
@end @end
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
<rect key="frame" x="0.0" y="28" width="1024" height="90"/> <rect key="frame" x="0.0" y="28" width="1024" height="90"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ctQ-16-eCQ" id="DuY-Eq-G4z"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ctQ-16-eCQ" id="DuY-Eq-G4z">
<rect key="frame" x="0.0" y="0.0" width="830" height="89.5"/> <rect key="frame" x="0.0" y="0.0" width="830" height="89"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="00登录-谭" translatesAutoresizingMaskIntoConstraints="NO" id="jVJ-Bu-xw9"> <imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="00登录-谭" translatesAutoresizingMaskIntoConstraints="NO" id="jVJ-Bu-xw9">
...@@ -1065,7 +1065,7 @@ ...@@ -1065,7 +1065,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="AssessmentHeaderView" id="UfB-K3-NdF" customClass="AssessmentHeaderView"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="AssessmentHeaderView" id="UfB-K3-NdF" customClass="AssessmentHeaderView">
<rect key="frame" x="0.0" y="55.5" width="460" height="44"/> <rect key="frame" x="0.0" y="56" width="460" height="44"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="UfB-K3-NdF" id="WGo-Wa-YTq"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="UfB-K3-NdF" id="WGo-Wa-YTq">
<rect key="frame" x="0.0" y="0.0" width="460" height="44"/> <rect key="frame" x="0.0" y="0.0" width="460" height="44"/>
...@@ -1091,7 +1091,7 @@ ...@@ -1091,7 +1091,7 @@
</connections> </connections>
</tableViewCell> </tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentTableViewCell" rowHeight="52" id="gIe-bF-XsX" customClass="AssessmentTableViewCell"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentTableViewCell" rowHeight="52" id="gIe-bF-XsX" customClass="AssessmentTableViewCell">
<rect key="frame" x="0.0" y="99.5" width="460" height="52"/> <rect key="frame" x="0.0" y="100" width="460" height="52"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="gIe-bF-XsX" id="Va8-wn-DBM"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="gIe-bF-XsX" id="Va8-wn-DBM">
<rect key="frame" x="0.0" y="0.0" width="460" height="52"/> <rect key="frame" x="0.0" y="0.0" width="460" height="52"/>
...@@ -1137,7 +1137,7 @@ ...@@ -1137,7 +1137,7 @@
</connections> </connections>
</tableViewCell> </tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentShortAnswerTableViewCell" rowHeight="112" id="smV-qr-KgP" customClass="AssessmentShortAnswerTableViewCell"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentShortAnswerTableViewCell" rowHeight="112" id="smV-qr-KgP" customClass="AssessmentShortAnswerTableViewCell">
<rect key="frame" x="0.0" y="151.5" width="460" height="112"/> <rect key="frame" x="0.0" y="152" width="460" height="112"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="smV-qr-KgP" id="A2f-ek-60T"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="smV-qr-KgP" id="A2f-ek-60T">
<rect key="frame" x="0.0" y="0.0" width="460" height="112"/> <rect key="frame" x="0.0" y="0.0" width="460" height="112"/>
...@@ -1373,7 +1373,7 @@ ...@@ -1373,7 +1373,7 @@
</collectionViewFlowLayout> </collectionViewFlowLayout>
<cells> <cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CalibrationDetailCollectionCell" id="dGo-4o-u9g" customClass="CalibrationDetailCollectionCell"> <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CalibrationDetailCollectionCell" id="dGo-4o-u9g" customClass="CalibrationDetailCollectionCell">
<rect key="frame" x="0.0" y="9.5" width="93" height="41"/> <rect key="frame" x="0.0" y="10" width="93" height="41"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="93" height="41"/> <rect key="frame" x="0.0" y="0.0" width="93" height="41"/>
...@@ -1453,7 +1453,7 @@ ...@@ -1453,7 +1453,7 @@
</collectionViewFlowLayout> </collectionViewFlowLayout>
<cells> <cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CalibrationCollectionViewCell" id="v20-Kz-8OX" customClass="CalibrationCollectionViewCell"> <collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CalibrationCollectionViewCell" id="v20-Kz-8OX" customClass="CalibrationCollectionViewCell">
<rect key="frame" x="0.0" y="4.5" width="50" height="50"/> <rect key="frame" x="0.0" y="5" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/> <autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center"> <view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/> <rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
...@@ -2157,7 +2157,7 @@ ...@@ -2157,7 +2157,7 @@
<rect key="frame" x="0.0" y="28" width="1024" height="100"/> <rect key="frame" x="0.0" y="28" width="1024" height="100"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Qnm-0r-wEL" id="VAA-bT-OlF"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Qnm-0r-wEL" id="VAA-bT-OlF">
<rect key="frame" x="0.0" y="0.0" width="1024" height="99.5"/> <rect key="frame" x="0.0" y="0.0" width="1024" height="99"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="课时简介" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="agZ-rF-DnB"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="课时简介" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="agZ-rF-DnB">
...@@ -2189,7 +2189,7 @@ ...@@ -2189,7 +2189,7 @@
<rect key="frame" x="0.0" y="128" width="1024" height="130"/> <rect key="frame" x="0.0" y="128" width="1024" height="130"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WzB-nZ-wsW" id="Zzv-Yi-ZxT"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WzB-nZ-wsW" id="Zzv-Yi-ZxT">
<rect key="frame" x="0.0" y="0.0" width="1024" height="129.5"/> <rect key="frame" x="0.0" y="0.0" width="1024" height="129"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="授课讲师" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kxK-dX-OAf"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="授课讲师" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kxK-dX-OAf">
...@@ -2246,7 +2246,7 @@ ...@@ -2246,7 +2246,7 @@
<rect key="frame" x="0.0" y="258" width="1024" height="100"/> <rect key="frame" x="0.0" y="258" width="1024" height="100"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="oia-jO-L9n" id="AMF-ag-ZWN"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="oia-jO-L9n" id="AMF-ag-ZWN">
<rect key="frame" x="0.0" y="0.0" width="1024" height="99.5"/> <rect key="frame" x="0.0" y="0.0" width="1024" height="99"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<subviews> <subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="针对人员" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NfI-IM-h1i"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="针对人员" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NfI-IM-h1i">
...@@ -2517,6 +2517,17 @@ ...@@ -2517,6 +2517,17 @@
<constraint firstAttribute="height" constant="1" id="wjU-cG-Cbi"/> <constraint firstAttribute="height" constant="1" id="wjU-cG-Cbi"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kEq-ur-qoX">
<rect key="frame" x="330" y="10" width="70" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="70" id="AyV-pl-VGJ"/>
<constraint firstAttribute="height" constant="30" id="oBJ-gK-mHg"/>
</constraints>
<state key="normal" title="开始答题"/>
<connections>
<action selector="actionStartAnswer:" destination="YXo-b3-NKo" eventType="touchUpInside" id="Bgd-Lu-ItT"/>
</connections>
</button>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstItem="Ast-eO-9V0" firstAttribute="centerY" secondItem="FNL-Q4-kdY" secondAttribute="centerY" id="4D8-Yl-tb5"/> <constraint firstItem="Ast-eO-9V0" firstAttribute="centerY" secondItem="FNL-Q4-kdY" secondAttribute="centerY" id="4D8-Yl-tb5"/>
...@@ -2526,6 +2537,7 @@ ...@@ -2526,6 +2537,7 @@
<constraint firstItem="BVg-HN-E2s" firstAttribute="leading" secondItem="cny-PA-JpH" secondAttribute="trailing" constant="10" id="FeY-kV-5zF"/> <constraint firstItem="BVg-HN-E2s" firstAttribute="leading" secondItem="cny-PA-JpH" secondAttribute="trailing" constant="10" id="FeY-kV-5zF"/>
<constraint firstAttribute="trailing" secondItem="fYk-7O-XdO" secondAttribute="trailing" id="Hs3-xl-h3f"/> <constraint firstAttribute="trailing" secondItem="fYk-7O-XdO" secondAttribute="trailing" id="Hs3-xl-h3f"/>
<constraint firstItem="FNL-Q4-kdY" firstAttribute="leading" secondItem="Zsh-Nm-SGv" secondAttribute="leading" constant="12" id="IKT-GZ-UfU"/> <constraint firstItem="FNL-Q4-kdY" firstAttribute="leading" secondItem="Zsh-Nm-SGv" secondAttribute="leading" constant="12" id="IKT-GZ-UfU"/>
<constraint firstItem="BVg-HN-E2s" firstAttribute="leading" secondItem="kEq-ur-qoX" secondAttribute="trailing" constant="9" id="Izj-z7-6cb"/>
<constraint firstItem="0QA-OC-BkN" firstAttribute="centerY" secondItem="FNL-Q4-kdY" secondAttribute="centerY" id="KVJ-bY-0gc"/> <constraint firstItem="0QA-OC-BkN" firstAttribute="centerY" secondItem="FNL-Q4-kdY" secondAttribute="centerY" id="KVJ-bY-0gc"/>
<constraint firstItem="cny-PA-JpH" firstAttribute="centerY" secondItem="BVg-HN-E2s" secondAttribute="centerY" id="Odt-ir-59j"/> <constraint firstItem="cny-PA-JpH" firstAttribute="centerY" secondItem="BVg-HN-E2s" secondAttribute="centerY" id="Odt-ir-59j"/>
<constraint firstItem="0QA-OC-BkN" firstAttribute="leading" secondItem="FNL-Q4-kdY" secondAttribute="trailing" constant="20" id="Qc4-J9-Joq"/> <constraint firstItem="0QA-OC-BkN" firstAttribute="leading" secondItem="FNL-Q4-kdY" secondAttribute="trailing" constant="20" id="Qc4-J9-Joq"/>
...@@ -2533,9 +2545,11 @@ ...@@ -2533,9 +2545,11 @@
<constraint firstAttribute="trailing" secondItem="Ast-eO-9V0" secondAttribute="trailing" constant="15" id="Xih-52-5hy"/> <constraint firstAttribute="trailing" secondItem="Ast-eO-9V0" secondAttribute="trailing" constant="15" id="Xih-52-5hy"/>
<constraint firstItem="Ast-eO-9V0" firstAttribute="leading" secondItem="BVg-HN-E2s" secondAttribute="trailing" constant="10" id="i3G-EM-h4h"/> <constraint firstItem="Ast-eO-9V0" firstAttribute="leading" secondItem="BVg-HN-E2s" secondAttribute="trailing" constant="10" id="i3G-EM-h4h"/>
<constraint firstItem="BVg-HN-E2s" firstAttribute="leading" secondItem="0QA-OC-BkN" secondAttribute="trailing" constant="20" id="igE-qL-tRe"/> <constraint firstItem="BVg-HN-E2s" firstAttribute="leading" secondItem="0QA-OC-BkN" secondAttribute="trailing" constant="20" id="igE-qL-tRe"/>
<constraint firstItem="kEq-ur-qoX" firstAttribute="centerY" secondItem="0QA-OC-BkN" secondAttribute="centerY" id="mXX-oH-lQ1"/>
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
<connections> <connections>
<outlet property="btnStartAnswer" destination="kEq-ur-qoX" id="Mfo-QQ-ha3"/>
<outlet property="examResultImageView" destination="cny-PA-JpH" id="R7t-ol-rAq"/> <outlet property="examResultImageView" destination="cny-PA-JpH" id="R7t-ol-rAq"/>
<outlet property="playButton" destination="FNL-Q4-kdY" id="Abd-Au-JQk"/> <outlet property="playButton" destination="FNL-Q4-kdY" id="Abd-Au-JQk"/>
<outlet property="seekbarView" destination="BVg-HN-E2s" id="Ngx-Ju-zff"/> <outlet property="seekbarView" destination="BVg-HN-E2s" id="Ngx-Ju-zff"/>
...@@ -2585,8 +2599,21 @@ ...@@ -2585,8 +2599,21 @@
<constraint firstAttribute="height" constant="1" id="sBH-lC-hCS"/> <constraint firstAttribute="height" constant="1" id="sBH-lC-hCS"/>
</constraints> </constraints>
</view> </view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cSM-mJ-Ih8">
<rect key="frame" x="337" y="10" width="70" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="AhY-XM-AIa"/>
<constraint firstAttribute="width" constant="70" id="dZU-Xt-mQu"/>
</constraints>
<state key="normal" title="开始答题"/>
<connections>
<action selector="actionStartAnswer:" destination="OSF-93-RuO" eventType="touchUpInside" id="GlH-hr-1xT"/>
</connections>
</button>
</subviews> </subviews>
<constraints> <constraints>
<constraint firstItem="cSM-mJ-Ih8" firstAttribute="centerY" secondItem="IQr-pV-6ZO" secondAttribute="centerY" id="1Dw-hQ-AZN"/>
<constraint firstItem="t1Q-41-RAj" firstAttribute="leading" secondItem="cSM-mJ-Ih8" secondAttribute="trailing" constant="50" id="9bb-a8-pJP"/>
<constraint firstItem="Gwb-yp-kzF" firstAttribute="centerY" secondItem="t1Q-41-RAj" secondAttribute="centerY" id="Lvf-ms-adf"/> <constraint firstItem="Gwb-yp-kzF" firstAttribute="centerY" secondItem="t1Q-41-RAj" secondAttribute="centerY" id="Lvf-ms-adf"/>
<constraint firstItem="t1Q-41-RAj" firstAttribute="leading" secondItem="6O1-Dg-ELo" secondAttribute="trailing" constant="20" id="P2g-cX-AOe"/> <constraint firstItem="t1Q-41-RAj" firstAttribute="leading" secondItem="6O1-Dg-ELo" secondAttribute="trailing" constant="20" id="P2g-cX-AOe"/>
<constraint firstAttribute="bottom" secondItem="SCg-SR-kAg" secondAttribute="bottom" id="PQy-Zh-wy0"/> <constraint firstAttribute="bottom" secondItem="SCg-SR-kAg" secondAttribute="bottom" id="PQy-Zh-wy0"/>
...@@ -2602,6 +2629,7 @@ ...@@ -2602,6 +2629,7 @@
</constraints> </constraints>
</tableViewCellContentView> </tableViewCellContentView>
<connections> <connections>
<outlet property="btnStartAnswer" destination="cSM-mJ-Ih8" id="phi-7Q-oZT"/>
<outlet property="examResultImageView" destination="Gwb-yp-kzF" id="Ftr-TR-W7i"/> <outlet property="examResultImageView" destination="Gwb-yp-kzF" id="Ftr-TR-W7i"/>
<outlet property="pptButton" destination="j7R-oP-wMP" id="m7u-ia-zmb"/> <outlet property="pptButton" destination="j7R-oP-wMP" id="m7u-ia-zmb"/>
<outlet property="studyItemLabel" destination="t1Q-41-RAj" id="jCw-CL-C3l"/> <outlet property="studyItemLabel" destination="t1Q-41-RAj" id="jCw-CL-C3l"/>
...@@ -2667,7 +2695,7 @@ ...@@ -2667,7 +2695,7 @@
</viewController> </viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="9lH-c2-zzY" userLabel="First Responder" sceneMemberID="firstResponder"/> <placeholder placeholderIdentifier="IBFirstResponder" id="9lH-c2-zzY" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects> </objects>
<point key="canvasLocation" x="3137" y="-1598"/> <point key="canvasLocation" x="3177" y="-1611"/>
</scene> </scene>
<!--Assessment View Controller--> <!--Assessment View Controller-->
<scene sceneID="2bA-hi-BSu"> <scene sceneID="2bA-hi-BSu">
...@@ -2719,7 +2747,7 @@ ...@@ -2719,7 +2747,7 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/> <color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes> <prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="AssessmentHeaderView" rowHeight="60" id="2M5-To-MLj" customClass="AssessmentHeaderView"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="AssessmentHeaderView" rowHeight="60" id="2M5-To-MLj" customClass="AssessmentHeaderView">
<rect key="frame" x="0.0" y="55.5" width="1024" height="60"/> <rect key="frame" x="0.0" y="56" width="1024" height="60"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2M5-To-MLj" id="ypf-GL-4CP"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2M5-To-MLj" id="ypf-GL-4CP">
<rect key="frame" x="0.0" y="0.0" width="1024" height="60"/> <rect key="frame" x="0.0" y="0.0" width="1024" height="60"/>
...@@ -2745,7 +2773,7 @@ ...@@ -2745,7 +2773,7 @@
</connections> </connections>
</tableViewCell> </tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentTableViewCell" rowHeight="50" id="BjI-a1-CRm" customClass="AssessmentTableViewCell"> <tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentTableViewCell" rowHeight="50" id="BjI-a1-CRm" customClass="AssessmentTableViewCell">
<rect key="frame" x="0.0" y="115.5" width="1024" height="50"/> <rect key="frame" x="0.0" y="116" width="1024" height="50"/>
<autoresizingMask key="autoresizingMask"/> <autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="BjI-a1-CRm" id="bq8-ly-DcD"> <tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="BjI-a1-CRm" id="bq8-ly-DcD">
<rect key="frame" x="0.0" y="0.0" width="1024" height="50"/> <rect key="frame" x="0.0" y="0.0" width="1024" height="50"/>
......
...@@ -96,7 +96,7 @@ typedef NS_ENUM(NSInteger,COMMENT_PRAISE) { ...@@ -96,7 +96,7 @@ typedef NS_ENUM(NSInteger,COMMENT_PRAISE) {
/** /**
* 服务器开发地址 * 服务器开发地址
*/ */
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://gomoredev:8082/opple-web/app%@",URL] #define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://gomoredev:8082/opple-web/app%@",URL]
//外网http://debenson.picp.io/opple-web/ //外网http://debenson.picp.io/opple-web/
...@@ -108,7 +108,7 @@ typedef NS_ENUM(NSInteger,COMMENT_PRAISE) { ...@@ -108,7 +108,7 @@ typedef NS_ENUM(NSInteger,COMMENT_PRAISE) {
//** //**
// * 服务器正式地址 // * 服务器正式地址
// */ // */
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL] //#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL]
/*****************************************接口地址*****************************************/ /*****************************************接口地址*****************************************/
......
...@@ -24,5 +24,10 @@ ...@@ -24,5 +24,10 @@
@param number 圆角系数 @param number 圆角系数
*/ */
- (void)setMyCorner:(CGFloat)number; - (void)setMyCorner:(CGFloat)number;
/**
* 获取view父视图的控制器
*
* @return 控制器
*/
- (UIViewController *)viewController;
@end @end
...@@ -73,5 +73,15 @@ ...@@ -73,5 +73,15 @@
self.layer.rasterizationScale = [UIScreen mainScreen].scale; self.layer.rasterizationScale = [UIScreen mainScreen].scale;
} }
- (UIViewController *)viewController
{
for (UIView *next = [self superview]; next; next = next.superview) {
UIResponder *nextResponder = [next nextResponder];
if ([nextResponder isKindOfClass:[UIViewController class]]) {
return (UIViewController *)nextResponder;
}
}
return nil;
}
@end @end
...@@ -4098,6 +4098,12 @@ extern NSString * const GRADEMETHOD_MANUL; ...@@ -4098,6 +4098,12 @@ extern NSString * const GRADEMETHOD_MANUL;
* *
*/ */
@property (nonatomic, copy) NSString *examResult; @property (nonatomic, copy) NSString *examResult;
/**
* 是否学习完成
*
*
*/
@property (nonatomic, copy) NSString *studyComplete;
/** /**
* 学习内容 * 学习内容
* *
...@@ -4170,6 +4176,12 @@ extern NSString * const GRADEMETHOD_MANUL; ...@@ -4170,6 +4176,12 @@ extern NSString * const GRADEMETHOD_MANUL;
* *
*/ */
@property (nonatomic, copy) NSString *studyCategory; @property (nonatomic, copy) NSString *studyCategory;
/**
* 分类id
*
*
*/
@property (nonatomic, assign) BOOL hasStudyTopic;
/** /**
* 分类标题 * 分类标题
* *
......
...@@ -1443,6 +1443,7 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -1443,6 +1443,7 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@synthesize title; @synthesize title;
@synthesize typeName; @synthesize typeName;
@synthesize examResult; @synthesize examResult;
@synthesize studyComplete;
@synthesize content; @synthesize content;
@synthesize teacher; @synthesize teacher;
@synthesize teacherIntro; @synthesize teacherIntro;
...@@ -1455,6 +1456,7 @@ NSString * const SORTDIRECTION_DESC = @"desc"; ...@@ -1455,6 +1456,7 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@synthesize topics; @synthesize topics;
@synthesize stateName; @synthesize stateName;
@synthesize studyCategory; @synthesize studyCategory;
@synthesize hasStudyTopic;
@synthesize categoryName; @synthesize categoryName;
+(BOOL)propertyIsOptional:(NSString*)propertyName +(BOOL)propertyIsOptional:(NSString*)propertyName
......
...@@ -54,6 +54,7 @@ typedef NS_ENUM(NSInteger,CALL_TYPE) { ...@@ -54,6 +54,7 @@ typedef NS_ENUM(NSInteger,CALL_TYPE) {
学习项下标 学习项下标
*/ */
@property (nonatomic,strong) NSIndexPath *indexPath; @property (nonatomic,strong) NSIndexPath *indexPath;
@property (strong, nonatomic) NSString *studyId;
@end @end
...@@ -189,11 +189,13 @@ ...@@ -189,11 +189,13 @@
#pragma mark - <UIScrollViewDelegate> #pragma mark - <UIScrollViewDelegate>
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView - (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{ {
CGFloat height = scrollView.frame.size.height; CGFloat height = scrollView.frame.size.height;
CGFloat contentYoffset = scrollView.contentOffset.y; CGFloat contentYoffset = scrollView.contentOffset.y;
CGFloat distanceFromBottom = scrollView.contentSize.height - contentYoffset; CGFloat distanceFromBottom = scrollView.contentSize.height - contentYoffset;
WS(weakSelf); WS(weakSelf);
if (distanceFromBottom <= height && self.type == Study) { if (distanceFromBottom <= height && self.type == Study) {
[self httpStudyCompleteTaskId:self.studyId];
ShowDefaultAlertView(self, nil, @"学习完成,是否开始考核?", UIAlertControllerStyleAlert, ^{ ShowDefaultAlertView(self, nil, @"学习完成,是否开始考核?", UIAlertControllerStyleAlert, ^{
if (weakSelf.scrollViewEndBottomBlock) { if (weakSelf.scrollViewEndBottomBlock) {
weakSelf.scrollViewEndBottomBlock(weakSelf.indexPath); weakSelf.scrollViewEndBottomBlock(weakSelf.indexPath);
...@@ -202,7 +204,15 @@ ...@@ -202,7 +204,15 @@
} }
} }
#pragma mark - 学习完成,告诉服务器学习完成
- (void)httpStudyCompleteTaskId:(NSString *)taskId {
NSString *url = [NSString stringWithFormat:@"/study/finishStudy/%@/%@", taskId, [Shoppersmanager manager].shoppers.employee.fid];
[HTTP networkRequestWithURL:SERVERREQUESTURL(url) withRequestType:(GET) withParameter:nil withReturnValueBlock:^(id returnValue) {
NSLog(@"%@", returnValue);
} withFailureBlock:^(NSError *error) {
}];
}
......
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