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
6607a38b
Commit
6607a38b
authored
Jan 05, 2021
by
liudong1993
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://gitlab.oytour.com/Kui2/education
parents
a6b7e41d
d456a39e
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
574 additions
and
178 deletions
+574
-178
StringHelper.cs
Edu.Common/Plugin/StringHelper.cs
+58
-1
RB_Question.cs
Edu.Model/Entity/Question/RB_Question.cs
+86
-80
RB_Question_Point.cs
Edu.Model/Entity/Question/RB_Question_Point.cs
+0
-5
RB_OKR_Comment_ViewModel.cs
Edu.Model/ViewModel/OKR/RB_OKR_Comment_ViewModel.cs
+18
-0
RB_Question_Answer_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_Answer_ViewModel.cs
+1
-20
RB_Question_Point_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_Point_ViewModel.cs
+5
-0
RB_Question_Type_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_Type_ViewModel.cs
+65
-1
RB_Question_ViewModel.cs
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
+23
-2
OKRPeriodModule.cs
Edu.Module.OKR/OKRPeriodModule.cs
+57
-0
QuestionModule.cs
Edu.Module.Question/QuestionModule.cs
+4
-2
RB_OKR_CommentRepository.cs
Edu.Repository/OKR/RB_OKR_CommentRepository.cs
+8
-2
RB_QuestionRepository.cs
Edu.Repository/Question/RB_QuestionRepository.cs
+12
-6
RB_Question_PointRepository.cs
Edu.Repository/Question/RB_Question_PointRepository.cs
+4
-4
QuestionController.cs
Edu.WebApi/Controllers/Course/QuestionController.cs
+43
-3
OKRPeriodController.cs
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
+190
-52
No files found.
Edu.Common/Plugin/StringHelper.cs
View file @
6607a38b
...
...
@@ -50,6 +50,62 @@ namespace Edu.Common.Plugin
#
endregion
#
region
"日期相关"
public
static
string
DateFormatToString
(
DateTime
dt
)
{
//TimeSpan表示时间间隔
TimeSpan
span
=
(
DateTime
.
Now
-
dt
).
Duration
();
//表示取timespan绝对值
//if (span.TotalDays > 60)
//{
// return dt.ToString("yyyy-MM-dd");
//}
//else if (span.TotalDays > 30)
//{
// return "1个月前";
//}
//else if (span.TotalDays > 14)
//{
// return "2周前";
//}
if
(
dt
.
Year
==
DateTime
.
Now
.
Year
)
{
if
(
span
.
TotalDays
>
7
)
{
return
dt
.
ToString
(
"yyyy-MM-dd"
);
}
else
if
(
span
.
TotalDays
>
1
)
{
return
string
.
Format
(
"{0}天前"
,
(
int
)
Math
.
Floor
(
span
.
TotalDays
));
}
else
if
(
span
.
TotalHours
>
1
)
{
return
string
.
Format
(
"{0}小时前"
,
(
int
)
Math
.
Floor
(
span
.
TotalHours
));
}
else
if
(
span
.
TotalMinutes
>
1
)
{
return
string
.
Format
(
"{0}分钟前"
,
(
int
)
Math
.
Floor
(
span
.
TotalMinutes
));
}
else
if
(
span
.
TotalSeconds
>=
1
)
{
return
string
.
Format
(
"{0}秒前"
,
(
int
)
Math
.
Floor
(
span
.
TotalSeconds
));
}
else
{
return
"1秒前"
;
}
}
else
{
return
dt
.
ToString
(
"yyyy-MM-dd"
);
}
}
/// <summary>
/// 获取星期的字符串
/// </summary>
...
...
@@ -472,7 +528,8 @@ namespace Edu.Common.Plugin
{
TotalDay
=
Saturday
+
Sunday
+
2
;
}
else
{
else
{
TotalDay
=
Saturday
+
Sunday
+
1
;
}
}
...
...
Edu.Model/Entity/Question/RB_Question.cs
View file @
6607a38b
...
...
@@ -12,84 +12,90 @@ namespace Edu.Model.Entity.Question
[
DB
(
ConnectionName
=
"DefaultConnection"
)]
public
class
RB_Question
{
/// <summary>
/// 主键(问题编号)
/// </summary>
public
int
QuestionId
{
get
;
set
;
}
/// <summary>
/// 课程编号
/// </summary>
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 问题名称
/// </summary>
public
string
Title
{
get
;
set
;
}
/// <summary>
/// 难易程度(1-易,2-中,3-难)
/// </summary>
public
DifficultyTypeEnum
DifficultyType
{
get
;
set
;
}
/// <summary>
/// 答案解析
/// </summary>
public
string
AnswerParse
{
get
;
set
;
}
/// <summary>
/// 问题类型编号
/// </summary>
public
int
QuestionTypeId
{
get
;
set
;
}
/// <summary>
/// 知识点
/// </summary>
public
string
Knowledge
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 修改人
/// </summary>
public
int
UpdateBy
{
get
;
set
;
}
/// <summary>
/// 更新时间
/// </summary>
public
DateTime
UpdateTime
{
get
;
set
;
}
/// <summary>
/// 是否同步修改引用此题目的作业和考试(1-是)
/// </summary>
public
int
IsUpdateJobExam
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// 排序
/// </summary>
public
int
SortNum
{
get
;
set
;
}
/// <summary>
/// 问题答案【JSON字符串】
/// </summary>
public
string
Answer
{
get
;
set
;
}
/// <summary>
/// 问题分数
/// </summary>
public
decimal
Score
{
get
;
set
;
}
}
/// <summary>
/// 主键(问题编号)
/// </summary>
public
int
QuestionId
{
get
;
set
;
}
/// <summary>
/// 课程编号
/// </summary>
public
int
CourseId
{
get
;
set
;
}
/// <summary>
/// 问题名称
/// </summary>
public
string
Title
{
get
;
set
;
}
/// <summary>
/// 难易程度(1-易,2-中,3-难)
/// </summary>
public
DifficultyTypeEnum
DifficultyType
{
get
;
set
;
}
/// <summary>
/// 答案解析
/// </summary>
public
string
AnswerParse
{
get
;
set
;
}
/// <summary>
/// 问题类型编号
/// </summary>
public
int
QuestionTypeId
{
get
;
set
;
}
/// <summary>
/// 问题类型Key
/// </summary>
public
string
QuestionTypeKey
{
get
;
set
;
}
/// <summary>
/// 知识点
/// </summary>
public
string
Knowledge
{
get
;
set
;
}
/// <summary>
/// 创建人
/// </summary>
public
int
CreateBy
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
DateTime
CreateTime
{
get
;
set
;
}
/// <summary>
/// 修改人
/// </summary>
public
int
UpdateBy
{
get
;
set
;
}
/// <summary>
/// 更新时间
/// </summary>
public
DateTime
UpdateTime
{
get
;
set
;
}
/// <summary>
/// 是否同步修改引用此题目的作业和考试(1-是)
/// </summary>
public
int
IsUpdateJobExam
{
get
;
set
;
}
/// <summary>
/// 删除状态
/// </summary>
public
DateStateEnum
Status
{
get
;
set
;
}
/// <summary>
/// 排序
/// </summary>
public
int
SortNum
{
get
;
set
;
}
/// <summary>
/// 问题答案【JSON字符串】
/// </summary>
public
string
Answer
{
get
;
set
;
}
/// <summary>
/// 问题分数
/// </summary>
public
decimal
Score
{
get
;
set
;
}
}
}
Edu.Model/Entity/Question/RB_Question_Point.cs
View file @
6607a38b
...
...
@@ -16,11 +16,6 @@ namespace Edu.Model.Entity.Question
/// </summary>
public
int
PointId
{
get
;
set
;
}
/// <summary>
/// 问题编号
/// </summary>
public
int
QuestionId
{
get
;
set
;
}
/// <summary>
/// 课程编号
/// </summary>
...
...
Edu.Model/ViewModel/OKR/RB_OKR_Comment_ViewModel.cs
View file @
6607a38b
...
...
@@ -9,6 +9,24 @@ namespace Edu.Model.ViewModel.OKR
[
Serializable
]
public
class
RB_OKR_Comment_ViewModel
:
Model
.
Entity
.
OKR
.
RB_OKR_Comment
{
/// <summary>
/// 创建人
/// </summary>
public
string
CreateByName
{
get
;
set
;
}
/// <summary>
/// 创建人头像
/// </summary>
public
string
CreateByIco
{
get
;
set
;
}
/// <summary>
/// 操作人
/// </summary>
public
string
UpdateByName
{
get
;
set
;
}
/// <summary>
/// 创建时间
/// </summary>
public
string
CreateTimeStr
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Question/RB_Question_Answer_ViewModel.cs
View file @
6607a38b
namespace
Edu.Model.ViewModel.Question
{
/// <summary>
/// 问题答案视图实体类
/// </summary>
public
class
Answer_ViewModel
{
/// <summary>
/// 答案选项(A、B、C、D、E)
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 答案内容
/// </summary>
public
string
Content
{
get
;
set
;
}
/// <summary>
/// 是否是正确答案
/// </summary>
public
bool
Isanswer
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Question/RB_Question_Point_ViewModel.cs
View file @
6607a38b
...
...
@@ -26,5 +26,10 @@ namespace Edu.Model.ViewModel.Question
/// 更新时间字符串
/// </summary>
public
string
UpdateTimeStr
{
get
{
return
this
.
UpdateTime
.
FormatTime
();
}
}
/// <summary>
/// 问题知识点编号【查询使用】
/// </summary>
public
string
QPointIds
{
get
;
set
;
}
}
}
Edu.Model/ViewModel/Question/RB_Question_Type_ViewModel.cs
View file @
6607a38b
using
System
;
using
Edu.Common.Enum.Question
;
using
System
;
using
System.Collections.Generic
;
namespace
Edu.Model.ViewModel.Question
{
...
...
@@ -10,4 +12,66 @@ namespace Edu.Model.ViewModel.Question
{
}
public
class
QuestionTypeItem
{
/// <summary>
/// 题目类型Key
/// </summary>
public
string
Key
{
get
;
set
;
}
/// <summary>
/// 题目数据
/// </summary>
public
object
Data
{
get
;
set
;
}
}
/// <summary>
/// 选择题选项列表
/// </summary>
public
class
optionItem
{
/// <summary>
/// 选项编号【例如:A,B,C,D】
/// </summary>
public
string
Name
{
get
;
set
;
}
/// <summary>
/// 选项内容
/// </summary>
public
string
Content
{
get
;
set
;
}
/// <summary>
/// 是否是选项答案
/// </summary>
public
bool
IsAnswer
{
get
;
set
;
}
}
/// <summary>
/// 单选题
/// </summary>
public
class
singleQuestion
{
/// <summary>
/// 题目名称
/// </summary>
public
string
Title
{
get
;
set
;
}
/// <summary>
/// 答案解析
/// </summary>
public
string
AnswerAnalysis
{
get
;
set
;
}
/// <summary>
/// 选项列表
/// </summary>
public
List
<
optionItem
>
AnswerOptionList
{
get
;
set
;
}
/// <summary>
/// 难易程度
/// </summary>
public
DifficultyTypeEnum
EasyType
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Model/ViewModel/Question/RB_Question_ViewModel.cs
View file @
6607a38b
...
...
@@ -29,8 +29,29 @@ namespace Edu.Model.ViewModel.Question
public
string
UpdateTimeStr
{
get
{
return
this
.
UpdateTime
.
FormatTime
();
}
}
/// <summary>
///
答案列表
///
问题类型名称
/// </summary>
public
List
<
Answer_ViewModel
>
AnswerList
{
get
;
set
;
}
public
string
QuestionTypeName
{
get
;
set
;
}
/// <summary>
/// 知识点列表
/// </summary>
public
List
<
RB_Question_Point_ViewModel
>
QuestionPointList
{
get
;
set
;
}
/// <summary>
/// 问题类型【查询使用,多选】
/// </summary>
public
string
QQuestionTypeStr
{
get
;
set
;
}
/// <summary>
/// 知识点【查询使用,多选】
/// </summary>
public
string
QPointStr
{
get
;
set
;
}
/// <summary>
/// 难易程度【查询使用,多选】
/// </summary>
public
string
QDifficultyType
{
get
;
set
;
}
}
}
\ No newline at end of file
Edu.Module.OKR/OKRPeriodModule.cs
View file @
6607a38b
...
...
@@ -2576,5 +2576,62 @@ namespace Edu.Module.OKR
}
#
endregion
#
region
okr
任务评论
/// <summary>
/// 获取评论分页列表
/// </summary>
/// <param name="pageIndex"></param>
/// <param name="pageSize"></param>
/// <param name="rowsCount"></param>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_OKR_Comment_ViewModel
>
GetCommentPageList
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_OKR_Comment_ViewModel
demodel
)
{
return
oKR_CommentRepository
.
GetPageList
(
pageIndex
,
pageSize
,
out
rowsCount
,
demodel
);
}
/// <summary>
/// 获取评论列表
/// </summary>
/// <param name="demodel"></param>
/// <returns></returns>
public
List
<
RB_OKR_Comment_ViewModel
>
GetCommentList
(
RB_OKR_Comment_ViewModel
demodel
)
{
return
oKR_CommentRepository
.
GetList
(
demodel
);
}
/// <summary>
/// 新增/修改ork评论
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetOKRComment
(
RB_OKR_Comment_ViewModel
model
)
{
if
(
model
.
Id
==
0
)
{
return
oKR_CommentRepository
.
Insert
(
model
)
>
0
;
}
else
{
Dictionary
<
string
,
object
>
keyValues
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_OKR_Comment_ViewModel
.
State
),
model
.
State
},
{
nameof
(
RB_OKR_Comment_ViewModel
.
UpdateBy
),
model
.
UpdateBy
},
{
nameof
(
RB_OKR_Comment_ViewModel
.
UpdateTime
),
DateTime
.
Now
},
};
List
<
WhereHelper
>
wheres
=
new
List
<
WhereHelper
>()
{
new
WhereHelper
(){
FiledName
=
nameof
(
RB_OKR_Comment_ViewModel
.
Id
),
FiledValue
=
model
.
Id
,
OperatorEnum
=
OperatorEnum
.
Equal
}
};
return
oKR_CommentRepository
.
Update
(
keyValues
,
wheres
);
}
}
#
endregion
}
}
Edu.Module.Question/QuestionModule.cs
View file @
6607a38b
...
...
@@ -3,6 +3,7 @@ using Edu.Common.Enum;
using
Edu.Model.ViewModel.Question
;
using
Edu.Repository.Question
;
using
System.Collections.Generic
;
using
System.Linq
;
using
VT.FW.DB
;
namespace
Edu.Module.Question
...
...
@@ -66,7 +67,7 @@ namespace Edu.Module.Question
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetQuestionModule
(
RB_Question_ViewModel
model
)
public
virtual
bool
SetQuestionModule
(
RB_Question_ViewModel
model
)
{
bool
flag
;
if
(
model
.
QuestionId
>
0
)
...
...
@@ -77,6 +78,7 @@ namespace Edu.Module.Question
{
nameof
(
RB_Question_ViewModel
.
DifficultyType
),(
int
)
model
.
DifficultyType
},
{
nameof
(
RB_Question_ViewModel
.
AnswerParse
),
model
.
AnswerParse
},
{
nameof
(
RB_Question_ViewModel
.
QuestionTypeId
),
model
.
QuestionTypeId
},
{
nameof
(
RB_Question_ViewModel
.
QuestionTypeKey
),
model
.
QuestionTypeKey
},
{
nameof
(
RB_Question_ViewModel
.
Knowledge
),
model
.
Knowledge
},
{
nameof
(
RB_Question_ViewModel
.
IsUpdateJobExam
),
model
.
IsUpdateJobExam
},
{
nameof
(
RB_Question_ViewModel
.
UpdateBy
),
model
.
UpdateBy
},
...
...
@@ -115,7 +117,7 @@ namespace Edu.Module.Question
/// </summary>
/// <returns></returns>
[
TransactionCallHandler
]
public
virtual
bool
UpdateQuestionSortModule
(
int
curQId
,
int
targetQId
)
public
virtual
bool
UpdateQuestionSortModule
(
int
curQId
,
int
targetQId
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
...
...
Edu.Repository/OKR/RB_OKR_CommentRepository.cs
View file @
6607a38b
...
...
@@ -37,7 +37,10 @@ namespace Edu.Repository.OKR
{
where
+=
$@" and
{
nameof
(
RB_OKR_Comment_ViewModel
.
State
)}
=
{
demodel
.
State
}
"
;
}
if
(
demodel
.
CreateBy
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_OKR_Comment_ViewModel
.
CreateBy
)}
=
{
demodel
.
CreateBy
}
"
;
}
string
sql
=
$@" select * from RB_OKR_Comment where
{
where
}
order by Id desc"
;
return
GetPage
<
RB_OKR_Comment_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
sql
).
ToList
();
}
...
...
@@ -62,7 +65,10 @@ namespace Edu.Repository.OKR
{
where
+=
$@" and
{
nameof
(
RB_OKR_Comment_ViewModel
.
State
)}
=
{
demodel
.
State
}
"
;
}
if
(
demodel
.
CreateBy
>
0
)
{
where
+=
$@" and
{
nameof
(
RB_OKR_Comment_ViewModel
.
CreateBy
)}
=
{
demodel
.
CreateBy
}
"
;
}
string
sql
=
$@" select * from RB_OKR_Comment where
{
where
}
order by Id desc"
;
return
Get
<
RB_OKR_Comment_ViewModel
>(
sql
).
ToList
();
}
...
...
Edu.Repository/Question/RB_QuestionRepository.cs
View file @
6607a38b
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
VT.FW.DB.Dapper
;
namespace
Edu.Repository.Question
{
...
...
@@ -48,12 +49,12 @@ WHERE 1=1
public
List
<
RB_Question_ViewModel
>
GetQuestionPageListRepository
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Question_ViewModel
query
)
{
rowsCount
=
0
;
var
parameters
=
new
DynamicParameters
();
StringBuilder
builder
=
new
StringBuilder
();
builder
.
AppendFormat
(
@"
SELECT *
FROM RB_Question
WHERE 1=1
"
);
SELECT A.*,IFNULL(B.`Name` ,'') AS QuestionTypeName
FROM RB_Question AS A LEFT JOIN RB_Question_Type B ON A.QuestionTypeId=B.QId
WHERE 1=1 "
);
if
(
query
==
null
)
{
return
new
List
<
RB_Question_ViewModel
>();
...
...
@@ -62,9 +63,14 @@ WHERE 1=1
{
if
(
query
.
CourseId
>
0
)
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Question_ViewModel
.
CourseId
),
query
.
CourseId
);
builder
.
AppendFormat
(
" AND A.{0}={1} "
,
nameof
(
RB_Question_ViewModel
.
CourseId
),
query
.
CourseId
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
Title
))
{
builder
.
AppendFormat
(
" AND A.{0} LIKE @Title "
,
nameof
(
RB_Question_ViewModel
.
Title
));
parameters
.
Add
(
"Title"
,
"%"
+
query
.
Title
.
Trim
()
+
"%"
);
}
return
GetPage
<
RB_Question_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
return
GetPage
<
RB_Question_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()
,
parameters
).
ToList
();
}
}
}
...
...
Edu.Repository/Question/RB_Question_PointRepository.cs
View file @
6607a38b
...
...
@@ -31,9 +31,9 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Question_Point_ViewModel
.
CourseId
),
query
.
CourseId
);
}
if
(
query
.
QuestionId
>
0
)
if
(
!
string
.
IsNullOrEmpty
(
query
.
QPointIds
)
)
{
builder
.
AppendFormat
(
" AND {0}
={1} "
,
nameof
(
RB_Question_Point_ViewModel
.
CourseId
),
query
.
CourseId
);
builder
.
AppendFormat
(
" AND {0}
IN({1}) "
,
nameof
(
RB_Question_Point_ViewModel
.
CourseId
),
query
.
QPointIds
);
}
}
return
Get
<
RB_Question_Point_ViewModel
>(
builder
.
ToString
()).
ToList
();
...
...
@@ -62,9 +62,9 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Question_Point_ViewModel
.
CourseId
),
query
.
CourseId
);
}
if
(
query
.
QuestionId
>
0
)
if
(
!
string
.
IsNullOrEmpty
(
query
.
QPointIds
)
)
{
builder
.
AppendFormat
(
" AND {0}
={1} "
,
nameof
(
RB_Question_Point_ViewModel
.
CourseId
),
query
.
CourseId
);
builder
.
AppendFormat
(
" AND {0}
IN({1}) "
,
nameof
(
RB_Question_Point_ViewModel
.
CourseId
),
query
.
QPointIds
);
}
}
return
GetPage
<
RB_Question_Point_ViewModel
>(
pageIndex
,
pageSize
,
out
rowsCount
,
builder
.
ToString
()).
ToList
();
...
...
Edu.WebApi/Controllers/Course/QuestionController.cs
View file @
6607a38b
using
Edu.Cache.User
;
using
Edu.Common.API
;
using
Edu.Common.Enum.Question
;
using
Edu.Common.Plugin
;
using
Edu.Model.ViewModel.Question
;
using
Edu.Module.Question
;
...
...
@@ -7,6 +8,7 @@ using Edu.WebApi.Filter;
using
Microsoft.AspNetCore.Cors
;
using
Microsoft.AspNetCore.Mvc
;
using
System
;
using
System.Collections.Generic
;
namespace
Edu.WebApi.Controllers.Course
{
...
...
@@ -43,8 +45,14 @@ namespace Edu.WebApi.Controllers.Course
public
ApiResult
GetQuestionPageList
()
{
var
pageModel
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
ResultPageModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
RB_Question_ViewModel
>(
RequestParm
.
Msg
.
ToString
());
var
query
=
new
RB_Question_ViewModel
()
{
CourseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
),
Title
=
base
.
ParmJObj
.
GetStringValue
(
"Title"
),
};
var
list
=
questionModule
.
GetQuestionPageListModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
List
<
object
>
resultList
=
new
List
<
object
>();
foreach
(
var
item
in
list
)
{
if
(
item
.
CreateBy
>
0
)
...
...
@@ -55,12 +63,44 @@ namespace Edu.WebApi.Controllers.Course
{
item
.
UpdateByName
=
UserReidsCache
.
GetUserLoginInfo
(
item
.
UpdateBy
)?.
AccountName
??
""
;
}
resultList
.
Add
(
new
{
item
.
QuestionId
,
item
.
CourseId
,
item
.
Title
,
item
.
QuestionTypeId
,
item
.
QuestionTypeKey
,
item
.
QuestionTypeName
,
item
.
CreateByName
,
item
.
CreateTimeStr
,
item
.
DifficultyType
,
DifficultyTypeName
=
item
.
DifficultyType
.
ToName
(),
});
}
pageModel
.
Count
=
rowsCount
;
pageModel
.
PageData
=
l
ist
;
pageModel
.
PageData
=
resultL
ist
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 获取问题难易列表
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
GetDifficultyType
()
{
var
list
=
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
DifficultyTypeEnum
));
if
(
list
!=
null
)
{
list
.
Insert
(
0
,
new
EnumItem
()
{
Id
=
0
,
Name
=
"全部难度"
});
}
return
ApiResult
.
Success
(
data
:
list
);
}
/// <summary>
/// 获取课程问题列表
/// </summary>
...
...
@@ -106,7 +146,7 @@ namespace Edu.WebApi.Controllers.Course
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
Remove
CourseCategory
()
public
ApiResult
Remove
Question
()
{
var
QuestionId
=
base
.
ParmJObj
.
GetInt
(
"QuestionId"
,
0
);
var
flag
=
questionModule
.
RemoveQuestionModule
(
QuestionId
);
...
...
Edu.WebApi/Controllers/OKR/OKRPeriodController.cs
View file @
6607a38b
This diff is collapsed.
Click to expand it.
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