Skip to content

Commit

Permalink
remove comments
Browse files Browse the repository at this point in the history
  • Loading branch information
StackSurfer committed Dec 9, 2023
1 parent 3f659a9 commit 5539d80
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 21 deletions.
2 changes: 0 additions & 2 deletions components/Reported-Tasks/QuizInfo.vue
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
<template>
<div class="flex flex-col items-start gap-3 py-2">
<!-- Information: Quiz Question -->
<div>
<p class="text-xl mb-1 text-white">{{ t("Headings.Quiz") }}</p>
<p>
<span> {{ t("Headings.Question") }}: </span>{{ mcq?.question ?? "" }}
</p>
</div>

<!-- Information: Quiz Options -->
<div>
<p class="text-xl mb-2 text-white">{{ t("Headings.Options") }}</p>
<div class="flex flex-col gap-2">
Expand Down
7 changes: 1 addition & 6 deletions components/Reported-Tasks/Table.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

<template #reason="{ item }">
<chip class="w-fit">
<!-- AddLocale: reason-enums -->
{{ item?.reason ?? "" }}
</chip>
</template>
Expand Down Expand Up @@ -112,12 +113,6 @@
function onclickEditItem(item: ReportBase) {
reportedTask.value = item;
if (Boolean(!item) || Boolean(!item.id)) return;
// Todo: remove this unrelated stuff -> all info is already in reportedTask
// Todo: I have to edit and remove reportReasen & type everywhere it's used
const reportReason = useReportReason();
reportReason.value = item?.comment ?? "";
const reportSubtaskType = useReportSubtaskType();
reportSubtaskType.value = item?.subtask_type ?? "";
router.push(
`/dashboard/reported-tasks/${item.id}?taskId=${item.task_id}&subtaskId=${item.subtask_id}`
);
Expand Down
3 changes: 0 additions & 3 deletions composables/reportedSubtasks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,6 @@ export async function assignReportUser() {
}

export async function resolveReport(report_id: any, body: any) {
// Todo: edit this so i can choose between block reporter, block creator, revise
// Todo: edit body arg -> get RESOLVE enum and build body from that
try {
const res = await PUT(`/challenges/subtask_reports/${report_id}`, body);
return [res, null];
Expand All @@ -140,7 +138,6 @@ export async function resolveReport(report_id: any, body: any) {
}

export async function getCodingChallenge(task_id: any, subtask_id: any) {
// Bug: this does not work for coding-challenges
try {
const res = await GET(
`/challenges/tasks/${task_id}/coding_challenges/${subtask_id}`
Expand Down
11 changes: 1 addition & 10 deletions pages/dashboard/reported-tasks/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
</section>
<div class="flex flex-wrap xl:flex-nowrap justify-center">
<div class="w-1/3 p-3 min-w-[400px] flex-grow xl:flex-grow-0">
<!-- Todo: add task-type -->
<!-- Information: Report Info -->
<p class="text-xl text-white">{{ t("Body.reportInformation") }}</p>
<p class="text-md text-white">
{{ t("Body.taskType") }}:
Expand Down Expand Up @@ -102,7 +100,6 @@
:loading="loadingCorrect"
@click="fnResolveReport(RESOLVE.BLOCK_CREATOR), (loadingCorrect = true)"
>
<!-- Information: Block-creator -->
{{ t("Buttons.blockCreator") }}
</InputBtn>
</section>
Expand Down Expand Up @@ -131,7 +128,6 @@
const { t } = useI18n();
const route = useRoute();
const router = useRouter();
const reportSubtaskType: any = useReportSubtaskType(); // Todo: remove this -> is not needed
const codingChallengeSolution: any = useCodingChallengeSolution();
const reportId = computed(() => {
return route.params?.id ?? "";
Expand Down Expand Up @@ -191,15 +187,12 @@
if (
reportedTask.value.subtask_type === TASK_TYPE.MULTIPLE_CHOICE_QUESTION
) {
// Information: Multiple Choice Question
const [success, error] = await getMcq(task_id.value, subtask_id.value);
if (error) {
openSnackbar("error", error ?? "");
router.push("/dashboard/reported-tasks");
}
} else if (reportedTask.value.subtask_type === TASK_TYPE.MATCHING) {
// Information: Matching
console.log("matching");
const [success, error] = await getMatching(
reportedTask.value.task_id,
reportedTask.value.subtask_id
Expand All @@ -209,17 +202,15 @@
router.push("/dashboard/reported-tasks");
}
} else if (reportedTask.value.subtask_type === TASK_TYPE.CODING_CHALLENGE) {
// Information: Coding Challenge
const [success, error] = await getCodingChallenge(
task_id.value,
subtask_id.value
);
if (error) {
openSnackbar("error", error ?? "");
// router.push("/dashboard/reported-tasks");
router.push("/dashboard/reported-tasks");
}
} else if (reportedTask.value.subtask_type === TASK_TYPE.QUESTION) {
// Information: Question
console.log("question");
}
});
Expand Down

0 comments on commit 5539d80

Please sign in to comment.