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
a5bcec0b
Commit
a5bcec0b
authored
Jan 25, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
f5a7356e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
5 deletions
+9
-5
WordHelper.cs
Edu.Common/Plugin/WordHelper.cs
+2
-2
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+6
-2
UploadController.cs
Edu.WebApi/Controllers/Upload/UploadController.cs
+1
-1
No files found.
Edu.Common/Plugin/WordHelper.cs
View file @
a5bcec0b
...
@@ -33,10 +33,9 @@ namespace Edu.Common.Plugin
...
@@ -33,10 +33,9 @@ namespace Edu.Common.Plugin
{
{
Directory
.
CreateDirectory
(
tempPath
);
Directory
.
CreateDirectory
(
tempPath
);
}
}
string
htmlName
=
basep
ath
+
DateTime
.
Now
.
Ticks
+
".html"
;
string
htmlName
=
tempP
ath
+
DateTime
.
Now
.
Ticks
+
".html"
;
document
.
SaveToFile
(
htmlName
,
FileFormat
.
Html
);
document
.
SaveToFile
(
htmlName
,
FileFormat
.
Html
);
htmlList
=
new
List
<
string
>();
htmlList
=
new
List
<
string
>();
try
try
{
{
Stream
myStream
=
new
FileStream
(
htmlName
,
FileMode
.
Open
);
Stream
myStream
=
new
FileStream
(
htmlName
,
FileMode
.
Open
);
...
@@ -62,6 +61,7 @@ namespace Edu.Common.Plugin
...
@@ -62,6 +61,7 @@ namespace Edu.Common.Plugin
}
}
List
<
string
>
imageList
=
new
List
<
string
>();
List
<
string
>
imageList
=
new
List
<
string
>();
foreach
(
Section
section
in
document
.
Sections
)
foreach
(
Section
section
in
document
.
Sections
)
{
{
...
...
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
a5bcec0b
...
@@ -747,7 +747,7 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -747,7 +747,7 @@ namespace Edu.WebApi.Controllers.Course
/// <param name="CourseId"></param>
/// <param name="CourseId"></param>
/// <param name="Uid"></param>
/// <param name="Uid"></param>
/// <returns></returns>
/// <returns></returns>
public
ApiResult
ImportWordQuestion
(
string
filePath
,
int
CourseId
,
int
Uid
)
public
ApiResult
ImportWordQuestion
(
string
filePath
,
int
CourseId
,
int
Uid
,
bool
isDelete
=
false
)
{
{
var
userInfo
=
base
.
GetUserInfo
(
Uid
);
var
userInfo
=
base
.
GetUserInfo
(
Uid
);
var
resultList
=
new
List
<
RB_Question_ViewModel
>();
var
resultList
=
new
List
<
RB_Question_ViewModel
>();
...
@@ -766,7 +766,11 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -766,7 +766,11 @@ namespace Edu.WebApi.Controllers.Course
resultList
.
Add
(
model
);
resultList
.
Add
(
model
);
}
}
}
}
System
.
IO
.
File
.
Delete
(
filePath
);
if
(
isDelete
)
{
System
.
IO
.
File
.
Delete
(
filePath
);
}
return
ApiResult
.
Success
(
data
:
resultList
);
return
ApiResult
.
Success
(
data
:
resultList
);
}
}
...
...
Edu.WebApi/Controllers/Upload/UploadController.cs
View file @
a5bcec0b
...
@@ -79,7 +79,7 @@ namespace Edu.WebApi.Controllers.Upload
...
@@ -79,7 +79,7 @@ namespace Edu.WebApi.Controllers.Upload
//导入Word文件
//导入Word文件
if
(
Analysis
==
1
&&
Word
==
1
)
if
(
Analysis
==
1
&&
Word
==
1
)
{
{
return
new
QuestionController
().
ImportWordQuestion
(
path_server
,
CourseId
,
Uid
);
return
new
QuestionController
().
ImportWordQuestion
(
path_server
,
CourseId
,
Uid
,
isDelete
:
true
);
}
}
return
ApiResult
.
Success
(
""
,
new
{
Name
=
filename
,
Path
=
path_server
});
return
ApiResult
.
Success
(
""
,
new
{
Name
=
filename
,
Path
=
path_server
});
}
}
...
...
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