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
6d4cd255
Commit
6d4cd255
authored
Mar 17, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
71ad9eb9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
104 additions
and
76 deletions
+104
-76
CourseExamModule.cs
Edu.Module.Exam/CourseExamModule.cs
+104
-76
No files found.
Edu.Module.Exam/CourseExamModule.cs
View file @
6d4cd255
...
...
@@ -702,47 +702,94 @@ namespace Edu.Module.Exam
StudentId
=
StudentId
,
};
sQuery
.
LevelType
=
query
?.
BankType
??
0
;
var
finishList
=
student_PracticeRepository
.
GetStudentPracticeListRepository
(
sQuery
);
if
(
finishList
!=
null
&&
finishList
.
Count
>
0
)
{
var
tempReadingList
=
finishList
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ReadingChoose
)?.
ToList
();
readingFinishCount
=
tempReadingList
?.
Count
()
??
0
;
readingStartId
=
tempReadingList
!=
null
&&
tempReadingList
.
Count
>
0
?
(
tempReadingList
?.
Max
(
qitem
=>
qitem
.
QuestionId
)
??
0
)
:
0
;
//if (readingStartId == readingFinishCount&& readingFinishCount>0)
//{
// readingStartId = 0;
// readingTimes = tempReadingList?.FirstOrDefault()?.Times ?? 1;
// readingFinishCount = 0;
//}
var
tempListeningList
=
finishList
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
Listening
)?.
ToList
();
listeningFinishCount
=
tempListeningList
?.
Count
()
??
0
;
listeningStartId
=
tempListeningList
!=
null
&&
tempListeningList
.
Count
>
0
?
(
tempListeningList
?.
Max
(
qitem
=>
qitem
.
QuestionId
)
??
0
)
:
0
;
var
tempGrammarList
=
finishList
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseGrammarUse
)?.
ToList
();
grammarFinishCount
=
tempGrammarList
?.
Count
()
??
0
;
grammarStartId
=
tempGrammarList
!=
null
&&
tempGrammarList
.
Count
>
0
?
(
tempGrammarList
?.
Max
(
qitem
=>
qitem
.
QuestionId
)
??
0
)
:
0
;
var
tempWordsList
=
finishList
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseWord
||
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseMean
||
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseWordUse
)?.
ToList
();
wordsFinishCount
=
tempWordsList
?.
Count
()
??
0
;
wordsStartId
=
tempWordsList
!=
null
&&
tempWordsList
.
Count
>
0
?
(
tempWordsList
?.
Max
(
qitem
=>
qitem
.
QuestionId
)
??
0
)
:
0
;
}
var
list
=
questionRepository
.
GetQuestionCategoryListRepository
(
query
);
if
(
list
!=
null
&&
list
.
Count
>
0
)
//问题列表
var
questionList
=
questionRepository
.
GetQuestionCategoryListRepository
(
query
);
if
(
questionList
!=
null
&&
questionList
.
Count
>
0
)
{
readingTotalCount
=
l
ist
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ReadingChoose
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
listeningTotalCount
=
l
ist
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
Listening
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
grammarTotalCount
=
l
ist
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseGrammarUse
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
wordsTotalCount
=
l
ist
?.
Where
(
qitem
=>
readingTotalCount
=
questionL
ist
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ReadingChoose
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
listeningTotalCount
=
questionL
ist
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
Listening
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
grammarTotalCount
=
questionL
ist
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseGrammarUse
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
wordsTotalCount
=
questionL
ist
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseWord
||
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseMean
||
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseWordUse
)?.
Sum
(
qitem
=>
qitem
.
QuestionCount
)
??
0
;
}
//学员完成情况
var
finishList
=
student_PracticeRepository
.
GetStudentPracticeListRepository
(
sQuery
);
//阅读题练习完成列表
var
tempReadingList
=
finishList
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ReadingChoose
)?.
ToList
();
//听力题练习完成列表
var
tempListeningList
=
finishList
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
Listening
)?.
ToList
();
//语法题练习完成列表
var
tempGrammarList
=
finishList
?.
Where
(
qitem
=>
qitem
.
Category
==
Common
.
Enum
.
Course
.
QuestionCategoryEnum
.
ChooseGrammarUse
)?.
ToList
();
//单词题练习完成列表
var
tempWordsList
=
finishList
?.
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
(
tempReadingList
!=
null
&&
tempReadingList
.
Count
>
0
)
{
readingTimes
=
tempReadingList
?.
Max
(
qitem
=>
qitem
.
Times
)
??
1
;
readingFinishCount
=
tempReadingList
?.
Where
(
qitem
=>
qitem
.
Times
==
readingTimes
)?.
Count
()
??
0
;
if
(
tempReadingList
?.
Where
(
qitem
=>
qitem
.
Times
==
readingTimes
).
Count
()
>
0
)
{
readingStartId
=
tempReadingList
?.
Where
(
qitem
=>
qitem
.
Times
==
readingTimes
)?.
Max
(
qitem
=>
qitem
.
QuestionId
)
??
0
;
}
if
(
readingFinishCount
==
readingTotalCount
)
{
readingStartId
=
0
;
readingTimes
=
readingTimes
+
1
;
}
}
if
(
tempListeningList
!=
null
&&
tempListeningList
.
Count
>
0
)
{
listeningTimes
=
tempListeningList
?.
Max
(
qitem
=>
qitem
.
Times
)
??
1
;
listeningFinishCount
=
tempListeningList
?.
Where
(
qitem
=>
qitem
.
Times
==
listeningTimes
)?.
Count
()
??
0
;
if
(
tempListeningList
?.
Where
(
qitem
=>
qitem
.
Times
==
listeningTimes
)?.
Count
()
>
0
)
{
listeningStartId
=
tempListeningList
?.
Where
(
qitem
=>
qitem
.
Times
==
listeningTimes
)?.
Max
(
qitem
=>
qitem
.
QuestionId
)
??
0
;
}
if
(
listeningFinishCount
==
listeningFinishCount
)
{
listeningStartId
=
0
;
listeningTimes
=
listeningTimes
+
1
;
}
}
if
(
tempGrammarList
!=
null
&&
tempGrammarList
.
Count
>
0
)
{
grammarTimes
=
tempGrammarList
?.
Max
(
qitem
=>
qitem
.
Times
)
??
1
;
grammarFinishCount
=
tempGrammarList
?.
Where
(
qitem
=>
qitem
.
Times
==
grammarTimes
).
Count
()
??
0
;
if
(
tempGrammarList
?.
Where
(
qitem
=>
qitem
.
Times
==
grammarTimes
).
Count
()
>
0
)
{
grammarStartId
=
tempGrammarList
?.
Where
(
qitem
=>
qitem
.
Times
==
grammarTimes
)?.
Max
(
qitem
=>
qitem
.
QuestionId
)
??
0
;
}
if
(
grammarFinishCount
==
grammarTotalCount
)
{
grammarStartId
=
0
;
grammarTimes
=
grammarTimes
+
1
;
}
}
if
(
tempWordsList
!=
null
&&
tempWordsList
.
Count
>
0
)
{
wordsTimes
=
tempWordsList
?.
Max
(
qitem
=>
qitem
.
Times
)
??
1
;
wordsFinishCount
=
tempWordsList
?.
Where
(
qitem
=>
qitem
.
Times
==
wordsTimes
)?.
Count
()
??
0
;
if
(
tempWordsList
?.
Where
(
qitem
=>
qitem
.
Times
==
wordsTimes
)?.
Count
()
>
0
)
{
wordsStartId
=
tempWordsList
?.
Where
(
qitem
=>
qitem
.
Times
==
wordsTimes
)?.
Max
(
qitem
=>
qitem
.
QuestionId
)
??
0
;
}
if
(
wordsFinishCount
==
wordsTotalCount
)
{
wordsStartId
=
0
;
wordsTimes
=
wordsTimes
+
1
;
}
}
obj
=
new
{
readingFinishCount
,
...
...
@@ -1044,27 +1091,28 @@ namespace Edu.Module.Exam
public
bool
SetStudentPracticeModule
(
RB_Student_Practice_Extend
model
)
{
bool
flag
=
false
;
var
oldModel
=
student_PracticeRepository
.
GetStudentPracticeListRepository
(
new
RB_Student_Practice_Extend
()
{
StudentId
=
model
.
StudentId
,
QuestionId
=
model
.
QuestionId
})?.
FirstOrDefault
();
model
.
Id
=
oldModel
?.
Id
??
0
;
if
(
model
.
Id
>
0
)
{
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
{
{
nameof
(
RB_Student_Practice_Extend
.
IsAnswer
),
model
.
IsAnswer
},
{
nameof
(
RB_Student_Practice_Extend
.
IsWrong
),
model
.
IsWrong
},
};
flag
=
student_PracticeRepository
.
Update
(
fileds
,
new
WhereHelper
(
nameof
(
RB_Student_Practice_Extend
.
Id
),
model
.
Id
));
}
else
{
var
newId
=
student_PracticeRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
}
//var oldModel = student_PracticeRepository.GetStudentPracticeListRepository(new RB_Student_Practice_Extend()
//{
// StudentId = model.StudentId,
// QuestionId = model.QuestionId
//})?.FirstOrDefault();
//model.Id = oldModel?.Id ?? 0;
//if (model.Id > 0)
//{
// Dictionary<string, object> fileds = new Dictionary<string, object>()
// {
// {nameof(RB_Student_Practice_Extend.IsAnswer),model.IsAnswer },
// {nameof(RB_Student_Practice_Extend.IsWrong),model.IsWrong },
// };
// flag = student_PracticeRepository.Update(fileds, new WhereHelper(nameof(RB_Student_Practice_Extend.Id), model.Id));
//}
//else
//{
//}
var
newId
=
student_PracticeRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
flag
=
newId
>
0
;
return
flag
;
}
...
...
@@ -1138,26 +1186,6 @@ namespace Edu.Module.Exam
}
}
}
//int totalPage = 0;
//int pageSize = 30;
//if (model.ExamDetailsList.Count % pageSize == 0)
//{
// totalPage = model.ExamDetailsList.Count % pageSize;
//}
//else
//{
// totalPage = model.ExamDetailsList.Count % pageSize + 1;
//}
//int pageIndex = 1;
//while (pageIndex <= totalPage)
//{
// var tempList = model.ExamDetailsList.Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();
// if (tempList != null && tempList.Count > 0)
// {
// // flag = student_ExamDetailsRepository.BatchStudentExamDetailsRepository(tempList);
// }
//}
flag
=
student_ExamDetailsRepository
.
BatchStudentExamDetailsRepository
(
model
.
ExamDetailsList
);
totalScore
=
model
.
ExamDetailsList
.
Sum
(
qitem
=>
qitem
.
StudentScore
);
}
...
...
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