瀏覽代碼

1.修正HiTeach取得學校資訊API 無法取得未入學年級問題 2.字串更新

jeff 2 年之前
父節點
當前提交
a2cfafffa0

+ 2 - 2
TEAMModelOS/ClientApp/public/lang/en-US.js

@@ -880,7 +880,7 @@ const LANG_EN_US = {
         cusTeachers: 'Instructor',
         teacherHolder: 'Please choose instructor',
         delContent: 'Are you sure to delete ',
-        delContent1: 'Note: If you need to free up the space occupied by this course, you need to manually delete the related activities and class records first, and the deletion will not be restored.',
+        delContent1: 'Note: To delete a course, please first manually delete all activities and lesson records of this course list. You will not be able to revert to the original status after deletion. If you have done so, click OK to proceed with the deletion.',
         codeErr1: 'Course ID cannot be empty',
         codeErr2: 'Course ID can only consist of English letters and numbers',
         tableCol1: 'Seat No.',
@@ -5474,7 +5474,7 @@ const LANG_EN_US = {
         type3: 'Exam File',
         type4: 'Local File',
         type5: 'Hyperlink',
-        type6: 'Other File',
+        type6: 'Other Files',
         preview: 'View',
         remove: 'Delete',
         upload: 'Upload Local File',

+ 2 - 2
TEAMModelOS/ClientApp/public/lang/zh-TW.js

@@ -880,7 +880,7 @@ const LANG_ZH_TW = {
         cusTeachers: '授課教師',
         teacherHolder: '請選擇授課教師',
         delContent: '是否確認刪除',
-        delContent1: '注意:若需释放本课程所占的空间,需先手动删除相关活动與課堂記錄, 且刪除後將無法復原。',
+        delContent1: '注意:如要刪除課程,請先手動刪除與此課程名單相關的所有活動與課堂記錄。刪除後將無法恢復原狀。如已完成上述事宜即可點擊確定繼續刪除。',
         codeErr1: '課程編碼不能為空',
         codeErr2: '課程編碼只能由字母和數位組成',
         tableCol1: '座號',
@@ -5478,7 +5478,7 @@ const LANG_ZH_TW = {
         type3: '試卷資源',
         type4: '本機檔案',
         type5: '超連結',
-        type6: '其它源',
+        type6: '其它源',
         preview: '查看',
         remove: '刪除',
         upload: '上傳本機檔案',

+ 8 - 13
TEAMModelOS/Controllers/Client/HiTeachController.cs

@@ -652,10 +652,12 @@ namespace TEAMModelOS.Controllers.Client
                 List<object> subjects = new List<object>();
                 List<object> examTypes = new List<object>();
 
+                string lang = "en-us";
                 School school_base = await client.GetContainer(Constant.TEAMModelOS, "School").ReadItemAsync<School>($"{school_code}", new PartitionKey("Base"));
                 if (!string.IsNullOrWhiteSpace(school_base.id))
                 {
-                    foreach(Period periodinfo in school_base.period)
+                    lang = (school_base.region.Equals("中国")) ? "zh-cn" : (school_base.region.Equals("臺灣")) ? "zh-tw" : "en-us"; //語系
+                    foreach (Period periodinfo in school_base.period)
                     {
                         periods.Add(new { id= periodinfo.id, name= periodinfo.name });
                         int gradeIndex = 0;
@@ -756,11 +758,12 @@ namespace TEAMModelOS.Controllers.Client
                                             if(!string.IsNullOrWhiteSpace(gradeInfo.id))
                                             {
                                                 classExtobj.gradeId = gradeInfo.id;
-                                                classExtobj.gradeName = gradeInfo.name;
+                                                if(gradeInfo.name.Equals("graduated")) classExtobj.gradeName = (lang.Equals("zh-cn")) ? "已毕业" : (lang.Equals("zh-tw")) ? "已畢業" : "Graduated";
+                                                else if(gradeInfo.name.Equals("not-enrollment")) classExtobj.gradeName = (lang.Equals("zh-cn")) ? "未到入学时间" : (lang.Equals("zh-tw")) ? "未到入學時間" : "It is not time for enrollment yet";
+                                                else classExtobj.gradeName = gradeInfo.name;
                                             }
                                         }
                                     }
-                                    
                                 }
                             }
                             //選課班 (過期者不選)
@@ -1929,16 +1932,8 @@ namespace TEAMModelOS.Controllers.Client
                         curYear--;
                     }
                     int gradeIndex = curYear - year;
-                    if (gradeIndex >= curPeriod.grades.Count)
-                    {
-                        result.id = gradeIndex.ToString();
-                        result.name = "graduated";
-                    }
-                    else
-                    {
-                        result.id = gradeIndex.ToString();
-                        result.name = curPeriod.grades[gradeIndex];
-                    }
+                    result.id = gradeIndex.ToString();
+                    result.name = (gradeIndex >= curPeriod.grades.Count) ? "graduated" : (gradeIndex >= 0) ? curPeriod.grades[gradeIndex] : "not-enrollment";
                 }
             }
             return result;