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 {
1515 displaySolution ,
1616 displayHintUnlock ,
1717 displaySolutionUnlock ,
18+ submitRating ,
1819} from "./pages/challenge" ;
1920import { getScoreboard , getScoreboardDetail , getBrackets } from "./pages/scoreboard" ;
2021import { updateSettings , generateToken , deleteToken } from "./pages/settings" ;
@@ -143,6 +144,7 @@ const pages = {
143144 displayHint,
144145 loadSolution,
145146 displaySolution,
147+ submitRating,
146148 } ,
147149 challenges : {
148150 getChallenges,
Original file line number Diff line number Diff line change @@ -163,3 +163,13 @@ export async function displaySolution(solutionId) {
163163 }
164164 }
165165}
166+
167+ export async function submitRating ( challengeId , rating ) {
168+ const response = await CTFd . fetch ( `/api/v1/challenges/${ challengeId } /ratings` , {
169+ method : "PUT" ,
170+ body : JSON . stringify ( { value : rating } ) ,
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