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
563b9bc0
Commit
563b9bc0
authored
Jan 10, 2022
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
0d523f36
05f6c2ee
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
105 additions
and
25 deletions
+105
-25
ConvertHelper.cs
Edu.Common/Plugin/ConvertHelper.cs
+13
-2
RB_Examination_Student_ViewModel.cs
Edu.Model/ViewModel/Exam/RB_Examination_Student_ViewModel.cs
+2
-2
CourseExamModule.cs
Edu.Module.Exam/CourseExamModule.cs
+59
-5
PaperModule.cs
Edu.Module.Exam/PaperModule.cs
+22
-9
RB_Examination_StudentRepository.cs
Edu.Repository/Exam/RB_Examination_StudentRepository.cs
+1
-1
AppletIndexController.cs
Edu.WebApi/Controllers/Applet/AppletIndexController.cs
+1
-1
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+7
-5
No files found.
Edu.Common/Plugin/ConvertHelper.cs
View file @
563b9bc0
...
...
@@ -277,7 +277,7 @@ namespace Edu.Common
/// <returns></returns>
public
static
int
CalcMinutes
(
DateTime
start
,
DateTime
end
)
{
int
minutes
=
Convert
.
ToInt32
((
end
-
start
).
TotalSeconds
);
int
minutes
=
Convert
.
ToInt32
((
end
-
start
).
TotalSeconds
);
minutes
/=
60
;
return
minutes
;
}
...
...
@@ -387,7 +387,7 @@ namespace Edu.Common
/// <param name="value"></param>
/// <param name="isAddNbsp"></param>
/// <returns></returns>
public
static
string
GetSpanString
(
string
value
,
bool
isAddNbsp
=
false
)
public
static
string
GetSpanString
(
string
value
,
bool
isAddNbsp
=
false
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"<span style='text-decoration: underline;'>{1}{0}{1}</span>"
,
value
,
(
isAddNbsp
?
" "
:
""
));
...
...
@@ -520,5 +520,16 @@ namespace Edu.Common
}
return
FormatDate
(
last
);
}
/// <summary>
/// 生成随机数
/// </summary>
/// <returns></returns>
public
static
int
CreateRandomNum
()
{
Random
rd
=
new
Random
();
int
result
=
rd
.
Next
(
1
,
100
);
return
result
%
4
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Exam/RB_Examination_Student_ViewModel.cs
View file @
563b9bc0
...
...
@@ -40,11 +40,11 @@ namespace Edu.Model.ViewModel.Exam
/// <summary>
/// 考试开始时间
/// </summary>
public
DateTime
Exam
StartTime
{
get
;
set
;
}
public
DateTime
Paper
StartTime
{
get
;
set
;
}
/// <summary>
/// 考试结束时间
/// </summary>
public
DateTime
EndTime
{
get
;
set
;
}
public
DateTime
Paper
EndTime
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.Exam/CourseExamModule.cs
View file @
563b9bc0
...
...
@@ -4,6 +4,7 @@ using System;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Linq
;
using
Edu.Model.ViewModel.Question
;
namespace
Edu.Module.Exam
{
...
...
@@ -25,7 +26,7 @@ namespace Edu.Module.Exam
/// <param name="ChapterId"></param>
/// <param name="NextChapterId"></param>
/// <returns></returns>
public
object
CreateCourseExam
(
int
CourseId
,
int
ChapterId
,
int
NextChapterId
)
public
object
CreateCourseExam
(
int
CourseId
,
int
ChapterId
,
int
NextChapterId
)
{
object
result
=
new
object
();
var
list
=
course_WordsRepository
.
GetCourseWordsListRepository
(
new
RB_Course_Words_Extend
()
...
...
@@ -33,25 +34,78 @@ namespace Edu.Module.Exam
CourseId
=
CourseId
,
QChapterIds
=
ChapterId
+
","
+
NextChapterId
});
var
reviewList
=
list
?.
Where
(
qitem
=>
qitem
.
ChapterId
==
ChapterId
)?.
OrderBy
(
qitem
=>
Guid
.
NewGuid
())?.
ToList
();
var
prepList
=
list
?.
Where
(
qitem
=>
qitem
.
ChapterId
==
NextChapterId
)?.
OrderBy
(
qitem
=>
Guid
.
NewGuid
())?.
ToList
();
List
<
object
>
reviewGroupList
=
new
List
<
object
>();
List
<
object
>
prepGroupList
=
new
List
<
object
>();
if
(
reviewList
!=
null
&&
reviewList
.
Count
>
0
)
{
for
(
var
i
=
0
;
i
<
reviewList
.
Count
;
i
++)
{
//选择题
if
(
i
%
2
==
0
)
{
{
string
title
=
"我是问题"
;
int
randNum
=
Common
.
ConvertHelper
.
CreateRandomNum
();
switch
(
randNum
)
{
//根据单词选择中文意思
case
0
:
break
;
//根据中文意思选择单词
case
1
:
break
;
//根据日语书写选择中文意思
case
2
:
break
;
//根据中文意思选日语书写
case
3
:
break
;
}
List
<
optionItem
>
options
=
new
List
<
optionItem
>();
reviewGroupList
.
Add
(
new
{
QuestionTypeName
=
"单选题"
,
QuestionTypeId
=
1
,
QuestionTypeKey
=
"single"
,
QuestionContent
=
options
,
Title
=
title
});
}
//填空题
else
{
string
title
=
"我是问题"
;
List
<
fillInItem
>
fillInItems
=
new
List
<
fillInItem
>();
reviewGroupList
.
Add
(
new
{
QuestionTypeName
=
"填空题"
,
QuestionTypeId
=
3
,
QuestionTypeKey
=
"fill-in"
,
QuestionContent
=
fillInItems
,
Title
=
title
});
}
}
}
if
(
prepList
!=
null
&&
prepList
.
Count
>
0
)
{
{
}
result
=
new
{
reviewGroupList
,
prepGroupList
,
};
return
result
;
}
}
...
...
Edu.Module.Exam/PaperModule.cs
View file @
563b9bc0
...
...
@@ -1634,17 +1634,30 @@ namespace Edu.Module.Exam
/// <returns></returns>
public
virtual
bool
SetStuExamStartTimeModule
(
int
PublishId
,
int
GuestId
,
int
PaperId
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
bool
flag
=
false
;
var
model
=
examination_StudentRepository
.
GetExaminationStudentListRepository
(
new
RB_Examination_Student_ViewModel
()
{
{
nameof
(
RB_Examination_Student_ViewModel
.
ExamStartTime
),
DateTime
.
Now
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
PaperId
=
PaperId
,
PublishId
=
PublishId
,
GuestId
=
GuestId
})?.
FirstOrDefault
();
if
(
model
!=
null
)
{
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
),
};
bool
flag
=
examination_StudentRepository
.
Update
(
fileds
,
wheres
);
if
(
model
.
ExamStartTime
==
null
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Examination_Student_ViewModel
.
ExamStartTime
),
DateTime
.
Now
},
};
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
);
}
}
return
flag
;
}
...
...
Edu.Repository/Exam/RB_Examination_StudentRepository.cs
View file @
563b9bc0
...
...
@@ -24,7 +24,7 @@ namespace Edu.Repository.Exam
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT A.*,IFNULL(B.GuestName,'') AS GuestName,c.ClassName,b.Mobile,s.StuIcon,p.ExamStartTime
,p.ExamEndTime AS
EndTime
SELECT A.*,IFNULL(B.GuestName,'') AS GuestName,c.ClassName,b.Mobile,s.StuIcon,p.ExamStartTime
AS PaperStartTime,p.ExamEndTime AS Paper
EndTime
FROM RB_Examination_Student AS A LEFT JOIN rb_order_guest AS B ON A.GuestId=B.Id
LEFT JOIN rb_class as c on c.ClassId=a.ClassId
LEFT JOIN rb_student_orderguest as sog on sog.GuestId=a.GuestId
...
...
Edu.WebApi/Controllers/Applet/AppletIndexController.cs
View file @
563b9bc0
...
...
@@ -110,7 +110,7 @@ namespace Edu.WebApi.Controllers.Applet
classModel
=
new
Model
.
ViewModel
.
Grade
.
RB_Class_Time_Extend
();
}
#
region
我的试卷
List
<
Model
.
ViewModel
.
Exam
.
RB_Examination_Publish_ViewModel
>
examinationPublishList
=
new
List
<
Model
.
ViewModel
.
Exam
.
RB_Examination_Publish_ViewModel
>();
List
<
RB_Examination_Publish_ViewModel
>
examinationPublishList
=
new
List
<
RB_Examination_Publish_ViewModel
>();
if
(
studentModel
!=
null
&&
studentModel
.
GuestId
>
0
)
{
examinationPublishList
=
paperModule
.
GetGuestExaminationPublishPage
(
1
,
5
,
out
long
rowsCount
,
...
...
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
563b9bc0
...
...
@@ -854,18 +854,18 @@ namespace Edu.WebApi.Controllers.Exam
var
list
=
paperModule
.
GetExaminationStudentPageRepository
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
foreach
(
var
item
in
list
)
{
if
(
item
.
Exam
StartTime
>
System
.
DateTime
.
Now
)
if
(
item
.
Paper
StartTime
>
System
.
DateTime
.
Now
)
{
item
.
ExamStatus
=
ExamTestStatusEnum
.
NotStarted
;
}
else
if
(
item
.
ExamStartTime
<
System
.
DateTime
.
Now
&&
item
.
EndTime
>
System
.
DateTime
.
Now
)
else
if
(
item
.
PaperStartTime
<
System
.
DateTime
.
Now
&&
item
.
Paper
EndTime
>
System
.
DateTime
.
Now
)
{
if
(
item
.
ExamStatus
!=
ExamTestStatusEnum
.
FinishTest
&&
item
.
ExamStatus
!=
ExamTestStatusEnum
.
FinishScoring
)
{
item
.
ExamStatus
=
ExamTestStatusEnum
.
FinishStarted
;
}
}
else
if
(
item
.
EndTime
<
System
.
DateTime
.
Now
)
else
if
(
item
.
Paper
EndTime
<
System
.
DateTime
.
Now
)
{
if
(
item
.
ExamStatus
!=
ExamTestStatusEnum
.
FinishTest
&&
item
.
ExamStatus
!=
ExamTestStatusEnum
.
FinishScoring
)
{
...
...
@@ -888,8 +888,10 @@ namespace Edu.WebApi.Controllers.Exam
CreateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
CreateBy
)?.
AccountName
??
""
,
item
.
ExamStatus
,
ExamStatusName
=
item
.
ExamStatus
.
ToName
(),
ExamStartTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
ExamStartTime
),
EndTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
EndTime
),
ExamStartTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
ExamStartTime
),
ExamEndTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
ExamEndTime
),
PaperStartTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
PaperStartTime
),
PaperEndTime
=
Common
.
ConvertHelper
.
FormatTime
(
item
.
PaperEndTime
),
};
result
.
Add
(
obj
);
}
...
...
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