Skip to content
This repository was archived by the owner on Dec 14, 2020. It is now read-only.

Commit 78a4353

Browse files
committed
feat(actionOnSiteActivity): Adds score.
1 parent 4f2c56e commit 78a4353

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/statementCreators/actionOnSiteActivity.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ export interface SiteActivityAction extends UserSiteActivityAction {
2020

2121
/** Determines how long the activity took. */
2222
readonly duration?: Duration;
23+
24+
/** Score achieved in the activity as a percentage (decimal between -1 and 1). */
25+
readonly scaledScore?: number;
26+
27+
/** Raw score achieved in the activity. */
28+
readonly rawScore?: number;
2329
}
2430

2531
/**
@@ -48,6 +54,12 @@ export default function actionOnSiteActivity(action: SiteActivityAction): Statem
4854
duration: action.duration === undefined ? undefined : (
4955
action.duration.toISOString()
5056
),
57+
...pickFilled({
58+
score: pickDefined({
59+
scaled: action.scaledScore,
60+
raw: action.rawScore,
61+
}),
62+
}),
5163
}),
5264
}),
5365
context: {

0 commit comments

Comments
 (0)