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
5a153466
Commit
5a153466
authored
Jan 22, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
fc19e487
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
2 deletions
+21
-2
QuestionCategoryEnum.cs
Edu.Common/Enum/Course/QuestionCategoryEnum.cs
+12
-0
WordHelper.cs
Edu.Common/Plugin/WordHelper.cs
+2
-1
Program.cs
Edu.Test/Program.cs
+1
-1
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+6
-0
No files found.
Edu.Common/Enum/Course/QuestionCategoryEnum.cs
View file @
5a153466
...
@@ -30,5 +30,17 @@ namespace Edu.Common.Enum.Course
...
@@ -30,5 +30,17 @@ namespace Edu.Common.Enum.Course
/// </summary>
/// </summary>
[
EnumField
(
"阅读理解"
)]
[
EnumField
(
"阅读理解"
)]
ReadingComprehensio
=
3
,
ReadingComprehensio
=
3
,
/// <summary>
/// 文字词汇
/// </summary>
[
EnumField
(
"文字词汇"
)]
WordVocabulary
=
4
,
/// <summary>
/// 语法
/// </summary>
[
EnumField
(
"语法"
)]
Grammar
=
5
}
}
}
}
\ No newline at end of file
Edu.Common/Plugin/WordHelper.cs
View file @
5a153466
...
@@ -92,7 +92,7 @@ namespace Edu.Common.Plugin
...
@@ -92,7 +92,7 @@ namespace Edu.Common.Plugin
{
{
QuestionWordData
questionWordData
=
new
QuestionWordData
();
QuestionWordData
questionWordData
=
new
QuestionWordData
();
// \r\n【图一】\r\n
// \r\n【图一】\r\n
string
imgPattern
=
@"
\r\n
[【][图][一二三四五六七八九十]*[】]"
;
string
imgPattern
=
@"[【][图][一二三四五六七八九十]*[】]"
;
Regex
imgReg
=
new
Regex
(
imgPattern
);
Regex
imgReg
=
new
Regex
(
imgPattern
);
//判断是否有图片
//判断是否有图片
if
(
imgReg
.
IsMatch
(
questionStr
))
if
(
imgReg
.
IsMatch
(
questionStr
))
...
@@ -101,6 +101,7 @@ namespace Edu.Common.Plugin
...
@@ -101,6 +101,7 @@ namespace Edu.Common.Plugin
var
imgMatchs
=
Regex
.
Matches
(
questionStr
,
imgPattern
);
var
imgMatchs
=
Regex
.
Matches
(
questionStr
,
imgPattern
);
if
(
imgMatchs
!=
null
&&
imgMatchs
.
Count
>
0
)
if
(
imgMatchs
!=
null
&&
imgMatchs
.
Count
>
0
)
{
{
//"【图十】【图三】"
foreach
(
var
item
in
imgMatchs
)
foreach
(
var
item
in
imgMatchs
)
{
{
//获取文档中“【图一】、【图二】...”中的“一、二”
//获取文档中“【图一】、【图二】...”中的“一、二”
...
...
Edu.Test/Program.cs
View file @
5a153466
...
@@ -7,7 +7,7 @@ namespace Edu.Test
...
@@ -7,7 +7,7 @@ namespace Edu.Test
static
void
Main
(
string
[]
args
)
static
void
Main
(
string
[]
args
)
{
{
string
filePath
=
""
;
string
filePath
=
""
;
filePath
=
@"C:/Users/qiaoyajun/Desktop/
10年7月N3题库-朱俊贤 - 副本
.docx"
;
filePath
=
@"C:/Users/qiaoyajun/Desktop/
源模板
.docx"
;
//filePath = @"C:/Users/qiaoyajun/Desktop/EduWordTemplate.doc";
//filePath = @"C:/Users/qiaoyajun/Desktop/EduWordTemplate.doc";
var
data
=
Common
.
Data
.
QuestionHelper
.
GetWordQuestionData
(
filePath
);
var
data
=
Common
.
Data
.
QuestionHelper
.
GetWordQuestionData
(
filePath
);
Console
.
WriteLine
(
Common
.
Plugin
.
JsonHelper
.
Serialize
(
data
));
Console
.
WriteLine
(
Common
.
Plugin
.
JsonHelper
.
Serialize
(
data
));
...
...
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
5a153466
...
@@ -750,6 +750,12 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -750,6 +750,12 @@ namespace Edu.WebApi.Controllers.Course
case
"阅读理解"
:
case
"阅读理解"
:
Category
=
QuestionCategoryEnum
.
ReadingComprehensio
;
Category
=
QuestionCategoryEnum
.
ReadingComprehensio
;
break
;
break
;
case
"文字词汇"
:
Category
=
QuestionCategoryEnum
.
WordVocabulary
;
break
;
case
"语法"
:
Category
=
QuestionCategoryEnum
.
Grammar
;
break
;
}
}
}
}
var
questionTypeModel
=
questionTypeList
?.
Where
(
qitem
=>
qitem
.
Name
==
item
.
QuestionTypeName
)?.
FirstOrDefault
();
var
questionTypeModel
=
questionTypeList
?.
Where
(
qitem
=>
qitem
.
Name
==
item
.
QuestionTypeName
)?.
FirstOrDefault
();
...
...
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