Skip to content

Commit 2a21a5a

Browse files
authored
Added CTF flag (#353)
adding ctf flag
1 parent c0e1e00 commit 2a21a5a

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

frontend/src/components/FilterModal/FilterModal.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,15 @@ export default function FilterModal({
105105
}
106106
});
107107

108+
// Show secret message if specific filters are selected
109+
if (
110+
selectedFaculties.includes("Arts") &&
111+
selectedTerms.includes("-1") &&
112+
selectedTerms.includes("-2")
113+
) {
114+
alert("Alss aol zlhyjo ihy...");
115+
}
116+
108117
setFilters({ faculties: selectedFaculties, terms: selectedTerms });
109118

110119
setOpen(false);

frontend/src/components/ReviewModal/ReviewModal.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import {
1010
useContext,
1111
useMemo,
1212
useState,
13+
useEffect,
1314
} from "react";
1415
import ReviewRatingInput from "../ReviewRatingInput/ReviewRatingInput";
1516
import { validatedReq } from "@/utils/request";
@@ -40,6 +41,13 @@ export default function ReviewModal({
4041
const [isOpen, setIsOpen] = useState(false);
4142
const { setAlert } = useContext(AlertContext);
4243

44+
// Show secret message if the review modal is open for the right course
45+
useEffect(() => {
46+
if (isOpen && courseCode === "ARTS2821") {
47+
alert("aSdtIGxvb2tpbmcgZm9yIGEgZmxhZyE=");
48+
}
49+
}, [isOpen, courseCode]);
50+
4351
// States: Modal Inputs
4452
const defaultInputs = {
4553
overallRating: null,

frontend/src/components/SearchBar/SearchBar.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ export default function SearchBar({
1313

1414
const handleOnChange = useCallback(
1515
debounce((event: ChangeEvent<HTMLInputElement>) => {
16+
// Check if user entered the secret phrase
17+
if (event.target.value.trim().toLowerCase() === "i'm looking for a flag!") {
18+
alert("Congrats! You found the flag: RCR{leave_a_review}!");
19+
}
1620
onSearchChange(event.target.value.trim().replaceAll(" ", "%20"));
1721
}, 300),
1822
[]

0 commit comments

Comments
 (0)