20220725 优化答题交卷接口
This commit is contained in:
@@ -502,11 +502,11 @@ namespace BLL
|
||||
/// </summary>
|
||||
/// <param name="testRecordItemId"></param>
|
||||
/// <param name="answerItems"></param>
|
||||
public static void getTestRecordItemAnswerBySelectedItem(Model.Training_TestRecordItem getTItemT, string selectedItem)
|
||||
public static void getTestRecordItemAnswerBySelectedItem(string testRecordItemId, string selectedItem)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getTItem = db.Training_TestRecordItem.FirstOrDefault(x => x.TestRecordItemId == getTItemT.TestRecordItemId);
|
||||
var getTItem = db.Training_TestRecordItem.FirstOrDefault(x => x.TestRecordItemId == testRecordItemId);
|
||||
if (getTItem != null)
|
||||
{
|
||||
getTItem.SubjectScore = 0;
|
||||
@@ -588,28 +588,31 @@ namespace BLL
|
||||
/// <param name="testRecord"></param>
|
||||
public static string getResitTestRecord(Model.Training_TestRecord getTestRecord)
|
||||
{
|
||||
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
TestRecordId = SQLHelper.GetNewID(),
|
||||
ProjectId = getTestRecord.ProjectId,
|
||||
TestPlanId = getTestRecord.TestPlanId,
|
||||
TestManId = getTestRecord.TestManId,
|
||||
TestType = getTestRecord.TestType,
|
||||
TemporaryUser = getTestRecord.TemporaryUser,
|
||||
Duration = getTestRecord.Duration,
|
||||
// TestStartTime = DateTime.Now,
|
||||
};
|
||||
Model.Training_TestRecord newTestRecord = new Model.Training_TestRecord
|
||||
{
|
||||
TestRecordId = SQLHelper.GetNewID(),
|
||||
ProjectId = getTestRecord.ProjectId,
|
||||
TestPlanId = getTestRecord.TestPlanId,
|
||||
TestManId = getTestRecord.TestManId,
|
||||
TestType = getTestRecord.TestType,
|
||||
TemporaryUser = getTestRecord.TemporaryUser,
|
||||
Duration = getTestRecord.Duration,
|
||||
// TestStartTime = DateTime.Now,
|
||||
};
|
||||
|
||||
Funs.DB.Training_TestRecord.InsertOnSubmit(newTestRecord);
|
||||
Funs.DB.SubmitChanges();
|
||||
db.Training_TestRecord.InsertOnSubmit(newTestRecord);
|
||||
db.SubmitChanges();
|
||||
|
||||
var getTestPlan = Funs.DB.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == newTestRecord.TestPlanId);
|
||||
var person = PersonService.GetPersonByUserId(newTestRecord.TestManId, getTestPlan.ProjectId);
|
||||
if (getTestPlan != null && person != null)
|
||||
{
|
||||
CreateTestRecordItem(getTestPlan, newTestRecord.TestRecordId, person);
|
||||
var getTestPlan = db.Training_TestPlan.FirstOrDefault(x => x.TestPlanId == newTestRecord.TestPlanId);
|
||||
var person = PersonService.GetPersonByUserId(newTestRecord.TestManId, getTestPlan.ProjectId);
|
||||
if (getTestPlan != null && person != null)
|
||||
{
|
||||
CreateTestRecordItem(getTestPlan, newTestRecord.TestRecordId, person);
|
||||
}
|
||||
return newTestRecord.TestRecordId;
|
||||
}
|
||||
return newTestRecord.TestRecordId;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user