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
1628c8d6
Commit
1628c8d6
authored
Mar 08, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
2d730f50
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
78 additions
and
5 deletions
+78
-5
ConvertHelper.cs
Edu.Common/Plugin/ConvertHelper.cs
+31
-0
RB_Question_Bank_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_Bank_ViewModel.cs
+5
-0
CourseExamModule.cs
Edu.Module.Exam/CourseExamModule.cs
+41
-5
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+1
-0
No files found.
Edu.Common/Plugin/ConvertHelper.cs
View file @
1628c8d6
...
...
@@ -291,6 +291,37 @@ namespace Edu.Common
return
minutes
;
}
/// <summary>
/// 计算时分秒
/// </summary>
/// <param name="start"></param>
/// <param name="end"></param>
/// <returns></returns>
public
static
string
CalcMinutesAndSeconds
(
DateTime
start
,
DateTime
end
)
{
string
dateDiff
=
null
;
TimeSpan
ts1
=
new
TimeSpan
(
start
.
Ticks
);
TimeSpan
ts2
=
new
TimeSpan
(
end
.
Ticks
);
TimeSpan
ts
=
ts1
.
Subtract
(
ts2
).
Duration
();
if
(
ts
.
Days
>
0
)
{
dateDiff
+=
ts
.
Days
.
ToString
()
+
"天"
;
}
if
(
ts
.
Hours
>
0
)
{
dateDiff
+=
ts
.
Hours
.
ToString
()
+
"小时"
;
}
if
(
ts
.
Minutes
>
0
)
{
dateDiff
+=
ts
.
Minutes
.
ToString
()
+
"分"
;
}
if
(
ts
.
Seconds
>
0
)
{
dateDiff
+=
ts
.
Seconds
.
ToString
()
+
"秒"
;
}
return
dateDiff
;
}
/// <summary>
/// 是否为时间型字符串
/// </summary>
...
...
Edu.Model/ViewModel/Question/RB_Question_Bank_ViewModel.cs
View file @
1628c8d6
...
...
@@ -33,5 +33,10 @@ namespace Edu.Model.ViewModel.Question
/// </summary>
public
int
QuestionCount
{
get
;
set
;
}
/// <summary>
/// 学员编号
/// </summary>
public
int
StudentId
{
get
;
set
;
}
}
}
Edu.Module.Exam/CourseExamModule.cs
View file @
1628c8d6
...
...
@@ -847,10 +847,20 @@ namespace Edu.Module.Exam
{
var
tempList
=
stuExamList
?.
Where
(
qitem
=>
qitem
.
BankId
==
item
.
BankId
)?.
ToList
();
string
LeastTime
=
""
;
decimal
HighestScore
=
0
;
string
MyUseTime
=
""
;
decimal
MyScore
=
0
;
if
(
tempList
!=
null
)
{
var
least
=
tempList
?.
OrderBy
(
qitem
=>
qitem
.
ExamMinutes
)?.
FirstOrDefault
();
LeastTime
=
Common
.
ConvertHelper
.
CalcMinutesAndSeconds
(
least
.
StartTime
,
least
.
EndTime
);
HighestScore
=
tempList
?.
Max
(
qitem
=>
qitem
.
Score
)??
0
;
var
myLast
=
tempList
?.
Where
(
qitem
=>
qitem
.
StudentId
==
query
.
StudentId
).
OrderByDescending
(
qitem
=>
qitem
.
Id
)?.
FirstOrDefault
();
if
(
myLast
!=
null
)
{
MyUseTime
=
Common
.
ConvertHelper
.
CalcMinutesAndSeconds
(
myLast
.
StartTime
,
myLast
.
EndTime
);
MyScore
=
myLast
.
Score
;
}
}
var
obj
=
new
{
...
...
@@ -858,9 +868,9 @@ namespace Edu.Module.Exam
item
.
BankName
,
JoinNum
=
tempList
?.
Count
(),
LeastTime
,
HighestScore
=
new
Random
().
Next
(
1
,
100
)
,
MyUseTime
=
"55:55"
,
MyScore
=
new
Random
().
Next
(
1
,
100
)
,
HighestScore
,
MyUseTime
,
MyScore
,
MyRank
=
new
Random
().
Next
(
1
,
10
),
};
result
.
Add
(
obj
);
...
...
@@ -933,7 +943,7 @@ namespace Edu.Module.Exam
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetApp
QuestionCategoryListModule_
:"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
item
));
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetApp
BankDetailsPageModule_Item
:"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
item
));
}
}
}
...
...
@@ -991,6 +1001,32 @@ namespace Edu.Module.Exam
}
return
flag
;
}
/// <summary>
/// 新增修改学员考试练习
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetStudentExamModule
(
RB_Student_Exam_Extend
model
)
{
bool
flag
=
false
;
if
(
model
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
};
flag
=
student_ExamRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_Exam_Extend
.
Id
),
model
.
Id
));
}
else
{
var
newId
=
student_ExamRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
#
endregion
}
}
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
1628c8d6
...
...
@@ -1067,6 +1067,7 @@ namespace Edu.WebApi.Controllers.Exam
{
BankType
=
(
LevelTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
};
query
.
StudentId
=
base
.
ParmJObj
.
GetInt
(
"StudentId"
);
var
list
=
courseExamModule
.
GetAppBankPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
...
...
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