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
bc682a4f
Commit
bc682a4f
authored
Aug 12, 2021
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
3554fe8f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
1 deletion
+73
-1
RB_Examination_Template.cs
Edu.Model/Entity/Exam/RB_Examination_Template.cs
+1
-1
RB_Examination_Template_ViewModel.cs
...Model/ViewModel/Exam/RB_Examination_Template_ViewModel.cs
+4
-0
PaperModule.cs
Edu.Module.Exam/PaperModule.cs
+33
-0
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+35
-0
No files found.
Edu.Model/Entity/Exam/RB_Examination_Template.cs
View file @
bc682a4f
...
...
@@ -36,7 +36,7 @@ namespace Edu.Model.Entity.Exam
/// <summary>
/// 试卷难易程度
/// </summary>
public
int
TemplateDifficultyType
{
get
;
set
;
}
public
DifficultyTypeEnum
TemplateDifficultyType
{
get
;
set
;
}
/// <summary>
/// 模板数据
...
...
Edu.Model/ViewModel/Exam/RB_Examination_Template_ViewModel.cs
View file @
bc682a4f
...
...
@@ -10,5 +10,9 @@ namespace Edu.Model.ViewModel.Exam
/// </summary>
public
class
RB_Examination_Template_ViewModel
:
RB_Examination_Template
{
/// <summary>
/// 是否保存未组卷模板(1-是)
/// </summary>
public
int
IsSaveTemplate
{
get
;
set
;
}
}
}
Edu.Module.Exam/PaperModule.cs
View file @
bc682a4f
...
...
@@ -224,6 +224,39 @@ namespace Edu.Module.Exam
return
flag
;
}
/// <summary>
/// 智能组卷(根据模板生成试卷)
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
virtual
bool
SetPaperTemplateModule
(
RB_Examination_Template_ViewModel
model
)
{
bool
flag
=
true
;
if
(
model
.
IsSaveTemplate
==
1
)
{
if
(
model
.
TemplateId
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Examination_Template_ViewModel
.
TemplateName
),
model
.
TemplateName
},
{
nameof
(
RB_Examination_Template_ViewModel
.
TemplateScore
),
model
.
TemplateScore
},
{
nameof
(
RB_Examination_Template_ViewModel
.
TemplateNum
),
model
.
TemplateNum
},
{
nameof
(
RB_Examination_Template_ViewModel
.
TemplateDifficultyType
),
model
.
TemplateDifficultyType
},
{
nameof
(
RB_Examination_Template_ViewModel
.
TemplateData
),
model
.
TemplateData
},
{
nameof
(
RB_Examination_Template_ViewModel
.
TemplateBankIds
),
model
.
TemplateBankIds
},
};
flag
=
examination_TemplateRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Examination_Template_ViewModel
.
TemplateId
),
model
.
TemplateId
));
}
else
{
var
newTempId
=
examination_TemplateRepository
.
Insert
(
model
);
model
.
TemplateId
=
newTempId
;
flag
=
newTempId
>
0
;
}
}
return
flag
;
}
/// <summary>
/// 新增修改文件夹
/// </summary>
...
...
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
bc682a4f
...
...
@@ -155,6 +155,41 @@ namespace Edu.WebApi.Controllers.Exam
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
/// <summary>
/// 根据试卷模板添加
/// </summary>
/// <returns></returns>
[
HttpPost
]
public
ApiResult
SetPaperTemplate
()
{
var
extModel
=
new
RB_Examination_Template_ViewModel
()
{
TemplateId
=
base
.
ParmJObj
.
GetInt
(
"TemplateId"
),
TemplateName
=
base
.
ParmJObj
.
GetStringValue
(
"TemplateName"
),
TemplateScore
=
base
.
ParmJObj
.
GetDecimal
(
"TemplateScore"
),
TemplateNum
=
base
.
ParmJObj
.
GetInt
(
"TemplateNum"
),
TemplateDifficultyType
=(
DifficultyTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"DifficultyType"
),
TemplateBankIds
=
base
.
ParmJObj
.
GetStringValue
(
"TemplateBankIds"
),
CreateBy
=
UserInfo
.
Id
,
CreateTime
=
DateTime
.
Now
,
Group_Id
=
base
.
UserInfo
.
Group_Id
,
School_Id
=
base
.
UserInfo
.
School_Id
,
Status
=
Common
.
Enum
.
DateStateEnum
.
Normal
,
IsSaveTemplate
=
base
.
ParmJObj
.
GetInt
(
"IsSaveTemplate"
),
};
string
TemplateData
=
base
.
ParmJObj
.
GetStringValue
(
"TemplateData"
);
if
(!
string
.
IsNullOrEmpty
(
TemplateData
))
{
var
list
=
Common
.
Plugin
.
JsonHelper
.
DeserializeObject
<
List
<
ExamTemplate
>>(
TemplateData
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
extModel
.
TemplateData
=
Common
.
Plugin
.
JsonHelper
.
Serialize
(
list
);
}
}
bool
flag
=
paperModule
.
SetPaperTemplateModule
(
extModel
);
return
flag
?
ApiResult
.
Success
(
data
:
extModel
)
:
ApiResult
.
Failed
();
}
/// <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