Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
Education
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
黄奎
Education
Commits
8f07deee
Commit
8f07deee
authored
Aug 30, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
1257b2e8
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
88 additions
and
30 deletions
+88
-30
ExamTestStatusEnum.cs
Edu.Common/Enum/Exam/ExamTestStatusEnum.cs
+25
-0
RB_Examination_Student.cs
Edu.Model/Entity/Exam/RB_Examination_Student.cs
+3
-2
PaperModule.cs
Edu.Module.Exam/PaperModule.cs
+26
-7
PaperModule2.cs
Edu.Module.Exam/PaperModule2.cs
+25
-18
RB_Examination_StudentDetailsRepository.cs
...epository/Exam/RB_Examination_StudentDetailsRepository.cs
+2
-2
AppletIndexController.cs
Edu.WebApi/Controllers/Applet/AppletIndexController.cs
+7
-1
No files found.
Edu.Common/Enum/Exam/ExamTestStatusEnum.cs
0 → 100644
View file @
8f07deee
using
Edu.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Common.Enum.Exam
{
/// <summary>
/// 学员考试状态
/// </summary>
public
enum
ExamTestStatusEnum
{
/// <summary>
/// 已考试
/// </summary>
[
EnumField
(
"已考试"
)]
FinishTest
=
1
,
/// <summary>
/// 未考试
/// </summary>
[
EnumField
(
"未考试"
)]
NotFinishTest
=
2
,
}
}
Edu.Model/Entity/Exam/RB_Examination_Student.cs
View file @
8f07deee
using
System
;
using
Edu.Common.Enum.Exam
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
using
VT.FW.DB
;
...
...
@@ -75,7 +76,7 @@ namespace Edu.Model.Entity.Exam
/// <summary>
/// 考试状态,0-没考,1-已考
/// </summary>
public
int
ExamStatus
{
get
;
set
;
}
public
ExamTestStatusEnum
ExamStatus
{
get
;
set
;
}
/// <summary>
/// 考试结束时间
...
...
Edu.Module.Exam/PaperModule.cs
View file @
8f07deee
...
...
@@ -17,6 +17,7 @@ using Edu.Common.Enum.EduTask;
using
Edu.Model.ViewModel.EduTask
;
using
Edu.Common.Enum.Finance
;
using
Edu.Repository.EduTask
;
using
Edu.Common.Enum.Exam
;
namespace
Edu.Module.Exam
{
...
...
@@ -1273,7 +1274,7 @@ namespace Edu.Module.Exam
questionList
.
Add
(
qObj
);
}
}
else
if
(
gItem
.
DetailsList
!=
null
&&
gItem
.
DetailsList
.
Count
>
0
)
else
{
var
tempDetailsList
=
new
List
<
RB_Examination_Details_ViewModel
>();
//题目乱序
...
...
@@ -1323,6 +1324,7 @@ namespace Edu.Module.Exam
extModel
.
PaperId
,
extModel
.
PaperName
,
GuestId
,
extModel
.
Group_Id
,
PublishId
=
examPublish
.
Id
,
GroupList
=
paperTypeList
,
};
...
...
@@ -1361,12 +1363,11 @@ namespace Edu.Module.Exam
/// <param name="model"></param>
/// <returns></returns>
[
TransactionCallHandler
]
public
virtual
bool
SetStuExamPaperDetailsModule
(
int
PublishId
,
int
GuestId
,
int
PaperId
,
List
<
RB_Examination_Details_ViewModel
>
list
)
public
virtual
bool
SetStuExamPaperDetailsModule
(
int
PublishId
,
int
GuestId
,
int
PaperId
,
int
UserGroupId
,
List
<
RB_Examination_Details_ViewModel
>
list
)
{
bool
flag
=
false
;
var
modelPublish
=
GetExaminationPublishModule
(
PublishId
);
var
studentModel
=
modelPublish
.
StudentList
.
Where
(
x
=>
x
.
GuestId
==
GuestId
).
FirstOrDefault
();
studentModel
.
ExamEndTime
=
System
.
DateTime
.
Now
;
List
<
RB_Examination_StudentDetails_ViewModel
>
stuList
=
new
List
<
RB_Examination_StudentDetails_ViewModel
>();
if
(
list
!=
null
&&
list
.
Any
())
{
foreach
(
var
item
in
list
)
...
...
@@ -1398,16 +1399,34 @@ namespace Edu.Module.Exam
}
else
{
flag
=
examination_StudentDetailsRepository
.
Insert
(
model
)
>
0
;
var
newId
=
examination_StudentDetailsRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
}
stuList
.
Add
(
model
);
}
if
(
flag
)
//试卷提交成功,更新考试最后时间
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Examination_Student_ViewModel
.
ExamEndTime
),
studentModel
.
ExamEndTime
}
{
nameof
(
RB_Examination_Student_ViewModel
.
ExamEndTime
),
DateTime
.
Now
},
{
nameof
(
RB_Examination_Student_ViewModel
.
ExamStatus
),
ExamTestStatusEnum
.
FinishTest
},
};
flag
=
examination_StudentRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Examination_Student_ViewModel
.
Id
),
studentModel
.
Id
));
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(
nameof
(
RB_Examination_Student_ViewModel
.
PaperId
),
PaperId
),
new
WhereHelper
(
nameof
(
RB_Examination_Student_ViewModel
.
PublishId
),
PublishId
),
new
WhereHelper
(
nameof
(
RB_Examination_Student_ViewModel
.
GuestId
),
GuestId
),
};
flag
=
examination_StudentRepository
.
Update
(
fileds
,
wheres
);
}
var
config
=
GetExaminationConfigureModel
(
new
RB_Examination_Configure_ViewModel
()
{
Group_Id
=
UserGroupId
});
//自动阅卷
if
(
config
.
IsOpenAutoMarking
==
1
)
{
AutoReviewPaperModule
(
modelPublish
.
IsHalfScore
,
list
,
stuList
);
}
}
return
flag
;
...
...
Edu.Module.Exam/PaperModule2.cs
View file @
8f07deee
...
...
@@ -4,6 +4,7 @@ using System;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB
;
namespace
Edu.Module.Exam
{
...
...
@@ -25,28 +26,15 @@ namespace Edu.Module.Exam
/// <param name="PublishId">发布编号</param>
/// <param name="GuestId">学员编号</param>
/// <returns></returns>
public
bool
AutoReviewPaperModule
(
int
PaperId
,
int
PublishId
,
int
GuestId
)
public
bool
AutoReviewPaperModule
(
int
IsHalfScore
,
List
<
RB_Examination_Details_ViewModel
>
questionList
,
List
<
RB_Examination_StudentDetails_ViewModel
>
stuList
)
{
bool
flag
=
false
;
var
paperConfig
=
examination_PublishRepository
.
GetEntity
(
PublishId
);
//多选题未选全是否给一半的分
var
IsHalfScore
=
paperConfig
?.
IsHalfScore
??
0
;
List
<
RB_Examination_StudentDetails_ViewModel
>
answerList
=
new
List
<
RB_Examination_StudentDetails_ViewModel
>();
//试卷题目
var
sourceQuestionList
=
examination_DetailsRepository
.
GetExaminationDetailsListRepository
(
new
RB_Examination_Details_ViewModel
()
{
PaperId
=
PaperId
});
//学员提交答案列表
var
stuQuesList
=
examination_StudentDetailsRepository
.
GetExaminationStudentListRepository
(
new
RB_Examination_StudentDetails_ViewModel
()
{
GuestId
=
GuestId
,
PaperId
=
PaperId
,
PublishId
=
PublishId
,
});
if
(
sourceQuestionList
!=
null
&&
sourceQuestionList
.
Count
>
0
)
if
(
questionList
!=
null
&&
questionList
.
Count
>
0
)
{
foreach
(
var
sItem
in
sourceQ
uestionList
)
foreach
(
var
sItem
in
q
uestionList
)
{
var
answerModel
=
stu
Ques
List
?.
Where
(
qitem
=>
qitem
.
DetailsId
==
sItem
.
Id
)?.
FirstOrDefault
();
var
answerModel
=
stuList
?.
Where
(
qitem
=>
qitem
.
DetailsId
==
sItem
.
Id
)?.
FirstOrDefault
();
if
(
answerModel
!=
null
&&
answerModel
.
Id
>
0
)
{
switch
(
sItem
.
QuestionTypeKey
)
...
...
@@ -64,7 +52,14 @@ namespace Edu.Module.Exam
break
;
//多选题
case
"multiple"
:
if
(
sItem
.
Answer
==
answerModel
.
StundetAnswer
)
{
answerList
.
Add
(
new
RB_Examination_StudentDetails_ViewModel
()
{
Id
=
answerModel
.
Id
,
StundetScore
=
sItem
.
Score
});
}
break
;
//填空题
case
"fill-in"
:
...
...
@@ -166,6 +161,18 @@ namespace Edu.Module.Exam
}
}
}
if
(
answerList
!=
null
&&
answerList
.
Count
>
0
)
{
foreach
(
var
item
in
answerList
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Examination_StudentDetails_ViewModel
.
StundetScore
),
item
.
StundetScore
},
{
nameof
(
RB_Examination_StudentDetails_ViewModel
.
IsMarking
),
1
},
};
examination_StudentDetailsRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Examination_StudentDetails_ViewModel
.
Id
),
item
.
Id
));
}
}
return
flag
;
}
}
...
...
Edu.Repository/Exam/RB_Examination_StudentDetailsRepository.cs
View file @
8f07deee
...
...
@@ -24,8 +24,8 @@ namespace Edu.Repository.Exam
builder
.
AppendFormat
(
@"
SELECT A.*,IFNULL(B.GuestName,'') AS GuestName
FROM RB_Examination_StudentDetails AS A
LEFT JOIN RB_Examination_Student AS c ON C.GuestId=a.GuestId
LEFT
JOIN rb_order_guest AS B ON c.GuestId=B.Id
INNER JOIN RB_Examination_Student AS c ON (C.GuestId=a.GuestId AND A.PaperId=C.PaperId AND A.PublishId=C.PublishId)
INNER
JOIN rb_order_guest AS B ON c.GuestId=B.Id
WHERE 1=1
"
);
builder
.
AppendFormat
(
@" AND A.{0}={1} "
,
nameof
(
RB_Examination_StudentDetails_ViewModel
.
Status
),
0
);
...
...
Edu.WebApi/Controllers/Applet/AppletIndexController.cs
View file @
8f07deee
...
...
@@ -609,6 +609,7 @@ namespace Edu.WebApi.Controllers.Applet
LevelType
=
(
LevelTypeEnum
)
sObj
.
GetInt
(
"LevelType"
),
Answer
=
sObj
.
GetStringValue
(
"Answer"
),
StuPaperGroupId
=
jobj
.
GetInt
(
"GId"
),
Score
=
sObj
.
GetDecimal
(
"Score"
),
};
paperDetailsList
.
Add
(
detailModel
);
}
...
...
@@ -616,7 +617,12 @@ namespace Edu.WebApi.Controllers.Applet
}
}
}
var
result
=
paperModule
.
SetStuExamPaperDetailsModule
(
PublishId
,
GuestId
,
PaperId
,
paperDetailsList
);
int
Group_Id
=
base
.
ParmJObj
.
GetInt
(
"Group_Id"
);
if
(
Group_Id
<=
0
)
{
Group_Id
=
base
.
AppletUserInfo
.
Group_Id
;
}
var
result
=
paperModule
.
SetStuExamPaperDetailsModule
(
PublishId
,
GuestId
,
PaperId
,
Group_Id
,
paperDetailsList
);
return
result
?
ApiResult
.
Success
(
"提交试卷成功"
)
:
ApiResult
.
Failed
(
"提交试卷失败"
);
}
#
endregion
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment