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
8540b52b
Commit
8540b52b
authored
Apr 06, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
5ec3bad0
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
4 deletions
+26
-4
ConvertHelper.cs
Edu.Common/Plugin/ConvertHelper.cs
+8
-2
QuestionModule.cs
Edu.Module.Question/QuestionModule.cs
+16
-1
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+2
-1
No files found.
Edu.Common/Plugin/ConvertHelper.cs
View file @
8540b52b
...
...
@@ -316,10 +316,16 @@ namespace Edu.Common
return
builder
.
ToString
();
}
public
static
string
GetSpanString
(
string
value
)
/// <summary>
/// 拼接下划线
/// </summary>
/// <param name="value"></param>
/// <param name="isAddNbsp"></param>
/// <returns></returns>
public
static
string
GetSpanString
(
string
value
,
bool
isAddNbsp
=
false
)
{
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"<span style='text-decoration: underline;'>{
0}</span>"
,
value
);
builder
.
AppendFormat
(
@"<span style='text-decoration: underline;'>{
1}{0}{1}</span>"
,
value
,
(
isAddNbsp
?
" "
:
""
)
);
return
builder
.
ToString
();
}
}
...
...
Edu.Module.Question/QuestionModule.cs
View file @
8540b52b
...
...
@@ -5,6 +5,7 @@ using Edu.Model.ViewModel.Question;
using
Edu.Repository.Question
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
using
VT.FW.DB
;
namespace
Edu.Module.Question
...
...
@@ -249,7 +250,7 @@ namespace Edu.Module.Question
/// </summary>
/// <param name="QuestionId"></param>
/// <returns></returns>
public
RB_Question_ViewModel
GetQuestionModule
(
object
QuestionId
)
public
RB_Question_ViewModel
GetQuestionModule
(
object
QuestionId
,
int
isReplaceClozeTitle
=
0
)
{
var
extModel
=
questionRepository
.
GetEntity
<
RB_Question_ViewModel
>(
QuestionId
);
if
(
extModel
!=
null
)
...
...
@@ -263,6 +264,20 @@ namespace Edu.Module.Question
{
extModel
.
QuestionPointList
=
GetPointListModule
(
new
RB_Question_Point_ViewModel
()
{
QPointIds
=
extModel
.
Knowledge
});
}
if
(
extModel
.
QuestionTypeKey
==
"cloze"
&&
!
string
.
IsNullOrEmpty
(
extModel
.
Title
)&&
isReplaceClozeTitle
==
1
)
{
string
categoryRule1
=
@"##[1234567890]##"
;
Regex
categoryReg
=
new
Regex
(
categoryRule1
);
MatchCollection
matchs
=
categoryReg
.
Matches
(
extModel
.
Title
);
foreach
(
var
item
in
matchs
)
{
if
(
item
!=
null
&&
!
string
.
IsNullOrEmpty
(
item
.
ToString
()))
{
var
content
=
item
.
ToString
().
Replace
(
"#"
,
""
);
extModel
.
Title
=
extModel
.
Title
.
Replace
(
item
.
ToString
(),
Common
.
ConvertHelper
.
GetSpanString
(
content
,
isAddNbsp
:
true
));
}
}
}
}
return
extModel
;
}
...
...
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
8540b52b
...
...
@@ -673,7 +673,8 @@ namespace Edu.WebApi.Controllers.Course
public
ApiResult
GetQuestion
()
{
var
QuestionId
=
base
.
ParmJObj
.
GetInt
(
"QuestionId"
,
0
);
var
extModel
=
questionModule
.
GetQuestionModule
(
QuestionId
);
int
isReplaceClozeTitle
=
base
.
ParmJObj
.
GetInt
(
"isReplaceClozeTitle"
,
0
);
var
extModel
=
questionModule
.
GetQuestionModule
(
QuestionId
,
isReplaceClozeTitle
:
isReplaceClozeTitle
);
return
ApiResult
.
Success
(
data
:
extModel
);
}
...
...
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