|
@@ -3,7 +3,7 @@ using Azure.Core;
|
|
|
using Azure.Cosmos;
|
|
|
using Azure.Messaging.ServiceBus;
|
|
|
using Azure.Storage.Blobs.Models;
|
|
|
-using DinkToPdf.Contracts;
|
|
|
+using DinkToPdf.Contracts;
|
|
|
using HTEXLib.COMM.Helpers;
|
|
|
using Microsoft.AspNetCore.Authorization;
|
|
|
using Microsoft.AspNetCore.Hosting;
|
|
@@ -1999,12 +1999,12 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
code = $"LessonRecord-{schoolId}";// 組合區域碼
|
|
|
tbname = "School";
|
|
|
- school = $"{schoolId}";
|
|
|
+ school = $"{schoolId}";
|
|
|
//只查询某个老师的课例
|
|
|
- if (string.IsNullOrWhiteSpace($"{teammodelId}"))
|
|
|
+ if (string.IsNullOrWhiteSpace($"{teammodelId}"))
|
|
|
{
|
|
|
- return false;
|
|
|
- }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
}
|
|
|
else
|
|
|
{
|
|
@@ -2015,7 +2015,7 @@ namespace TEAMModelOS.Controllers
|
|
|
{
|
|
|
code = $"LessonRecord";
|
|
|
tbname = "Teacher";
|
|
|
- if (string.IsNullOrEmpty($"{teammodelId}"))
|
|
|
+ if (string.IsNullOrEmpty($"{teammodelId}"))
|
|
|
{
|
|
|
//如果不传tmdid, 则必须传递,课程id或者名单列表
|
|
|
// 如果不传递tmdid
|
|
@@ -2132,7 +2132,7 @@ namespace TEAMModelOS.Controllers
|
|
|
#endregion
|
|
|
|
|
|
List<ScoreLessonBase> lessonBases = new List<ScoreLessonBase>();
|
|
|
- string blobname = "";
|
|
|
+ string blobname = "";
|
|
|
|
|
|
foreach (var item in lessonRecords)
|
|
|
{// 先檢查課堂紀錄是否存在再取資料
|
|
@@ -2155,7 +2155,7 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else
|
|
|
+ else
|
|
|
{ // 個人課程
|
|
|
List<CourseTask_ta> ctList = new();
|
|
|
// 檢查這個課程的助教跟教授裡面有沒有包含傳進來的teammodelId 有的話用教授取blob的資料
|
|
@@ -2185,11 +2185,11 @@ namespace TEAMModelOS.Controllers
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- else { return false; }
|
|
|
+ //else { return false; }
|
|
|
+
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
}
|
|
|
List<ScoreLessonBase> lessonBasesCalcList = new List<ScoreLessonBase>();
|
|
|
// 重新比對資料以防 班級人數跟分數的數量對不上
|
|
@@ -2288,7 +2288,7 @@ namespace TEAMModelOS.Controllers
|
|
|
sb_examIds.Append($"'{examItem[i].examId}',");
|
|
|
}
|
|
|
// 取評量名稱
|
|
|
- string sql_examName = $"SELECT c.id as examId, c.name, c.startTime FROM c where c.pk = 'Exam' and c.id in ({sb_examIds.ToString().Remove(sb_examIds.Length - 1, 1)})";
|
|
|
+ string sql_examName = $"SELECT c.id as examId, c.name, c.startTime, b.point FROM c join b in c.papers where c.pk = 'Exam' and c.id in ({sb_examIds.ToString().Remove(sb_examIds.Length - 1, 1)})";
|
|
|
//string sql_examName = $"SELECT c.id as examId, c.name FROM c where c.pk = 'Exam' and c.id in ({sb_examIds.ToString().Remove(sb_examIds.Length - 1, 1)})";
|
|
|
await foreach (var item in clientCommon.GetItemQueryIterator<ExamItem>(queryText: sql_examName))
|
|
|
{
|
|
@@ -2304,6 +2304,11 @@ namespace TEAMModelOS.Controllers
|
|
|
ExamItem examItemCalc = new ExamItem();
|
|
|
examItemCalc.examId = examItem[i].examId;
|
|
|
examItemCalc.sum = new List<double>();
|
|
|
+ // 先計算出每個評量的總分
|
|
|
+ var totalPoints = examItemNameStartTime
|
|
|
+ .Where(exam => exam.examId == examItem[i].examId)
|
|
|
+ .SelectMany(exam => exam.point)
|
|
|
+ .Sum();
|
|
|
|
|
|
// 設定分數的預設值
|
|
|
for (int f = 0; f < members.Count; f++)
|
|
@@ -2318,7 +2323,8 @@ namespace TEAMModelOS.Controllers
|
|
|
//如果有比對中學生id再把分數設定過來
|
|
|
if (examItem[i].studentIds[j] == members[k].id)
|
|
|
{
|
|
|
- examItemCalc.sum[k] = examItem[i].sum[j];
|
|
|
+ // 用每個評量的總分計算出每個學生評量的百分比分數
|
|
|
+ examItemCalc.sum[k] = 100 / totalPoints * examItem[i].sum[j];
|
|
|
}
|
|
|
}
|
|
|
}
|