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
9e428e62
Commit
9e428e62
authored
Aug 10, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
d40dd5a5
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 @
9e428e62
...
...
@@ -14,5 +14,10 @@ namespace Edu.Model.ViewModel.Exam
/// 试卷编号【查询使用】
/// </summary>
public
string
QPaperIds
{
get
;
set
;
}
/// <summary>
/// 显示标题
/// </summary>
public
string
ShowTitle
{
get
;
set
;
}
}
}
Edu.Module.Exam/PaperModule.cs
View file @
9e428e62
...
...
@@ -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
;
}
}
}
}
}
...
...
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