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
2ca30ba5
Commit
2ca30ba5
authored
Sep 08, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
c992b43e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
34 additions
and
2 deletions
+34
-2
RB_Examination_Details_ViewModel.cs
Edu.Model/ViewModel/Exam/RB_Examination_Details_ViewModel.cs
+5
-0
PaperModule.cs
Edu.Module.Exam/PaperModule.cs
+16
-2
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+13
-0
No files found.
Edu.Model/ViewModel/Exam/RB_Examination_Details_ViewModel.cs
View file @
2ca30ba5
...
@@ -41,6 +41,11 @@ namespace Edu.Model.ViewModel.Exam
...
@@ -41,6 +41,11 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
/// </summary>
public
decimal
StudentScore
{
get
;
set
;
}
public
decimal
StudentScore
{
get
;
set
;
}
/// <summary>
/// 听力、阅读理解、完型填空、子项列表
/// </summary>
public
List
<
SubAnswerItem
>
SubList
{
get
;
set
;
}
/// <summary>
/// <summary>
/// 学生答案详情id(关联RB_Examination_StudentDetails表中的Id)
/// 学生答案详情id(关联RB_Examination_StudentDetails表中的Id)
/// </summary>
/// </summary>
...
...
Edu.Module.Exam/PaperModule.cs
View file @
2ca30ba5
...
@@ -1540,8 +1540,18 @@ namespace Edu.Module.Exam
...
@@ -1540,8 +1540,18 @@ namespace Edu.Module.Exam
{
{
decimal
totalScore
=
0
;
decimal
totalScore
=
0
;
foreach
(
var
item
in
list
)
foreach
(
var
item
in
list
)
{
decimal
tempScore
=
item
.
StudentScore
;
if
(
item
.
SubList
!=
null
&&
item
.
SubList
.
Count
>
0
)
{
totalScore
+=
item
.
SubList
.
Sum
(
qitem
=>
qitem
.
StudentScore
);
tempScore
=
item
.
SubList
.
Sum
(
qitem
=>
qitem
.
StudentScore
);
}
else
{
{
totalScore
+=
item
.
StudentScore
;
totalScore
+=
item
.
StudentScore
;
}
RB_Examination_StudentDetails_ViewModel
model
=
new
RB_Examination_StudentDetails_ViewModel
()
RB_Examination_StudentDetails_ViewModel
model
=
new
RB_Examination_StudentDetails_ViewModel
()
{
{
Id
=
item
.
StundetDetailsId
,
Id
=
item
.
StundetDetailsId
,
...
@@ -1551,9 +1561,13 @@ namespace Edu.Module.Exam
...
@@ -1551,9 +1561,13 @@ namespace Edu.Module.Exam
{
{
Dictionary
<
string
,
object
>
stuFileds
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
stuFileds
=
new
Dictionary
<
string
,
object
>()
{
{
{
nameof
(
RB_Examination_StudentDetails_ViewModel
.
StudentScore
),
model
.
Student
Score
},
{
nameof
(
RB_Examination_StudentDetails_ViewModel
.
StudentScore
),
temp
Score
},
{
nameof
(
RB_Examination_StudentDetails_ViewModel
.
IsMarking
),
1
},
{
nameof
(
RB_Examination_StudentDetails_ViewModel
.
IsMarking
),
1
},
};
};
if
(
item
.
SubList
!=
null
&&
item
.
SubList
.
Count
>
0
)
{
stuFileds
.
Add
(
nameof
(
RB_Examination_StudentDetails_ViewModel
.
StundetAnswer
),
Common
.
Plugin
.
JsonHelper
.
Serialize
(
item
.
SubList
));
}
flag
=
examination_StudentDetailsRepository
.
Update
(
stuFileds
,
new
WhereHelper
(
nameof
(
RB_Examination_StudentDetails_ViewModel
.
Id
),
model
.
Id
));
flag
=
examination_StudentDetailsRepository
.
Update
(
stuFileds
,
new
WhereHelper
(
nameof
(
RB_Examination_StudentDetails_ViewModel
.
Id
),
model
.
Id
));
}
}
}
}
...
...
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
2ca30ba5
...
@@ -6,6 +6,7 @@ using Edu.Common.Enum.Question;
...
@@ -6,6 +6,7 @@ using Edu.Common.Enum.Question;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Exam
;
using
Edu.Model.ViewModel.Exam
;
using
Edu.Model.ViewModel.Flow
;
using
Edu.Model.ViewModel.Flow
;
using
Edu.Model.ViewModel.Question
;
using
Edu.Module.Exam
;
using
Edu.Module.Exam
;
using
Edu.Module.Question
;
using
Edu.Module.Question
;
using
Edu.Module.System
;
using
Edu.Module.System
;
...
@@ -854,11 +855,23 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -854,11 +855,23 @@ namespace Edu.WebApi.Controllers.Exam
foreach
(
var
sItem
in
subArray
)
foreach
(
var
sItem
in
subArray
)
{
{
JObject
sObj
=
JObject
.
Parse
(
sItem
.
ToString
());
JObject
sObj
=
JObject
.
Parse
(
sItem
.
ToString
());
var
qKey
=
sObj
.
GetStringValue
(
"QuestionTypeKey"
);
string
answer
=
sObj
.
GetStringValue
(
"AnswerList"
);
List
<
SubAnswerItem
>
subList
=
new
List
<
SubAnswerItem
>();
if
(
qKey
==
"reading-comprehensio"
||
qKey
==
"listening"
||
qKey
==
"cloze"
)
{
if
(!
string
.
IsNullOrEmpty
(
answer
))
{
subList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
SubAnswerItem
>>(
answer
);
}
}
var
detailModel
=
new
RB_Examination_Details_ViewModel
()
var
detailModel
=
new
RB_Examination_Details_ViewModel
()
{
{
Id
=
sObj
.
GetInt
(
"PaperDetailsId"
),
Id
=
sObj
.
GetInt
(
"PaperDetailsId"
),
StundetDetailsId
=
sObj
.
GetInt
(
"StundetDetailsId"
),
StundetDetailsId
=
sObj
.
GetInt
(
"StundetDetailsId"
),
StudentScore
=
sObj
.
GetDecimal
(
"StudentScore"
),
StudentScore
=
sObj
.
GetDecimal
(
"StudentScore"
),
SubList
=
subList
,
};
};
paperDetailsList
.
Add
(
detailModel
);
paperDetailsList
.
Add
(
detailModel
);
}
}
...
...
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