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
4a220d26
Commit
4a220d26
authored
Sep 07, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
52783b8f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
7 deletions
+28
-7
RB_Question_Type_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_Type_ViewModel.cs
+21
-0
AnalysisQuestionTypeModule.cs
Edu.Module.Question/AnalysisQuestionTypeModule.cs
+7
-7
No files found.
Edu.Model/ViewModel/Question/RB_Question_Type_ViewModel.cs
View file @
4a220d26
...
...
@@ -52,6 +52,22 @@ namespace Edu.Model.ViewModel.Question
public
string
ShowName
{
get
;
set
;
}
}
/// <summary>
/// 完型填空
/// </summary>
public
class
colzeItem
{
/// <summary>
/// 题目分数
/// </summary>
public
decimal
SubScore
{
get
;
set
;
}
/// <summary>
/// 选项列表
/// </summary>
public
List
<
optionItem
>
OptionList
{
get
;
set
;
}
}
/// <summary>
/// 填空题、简答题
/// </summary>
...
...
@@ -104,6 +120,11 @@ namespace Edu.Model.ViewModel.Question
/// </summary>
public
string
SubTitle
{
get
;
set
;
}
/// <summary>
/// 题目分数
/// </summary>
public
decimal
SubScore
{
get
;
set
;
}
/// <summary>
/// 题目答案内容
/// </summary>
...
...
Edu.Module.Question/AnalysisQuestionTypeModule.cs
View file @
4a220d26
...
...
@@ -336,14 +336,14 @@ namespace Edu.Module.Question
/// <returns></returns>
private
object
GetClozeList
(
string
data
,
bool
isNoAnswer
)
{
var
clozeList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
List
<
optionItem
>
>>(
data
);
var
clozeList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
colzeItem
>>(
data
);
if
(
isNoAnswer
)
{
if
(
clozeList
!=
null
&&
clozeList
.
Count
>
0
)
{
clozeList
.
ForEach
(
item
=>
{
item
.
ForEach
(
subItem
=>
item
.
OptionList
.
ForEach
(
subItem
=>
{
subItem
.
IsAnswer
=
false
;
});
...
...
@@ -588,21 +588,21 @@ namespace Edu.Module.Question
//完型填空
else
if
(
QuestionTypeKey
==
"cloze"
)
{
var
clozeList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
List
<
optionItem
>
>>(
QuestionContent
);
var
clozeList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
colzeItem
>>(
QuestionContent
);
if
(
clozeList
!=
null
&&
clozeList
.
Count
>
0
)
{
int
index
=
1
;
string
clozeAnswer
=
""
;
foreach
(
var
subList
in
clozeList
)
foreach
(
var
rootItem
in
clozeList
)
{
var
tempModel
=
sub
List
.
Where
(
qitem
=>
qitem
.
IsAnswer
==
true
)?.
FirstOrDefault
();
var
tempModel
=
rootItem
.
Option
List
.
Where
(
qitem
=>
qitem
.
IsAnswer
==
true
)?.
FirstOrDefault
();
clozeAnswer
+=
","
+
tempModel
?.
Name
??
""
;
if
(
sub
List
.
Where
(
qitem
=>
string
.
IsNullOrEmpty
(
qitem
.
Content
)).
Count
()
>
0
)
if
(
rootItem
.
Option
List
.
Where
(
qitem
=>
string
.
IsNullOrEmpty
(
qitem
.
Content
)).
Count
()
>
0
)
{
message
=
string
.
Format
(
"第{0}小题选项内容不能为空!"
,
index
);
return
message
;
}
if
(!(
sub
List
.
Where
(
qitem
=>
qitem
.
IsAnswer
==
true
).
Count
()
>
0
))
if
(!(
rootItem
.
Option
List
.
Where
(
qitem
=>
qitem
.
IsAnswer
==
true
).
Count
()
>
0
))
{
message
=
string
.
Format
(
"请设置第{0}小题选项的正确答案!"
,
index
);
return
message
;
...
...
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