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
e0fce697
Commit
e0fce697
authored
Jan 11, 2022
by
黄奎
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
页面修改
parent
bd91a5c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
23 deletions
+26
-23
CourseExamModule.cs
Edu.Module.Exam/CourseExamModule.cs
+23
-21
AppletWordsController.cs
Edu.WebApi/Controllers/Applet/AppletWordsController.cs
+3
-2
No files found.
Edu.Module.Exam/CourseExamModule.cs
View file @
e0fce697
...
...
@@ -281,16 +281,16 @@ namespace Edu.Module.Exam
/// </summary>
/// <param name="CourseId">课程编号</param>
/// <param name="ChapterId">当前章节编号</param>
/// <param name="
PrevChapterId">上一
章节编号</param>
/// <param name="
ReviewChapterId">复习
章节编号</param>
/// <returns></returns>
public
object
GetStudyCourseWords
(
int
CourseId
,
int
ChapterId
,
int
Prev
ChapterId
)
public
object
GetStudyCourseWords
(
int
CourseId
,
int
ChapterId
,
int
Review
ChapterId
)
{
List
<
object
>
list
=
new
List
<
object
>();
List
<
object
>
reviewList
=
new
List
<
object
>();
var
dataList
=
course_WordsRepository
.
GetCourseWordsListRepository
(
new
RB_Course_Words_Extend
()
{
CourseId
=
CourseId
,
QChapterIds
=
ChapterId
+
","
+
Prev
ChapterId
QChapterIds
=
ChapterId
+
","
+
Review
ChapterId
});
if
(
dataList
!=
null
&&
dataList
.
Count
>
0
)
{
...
...
@@ -310,7 +310,7 @@ namespace Edu.Module.Exam
});
}
foreach
(
var
item
in
dataList
.
Where
(
qitem
=>
qitem
.
ChapterId
==
Prev
ChapterId
))
foreach
(
var
item
in
dataList
.
Where
(
qitem
=>
qitem
.
ChapterId
==
Review
ChapterId
))
{
reviewList
.
Add
(
new
{
...
...
@@ -333,16 +333,6 @@ namespace Edu.Module.Exam
};
}
/// <summary>
/// 获取单词预习分页列表
/// </summary>
/// <param name="query"></param>
/// <returns></returns>
public
List
<
RB_StuWords_Prep_Extend
>
GetStuWordsPrepPageModule
(
int
pageIndex
,
int
pageSize
,
out
long
rowsCount
,
RB_StuWords_Prep_Extend
query
)
{
var
list
=
stuWords_PrepRepository
.
GetStuWordsPrepPageRepository
(
pageIndex
,
pageSize
,
out
rowsCount
,
query
);
return
list
;
}
/// <summary>
/// 获取单词预习列表
...
...
@@ -368,6 +358,8 @@ namespace Edu.Module.Exam
CourseId
=
model
.
CourseId
,
QChapterIds
=
model
.
ChapterId
+
","
+
model
.
ReviewCourseChapterId
});
//当前章节单词总数
var
currentChapterCount
=
wordsList
?.
Where
(
qitem
=>
qitem
.
ChapterId
==
model
.
ChapterId
)?.
Count
()
??
0
;
var
oldModel
=
GetStuWordsPrepListModule
(
new
RB_StuWords_Prep_Extend
()
{
Stu_Account_Id
=
model
.
Stu_Account_Id
,
...
...
@@ -376,14 +368,24 @@ namespace Edu.Module.Exam
Group_Id
=
model
.
Group_Id
})?.
FirstOrDefault
();
model
.
Id
=
oldModel
?.
Id
??
0
;
model
.
TotalNum
=
oldModel
?.
TotalNum
??
(
wordsList
?.
Count
??
0
);
if
(
model
.
Id
>
0
)
{
model
.
TotalNum
=
oldModel
?.
TotalNum
??
(
wordsList
?.
Count
??
0
);
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>()
Dictionary
<
string
,
object
>
fileds
=
new
Dictionary
<
string
,
object
>();
//预习
if
(
model
.
StudyType
==
1
)
{
{
nameof
(
RB_StuWords_Prep_Extend
.
StudyNum
),
model
.
StudyNum
},
};
model
.
Score
=
GetScoreModule
(
model
.
StudyNum
,
model
.
TotalNum
);
fileds
.
Add
(
nameof
(
RB_StuWords_Prep_Extend
.
PrepNum
),
model
.
PrepNum
);
model
.
StudyNum
=
model
.
PrepNum
;
}
//复习
else
{
fileds
.
Add
(
nameof
(
RB_StuWords_Prep_Extend
.
ReviewNum
),
model
.
ReviewNum
);
model
.
StudyNum
=
oldModel
.
PrepNum
+
model
.
ReviewNum
;
}
fileds
.
Add
(
nameof
(
RB_StuWords_Prep_Extend
.
StudyNum
),
model
.
StudyNum
);
model
.
Score
=
GetScoreModule
(
model
.
PrepNum
,
currentChapterCount
);
fileds
.
Add
(
nameof
(
RB_StuWords_Prep_Extend
.
Score
),
model
.
Score
);
if
(
model
.
StudyNum
==
(
wordsList
?.
Count
??
0
))
{
...
...
@@ -394,9 +396,9 @@ namespace Edu.Module.Exam
}
else
{
model
.
PrepNum
=
1
;
model
.
StudyNum
=
1
;
model
.
TotalNum
=
wordsList
?.
Count
()
??
0
;
model
.
Score
=
GetScoreModule
(
model
.
StudyNum
,
model
.
TotalNum
);
model
.
Score
=
GetScoreModule
(
model
.
PrepNum
,
currentChapterCount
);
model
.
StartTime
=
DateTime
.
Now
;
var
newId
=
stuWords_PrepRepository
.
Insert
(
model
);
model
.
Id
=
newId
;
...
...
Edu.WebApi/Controllers/Applet/AppletWordsController.cs
View file @
e0fce697
...
...
@@ -29,8 +29,8 @@ namespace Edu.WebApi.Controllers.Applet
{
var
CourseId
=
base
.
ParmJObj
.
GetInt
(
"CourseId"
);
var
ChapterId
=
base
.
ParmJObj
.
GetInt
(
"ChapterId"
);
var
PrevChapterId
=
base
.
ParmJObj
.
GetInt
(
"Prev
ChapterId"
);
var
list
=
courseExamModule
.
GetStudyCourseWords
(
CourseId
,
ChapterId
,
Prev
ChapterId
);
var
ReviewChapterId
=
base
.
ParmJObj
.
GetInt
(
"Review
ChapterId"
);
var
list
=
courseExamModule
.
GetStudyCourseWords
(
CourseId
,
ChapterId
,
Review
ChapterId
);
return
ApiResult
.
Success
(
data
:
list
);
}
...
...
@@ -53,6 +53,7 @@ namespace Edu.WebApi.Controllers.Applet
ReviewNum
=
base
.
ParmJObj
.
GetInt
(
"ReviewNum"
),
StudyNum
=
base
.
ParmJObj
.
GetInt
(
"StudyNum"
),
ReviewCourseChapterId
=
base
.
ParmJObj
.
GetInt
(
"ReviewCourseChapterId"
),
StudyType
=
base
.
ParmJObj
.
GetInt
(
"StudyType"
),
};
model
.
CreateBy
=
base
.
AppletUserInfo
.
Id
;
model
.
CreateTime
=
DateTime
.
Now
;
...
...
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