|
@@ -106,7 +106,7 @@ namespace TEAMModelOS.SDK
|
|
|
}
|
|
|
//每次都统计活动相关的数据。
|
|
|
train= await DoActivity(train, setting, area, client, _school, _tmdid);
|
|
|
- train.totalTime = train.onlineTime + train.classTime + train.submitTime + train.offlineTime;
|
|
|
+ train.totalTime = train.onlineTime + train.classTime + train.currency.submitTime + train.offlineTime;
|
|
|
return train;
|
|
|
}
|
|
|
private static async IAsyncEnumerable<TeacherTrain> DoProperty(HashSet<string> updateProperty, AreaSetting setting, Area area, CosmosClient client, TeacherTrain train )
|
|
@@ -352,7 +352,7 @@ namespace TEAMModelOS.SDK
|
|
|
}
|
|
|
if (file != null)
|
|
|
{
|
|
|
- train.videoTime = file.fileRecords.Where(x => x.type.Equals("video")).Select(y => y.duration).Sum();
|
|
|
+ train.videoTime = file.fileRecords.Where(x => x.type.Equals("video")).Select(y => y.view).Sum();
|
|
|
}
|
|
|
train.onlineTime = (int)train.videoTime / setting.lessonMinutes;
|
|
|
return train;
|
|
@@ -383,80 +383,104 @@ namespace TEAMModelOS.SDK
|
|
|
}
|
|
|
|
|
|
if (currency == 1) {
|
|
|
- train.uploadTotal += ability.stds.FindAll(x=> x.task.IsNotEmpty()).Select(y=>y.task).Count();
|
|
|
- if (item.uploads.IsNotEmpty())
|
|
|
+ train.currency.subCount += 1;
|
|
|
+ train.currency.uploadTotal += ability.stds.FindAll(x => x.task.IsNotEmpty()).Select(y => y.task).Count();
|
|
|
+ }
|
|
|
+ train.currencyAll.subCount += 1;
|
|
|
+ train.currencyAll.uploadTotal += ability.stds.FindAll(x => x.task.IsNotEmpty()).Select(y => y.task).Count();
|
|
|
+
|
|
|
+ if (item.uploads.IsNotEmpty())
|
|
|
+ {
|
|
|
+ if (currency == 1)
|
|
|
{
|
|
|
- train.uploadDone += item.uploads.Count;
|
|
|
+ train.currency.uploadDone += item.uploads.Count;
|
|
|
}
|
|
|
- train.subCount += 1;
|
|
|
- if (item.exerciseScore > 0)
|
|
|
- {
|
|
|
- train.exerciseAbility += 1;
|
|
|
+ train.currencyAll.uploadDone += item.uploads.Count;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ if (item.exerciseScore > 0)
|
|
|
+ {
|
|
|
+ if (currency == 1) {
|
|
|
+ train.currency.exerciseAbility += 1;
|
|
|
+ train.currency.learnAbility += item.abilityCount;
|
|
|
}
|
|
|
- List<TeacherHprecord> hprecords = new List<TeacherHprecord>();
|
|
|
- TeacherAility teacherAility = new Models.TeacherAility
|
|
|
+ train.currencyAll.exerciseAbility += 1;
|
|
|
+ train.currencyAll.learnAbility += item.abilityCount;
|
|
|
+ }
|
|
|
+ List<TeacherHprecord> hprecords = new List<TeacherHprecord>();
|
|
|
+ TeacherAility teacherAility = new Models.TeacherAility
|
|
|
+ {
|
|
|
+ id = ability.id,
|
|
|
+ currency = currency,
|
|
|
+ no = ability.no,
|
|
|
+ dimension = ability.dimension,
|
|
|
+ zpscore = item.self,
|
|
|
+ hprecord = hprecords,
|
|
|
+ uploadHas = item.uploads.Count
|
|
|
+ };
|
|
|
+ if (item.otherScore.IsNotEmpty())
|
|
|
+ {
|
|
|
+ var schoolScore = item.otherScore.Where(x => x.roleType.Equals("school")).FirstOrDefault();
|
|
|
+ if (schoolScore != null && schoolScore.score > 0)
|
|
|
{
|
|
|
- id = ability.id,
|
|
|
- currency = currency,
|
|
|
- no = ability.no,
|
|
|
- dimension = ability.dimension,
|
|
|
- zpscore = item.self,
|
|
|
- hprecord = hprecords,
|
|
|
- uploadHas = item.uploads.Count
|
|
|
- };
|
|
|
- //train.learnAbility += item.abilityCount;
|
|
|
- if (item.otherScore.IsNotEmpty())
|
|
|
+ teacherAility.xzscore = schoolScore.score;
|
|
|
+
|
|
|
+ }
|
|
|
+ var hprecord = item.otherScore.FindAll(x => x.roleType.Equals("member")).Select(y => new TeacherHprecord { tmdid = y.tmdid, tmdname = y.tmdname, score = y.score });
|
|
|
+ if (hprecord != null)
|
|
|
{
|
|
|
- var schoolScore = item.otherScore.Where(x => x.roleType.Equals("school")).FirstOrDefault();
|
|
|
- if (schoolScore != null && schoolScore.score > 0)
|
|
|
+ var no = hprecord.Where(x => x.score == 0) != null ? hprecord.Where(x => x.score == 0).Count() : 0;
|
|
|
+ var hg = hprecord.Where(x => x.score == 1) != null ? hprecord.Where(x => x.score == 1).Count() : 0;
|
|
|
+ var yx = hprecord.Where(x => x.score == 2) != null ? hprecord.Where(x => x.score == 2).Count() : 0;
|
|
|
+ if (no == hg && hg == yx && no == 0)
|
|
|
+ {
|
|
|
+ teacherAility.hpscore = -1;
|
|
|
+ }
|
|
|
+ else if (no == hg && hg == yx && no != 0)
|
|
|
{
|
|
|
- teacherAility.xzscore = schoolScore.score;
|
|
|
-
|
|
|
+ teacherAility.hpscore = 2;
|
|
|
}
|
|
|
- var hprecord= item.otherScore.FindAll(x => x.roleType.Equals("member")).Select(y => new TeacherHprecord { tmdid = y.tmdid,tmdname=y.tmdname,score=y.score });
|
|
|
- if (hprecord != null) {
|
|
|
- var no = hprecord.Where(x => x.score == 0) != null ? hprecord.Where(x => x.score == 0).Count() : 0;
|
|
|
- var hg = hprecord.Where(x => x.score == 1) != null ? hprecord.Where(x => x.score == 1).Count() : 0;
|
|
|
- var yx = hprecord.Where(x => x.score == 2) != null ? hprecord.Where(x => x.score == 2).Count() : 0;
|
|
|
- if (no == hg && hg == yx && no == 0)
|
|
|
+ else
|
|
|
+ {
|
|
|
+ bool ok = false;
|
|
|
+ List<int> arr = new List<int>() { yx, hg, no };
|
|
|
+ int max = arr.Max();
|
|
|
+ if (max == yx && !ok)
|
|
|
{
|
|
|
- teacherAility.hpscore = -1;
|
|
|
+ teacherAility.hpscore = 2;
|
|
|
+ ok = true;
|
|
|
}
|
|
|
- else if (no == hg && hg == yx && no != 0)
|
|
|
+ if (max == hg && !ok)
|
|
|
{
|
|
|
- teacherAility.hpscore = 2;
|
|
|
+ teacherAility.hpscore = 1;
|
|
|
+ ok = true;
|
|
|
}
|
|
|
- else {
|
|
|
- bool ok = false;
|
|
|
- List<int> arr = new List<int>() { yx,hg,no};
|
|
|
- int max = arr.Max();
|
|
|
- if (max == yx && !ok) {
|
|
|
- teacherAility.hpscore = 2;
|
|
|
- ok = true;
|
|
|
- }
|
|
|
- if (max == hg && !ok)
|
|
|
- {
|
|
|
- teacherAility.hpscore = 1;
|
|
|
- ok = true;
|
|
|
- }
|
|
|
- if (max == no && !ok)
|
|
|
- {
|
|
|
- teacherAility.hpscore = 0;
|
|
|
- ok = true;
|
|
|
- }
|
|
|
+ if (max == no && !ok)
|
|
|
+ {
|
|
|
+ teacherAility.hpscore = 0;
|
|
|
+ ok = true;
|
|
|
}
|
|
|
- teacherAility.hprecord.AddRange(hprecord);
|
|
|
}
|
|
|
+ teacherAility.hprecord.AddRange(hprecord);
|
|
|
}
|
|
|
- train.teacherAilities.Add(teacherAility);
|
|
|
}
|
|
|
+ if (currency == 1)
|
|
|
+ {
|
|
|
+ train.currency.teacherAilities.Add(teacherAility);
|
|
|
+ }
|
|
|
+ train.currencyAll.teacherAilities.Add(teacherAility);
|
|
|
}
|
|
|
- var bhg = train.teacherAilities.FindAll(x => x.xzscore <= 0);
|
|
|
- if (bhg.IsEmpty()) {
|
|
|
+ var bhg = train.currency.teacherAilities.FindAll(x => x.xzscore <= 0);
|
|
|
+ if (bhg.IsEmpty())
|
|
|
+ {
|
|
|
///要全部合格才能获得学时。
|
|
|
- train.submitTime = setting.submitTime;
|
|
|
+ train.currency.submitTime = setting.submitTime;
|
|
|
+ train.currencyAll.submitTime = setting.submitTime;
|
|
|
}
|
|
|
return train;
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|