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
e0b1fe2b
Commit
e0b1fe2b
authored
Mar 07, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
fb5ad60d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
113 additions
and
10 deletions
+113
-10
CourseExamModule.cs
Edu.Module.Exam/CourseExamModule.cs
+60
-5
RB_QuestionRepository.cs
Edu.Repository/Question/RB_QuestionRepository.cs
+4
-0
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+49
-5
No files found.
Edu.Module.Exam/CourseExamModule.cs
View file @
e0b1fe2b
...
...
@@ -10,6 +10,7 @@ using Edu.Model.ViewModel.Exam;
using
VT.FW.DB
;
using
Edu.Repository.Question
;
using
Edu.Module.Question
;
using
Edu.Common.Plugin
;
namespace
Edu.Module.Exam
{
...
...
@@ -652,30 +653,84 @@ namespace Edu.Module.Exam
#
region
题库相关测试
public
List
<
object
>
GetAppQuestionCategoryListModule
(
RB_Question_ViewModel
query
)
public
List
<
object
>
GetAppQuestionCategoryListModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Question_ViewModel
query
)
{
List
<
object
>
list
=
new
List
<
object
>();
var
dataList
=
questionRepository
.
GetQuestionListRepository
(
query
);
var
dataList
=
questionRepository
.
GetQuestionPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
if
(
dataList
!=
null
&&
dataList
.
Count
>
0
)
{
foreach
(
var
item
in
dataList
)
{
var
QuestionContentObj
=
analysisQuestion
.
ParsingQuestion
(
item
.
QuestionTypeKey
,
item
.
QuestionContent
);
List
<
object
>
answerList
=
new
List
<
object
>();
List
<
object
>
quesAnswerList
=
new
List
<
object
>();
//填空题、分录题、资料题
if
(
item
.
QuestionTypeKey
==
"fill-in"
||
item
.
QuestionTypeKey
==
"entry-problem"
||
item
.
QuestionTypeKey
==
"data-question"
)
{
var
tempList
=
item
.
Answer
.
Split
(
'★'
);
if
(
tempList
!=
null
&&
tempList
.
Count
()
>
0
)
{
foreach
(
var
tItem
in
tempList
)
{
answerList
.
Add
(
tItem
);
}
}
}
//完型填空
else
if
(
item
.
QuestionTypeKey
==
"cloze"
)
{
if
(!
string
.
IsNullOrEmpty
(
item
.
Answer
.
ToString
()))
{
var
qAnsList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
SubAnswerItem
>>(
item
.
Answer
.
ToString
());
if
(
qAnsList
!=
null
&&
qAnsList
.
Count
()
>
0
)
{
foreach
(
var
tItem
in
qAnsList
)
{
quesAnswerList
.
Add
(
tItem
);
}
}
}
}
else
if
(
item
.
QuestionTypeKey
==
"reading-comprehensio"
||
item
.
QuestionTypeKey
==
"listening"
)
{
if
(!
string
.
IsNullOrEmpty
(
item
.
Answer
.
ToString
()))
{
try
{
var
tempList
=
Common
.
ConvertHelper
.
StringToFileList
(
item
.
Answer
);
if
(
tempList
!=
null
&&
tempList
.
Count
>
0
)
{
foreach
(
var
tItem
in
tempList
)
{
quesAnswerList
.
Add
(
tItem
);
}
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetAppQuestionCategoryListModule_:"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
item
));
}
}
}
var
obj
=
new
{
item
.
QuestionId
,
item
.
QuestionTypeId
,
item
.
QuestionTypeKey
,
item
.
Title
,
QuestionContentObj
item
.
DifficultyType
,
item
.
DifficultyTypeStr
,
item
.
AnswerParse
,
QuestionContentObj
,
QuestionAnswerList
=
quesAnswerList
,
AnswerList
=
answerList
,
};
list
.
Add
(
obj
);
}
}
return
list
;
}
#
endregion
}
}
Edu.Repository/Question/RB_QuestionRepository.cs
View file @
e0b1fe2b
...
...
@@ -152,6 +152,10 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Question_ViewModel
.
Category
),
query
.
QCategoryId
);
}
if
(
query
.
BankType
>
0
)
{
builder
.
AppendFormat
(
" AND C.{0}={1} "
,
nameof
(
RB_Question_ViewModel
.
BankType
),
(
int
)
query
.
BankType
);
}
builder
.
AppendFormat
(
" ORDER BY A.{0} ASC "
,
nameof
(
RB_Question_ViewModel
.
SortNum
));
return
GetPage
<
RB_Question_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
...
...
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
e0b1fe2b
...
...
@@ -971,13 +971,16 @@ namespace Edu.WebApi.Controllers.Exam
[
HttpPost
]
public
ApiResult
GetQuestionWordsList
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Question_ViewModel
()
{
BankType
=
(
BankTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
QCategoryId
=
base
.
ParmJObj
.
GetStringValue
(
"QCategoryId"
),
};
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
...
...
@@ -987,13 +990,54 @@ namespace Edu.WebApi.Controllers.Exam
[
HttpPost
]
public
ApiResult
GetQuestionGrammar
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Question_ViewModel
()
{
BankType
=
(
BankTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
QCategoryId
=
base
.
ParmJObj
.
GetStringValue
(
"QCategoryId"
),
QCategoryId
=
string
.
Format
(
"{0}"
,
(
int
)
QuestionCategoryEnum
.
ChooseGrammarUse
),
};
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
query
);
return
ApiResult
.
Success
(
data
:
list
);
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 甲小鹤小程序获取题库听力训练
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetQuestionListening
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Question_ViewModel
()
{
BankType
=
(
BankTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
QCategoryId
=
string
.
Format
(
"{0}"
,
(
int
)
QuestionCategoryEnum
.
Listening
),
};
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 甲小鹤小程序获取题库阅读理解训练
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetQuestionReading
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Question_ViewModel
()
{
BankType
=
(
BankTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"BankType"
),
QCategoryId
=
string
.
Format
(
"{0}"
,
(
int
)
QuestionCategoryEnum
.
ReadingChoose
),
};
var
list
=
courseExamModule
.
GetAppQuestionCategoryListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
}
}
\ No newline at end of file
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