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
ff2b9ea0
Commit
ff2b9ea0
authored
Jan 20, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
28f73626
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
37 additions
and
6 deletions
+37
-6
RB_Question_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
+7
-1
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+30
-5
No files found.
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
View file @
ff2b9ea0
...
...
@@ -73,6 +73,12 @@ namespace Edu.Model.ViewModel.Question
/// <summary>
/// 大类名称
/// </summary>
public
string
CategoryName
{
get
;
set
;
}
public
string
CategoryName
{
get
{
return
Common
.
Plugin
.
EnumHelper
.
ToName
(
this
.
Category
);
}
}
}
}
\ No newline at end of file
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
ff2b9ea0
...
...
@@ -99,7 +99,7 @@ namespace Edu.WebApi.Controllers.Course
item
.
CreateByName
,
item
.
CreateTimeStr
,
item
.
DifficultyType
,
CategoryName
=
item
.
Category
.
ToName
()
,
item
.
CategoryName
,
DifficultyTypeName
=
item
.
DifficultyType
.
ToName
(),
});
;
}
...
...
@@ -197,6 +197,7 @@ namespace Edu.WebApi.Controllers.Course
{
return
ApiResult
.
Failed
(
message
:
shortMessage
);
}
extModel
.
QuestionContent
=
""
;
}
//名词解释
else
if
(
extModel
.
QuestionTypeKey
==
"noun-explanation"
)
...
...
@@ -205,6 +206,7 @@ namespace Edu.WebApi.Controllers.Course
{
return
ApiResult
.
Failed
(
message
:
"请填写名词解释答案!"
);
}
extModel
.
QuestionContent
=
""
;
}
//论述题
else
if
(
extModel
.
QuestionTypeKey
==
"essay-question"
)
...
...
@@ -213,6 +215,7 @@ namespace Edu.WebApi.Controllers.Course
{
return
ApiResult
.
Failed
(
message
:
"请填写论述题答案!"
);
}
extModel
.
QuestionContent
=
""
;
}
//计算题
else
if
(
extModel
.
QuestionTypeKey
==
"calculation"
)
...
...
@@ -221,6 +224,7 @@ namespace Edu.WebApi.Controllers.Course
{
return
ApiResult
.
Failed
(
message
:
"请填写计算题答案!"
);
}
extModel
.
QuestionContent
=
""
;
}
//分录题、资料题
else
if
(
extModel
.
QuestionTypeKey
==
"entry-problem"
||
extModel
.
QuestionTypeKey
==
"data-question"
)
...
...
@@ -260,13 +264,34 @@ namespace Edu.WebApi.Controllers.Course
var
matchList
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
List
<
matchingItem
>>>(
extModel
.
QuestionContent
);
if
(
matchList
!=
null
&&
matchList
.
Count
>
0
)
{
if
(
matchList
[
0
]
.
Where
(
qitem
=>
string
.
IsNullOrEmpty
(
qitem
.
Content
)).
Count
()
>
0
)
if
(
matchList
[
0
]
!=
null
&&
matchList
[
0
].
Count
>
0
)
{
return
ApiResult
.
Failed
(
message
:
"第一组选项内容不能为空!"
);
if
(
matchList
[
0
].
Where
(
qitem
=>
string
.
IsNullOrEmpty
(
qitem
.
Content
)).
Count
()
>
0
)
{
return
ApiResult
.
Failed
(
message
:
"第一组选项内容不能为空!"
);
}
}
else
{
return
ApiResult
.
Failed
(
message
:
"请添加第一组选项!"
);
}
if
(
matchList
.
Count
>
1
&&
matchList
[
1
]
!=
null
&&
matchList
[
1
].
Count
>
0
)
{
if
(
matchList
[
1
].
Where
(
qitem
=>
string
.
IsNullOrEmpty
(
qitem
.
Content
)).
Count
()
>
0
)
{
return
ApiResult
.
Failed
(
message
:
"第二组选项内容不能为空!"
);
}
}
else
{
return
ApiResult
.
Failed
(
message
:
"请添加第二组选项!"
);
}
if
(
matchList
[
1
].
Where
(
qitem
=>
string
.
IsNullOrEmpty
(
qitem
.
Content
)).
Count
()
>
0
)
if
(
matchList
.
Count
>
2
)
{
return
ApiResult
.
Failed
(
message
:
"第二组选项内容不能为空!"
);
if
(
matchList
[
2
].
Where
(
qitem
=>
string
.
IsNullOrEmpty
(
qitem
.
Content
)).
Count
()
>
0
)
{
return
ApiResult
.
Failed
(
message
:
"请设置答案!"
);
}
}
}
else
...
...
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