Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Layout changes extra checks #420

Merged
merged 19 commits into from
May 13, 2024
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
3 changes: 2 additions & 1 deletion backend/api/serializers/project_serializer.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@ def validate(self, attrs):
raise ValidationError(gettext("project.errors.context"))

# Check if start date of the project is not in the past
if "start_date" in attrs and attrs["start_date"] < timezone.now().replace(hour=0, minute=0, second=0):
if "start_date" in attrs and not self.partial and \
attrs["start_date"] < timezone.now().replace(hour=0, minute=0, second=0):
raise ValidationError(gettext("project.errors.start_date_in_past"))

# Set the start date depending on if it is a partial update and whether it was given by the user
Expand Down
3 changes: 1 addition & 2 deletions frontend/src/assets/lang/app/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
"max_score": "Maximum score that can be achieved",
"visibility": "Make project visible to students",
"scoreVisibility": "Make score, when uploaded, automatically visible to students",
"bashUpload": "Upload a bash script for automatic testing",
"submissionStructure": "Structure of how a submission should be made",
"noStudents": "No students in this group",
"locked": "Closed",
Expand All @@ -83,7 +82,7 @@
"dockerImage": "Docker image",
"timeLimit": "Time limit for execution (in seconds)",
"memoryLimit": "Memory limit for execution (in MB)",
"showLog": "Show logfile to students"
"showLog": "Making the extra logs of the docker container visible to the students"
}
},
"submissions": {
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/assets/lang/app/nl.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
"dockerImage": "Docker image",
"timeLimit": "Tijdslimiet voor de uitvoering (in seconden)",
"memoryLimit": "Geheugenlimiet voor de uitvoering (in MB)",
"showLog": "Toon logbestand aan studenten"
"showLog": "Maak de extra logs van de docker container zichtbaar voor de studenten"
}
},
"submissions": {
Expand Down
21 changes: 11 additions & 10 deletions frontend/src/components/projects/ExtraChecksUpload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -178,14 +178,15 @@ onMounted(async () => {
<!-- List with the extra checks -->
<DataView :value="extraChecksList" data-key="id" v-if="extraChecksList.length > 0">
<template #list="slotProps">
<div
v-for="(item, index) in slotProps.items"
:key="index"
class="flex align-items-center justify-content-between mr-6"
>
<p class="text-lg font-semibold">{{ item.name }}</p>

<Button icon="pi pi-times" class="p-button p-button-danger" @click="extraChecksList.splice(index, 1)" />
<div v-for="(item, index) in slotProps.items" :key="index">
<div class="flex align-items-center justify-content-between">
<p style="max-width: 300px">{{ item.name }}</p>
<Button
icon="pi pi-times"
class="p-button-danger p-button-sm"
@click="extraChecksList.splice(index, 1)"
/>
</div>
</div>
</template>
</DataView>
Expand Down Expand Up @@ -277,8 +278,8 @@ onMounted(async () => {

<!-- Visibility of the log files for students -->
<div class="grid">
<div class="flex align-items-center field-checkbox col-12">
<InputSwitch id="showLog" v-model="form.showLog" />
<div class="field-checkbox col-12">
<InputSwitch id="showLog" v-model="form.showLog" style="min-width: 50px" />
<label for="showLog">{{ t('views.projects.extraChecks.showLog') }}</label>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/projects/CreateProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ async function submitProject(): Promise<void> {

<div class="col-12 lg:col-6 checks">
<!-- Extra checks upload -->
<div class="field col">
<label for="extraChecks">{{ t('views.projects.extraChecks.title') }}</label>
<div class="field col-8">
<label for="extraChecks" class="mr-4">{{ t('views.projects.extraChecks.title') }}</label>
<ExtraChecksUpload
id="extraChecks"
:create-checks-backend="createExtraChecksBackend"
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/views/projects/UpdateProjectView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ async function submitProject(): Promise<void> {

<div class="col-12 lg:col-6 checks">
<!-- Extra checks upload -->
<div class="field col">
<label for="extraChecks">{{ t('views.projects.extraChecks.title') }}</label>
<div class="field col-8">
<label for="extraChecks" class="mr-4">{{ t('views.projects.extraChecks.title') }}</label>
<ExtraChecksUpload
id="extraChecks"
:create-checks-backend="createExtraChecksBackend"
Expand Down