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
d1c0612d
Commit
d1c0612d
authored
Jan 25, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
b3bffeb0
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
85 additions
and
36 deletions
+85
-36
QuestionHelper.cs
Edu.Common/Data/QuestionHelper.cs
+5
-5
QuestionCategoryEnum.cs
Edu.Common/Enum/Course/QuestionCategoryEnum.cs
+33
-14
RB_Question_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
+5
-0
RB_QuestionRepository.cs
Edu.Repository/Question/RB_QuestionRepository.cs
+4
-0
Edu.Test.csproj
Edu.Test/Edu.Test.csproj
+1
-0
Program.cs
Edu.Test/Program.cs
+7
-8
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+30
-9
No files found.
Edu.Common/Data/QuestionHelper.cs
View file @
d1c0612d
...
@@ -121,18 +121,18 @@ namespace Edu.Common.Data
...
@@ -121,18 +121,18 @@ namespace Edu.Common.Data
{
{
if
(
rootItem
.
QuestionList
!=
null
&&
rootItem
.
QuestionList
.
Count
>
0
)
if
(
rootItem
.
QuestionList
!=
null
&&
rootItem
.
QuestionList
.
Count
>
0
)
{
{
if
(
rootItem
.
BigTitle
==
"阅读
理解
"
)
if
(
rootItem
.
BigTitle
==
"阅读
选择
"
)
{
{
foreach
(
var
item
in
rootItem
.
QuestionList
)
foreach
(
var
item
in
rootItem
.
QuestionList
)
{
{
if
(!
string
.
IsNullOrEmpty
(
item
))
if
(!
string
.
IsNullOrEmpty
(
item
))
{
{
string
readStr
=
item
.
Replace
(
"阅读
理解
"
,
""
).
Trim
();
string
readStr
=
item
.
Replace
(
"阅读
选择
"
,
""
).
Trim
();
if
(!
string
.
IsNullOrEmpty
(
readStr
))
if
(!
string
.
IsNullOrEmpty
(
readStr
))
{
{
ImportModel
model
=
new
ImportModel
ImportModel
model
=
new
ImportModel
{
{
Category
=
rootItem
.
BigTitle
,
Category
=
rootItem
.
BigTitle
.
Trim
()
,
SubQuestionList
=
new
List
<
ImportModel
>(),
SubQuestionList
=
new
List
<
ImportModel
>(),
QuestionTypeName
=
"阅读理解"
QuestionTypeName
=
"阅读理解"
};
};
...
@@ -148,7 +148,7 @@ namespace Edu.Common.Data
...
@@ -148,7 +148,7 @@ namespace Edu.Common.Data
{
{
ImportModel
model
=
new
ImportModel
()
ImportModel
model
=
new
ImportModel
()
{
{
Category
=
rootItem
.
BigTitle
Category
=
rootItem
.
BigTitle
.
Trim
()
};
};
if
(!
string
.
IsNullOrEmpty
(
item
))
if
(!
string
.
IsNullOrEmpty
(
item
))
{
{
...
@@ -541,7 +541,7 @@ namespace Edu.Common.Data
...
@@ -541,7 +541,7 @@ namespace Edu.Common.Data
ImportModel
subQuestion
=
new
ImportModel
();
ImportModel
subQuestion
=
new
ImportModel
();
AnalysisQuestionTitle
(
item
,
subQuestion
);
AnalysisQuestionTitle
(
item
,
subQuestion
);
model
.
SubQuestionList
.
Add
(
subQuestion
);
model
.
SubQuestionList
.
Add
(
subQuestion
);
model
.
AnswerAnalysis
+=
(
index
)
+
"、"
+
subQuestion
.
AnswerAnalysis
;
model
.
AnswerAnalysis
+=
"<p>"
+(
index
)
+
"、"
+
subQuestion
.
AnswerAnalysis
+
"</p>"
;
}
}
index
++;
index
++;
}
}
...
...
Edu.Common/Enum/Course/QuestionCategoryEnum.cs
View file @
d1c0612d
...
@@ -15,32 +15,51 @@ namespace Edu.Common.Enum.Course
...
@@ -15,32 +15,51 @@ namespace Edu.Common.Enum.Course
/// </summary>
/// </summary>
[
EnumField
(
"默认"
)]
[
EnumField
(
"默认"
)]
Default
=
0
,
Default
=
0
,
/// <
summary
>
/// <
读音选择题
>
/// 日语选择题
/// 日语选择题
/// </summary>
/// </summary>
[
EnumField
(
"
日语
选择题"
)]
[
EnumField
(
"
读音
选择题"
)]
JapaneseChoose
=
1
,
Japanese
Sound
Choose
=
1
,
/// <summary>
/// <summary>
///
中文
选择题
///
汉字
选择题
/// </summary>
/// </summary>
[
EnumField
(
"
中文
选择题"
)]
[
EnumField
(
"
汉字
选择题"
)]
ChineseChoose
=
2
,
ChineseChoose
=
2
,
/// <summary>
/// <summary>
/// 阅读理解
/// 选择最适当的单词
/// </summary>
[
EnumField
(
"选择最适当的单词"
)]
ChooseWord
=
3
,
/// <summary>
/// 选择意义最接近的单词
/// </summary>
/// </summary>
[
EnumField
(
"
阅读理解
"
)]
[
EnumField
(
"
选择意义最接近的单词
"
)]
ReadingComprehensio
=
3
,
ChooseMean
=
4
,
/// <summary>
/// <summary>
///
文字词汇
///
选择单词正确用法
/// </summary>
/// </summary>
[
EnumField
(
"
文字词汇
"
)]
[
EnumField
(
"
选择单词正确用法
"
)]
WordVocabulary
=
4
,
ChooseWordUse
=
5
,
/// <summary>
/// <summary>
///
语
法
///
选择单词正确用
法
/// </summary>
/// </summary>
[
EnumField
(
"语法"
)]
[
EnumField
(
"选择语法正确的一项"
)]
Grammar
=
5
ChooseGrammarUse
=
6
,
/// <summary>
/// 选择★应该填入的词
/// </summary>
[
EnumField
(
"选择★应该填入的词"
)]
ChooseFillInWord
=
7
,
/// <summary>
/// 阅读选择
/// </summary>
[
EnumField
(
"阅读选择"
)]
ReadingChoose
=
8
,
}
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
View file @
d1c0612d
...
@@ -80,5 +80,10 @@ namespace Edu.Model.ViewModel.Question
...
@@ -80,5 +80,10 @@ namespace Edu.Model.ViewModel.Question
return
Common
.
Plugin
.
EnumHelper
.
ToName
(
this
.
Category
);
return
Common
.
Plugin
.
EnumHelper
.
ToName
(
this
.
Category
);
}
}
}
}
/// <summary>
/// 分类编号
/// </summary>
public
string
QCategoryId
{
get
;
set
;
}
}
}
}
}
\ No newline at end of file
Edu.Repository/Question/RB_QuestionRepository.cs
View file @
d1c0612d
...
@@ -85,6 +85,10 @@ WHERE 1=1 ");
...
@@ -85,6 +85,10 @@ WHERE 1=1 ");
{
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Question_ViewModel
.
DifficultyType
),
query
.
QDifficultyType
);
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Question_ViewModel
.
DifficultyType
),
query
.
QDifficultyType
);
}
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QCategoryId
))
{
builder
.
AppendFormat
(
" AND A.{0} IN({1}) "
,
nameof
(
RB_Question_ViewModel
.
Category
),
query
.
QCategoryId
);
}
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Question_ViewModel
.
QuestionId
));
builder
.
AppendFormat
(
" ORDER BY A.{0} DESC "
,
nameof
(
RB_Question_ViewModel
.
QuestionId
));
return
GetPage
<
RB_Question_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
return
GetPage
<
RB_Question_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
(),
parameters
).
ToList
();
}
}
...
...
Edu.Test/Edu.Test.csproj
View file @
d1c0612d
...
@@ -21,6 +21,7 @@
...
@@ -21,6 +21,7 @@
<ProjectReference Include="..\Edu.Module.User\Edu.Module.User.csproj" />
<ProjectReference Include="..\Edu.Module.User\Edu.Module.User.csproj" />
<ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" />
<ProjectReference Include="..\Edu.Repository\Edu.Repository.csproj" />
<ProjectReference Include="..\Edu.ThirdCore\Edu.ThirdCore.csproj" />
<ProjectReference Include="..\Edu.ThirdCore\Edu.ThirdCore.csproj" />
<ProjectReference Include="..\Edu.WebApi\Edu.WebApi.csproj" />
</ItemGroup>
</ItemGroup>
</Project>
</Project>
Edu.Test/Program.cs
View file @
d1c0612d
using
System
;
using
Edu.WebApi.Controllers.Course
;
using
System
;
namespace
Edu.Test
namespace
Edu.Test
{
{
...
@@ -7,14 +8,12 @@ namespace Edu.Test
...
@@ -7,14 +8,12 @@ namespace Edu.Test
static
void
Main
(
string
[]
args
)
static
void
Main
(
string
[]
args
)
{
{
string
filePath
=
""
;
string
filePath
=
""
;
filePath
=
@"C:/Users/qiaoyajun/Desktop/
源模板.docx
"
;
filePath
=
@"C:/Users/qiaoyajun/Desktop/
EduWordTemplate.doc
"
;
//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
));
var
data2
=
new
QuestionController
().
ImportWordQuestion
(
filePath
,
1
,
1
);
if
(
data
!=
null
&&
data
.
Count
>
0
)
Console
.
WriteLine
(
Common
.
Plugin
.
JsonHelper
.
Serialize
(
data2
));
{
Console
.
WriteLine
(
"总共:"
+
data
.
Count
);
}
}
}
}
}
}
}
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
d1c0612d
...
@@ -76,6 +76,18 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -76,6 +76,18 @@ namespace Edu.WebApi.Controllers.Course
}
}
catch
catch
{
{
}
try
{
var
categoryList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
int
>>(
base
.
ParmJObj
.
GetStringValue
(
"QCategoryId"
));
if
(
categoryList
!=
null
&&
categoryList
.
Count
>
0
)
{
query
.
QCategoryId
=
string
.
Join
(
","
,
categoryList
);
}
}
catch
{
}
}
var
list
=
questionModule
.
GetQuestionPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
var
list
=
questionModule
.
GetQuestionPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
List
<
object
>
resultList
=
new
List
<
object
>();
List
<
object
>
resultList
=
new
List
<
object
>();
...
@@ -753,20 +765,29 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -753,20 +765,29 @@ namespace Edu.WebApi.Controllers.Course
{
{
switch
(
item
.
Category
)
switch
(
item
.
Category
)
{
{
case
"
日语
选择题"
:
case
"
读音
选择题"
:
Category
=
QuestionCategoryEnum
.
JapaneseChoose
;
Category
=
QuestionCategoryEnum
.
Japanese
Sound
Choose
;
break
;
break
;
case
"
中文
选择题"
:
case
"
汉字
选择题"
:
Category
=
QuestionCategoryEnum
.
ChineseChoose
;
Category
=
QuestionCategoryEnum
.
ChineseChoose
;
break
;
break
;
case
"阅读理解"
:
case
"选择最适当的单词"
:
Category
=
QuestionCategoryEnum
.
ReadingComprehensio
;
Category
=
QuestionCategoryEnum
.
ChooseWord
;
break
;
case
"选择意义最接近的单词"
:
Category
=
QuestionCategoryEnum
.
ChooseMean
;
break
;
case
"选择单词正确用法"
:
Category
=
QuestionCategoryEnum
.
ChooseWordUse
;
break
;
case
"选择语法正确的一项"
:
Category
=
QuestionCategoryEnum
.
ChooseGrammarUse
;
break
;
break
;
case
"
文字词汇
"
:
case
"
选择★应该填入的词
"
:
Category
=
QuestionCategoryEnum
.
WordVocabulary
;
Category
=
QuestionCategoryEnum
.
ChooseFillInWord
;
break
;
break
;
case
"
语法
"
:
case
"
阅读选择
"
:
Category
=
QuestionCategoryEnum
.
Grammar
;
Category
=
QuestionCategoryEnum
.
ReadingChoose
;
break
;
break
;
}
}
}
}
...
...
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