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
7fa36a61
Commit
7fa36a61
authored
Mar 14, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
8ac2af28
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
65 additions
and
23 deletions
+65
-23
RB_Student_Practice.cs
Edu.Model/Entity/Exam/RB_Student_Practice.cs
+5
-0
CourseExamModule.cs
Edu.Module.Exam/CourseExamModule.cs
+38
-23
RB_Student_PracticeRepository.cs
Edu.Repository/Exam/RB_Student_PracticeRepository.cs
+4
-0
ExamController.cs
Edu.WebApi/Controllers/Exam/ExamController.cs
+18
-0
No files found.
Edu.Model/Entity/Exam/RB_Student_Practice.cs
View file @
7fa36a61
...
...
@@ -83,5 +83,10 @@ namespace Edu.Model.Entity.Exam
/// 学生答案
/// </summary>
public
string
StudentAnswer
{
get
;
set
;
}
/// <summary>
/// 是否复习
/// </summary>
public
int
IsReview
{
get
;
set
;
}
}
}
Edu.Module.Exam/CourseExamModule.cs
View file @
7fa36a61
...
...
@@ -838,7 +838,7 @@ namespace Edu.Module.Exam
{
List
<
object
>
result
=
new
List
<
object
>();
var
list
=
student_ExamRepository
.
GetStudentExamStaticRepository
(
new
RB_Student_Exam_Extend
());
var
bankTypeList
=
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
LevelTypeEnum
));
var
bankTypeList
=
Common
.
Plugin
.
EnumHelper
.
EnumToList
(
typeof
(
LevelTypeEnum
));
if
(
bankTypeList
!=
null
&&
bankTypeList
.
Count
>
0
)
{
foreach
(
var
item
in
bankTypeList
)
...
...
@@ -850,7 +850,7 @@ namespace Edu.Module.Exam
{
item
.
Id
,
item
.
Name
,
JoinNum
=
joinNum
JoinNum
=
joinNum
});
}
}
...
...
@@ -877,7 +877,7 @@ namespace Edu.Module.Exam
{
stuExamList
=
student_ExamRepository
.
GetStudentExamListRepository
(
new
RB_Student_Exam_Extend
()
{
// GroupId = query.Group_Id,
// GroupId = query.Group_Id,
QBankIds
=
bankIds
});
}
...
...
@@ -903,7 +903,7 @@ namespace Edu.Module.Exam
{
MyUseTime
=
Common
.
ConvertHelper
.
CalcMinutesAndSeconds
(
myLast
.
StartTime
,
myLast
.
EndTime
);
MyScore
=
myLast
.
Score
;
MyRank
=
tempList
.
FindIndex
(
qitem
=>
qitem
.
Id
==
myLast
.
Id
)
+
1
;
MyRank
=
tempList
.
FindIndex
(
qitem
=>
qitem
.
Id
==
myLast
.
Id
)
+
1
;
}
MyTimes
=
tempList
?.
Where
(
qitem
=>
qitem
.
StudentId
==
query
.
StudentId
)?.
Count
()
??
0
;
}
...
...
@@ -933,14 +933,14 @@ namespace Edu.Module.Exam
/// <param name="rowsCount"></param>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
object
>
GetAppBankDetailsPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Question_ViewModel
query
,
int
StudentId
=
0
)
public
List
<
object
>
GetAppBankDetailsPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_Question_ViewModel
query
,
int
StudentId
=
0
)
{
List
<
object
>
result
=
new
List
<
object
>();
var
questionList
=
questionRepository
.
GetQuestionPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
)?.
OrderBy
(
qitem
=>
qitem
.
Category
)?.
ToList
();
var
questionList
=
questionRepository
.
GetQuestionPageListRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
)?.
OrderBy
(
qitem
=>
qitem
.
Category
)?.
ToList
();
List
<
RB_Student_ExamDetails_Extend
>
stuExamList
=
new
List
<
RB_Student_ExamDetails_Extend
>();
if
(
StudentId
>
0
)
{
stuExamList
=
student_ExamDetailsRepository
.
GetStudentExamDetailsListRepository
(
new
RB_Student_ExamDetails_Extend
()
{
BankId
=
query
.
BankId
,
StudentId
=
StudentId
});
stuExamList
=
student_ExamDetailsRepository
.
GetStudentExamDetailsListRepository
(
new
RB_Student_ExamDetails_Extend
()
{
BankId
=
query
.
BankId
,
StudentId
=
StudentId
});
}
if
(
questionList
!=
null
&&
questionList
.
Count
>
0
)
{
...
...
@@ -954,7 +954,7 @@ namespace Edu.Module.Exam
{
try
{
var
listenList
=
JsonHelper
.
DeserializeObject
<
List
<
SubAnswerItem
>>(
item
.
Answer
);
if
(
listenList
!=
null
&&
listenList
.
Count
>
0
)
{
...
...
@@ -1009,8 +1009,8 @@ namespace Edu.Module.Exam
StudentAnswer
=
studentAnswerList
,
item
.
Answer
,
Score
,
IsAnswer
=
tempQuestion
?.
IsAnswer
??
0
,
IsWrong
=
tempQuestion
?.
IsWrong
??
0
,
IsAnswer
=
tempQuestion
?.
IsAnswer
??
0
,
IsWrong
=
tempQuestion
?.
IsWrong
??
0
,
StudentScore
=
tempQuestion
?.
StudentScore
??
0
,
};
result
.
Add
(
obj
);
...
...
@@ -1019,7 +1019,7 @@ namespace Edu.Module.Exam
return
result
;
}
/// <summary>
/// 新增修改学员练习
...
...
@@ -1082,7 +1082,7 @@ namespace Edu.Module.Exam
decimal
totalScore
=
0
;
if
(
model
.
ExamDetailsList
!=
null
&&
model
.
ExamDetailsList
.
Count
>
0
)
{
foreach
(
var
item
in
model
.
ExamDetailsList
)
{
item
.
ExamId
=
model
.
Id
;
...
...
@@ -1110,8 +1110,8 @@ namespace Edu.Module.Exam
}
}
catch
{
{
}
item
.
StudentScore
=
tempScore
;
}
...
...
@@ -1174,7 +1174,7 @@ namespace Edu.Module.Exam
int
wordsWrongFinishCount
=
0
;
int
wordsWrongStartId
=
0
;
var
list
=
student_PracticeRepository
.
GetStudentPracticeWrongStaticRepository
(
query
);
var
list
=
student_PracticeRepository
.
GetStudentPracticeWrongStaticRepository
(
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
var
tempReadingList
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ReadingChoose
)?.
ToList
();
...
...
@@ -1182,23 +1182,23 @@ namespace Edu.Module.Exam
{
readingWrongTotalCount
=
tempReadingList
.
Sum
(
qitem
=>
qitem
.
WrongCount
);
}
var
tempListeningList
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
Listening
)?.
ToList
();
if
(
tempListeningList
!=
null
&&
tempListeningList
.
Count
>
0
)
{
listeningWrongTotalCount
=
tempListeningList
.
Sum
(
qitem
=>
qitem
.
WrongCount
);
}
var
tempGrammarList
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseGrammarUse
)?.
ToList
();
var
tempGrammarList
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseGrammarUse
)?.
ToList
();
if
(
tempGrammarList
!=
null
&&
tempGrammarList
.
Count
>
0
)
{
grammarWrongTotalCount
=
tempGrammarList
.
Sum
(
qitem
=>
qitem
.
WrongCount
);
}
var
tempWordsList
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseWord
||
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseMean
||
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseWordUse
var
tempWordsList
=
list
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseWord
||
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseMean
||
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseWordUse
)?.
ToList
();
if
(
tempWordsList
!=
null
&&
tempWordsList
.
Count
>
0
)
{
...
...
@@ -1235,12 +1235,27 @@ namespace Edu.Module.Exam
{
var
list
=
student_PracticeRepository
.
GetStudentPracticePageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
{
{
}
return
list
;
}
/// <summary>
/// 设置错题已复习
/// </summary>
/// <param name="model"></param>
/// <returns></returns>
public
bool
SetPracticeReviewModule
(
RB_Student_Practice_Extend
model
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Practice_Extend
.
IsReview
),
model
.
IsReview
}
};
bool
flag
=
student_PracticeRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_Practice_Extend
.
Id
),
model
.
Id
));
return
flag
;
}
#
endregion
}
}
Edu.Repository/Exam/RB_Student_PracticeRepository.cs
View file @
7fa36a61
...
...
@@ -113,6 +113,10 @@ WHERE 1=1
{
builder
.
AppendFormat
(
" AND {0}={1} "
,
nameof
(
RB_Student_Practice_Extend
.
LevelType
),
(
int
)
query
.
LevelType
);
}
if
(!
string
.
IsNullOrEmpty
(
query
.
QCategoryIds
))
{
builder
.
AppendFormat
(
" AND {0} IN({1}) "
,
nameof
(
RB_Student_Practice_Extend
.
Category
),
query
.
QCategoryIds
);
}
}
builder
.
AppendFormat
(
" GROUP BY Category "
);
return
Get
<
RB_Student_Practice_Extend
>(
builder
.
ToString
()).
ToList
();
...
...
Edu.WebApi/Controllers/Exam/ExamController.cs
View file @
7fa36a61
...
...
@@ -1242,6 +1242,7 @@ namespace Edu.WebApi.Controllers.Exam
StudentId
=
base
.
ParmJObj
.
GetInt
(
"StudentId"
),
LevelType
=
(
LevelTypeEnum
)
base
.
ParmJObj
.
GetInt
(
"LevelType"
),
StartId
=
base
.
ParmJObj
.
GetInt
(
"StartId"
),
QCategoryIds
=
base
.
ParmJObj
.
GetStringValue
(
"QCategoryIds"
),
};
query
.
IsQueryWrong
=
1
;
var
list
=
courseExamModule
.
GetPracticeWrongPageModule
(
pageModel
.
PageIndex
,
pageModel
.
PageSize
,
out
long
rowsCount
,
query
);
...
...
@@ -1249,6 +1250,23 @@ namespace Edu.WebApi.Controllers.Exam
pageModel
.
PageData
=
list
;
return
ApiResult
.
Success
(
data
:
pageModel
);
}
/// <summary>
/// 设置错题复习
/// </summary>
/// <returns></returns>
[
HttpPost
]
[
AllowRepeat
]
public
ApiResult
SetPracticeReview
()
{
var
model
=
new
RB_Student_Practice_Extend
()
{
Id
=
base
.
ParmJObj
.
GetInt
(
"Id"
),
IsReview
=
1
};
bool
flag
=
courseExamModule
.
SetPracticeReviewModule
(
model
);
return
flag
?
ApiResult
.
Success
()
:
ApiResult
.
Failed
();
}
#
endregion
}
}
\ No newline at end of file
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