|
@@ -446,15 +446,14 @@ namespace TEAMModelOS.SDK
|
|
homeworkRecords.Add(item);
|
|
homeworkRecords.Add(item);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
-
|
|
|
|
List<OfflineRecord> offlines = new List<OfflineRecord>();
|
|
List<OfflineRecord> offlines = new List<OfflineRecord>();
|
|
activities.ForEach(item => {
|
|
activities.ForEach(item => {
|
|
Study study = studies.Find(y=>y.id.Equals(item.id));
|
|
Study study = studies.Find(y=>y.id.Equals(item.id));
|
|
- if (!string.IsNullOrEmpty(item.owner) && study != null && !string.IsNullOrEmpty(study.workId) && !item.owner.Equals("area") )
|
|
|
|
|
|
+ if (!string.IsNullOrEmpty(item.owner) && study != null
|
|
|
|
+ //&& !string.IsNullOrEmpty(study.workId)
|
|
|
|
+ && !item.owner.Equals("area") )
|
|
{
|
|
{
|
|
StudyRecord studyRecord = studyRecords.Find(y => y.id.Equals(item.id));
|
|
StudyRecord studyRecord = studyRecords.Find(y => y.id.Equals(item.id));
|
|
- HomeworkRecord homeworkRecord = homeworkRecords.Find(y => y.id.Equals(study.workId));
|
|
|
|
- Attachment attachment = homeworkRecord != null ? homeworkRecord.content.Find(x => x.prime) : null;
|
|
|
|
OfflineRecord record = new OfflineRecord
|
|
OfflineRecord record = new OfflineRecord
|
|
{
|
|
{
|
|
id = item.id,
|
|
id = item.id,
|
|
@@ -463,29 +462,51 @@ namespace TEAMModelOS.SDK
|
|
owner = item.owner
|
|
owner = item.owner
|
|
};
|
|
};
|
|
record.sethour = study.hour;
|
|
record.sethour = study.hour;
|
|
- if (!string.IsNullOrEmpty(study.workId) ) {
|
|
|
|
- record.haswork = 1;
|
|
|
|
- }
|
|
|
|
- if (null != studyRecord)
|
|
|
|
|
|
+ //
|
|
|
|
+ if (!string.IsNullOrEmpty(study.workId))
|
|
{
|
|
{
|
|
- //通过获得学时
|
|
|
|
- record.hour = studyRecord.status == 1 ? study.hour : 0;
|
|
|
|
-
|
|
|
|
- record.score = studyRecord.status;
|
|
|
|
- if (record.score >= 0)
|
|
|
|
|
|
+ HomeworkRecord homeworkRecord = homeworkRecords.Find(y => y.id.Equals(study.workId));
|
|
|
|
+ Attachment attachment = homeworkRecord != null ? homeworkRecord.content.Find(x => x.prime) : null;
|
|
|
|
+ record.haswork = 1;
|
|
|
|
+ //有作业的必须检查有没有提交作业,只有提交作业通过才能统计获得学时。
|
|
|
|
+ if (null != attachment)
|
|
{
|
|
{
|
|
- record.done = 1;
|
|
|
|
- }
|
|
|
|
- else {
|
|
|
|
- record.score = -1;
|
|
|
|
|
|
+ record.url = attachment.url;
|
|
|
|
+ record.upload = 1;
|
|
|
|
+ record.hash = attachment.hash;
|
|
|
|
+ record.size = attachment.size;
|
|
|
|
+ if (null != studyRecord)
|
|
|
|
+ {
|
|
|
|
+ //通过获得学时
|
|
|
|
+ record.hour = studyRecord.status == 1 ? study.hour : 0;
|
|
|
|
+ record.score = studyRecord.status;
|
|
|
|
+ if (record.score >= 0)
|
|
|
|
+ {
|
|
|
|
+ record.done = 1;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ record.score = -1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- if (null != attachment)
|
|
|
|
- {
|
|
|
|
- record.url = attachment.url;
|
|
|
|
- record.upload = 1;
|
|
|
|
- record.hash = attachment.hash;
|
|
|
|
- record.size = attachment.size;
|
|
|
|
|
|
+ else {
|
|
|
|
+ //没有作业的 可以直接统计通过获得学时
|
|
|
|
+ if (null != studyRecord)
|
|
|
|
+ {
|
|
|
|
+ //通过获得学时
|
|
|
|
+ record.hour = studyRecord.status == 1 ? study.hour : 0;
|
|
|
|
+ record.score = studyRecord.status;
|
|
|
|
+ if (record.score >= 0)
|
|
|
|
+ {
|
|
|
|
+ record.done = 1;
|
|
|
|
+ }
|
|
|
|
+ else
|
|
|
|
+ {
|
|
|
|
+ record.score = -1;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|
|
offlines.Add(record);
|
|
offlines.Add(record);
|
|
}
|
|
}
|