Skip to content

Commit

Permalink
Lint code
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick11514 committed Oct 5, 2024
1 parent e240034 commit 6b59cca
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 47 deletions.
4 changes: 2 additions & 2 deletions api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def tasks_list(request):
)
return JsonResponse({"tasks": result})


def tasks_list_all(request: HttpRequest):
result = []
filters = {}
Expand All @@ -78,7 +79,6 @@ def tasks_list_all(request: HttpRequest):
if "search" in request.GET:
filters["name__icontains"] = request.GET["search"]


if len(filters) == 0:
tasks = Task.objects.all()
else:
Expand All @@ -90,7 +90,7 @@ def tasks_list_all(request: HttpRequest):

if start is not None:
tasks = tasks[start:]

if count is not None:
tasks = tasks[:count]

Expand Down
1 change: 0 additions & 1 deletion common/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ class Task(models.Model):
plagiarism_key = models.CharField(max_length=255, null=True)
created_at = models.DateTimeField(auto_now_add=True)


def path_to_code(path):
path = os.path.realpath(os.path.abspath(path))
return os.path.relpath(path, os.path.abspath("./tasks"))
Expand Down
81 changes: 42 additions & 39 deletions frontend/src/components/Loader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,54 +7,57 @@ const unit = 'px';
</script>

<template>
<div v-for="i in generateRange(3, 1)" :key="i" class="wrapper" :style="`--size:${size}${unit}`">
<div class="dot" :style="`--dotSize:${size * 0.25}${unit}; --color:${color}; animation-delay: ${i * 0.07}s;`" />
</div>
<div v-for="i in generateRange(3, 1)" :key="i" class="wrapper" :style="`--size:${size}${unit}`">
<div
class="dot"
:style="`--dotSize:${size * 0.25}${unit}; --color:${color}; animation-delay: ${i * 0.07}s;`"
/>
</div>
</template>

<style scoped>
.wrapper {
height: var(--size);
width: var(--size);
display: flex;
align-items: center;
justify-content: center;
height: var(--size);
width: var(--size);
display: flex;
align-items: center;
justify-content: center;
}
.dot {
height: var(--dotSize);
width: var(--dotSize);
background-color: var(--color);
margin: 2px;
display: inline-block;
border-radius: 100%;
animation: sync 0.6s ease-in-out infinite alternate both running;
height: var(--dotSize);
width: var(--dotSize);
background-color: var(--color);
margin: 2px;
display: inline-block;
border-radius: 100%;
animation: sync 0.6s ease-in-out infinite alternate both running;
}
@-webkit-keyframes sync {
33% {
-webkit-transform: translateY(10px);
transform: translateY(10px);
}
66% {
-webkit-transform: translateY(-10px);
transform: translateY(-10px);
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
33% {
-webkit-transform: translateY(10px);
transform: translateY(10px);
}
66% {
-webkit-transform: translateY(-10px);
transform: translateY(-10px);
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
@keyframes sync {
33% {
-webkit-transform: translateY(10px);
transform: translateY(10px);
}
66% {
-webkit-transform: translateY(-10px);
transform: translateY(-10px);
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
33% {
-webkit-transform: translateY(10px);
transform: translateY(10px);
}
66% {
-webkit-transform: translateY(-10px);
transform: translateY(-10px);
}
100% {
-webkit-transform: translateY(0);
transform: translateY(0);
}
}
</style>
7 changes: 2 additions & 5 deletions web/views/teacher.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from notifications.signals import notify

from common.evaluate import evaluate_submit, get_meta
from common.models import AssignedTask, Class, Subject, Submit, Task, assignedtask_results
from common.models import AssignedTask, Class, Submit, Task, assignedtask_results
from common.plagcheck.moss import PlagiarismMatch
from common.utils import is_teacher
from evaluator.results import EvaluationResult
Expand Down Expand Up @@ -308,10 +308,7 @@ def download_csv_per_class(request, class_id: int):

@user_passes_test(is_teacher)
def all_tasks(request):
return render(
request,
"web/all_tasks.html"
)
return render(request, "web/all_tasks.html")


@user_passes_test(is_teacher)
Expand Down

0 comments on commit 6b59cca

Please sign in to comment.