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
ac3d2ecf
Commit
ac3d2ecf
authored
Mar 07, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
1cfbcff5
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
78 additions
and
73 deletions
+78
-73
BankTypeEnum.cs
Edu.Common/Enum/Exam/BankTypeEnum.cs
+0
-50
RB_Question_Bank.cs
Edu.Model/Entity/Question/RB_Question_Bank.cs
+2
-1
RB_Question_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
+2
-1
CourseExamModule.cs
Edu.Module.Exam/CourseExamModule.cs
+64
-12
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+2
-2
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+8
-7
No files found.
Edu.Common/Enum/Exam/BankTypeEnum.cs
deleted
100644 → 0
View file @
1cfbcff5
using
Edu.Common.Plugin
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
Edu.Common.Enum.Exam
{
/// <summary>
/// 题库类型
/// </summary>
public
enum
BankTypeEnum
{
/// <summary>
/// N5
/// </summary>
[
EnumField
(
"N5"
)]
N5
=
1
,
/// <summary>
/// N4
/// </summary>
[
EnumField
(
"N4"
)]
N4
=
2
,
/// <summary>
/// N3
/// </summary>
[
EnumField
(
"N3"
)]
N3
=
3
,
/// <summary>
/// N2
/// </summary>
[
EnumField
(
"N2"
)]
N2
=
4
,
/// <summary>
/// N1
/// </summary>
[
EnumField
(
"N1"
)]
N1
=
5
,
/// <summary>
/// 高考
/// </summary>
[
EnumField
(
"高考"
)]
CollegeEntranceExamination
=
6
,
}
}
Edu.Model/Entity/Question/RB_Question_Bank.cs
View file @
ac3d2ecf
using
Edu.Common.Enum
;
using
Edu.Common.Enum
;
using
Edu.Common.Enum.Exam
;
using
Edu.Common.Enum.Exam
;
using
Edu.Common.Enum.Question
;
using
System
;
using
System
;
using
VT.FW.DB
;
using
VT.FW.DB
;
...
@@ -66,7 +67,7 @@ namespace Edu.Model.Entity.Question
...
@@ -66,7 +67,7 @@ namespace Edu.Model.Entity.Question
/// <summary>
/// <summary>
/// 题库类型(见枚举)
/// 题库类型(见枚举)
/// </summary>
/// </summary>
public
Bank
TypeEnum
BankType
{
get
;
set
;
}
public
Level
TypeEnum
BankType
{
get
;
set
;
}
}
}
}
}
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
View file @
ac3d2ecf
using
Edu.Common
;
using
Edu.Common
;
using
Edu.Common.Enum.Exam
;
using
Edu.Common.Enum.Exam
;
using
Edu.Common.Enum.Question
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
...
@@ -127,6 +128,6 @@ namespace Edu.Model.ViewModel.Question
...
@@ -127,6 +128,6 @@ namespace Edu.Model.ViewModel.Question
/// <summary>
/// <summary>
/// 题库类型(见枚举)
/// 题库类型(见枚举)
/// </summary>
/// </summary>
public
Bank
TypeEnum
BankType
{
get
;
set
;
}
public
Level
TypeEnum
BankType
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Edu.Module.Exam/CourseExamModule.cs
View file @
ac3d2ecf
...
@@ -11,6 +11,7 @@ using VT.FW.DB;
...
@@ -11,6 +11,7 @@ using VT.FW.DB;
using
Edu.Repository.Question
;
using
Edu.Repository.Question
;
using
Edu.Module.Question
;
using
Edu.Module.Question
;
using
Edu.Common.Plugin
;
using
Edu.Common.Plugin
;
using
Edu.Common.Enum.Question
;
namespace
Edu.Module.Exam
namespace
Edu.Module.Exam
{
{
...
@@ -59,6 +60,11 @@ namespace Edu.Module.Exam
...
@@ -59,6 +60,11 @@ namespace Edu.Module.Exam
/// </summary>
/// </summary>
private
readonly
RB_Question_BankRepository
question_BankRepository
=
new
RB_Question_BankRepository
();
private
readonly
RB_Question_BankRepository
question_BankRepository
=
new
RB_Question_BankRepository
();
/// <summary>
/// 学员练习仓储层对象
/// </summary>
private
readonly
RB_Student_PracticeRepository
student_PracticeRepository
=
new
RB_Student_PracticeRepository
();
#
region
单词测试和复习
#
region
单词测试和复习
/// <summary>
/// <summary>
/// 生成课程复习和预习单词
/// 生成课程复习和预习单词
...
@@ -662,26 +668,46 @@ namespace Edu.Module.Exam
...
@@ -662,26 +668,46 @@ namespace Edu.Module.Exam
/// 题型数量统计
/// 题型数量统计
/// </summary>
/// </summary>
/// <param name="query"></param>
/// <param name="query"></param>
public
object
GetAppQuestionStaticModule
(
RB_Question_ViewModel
query
)
public
object
GetAppQuestionStaticModule
(
RB_Question_ViewModel
query
,
int
StudentId
)
{
{
object
obj
=
new
object
();
object
obj
=
new
object
();
int
readingCount
=
0
;
int
readingTotalCount
=
0
;
int
listeningCount
=
0
;
int
readingFinishCount
=
0
;
int
grammarCount
=
0
;
int
listeningTotalCount
=
0
;
int
wordsCount
=
0
;
int
listeningFinishCount
=
0
;
int
grammarTotalCount
=
0
;
int
grammarFinishCount
=
0
;
int
wordsTotalCount
=
0
;
int
wordsFinishCount
=
0
;
var
sQuery
=
new
RB_Student_Practice_Extend
()
{
StudentId
=
StudentId
,
};
sQuery
.
LevelType
=
query
?.
BankType
??
0
;
var
finishList
=
student_PracticeRepository
.
GetStudentPracticeListRepository
(
sQuery
);
if
(
finishList
!=
null
&&
finishList
.
Count
>
0
)
{
readingFinishCount
=
finishList
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ReadingChoose
)?.
Count
()
??
0
;
listeningFinishCount
=
finishList
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
Listening
)?.
Count
()
??
0
;
grammarFinishCount
=
finishList
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseGrammarUse
)?.
Count
()
??
0
;
}
var
list
=
questionRepository
.
GetQuestionCategoryListRepository
(
query
);
var
list
=
questionRepository
.
GetQuestionCategoryListRepository
(
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
{
readingCount
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ReadingChoose
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
reading
Total
Count
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ReadingChoose
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
listening
Count
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
Listening
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
listening
TotalCount
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
Listening
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
grammarCount
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseGrammarUse
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
grammar
Total
Count
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseGrammarUse
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
}
}
obj
=
new
obj
=
new
{
{
readingCount
,
readingFinishCount
,
listeningCount
,
readingTotalCount
,
grammarCount
,
listeningFinishCount
,
wordsCount
listeningTotalCount
,
grammarTotalCount
,
grammarFinishCount
,
wordsTotalCount
,
wordsFinishCount
};
};
return
obj
;
return
obj
;
}
}
...
@@ -884,6 +910,32 @@ namespace Edu.Module.Exam
...
@@ -884,6 +910,32 @@ namespace Edu.Module.Exam
}
}
return
result
;
return
result
;
}
}
/// <summary>
/// 新增修改学员练习
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetStudentPracticeModule
(
RB_Student_Practice_Extend
model
)
{
bool
flag
=
false
;
if
(
model
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Practice_Extend
.
IsAnswer
),
model
.
IsAnswer
},
{
nameof
(
RB_Student_Practice_Extend
.
IsWrong
),
model
.
IsWrong
},
};
flag
=
student_PracticeRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_Practice_Extend
.
Id
),
model
.
Id
));
}
else
{
var
newId
=
student_PracticeRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
}
return
flag
;
}
#
endregion
#
endregion
}
}
}
}
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
ac3d2ecf
...
@@ -100,7 +100,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -100,7 +100,7 @@ namespace Edu.WebApi.Controllers.Course
BankId
=
base
.
ParmJObj
.
GetInt
(
"BankId"
),
BankId
=
base
.
ParmJObj
.
GetInt
(
"BankId"
),
BankNo
=
base
.
ParmJObj
.
GetStringValue
(
"BankNo"
),
BankNo
=
base
.
ParmJObj
.
GetStringValue
(
"BankNo"
),
BankName
=
base
.
ParmJObj
.
GetStringValue
(
"BankName"
),
BankName
=
base
.
ParmJObj
.
GetStringValue
(
"BankName"
),
BankType
=(
Bank
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
BankType
=(
Level
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
};
};
extModel
.
CreateTime
=
DateTime
.
Now
;
extModel
.
CreateTime
=
DateTime
.
Now
;
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
extModel
.
CreateBy
=
base
.
UserInfo
.
Id
;
...
@@ -120,7 +120,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -120,7 +120,7 @@ namespace Edu.WebApi.Controllers.Course
[
HttpPost
]
[
HttpPost
]
public
ApiResult
GetBankTypeList
()
public
ApiResult
GetBankTypeList
()
{
{
var
list
=
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
Bank
TypeEnum
));
var
list
=
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
Level
TypeEnum
));
return
ApiResult
.
Success
(
data
:
list
);
return
ApiResult
.
Success
(
data
:
list
);
}
}
...
...
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
ac3d2ecf
...
@@ -972,9 +972,10 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -972,9 +972,10 @@ namespace Edu.WebApi.Controllers.Exam
{
{
var
query
=
new
RB_Question_ViewModel
()
var
query
=
new
RB_Question_ViewModel
()
{
{
BankType
=
(
Bank
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
BankType
=
(
Level
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
};
};
var
obj
=
courseExamModule
.
GetAppQuestionStaticModule
(
query
);
int
StudentId
=
base
.
ParmJObj
.
GetInt
(
"StudentId"
);
var
obj
=
courseExamModule
.
GetAppQuestionStaticModule
(
query
,
StudentId
);
return
ApiResult
.
Success
(
data
:
obj
);
return
ApiResult
.
Success
(
data
:
obj
);
}
}
...
@@ -988,7 +989,7 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -988,7 +989,7 @@ namespace Edu.WebApi.Controllers.Exam
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Question_ViewModel
()
var
query
=
new
RB_Question_ViewModel
()
{
{
BankType
=
(
Bank
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
BankType
=
(
Level
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
QCategoryId
=
base
.
ParmJObj
.
GetStringValue
(
"QCategoryId"
),
QCategoryId
=
base
.
ParmJObj
.
GetStringValue
(
"QCategoryId"
),
};
};
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
...
@@ -1007,7 +1008,7 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -1007,7 +1008,7 @@ namespace Edu.WebApi.Controllers.Exam
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Question_ViewModel
()
var
query
=
new
RB_Question_ViewModel
()
{
{
BankType
=
(
Bank
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
BankType
=
(
Level
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
QCategoryId
=
string
.
Format
(
"{0}"
,
(
int
)
QuestionCategoryEnum
.
ChooseGrammarUse
),
QCategoryId
=
string
.
Format
(
"{0}"
,
(
int
)
QuestionCategoryEnum
.
ChooseGrammarUse
),
};
};
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
...
@@ -1026,7 +1027,7 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -1026,7 +1027,7 @@ namespace Edu.WebApi.Controllers.Exam
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Question_ViewModel
()
var
query
=
new
RB_Question_ViewModel
()
{
{
BankType
=
(
Bank
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
BankType
=
(
Level
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
QCategoryId
=
string
.
Format
(
"{0}"
,
(
int
)
QuestionCategoryEnum
.
Listening
),
QCategoryId
=
string
.
Format
(
"{0}"
,
(
int
)
QuestionCategoryEnum
.
Listening
),
};
};
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
...
@@ -1045,7 +1046,7 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -1045,7 +1046,7 @@ namespace Edu.WebApi.Controllers.Exam
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Question_ViewModel
()
var
query
=
new
RB_Question_ViewModel
()
{
{
BankType
=
(
Bank
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
BankType
=
(
Level
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
QCategoryId
=
string
.
Format
(
"{0}"
,
(
int
)
QuestionCategoryEnum
.
ReadingChoose
),
QCategoryId
=
string
.
Format
(
"{0}"
,
(
int
)
QuestionCategoryEnum
.
ReadingChoose
),
};
};
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
...
@@ -1064,7 +1065,7 @@ namespace Edu.WebApi.Controllers.Exam
...
@@ -1064,7 +1065,7 @@ namespace Edu.WebApi.Controllers.Exam
var
pageModel
=
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
pageModel
=
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Question_Bank_ViewModel
()
var
query
=
new
RB_Question_Bank_ViewModel
()
{
{
BankType
=
(
Bank
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
BankType
=
(
Level
TypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
};
};
var
list
=
courseExamModule
.
GetAppBankPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
var
list
=
courseExamModule
.
GetAppBankPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
pageModel
.
Count
=
rowsCount
;
pageModel
.
Count
=
rowsCount
;
...
...
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