File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
15
15
displaySolution ,
16
16
displayHintUnlock ,
17
17
displaySolutionUnlock ,
18
+ submitRating ,
18
19
} from "./pages/challenge" ;
19
20
import { getScoreboard , getScoreboardDetail , getBrackets } from "./pages/scoreboard" ;
20
21
import { updateSettings , generateToken , deleteToken } from "./pages/settings" ;
@@ -143,6 +144,7 @@ const pages = {
143
144
displayHint,
144
145
loadSolution,
145
146
displaySolution,
147
+ submitRating,
146
148
} ,
147
149
challenges : {
148
150
getChallenges,
Original file line number Diff line number Diff line change @@ -163,3 +163,13 @@ export async function displaySolution(solutionId) {
163
163
}
164
164
}
165
165
}
166
+
167
+ export async function submitRating ( challengeId , rating , review ) {
168
+ const response = await CTFd . fetch ( `/api/v1/challenges/${ challengeId } /ratings` , {
169
+ method : "PUT" ,
170
+ body : JSON . stringify ( { value : rating , review : review } ) ,
171
+ } ) ;
172
+
173
+ const body = await response . json ( ) ;
174
+ return body [ "data" ] ;
175
+ }
You can’t perform that action at this time.
0 commit comments