Browse Source

作业状态和学生评价空状态根据课程状态不同提示

Steven 2 months ago
parent
commit
164400a28f

+ 1 - 2
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/project.pbxproj

@@ -7980,7 +7980,7 @@
 			isa = PBXProject;
 			attributes = {
 				BuildIndependentTargetsInParallel = 1;
-				LastUpgradeCheck = 1610;
+				LastUpgradeCheck = 1620;
 				TargetAttributes = {
 					275E8A6327E18F2300DD3F6E = {
 						CreatedOnToolsVersion = 13.2.1;
@@ -9124,7 +9124,6 @@
 				BCD1607B2CED8EA700A78B43 /* MyProgramCourseGroupCell.m in Sources */,
 				BC71DF0E2A89F470003F165E /* KSRateSliderView.m in Sources */,
 				BC206EF42CF01D4A001F2B85 /* GroupCourseSortView.m in Sources */,
-				BC71DF0E2A89F470003F165E /* KSRateSliderView.m in Sources */,
 				2779326427E30FD80010E277 /* FSCalendarDelegationProxy.m in Sources */,
 				BC106B852A8F4586000759A9 /* TXLiveMessageCardMessage.m in Sources */,
 				277935DF27E326DA0010E277 /* KSNetTypeManager.m in Sources */,

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher.xcodeproj/xcshareddata/xcschemes/KulexiuForTeacher.xcscheme

@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Scheme
-   LastUpgradeVersion = "1610"
+   LastUpgradeVersion = "1620"
    version = "1.7">
    <BuildAction
       parallelizeBuildables = "YES"

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/Controller/AccompanyDetailViewController.m

@@ -231,7 +231,7 @@
         BOOL isExpired = self.homeworkModel.homeworkExpire == 1 ? YES : NO;
         AccompanyHomeworkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyHomeworkCell"];
         MJWeakSelf;
-        [cell configWithAttachmentArray:self.fileArray hasSubmit:hasSubmitHomework isExpired:isExpired callback:^(NSInteger viewIndex) {
+        [cell configWithAttachmentArray:self.fileArray hasSubmit:hasSubmitHomework isExpired:isExpired courseStatus:self.homeworkModel.courseStatus callback:^(NSInteger viewIndex) {
             [weakSelf playVideoIndex:viewIndex];
         }];
         return cell;

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyHomeworkCell.h

@@ -13,7 +13,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface AccompanyHomeworkCell : UITableViewCell
 
-- (void)configWithAttachmentArray:(NSMutableArray *)fileArray hasSubmit:(BOOL)hasSubmit isExpired:(BOOL)homeworkExpire callback:(HomeworkPlayAction)callback;
+- (void)configWithAttachmentArray:(NSMutableArray *)fileArray hasSubmit:(BOOL)hasSubmit isExpired:(BOOL)homeworkExpire courseStatus:(NSString *)courseStatus callback:(HomeworkPlayAction)callback;
 
 @end
 

+ 26 - 20
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyHomeworkCell.m

@@ -29,35 +29,41 @@
     self.selectionStyle = UITableViewCellSelectionStyleNone;
 }
 
-- (void)configWithAttachmentArray:(NSMutableArray *)fileArray hasSubmit:(BOOL)hasSubmit isExpired:(BOOL)homeworkExpire callback:(HomeworkPlayAction)callback {
+- (void)configWithAttachmentArray:(NSMutableArray *)fileArray hasSubmit:(BOOL)hasSubmit isExpired:(BOOL)homeworkExpire courseStatus:(NSString *)courseStatus callback:(HomeworkPlayAction)callback {
     if (callback) {
         self.callback = callback;
     }
     [self.videoContainer removeAllSubViews];
-    if (homeworkExpire) {
-        self.emptyView.hidden = NO;
-        self.containerHeight.constant = 88.0f;
-        NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
-        [paragraphStyle setLineSpacing:4];//调整行间距
-        NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:@"作业已过期无法查看!" attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x999999)}];
-        self.emptyDescLabel.attributedText = attr;
-    }
-    else {
-        if (hasSubmit) {
-            self.emptyView.hidden = YES;
-            self.containerHeight.constant = 76.0f;
-            [self configVideoViewWithSource:fileArray];
-        }
-        else {
+    NSString *tipsDesc = @"";
+    if ([courseStatus isEqualToString:@"COMPLETE"]) {
+        if (homeworkExpire) {
+            tipsDesc = @"作业已过期无法查看!";
             self.emptyView.hidden = NO;
             self.containerHeight.constant = 88.0f;
-            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
-            [paragraphStyle setLineSpacing:4];//调整行间距
-            NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:@"学员尚未上传作业视频" attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x999999)}];
-            self.emptyDescLabel.attributedText = attr;
         }
+        else {
+            if (hasSubmit) {
+                self.emptyView.hidden = YES;
+                self.containerHeight.constant = 76.0f;
+                [self configVideoViewWithSource:fileArray];
+            }
+            else {
+                tipsDesc = @"学员尚未上传作业视频";
+                self.emptyView.hidden = NO;
+                self.containerHeight.constant = 88.0f;
+            }
+        }
+    }
+    else {
+        tipsDesc = @"课程结束之后学员可上传作业视频";
+        self.emptyView.hidden = NO;
+        self.containerHeight.constant = 88.0f;
     }
     
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    [paragraphStyle setLineSpacing:4];//调整行间距
+    NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:tipsDesc attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x999999)}];
+    self.emptyDescLabel.attributedText = attr;
 }
 
 - (void)configVideoViewWithSource:(NSMutableArray *)fileArray {

+ 17 - 9
KulexiuForTeacher/KulexiuForTeacher/Module/Course/AccompanyCourse/View/AccompanyStudentEvaCell.m

@@ -31,24 +31,32 @@
 }
 
 - (void)configWithEvaluateMessage:(NSString *)evaluateMessage courseStatus:(NSString *)courseStatus starNum:(NSInteger)starNum hasEvaluate:(BOOL)hasEvaluate {
-    
-    if (hasEvaluate) {
-        self.emptyView.hidden = YES;
-        if (![NSString isEmptyString:evaluateMessage]) {
-            NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
-            [paragraphStyle setLineSpacing:4];//调整行间距
-            NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:evaluateMessage attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x333333)}];
-            self.contentLabel.attributedText = attr;
+    NSString *tipsDesc = @"";
+    if ([courseStatus isEqualToString:@"COMPLETE"]) { // 结束
+        tipsDesc = @"学员尚未对您进行评价";
+        if (hasEvaluate) {
+            self.emptyView.hidden = YES;
+            if (![NSString isEmptyString:evaluateMessage]) {
+                NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+                [paragraphStyle setLineSpacing:4];//调整行间距
+                NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:evaluateMessage attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x333333)}];
+                self.contentLabel.attributedText = attr;
+            }
+            else {
+                self.contentLabel.attributedText = nil;
+            }
         }
         else {
+            self.emptyView.hidden = NO;
             self.contentLabel.attributedText = nil;
         }
     }
     else {
+        tipsDesc = @"课程结束之后学员才能对您进行评价哦";
         self.emptyView.hidden = NO;
         self.contentLabel.attributedText = nil;
     }
-    NSString *tipsDesc = @"学员尚未对您进行评价";
+
     NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
     [paragraphStyle setLineSpacing:4];//调整行间距
     NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:tipsDesc attributes:@{NSParagraphStyleAttributeName:paragraphStyle,NSFontAttributeName:[UIFont systemFontOfSize:13.0f],NSForegroundColorAttributeName:HexRGB(0x999999)}];

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Course/VIPCourse/Controller/VipCouseDetailViewController.m

@@ -233,7 +233,7 @@
         BOOL isExpired = self.homeworkModel.homeworkExpire == 1 ? YES : NO;
         AccompanyHomeworkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyHomeworkCell"];
         MJWeakSelf;
-        [cell configWithAttachmentArray:self.fileArray hasSubmit:hasSubmitHomework isExpired:isExpired callback:^(NSInteger viewIndex) {
+        [cell configWithAttachmentArray:self.fileArray hasSubmit:hasSubmitHomework isExpired:isExpired courseStatus:self.homeworkModel.courseStatus callback:^(NSInteger viewIndex) {
             [weakSelf playVideoIndex:viewIndex];
         }];
         return cell;

+ 1 - 1
KulexiuForTeacher/KulexiuForTeacher/Module/Home/Homework/Controller/HomeworkDetailViewController.m

@@ -135,7 +135,7 @@
         BOOL isExpired = self.detailModel.homeworkExpire == 1 ? YES : NO;
         AccompanyHomeworkCell *cell = [tableView dequeueReusableCellWithIdentifier:@"AccompanyHomeworkCell"];
         MJWeakSelf;
-        [cell configWithAttachmentArray:self.fileArray hasSubmit:hasSubmitHomework isExpired:isExpired callback:^(NSInteger viewIndex) {
+        [cell configWithAttachmentArray:self.fileArray hasSubmit:hasSubmitHomework isExpired:isExpired courseStatus:self.detailModel.courseStatus callback:^(NSInteger viewIndex) {
             [weakSelf playVideoIndex:viewIndex];
         }];
         return cell;