Skip to content
This repository was archived by the owner on Aug 28, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions assets/js/challenges.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ Alpine.data("Challenge", () => ({
share_url: null,
max_attempts: 0,
attempts: 0,
ratingValue: 0,
hoveredRating: 0,
selectedRating: 0,
ratingReview: "",
ratingSubmitted: false,

async init() {
highlight();
Expand Down Expand Up @@ -221,6 +226,20 @@ Alpine.data("Challenge", () => ({
// Dispatch load-challenges event to call loadChallenges in the ChallengeBoard
this.$dispatch("load-challenges");
},

async submitRating() {
const response = await CTFd.pages.challenge.submitRating(
this.id,
this.selectedRating,
this.ratingReview,
);
if (response.value) {
this.ratingValue = this.selectedRating;
this.ratingSubmitted = true;
} else {
alert("Error submitting rating");
}
},
}));

Alpine.data("ChallengeBoard", () => ({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"verify": "vite build; git diff --quiet --exit-code"
},
"dependencies": {
"@ctfdio/ctfd-js": "^0.0.17",
"@ctfdio/ctfd-js": "^0.0.18",
"@fontsource/lato": "^4.5.3",
"@fontsource/raleway": "^4.5.3",
"@fortawesome/fontawesome-free": "6.5.1",
Expand Down
1 change: 1 addition & 0 deletions static/assets/challenges.074c9899.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion static/assets/challenges.4dca8d2f.js

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions static/assets/page.1b85bc2f.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import{C as o,m as d}from"./index.b6be5691.js";window.CTFd=o;window.Alpine=d;d.start();
1 change: 0 additions & 1 deletion static/assets/page.2f07bf20.js

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading