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
b9699139
Commit
b9699139
authored
3 years ago
by
罗超
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
8e776e5b
9e428e62
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
0 deletions
+33
-0
RB_Examination_Details_ViewModel.cs
Edu.Model/ViewModel/Exam/RB_Examination_Details_ViewModel.cs
+5
-0
PaperModule.cs
Edu.Module.Exam/PaperModule.cs
+28
-0
No files found.
Edu.Model/ViewModel/Exam/RB_Examination_Details_ViewModel.cs
View file @
b9699139
...
...
@@ -14,5 +14,10 @@ namespace Edu.Model.ViewModel.Exam
/// 试卷编号【查询使用】
/// </summary>
public
string
QPaperIds
{
get
;
set
;
}
/// <summary>
/// 显示标题
/// </summary>
public
string
ShowTitle
{
get
;
set
;
}
}
}
This diff is collapsed.
Click to expand it.
Edu.Module.Exam/PaperModule.cs
View file @
b9699139
...
...
@@ -5,6 +5,7 @@ using System;
using
System.Collections.Generic
;
using
VT.FW.DB
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
namespace
Edu.Module.Exam
{
...
...
@@ -163,6 +164,8 @@ namespace Edu.Module.Exam
/// <returns></returns>
public
RB_Examination_Paper_ViewModel
GetExaminationPaperModule
(
object
PaperId
)
{
// 定义正则表达式用来匹配 img 标签
string
str
=
@"<img\b[^<>]*?\bsrc[\s\t\r\n]*=[\s\t\r\n]*[""']?[\s\t\r\n]*(?<imgUrl>[^\s\t\r\n""'<>]*)[^<>]*?/?[\s\t\r\n]*>"
;
var
extModel
=
examination_PaperRepository
.
GetEntity
<
RB_Examination_Paper_ViewModel
>(
PaperId
);
if
(
extModel
!=
null
&&
extModel
.
PaperId
>
0
)
{
...
...
@@ -179,6 +182,31 @@ namespace Edu.Module.Exam
foreach
(
var
gItem
in
extModel
.
GroupList
)
{
gItem
.
DetailsList
=
detailsList
?.
Where
(
qitem
=>
qitem
.
QuestionTypeId
==
gItem
.
QuestionTypeId
)?.
ToList
()
??
new
List
<
RB_Examination_Details_ViewModel
>();
if
(
gItem
.
DetailsList
!=
null
&&
gItem
.
DetailsList
.
Count
>
0
)
{
foreach
(
var
sItem
in
gItem
.
DetailsList
)
{
string
newTitle
=
sItem
.
Title
;
try
{
newTitle
=
Regex
.
Replace
(
newTitle
,
str
,
"[图片]"
);
}
catch
{
newTitle
=
sItem
.
Title
;
}
try
{
newTitle
=
Regex
.
Replace
(
newTitle
,
@"<iframe\s*[^>]*>"
,
"[音频"
,
RegexOptions
.
IgnoreCase
);
newTitle
=
Regex
.
Replace
(
newTitle
,
@"</iframe>"
,
"]"
,
RegexOptions
.
IgnoreCase
);
}
catch
{
newTitle
=
sItem
.
Title
;
}
sItem
.
ShowTitle
=
newTitle
;
}
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
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