Add final submission for assignment
This commit is contained in:
parent
0612daa05f
commit
b22b918d82
|
|
@ -0,0 +1,58 @@
|
||||||
|
<template>
|
||||||
|
<div class="final-submission">
|
||||||
|
<div class="final-submission__text">
|
||||||
|
{{submission.text}}
|
||||||
|
</div>
|
||||||
|
<div class="final-submission__explanation">
|
||||||
|
<info-icon class="final-submission__explanation-icon"></info-icon>
|
||||||
|
<span class="final-submission__explanation-text">Das Ergebnis wurde mit der Lehrperson geteilt</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import InfoIcon from '@/components/icons/InfoIcon';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: ['submission'],
|
||||||
|
|
||||||
|
components: {
|
||||||
|
InfoIcon
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped lang="scss">
|
||||||
|
@import "@/styles/_variables.scss";
|
||||||
|
@import "@/styles/_mixins.scss";
|
||||||
|
@import "@/styles/_functions.scss";
|
||||||
|
|
||||||
|
.final-submission {
|
||||||
|
&__text {
|
||||||
|
background-color: $color-white;
|
||||||
|
@include input-box-shadow;
|
||||||
|
border-radius: $input-border-radius;
|
||||||
|
padding: 15px;
|
||||||
|
font-size: toRem(17px);
|
||||||
|
font-family: $sans-serif-font-family;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
&__explanation {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
&__explanation-icon {
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
fill: $color-brand;
|
||||||
|
margin-right: 8px;
|
||||||
|
}
|
||||||
|
&__explanation-text {
|
||||||
|
color: $color-brand;
|
||||||
|
font-family: $sans-serif-font-family;
|
||||||
|
font-weight: 500;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -12,6 +12,11 @@
|
||||||
fill: $color-darkgrey-1;
|
fill: $color-darkgrey-1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@mixin input-box-shadow {
|
||||||
|
border: 1px solid #DBDBDB;
|
||||||
|
box-shadow: inset 0 1px 2px 0 rgba(0, 0, 0, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
@mixin skillbox-colors {
|
@mixin skillbox-colors {
|
||||||
&--yellow {
|
&--yellow {
|
||||||
background-color: $color-accent-1;
|
background-color: $color-accent-1;
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,7 @@ $brown: #EB9E77;
|
||||||
|
|
||||||
|
|
||||||
$default-border-radius: 13px;
|
$default-border-radius: 13px;
|
||||||
|
$input-border-radius: 3px;
|
||||||
|
|
||||||
//modal stuff
|
//modal stuff
|
||||||
$modal-lateral-padding: 34px;
|
$modal-lateral-padding: 34px;
|
||||||
|
|
|
||||||
|
|
@ -5,3 +5,4 @@ from graphene import InputObjectType
|
||||||
class AssignmentInput(InputObjectType):
|
class AssignmentInput(InputObjectType):
|
||||||
id = graphene.ID(required=True)
|
id = graphene.ID(required=True)
|
||||||
answer = graphene.String(required=True)
|
answer = graphene.String(required=True)
|
||||||
|
final = graphene.Boolean()
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,9 @@ class UpdateAssignment(relay.ClientIDMutation):
|
||||||
assignment = get_object(Assignment, assignment_data.get('id'))
|
assignment = get_object(Assignment, assignment_data.get('id'))
|
||||||
(submission, created) = assignment.submissions.get_or_create(student=info.context.user)
|
(submission, created) = assignment.submissions.get_or_create(student=info.context.user)
|
||||||
submission.text = assignment_data.get('answer')
|
submission.text = assignment_data.get('answer')
|
||||||
|
final = assignment_data.get('final')
|
||||||
|
if final is not None:
|
||||||
|
submission.final = final
|
||||||
submission.save()
|
submission.save()
|
||||||
return cls(updated_assignment=assignment, errors=None)
|
return cls(updated_assignment=assignment, errors=None)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue