Commit a5bcec0b authored by 黄奎's avatar 黄奎

页面修改

parent f5a7356e
......@@ -33,10 +33,9 @@ namespace Edu.Common.Plugin
{
Directory.CreateDirectory(tempPath);
}
string htmlName = basepath + DateTime.Now.Ticks + ".html";
string htmlName = tempPath + DateTime.Now.Ticks + ".html";
document.SaveToFile(htmlName, FileFormat.Html);
htmlList = new List<string>();
try
{
Stream myStream = new FileStream(htmlName, FileMode.Open);
......@@ -62,6 +61,7 @@ namespace Edu.Common.Plugin
}
List<string> imageList = new List<string>();
foreach (Section section in document.Sections)
{
......
......@@ -747,7 +747,7 @@ namespace Edu.WebApi.Controllers.Course
/// <param name="CourseId"></param>
/// <param name="Uid"></param>
/// <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 resultList = new List<RB_Question_ViewModel>();
......@@ -766,7 +766,11 @@ namespace Edu.WebApi.Controllers.Course
resultList.Add(model);
}
}
System.IO.File.Delete(filePath);
if (isDelete)
{
System.IO.File.Delete(filePath);
}
return ApiResult.Success(data: resultList);
}
......
......@@ -79,7 +79,7 @@ namespace Edu.WebApi.Controllers.Upload
//导入Word文件
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 });
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment