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
dfef7c4b
Commit
dfef7c4b
authored
Jan 13, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
7b5238c9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
7 deletions
+22
-7
Program.cs
Edu.Test/Program.cs
+3
-3
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+19
-4
No files found.
Edu.Test/Program.cs
View file @
dfef7c4b
...
...
@@ -6,9 +6,9 @@ namespace Edu.Test
{
static
void
Main
(
string
[]
args
)
{
string
filePath
=
@"C:/Users/qiaoyajun/Desktop/Word模板.docx"
;
var
data
=
Common
.
Data
.
QuestionHelper
.
GetWordQuestionData
(
filePath
);
Console
.
WriteLine
(
Common
.
Plugin
.
JsonHelper
.
Serialize
(
data
));
//
string filePath = @"C:/Users/qiaoyajun/Desktop/Word模板.docx";
//
var data = Common.Data.QuestionHelper.GetWordQuestionData(filePath);
//
Console.WriteLine(Common.Plugin.JsonHelper.Serialize(data));
}
}
}
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
dfef7c4b
...
...
@@ -294,7 +294,7 @@ namespace Edu.WebApi.Controllers.Course
model
.
CreateBy
=
userInfo
.
Id
;
model
.
UpdateBy
=
userInfo
.
Id
;
model
.
UpdateTime
=
DateTime
.
Now
;
bool
flag
=
questionModule
.
SetQuestionModule
(
model
);
//
bool flag = questionModule.SetQuestionModule(model);
resultList
.
Add
(
model
);
}
}
...
...
@@ -327,6 +327,7 @@ namespace Edu.WebApi.Controllers.Course
AnswerParse
=
item
.
AnswerAnalysis
,
QuestionTypeId
=
questionTypeModel
?.
QId
??
0
,
QuestionTypeKey
=
questionTypeModel
?.
Key
??
""
,
QuestionTypeName
=
questionTypeModel
?.
Name
??
""
,
};
Int32
.
TryParse
(
item
.
ChooseOptionCount
,
out
int
ChooseOptionCount
);
switch
(
item
.
QuestionTypeName
)
...
...
@@ -835,9 +836,23 @@ namespace Edu.WebApi.Controllers.Course
public
ApiResult
ImportWordQuestion
(
string
filePath
,
int
CourseId
,
int
Uid
)
{
var
userInfo
=
base
.
GetUserInfo
(
Uid
);
var
data
=
Common
.
Data
.
QuestionHelper
.
GetWordQuestionData
(
filePath
);
return
ApiResult
.
Success
();
var
resultList
=
new
List
<
RB_Question_ViewModel
>();
var
list
=
Common
.
Data
.
QuestionHelper
.
GetWordQuestionData
(
filePath
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
var
questionTypeList
=
questionModule
.
GetQuestionTypeListModule
(
new
RB_Question_Type_ViewModel
());
foreach
(
var
item
in
list
)
{
var
model
=
GetQuestionModel
(
item
,
questionTypeList
);
model
.
CourseId
=
CourseId
;
model
.
CreateTime
=
DateTime
.
Now
;
model
.
CreateBy
=
userInfo
.
Id
;
model
.
UpdateBy
=
userInfo
.
Id
;
model
.
UpdateTime
=
DateTime
.
Now
;
resultList
.
Add
(
model
);
}
}
return
ApiResult
.
Success
(
data
:
resultList
);
}
}
}
\ No newline at end of file
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