Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
middleLayer_for_JJ_F
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
template admin
middleLayer_for_JJ_F
Commits
eca5f827
Commit
eca5f827
authored
Jul 29, 2025
by
limingzhe
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 调整上报学情时机
parent
23e158e9
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
12 deletions
+19
-12
middleLayer.ts
assets/middleLayer_for_JJ_F/script/middleLayer.ts
+16
-10
studyRecord.js
assets/middleLayer_for_JJ_F/script/studyRecord.js
+3
-2
No files found.
assets/middleLayer_for_JJ_F/script/middleLayer.ts
View file @
eca5f827
...
...
@@ -435,10 +435,7 @@ export default class NewClass extends middleLayerBase {
onHomeworkFinish
(
d1
=
null
,
d2
=
null
)
{
if
(
this
.
studyRecord
)
{
this
.
reportData
();
}
if
(
this
.
isRunCamp
)
{
this
.
onHomeworkFinishRunCamp
(
d1
,
d2
);
return
;
...
...
@@ -598,19 +595,28 @@ export default class NewClass extends middleLayerBase {
}
}
showSRResultByRecord
()
{
showSRResultByRecord
(
isShowScore
=
false
)
{
if
(
this
.
studyRecord
)
{
this
.
studyRecordModel
.
recordData
=
this
.
studyRecord
.
getAllAudioKeyData
();
const
score
=
this
.
studyRecord
.
getTotalAverageAudioScore
();
this
.
showSRResult
(
score
)
this
.
reportData
(
score
);
if
(
isShowScore
)
{
this
.
showSRResult
(
score
)
}
}
}
showSRResultByQuestion
()
{
showSRResultByQuestion
(
isShowScore
=
false
)
{
if
(
this
.
studyRecord
)
{
this
.
studyRecordModel
.
recordData
=
this
.
studyRecord
.
getAllQuestionResults
();
const
score
=
this
.
studyRecord
.
getAverageScore
();
this
.
showSRResult
(
score
)
this
.
reportData
(
score
);
if
(
isShowScore
)
{
this
.
showSRResult
(
score
)
}
}
...
...
@@ -637,11 +643,11 @@ export default class NewClass extends middleLayerBase {
}
reportData
()
{
reportData
(
score
)
{
console
.
log
(
'
reportData 1
'
);
if
(
this
.
studyRecord
)
{
console
.
log
(
'
reportData 2
'
);
const
reportData
=
this
.
studyRecord
.
reportData
(
this
.
studyRecordModel
);
const
reportData
=
this
.
studyRecord
.
reportData
(
this
.
studyRecordModel
,
score
);
// 在这里处理网络请求
this
.
callNetworkApiPostNew
(
`insights/v1/study-analysis`
,
{
...
...
assets/middleLayer_for_JJ_F/script/studyRecord.js
View file @
eca5f827
...
...
@@ -326,7 +326,7 @@ class StudyRecord {
}
// ==================== 数据上报方法 ====================
reportData
(
studyRecordModel
)
{
reportData
(
studyRecordModel
,
score
)
{
// 注意:这个方法需要在使用时传入正确的上下文
// 因为 this.callNetworkApiPostNew 可能不存在于 StudyRecord 类中
console
.
log
(
'
reportData called with:
'
,
studyRecordModel
);
...
...
@@ -339,7 +339,8 @@ class StudyRecord {
totalAudioDuration
:
this
.
getTotalAudioDuration
(),
totalQuestions
:
this
.
totalQuestions
,
questionResults
:
this
.
getAllQuestionResults
(),
averageScore
:
this
.
getAverageScore
()
averageScore
:
this
.
getAverageScore
(),
totalScore
:
score
};
console
.
log
(
'
Prepared report data:
'
,
reportData
);
...
...
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