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
26aebfb7
Commit
26aebfb7
authored
Mar 09, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
题库答案处理
parent
f6814fb3
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
139 additions
and
72 deletions
+139
-72
CourseExamModule.cs
Edu.Module.Exam/CourseExamModule.cs
+43
-7
AnalysisQuestionTypeModule.cs
Edu.Module.Question/AnalysisQuestionTypeModule.cs
+63
-65
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+33
-0
No files found.
Edu.Module.Exam/CourseExamModule.cs
View file @
26aebfb7
...
@@ -770,7 +770,26 @@ namespace Edu.Module.Exam
...
@@ -770,7 +770,26 @@ namespace Edu.Module.Exam
{
{
var
QuestionContentObj
=
analysisQuestion
.
ParsingQuestion
(
item
.
QuestionTypeKey
,
item
.
QuestionContent
);
var
QuestionContentObj
=
analysisQuestion
.
ParsingQuestion
(
item
.
QuestionTypeKey
,
item
.
QuestionContent
);
List
<
object
>
quesAnswerList
=
new
List
<
object
>();
List
<
object
>
quesAnswerList
=
new
List
<
object
>();
if
(!
string
.
IsNullOrEmpty
(
item
.
Answer
.
ToString
()))
if
(
item
.
QuestionTypeKey
==
"listening"
||
item
.
QuestionTypeKey
==
"reading-comprehensio"
)
{
try
{
var
listenList
=
JsonHelper
.
DeserializeObject
<
List
<
SubAnswerItem
>>(
item
.
Answer
);
if
(
listenList
!=
null
&&
listenList
.
Count
>
0
)
{
foreach
(
var
subItem
in
listenList
)
{
quesAnswerList
.
Add
(
subItem
.
SubAnswer
);
}
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetAppQuestionCategoryListModule_listening:"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
item
));
}
}
if
(
item
.
QuestionTypeKey
!=
"listening"
&&
item
.
QuestionTypeKey
!=
"reading-comprehensio"
&&
!
string
.
IsNullOrEmpty
(
item
.
Answer
.
ToString
()))
{
{
try
try
{
{
...
@@ -891,15 +910,32 @@ namespace Edu.Module.Exam
...
@@ -891,15 +910,32 @@ namespace Edu.Module.Exam
{
{
var
QuestionContentObj
=
analysisQuestion
.
ParsingQuestion
(
item
.
QuestionTypeKey
,
item
.
QuestionContent
,
isNoAnswer
:
true
);
var
QuestionContentObj
=
analysisQuestion
.
ParsingQuestion
(
item
.
QuestionTypeKey
,
item
.
QuestionContent
,
isNoAnswer
:
true
);
List
<
object
>
quesAnswerList
=
new
List
<
object
>();
List
<
object
>
quesAnswerList
=
new
List
<
object
>();
if
(
item
.
QuestionTypeKey
==
"listening"
||
item
.
QuestionTypeKey
==
"reading-comprehensio"
)
if
(!
string
.
IsNullOrEmpty
(
item
.
Answer
.
ToString
()))
{
try
{
var
listenList
=
JsonHelper
.
DeserializeObject
<
List
<
SubAnswerItem
>>(
item
.
Answer
);
if
(
listenList
!=
null
&&
listenList
.
Count
>
0
)
{
foreach
(
var
subItem
in
listenList
)
{
quesAnswerList
.
Add
(
subItem
.
SubAnswer
);
}
}
}
catch
(
Exception
ex
)
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetAppQuestionCategoryListModule_listening:"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
item
));
}
}
if
(
item
.
QuestionTypeKey
!=
"listening"
&&
item
.
QuestionTypeKey
!=
"reading-comprehensio"
&&
!
string
.
IsNullOrEmpty
(
item
.
Answer
.
ToString
()))
{
{
try
try
{
{
var
qAnsList
=
Common
.
ConvertHelper
.
StringToFileList
(
item
.
Answer
.
ToString
()
);
var
tempList
=
Common
.
ConvertHelper
.
StringToFileList
(
item
.
Answer
);
if
(
qAnsList
!=
null
&&
qAnsList
.
Count
()
>
0
)
if
(
tempList
!=
null
&&
tempList
.
Count
>
0
)
{
{
foreach
(
var
tItem
in
qAns
List
)
foreach
(
var
tItem
in
temp
List
)
{
{
quesAnswerList
.
Add
(
tItem
);
quesAnswerList
.
Add
(
tItem
);
}
}
...
@@ -907,7 +943,7 @@ namespace Edu.Module.Exam
...
@@ -907,7 +943,7 @@ namespace Edu.Module.Exam
}
}
catch
(
Exception
ex
)
catch
(
Exception
ex
)
{
{
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetApp
BankDetailsPage
Module_Answer:"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
item
));
Common
.
Plugin
.
LogHelper
.
Write
(
ex
,
"GetApp
QuestionCategoryList
Module_Answer:"
+
Common
.
Plugin
.
JsonHelper
.
Serialize
(
item
));
}
}
}
}
var
obj
=
new
var
obj
=
new
...
...
Edu.Module.Question/AnalysisQuestionTypeModule.cs
View file @
26aebfb7
This diff is collapsed.
Click to expand it.
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
26aebfb7
...
@@ -14,6 +14,7 @@ using System;
...
@@ -14,6 +14,7 @@ using System;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Linq
;
using
System.Text.RegularExpressions
;
using
System.Text.RegularExpressions
;
using
System.Threading.Tasks
;
namespace
Edu.WebApi.Controllers.Course
namespace
Edu.WebApi.Controllers.Course
{
{
...
@@ -402,6 +403,38 @@ namespace Edu.WebApi.Controllers.Course
...
@@ -402,6 +403,38 @@ namespace Edu.WebApi.Controllers.Course
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
}
/// <summary>
/// 重新修改问题答案
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
RunQuestion
()
{
Task
.
Run
(()
=>
{
var
list
=
questionModule
.
GetQuestionListModule
(
new
RB_Question_ViewModel
()
{
Q_QuestionTypeIds
=
"14,16"
,
});
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
foreach
(
var
item
in
list
)
{
try
{
var
listenList
=
JsonHelper
.
DeserializeObject
<
List
<
SubAnswerItem
>>(
item
.
Answer
);
}
catch
{
string
str
=
analysisQuestion
.
CheckQuestion
(
item
.
QuestionTypeKey
,
item
.
QuestionContent
,
item
.
Answer
,
out
string
newAnswer
,
IsRequire
:
false
);
if
(!
string
.
IsNullOrEmpty
(
newAnswer
))
{
item
.
Answer
=
newAnswer
;
bool
flag
=
questionModule
.
SetQuestionModule
(
item
);
}
}
}
}
});
return
ApiResult
.
Success
();
}
/// <summary>
/// <summary>
/// 批量修改问题考级程度
/// 批量修改问题考级程度
/// </summary>
/// </summary>
...
...
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