Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
grady
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan Maximilian Michal
grady
Compare revisions
e3736f4346711e472f2b4638f7a9a0ca651f01ce to 150f024eb846ba28b6f3f4a61b65883243587440
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
j.michal/grady
Select target project
No results found
150f024eb846ba28b6f3f4a61b65883243587440
Select Git revision
Branches
169-add-date-to-examtype
233-make-exam-a-many-to-many-field-on-studentinfo-model
236-improve-importer-experience
243-replace-toggle-buttons-with-switches
250-update-vuetify
258-add-markdown-viewer
265-fix-selection-changing-on-window-switching
272-reviewers-should-be-able-to-assign-exercise-groups-to-tutors
276-create-new-yarn-lockfile
279-tutor-overview-no-scrolling
282-copy-button-does-not-work-when-reviewing-corrections
286-fix-misalignment-of-hide-show-sidebar-buttons
287-build-test-image-constantly-failing
288-add-dropdown-to-participantspage-to-set-students-groups
289-fix-change-log-card
291-revise-to-old-export-scheme
292-update-gitlab-ci-config-for-new-runner
292-update-gitlab-ci-config-for-new-runner-2
add-exercise-util-script
document-frontend-components
grady-exam
jakob.dieterle-master-patch-13835
master
parallel-test
test-233-branch-remove-examtype-foreign-key-on-group
update-export-dialogs
Tags
0.0.1
0.1
0.2
0.3
0.4
0.4.1
0.4.2
0.5.0
0.5.1
1.0.0
1.1.0
2.0.0
2.0.1
2.1.0
2.1.1
2.2.0
3.0.0
3.0.1
4.0.0
4.1.0
4.2.0
4.3.0
4.4.0
4.4.1
5.0.0
5.0.1
5.1.0
5.1.1
5.1.2
5.1.3
5.1.4
5.1.5
5.1.6
5.1.7
5.2.0
5.3.0
5.3.1
5.3.2
5.4.0
5.4.1
5.4.2
6.0.0
6.1.0
legacy
70 results
Swap
Target
j.michal/grady
Select target project
j.michal/grady
1 result
e3736f4346711e472f2b4638f7a9a0ca651f01ce
Select Git revision
Branches
169-add-date-to-examtype
233-make-exam-a-many-to-many-field-on-studentinfo-model
236-improve-importer-experience
243-replace-toggle-buttons-with-switches
250-update-vuetify
258-add-markdown-viewer
265-fix-selection-changing-on-window-switching
272-reviewers-should-be-able-to-assign-exercise-groups-to-tutors
276-create-new-yarn-lockfile
279-tutor-overview-no-scrolling
282-copy-button-does-not-work-when-reviewing-corrections
286-fix-misalignment-of-hide-show-sidebar-buttons
287-build-test-image-constantly-failing
288-add-dropdown-to-participantspage-to-set-students-groups
289-fix-change-log-card
291-revise-to-old-export-scheme
292-update-gitlab-ci-config-for-new-runner
292-update-gitlab-ci-config-for-new-runner-2
add-exercise-util-script
document-frontend-components
grady-exam
jakob.dieterle-master-patch-13835
master
parallel-test
test-233-branch-remove-examtype-foreign-key-on-group
update-export-dialogs
Tags
0.0.1
0.1
0.2
0.3
0.4
0.4.1
0.4.2
0.5.0
0.5.1
1.0.0
1.1.0
2.0.0
2.0.1
2.1.0
2.1.1
2.2.0
3.0.0
3.0.1
4.0.0
4.1.0
4.2.0
4.3.0
4.4.0
4.4.1
5.0.0
5.0.1
5.1.0
5.1.1
5.1.2
5.1.3
5.1.4
5.1.5
5.1.6
5.1.7
5.2.0
5.3.0
5.3.1
5.3.2
5.4.0
5.4.1
5.4.2
6.0.0
6.1.0
legacy
70 results
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
util/factory_boys.py
+97
-0
97 additions, 0 deletions
util/factory_boys.py
util/format_index.py
+1
-1
1 addition, 1 deletion
util/format_index.py
util/importer.py
+8
-8
8 additions, 8 deletions
util/importer.py
with
106 additions
and
9 deletions
util/factory_boys.py
0 → 100644
View file @
150f024e
import
factory
from
factory.django
import
DjangoModelFactory
from
faker
import
Faker
from
core
import
models
fake
=
Faker
()
fake
.
seed
(
42
)
class
ExamTypeFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
models
.
ExamType
django_get_or_create
=
(
'
module_reference
'
,)
module_reference
=
'
B.Inf.4242 Test Module
'
total_score
=
90
pass_score
=
45
pass_only
=
False
class
SubmissionTypeFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
models
.
SubmissionType
name
=
factory
.
Sequence
(
lambda
n
:
f
"
[
{
n
}
] Example submission type
"
)
full_score
=
15
description
=
factory
.
Sequence
(
lambda
n
:
f
'
Type
{
n
}
\n
<h1>This</h1> is a description containing html
'
)
solution
=
factory
.
Sequence
(
lambda
n
:
f
'
//This is a solution
\n
#include<stdio.h>
\n\n
int main() {{
\n\t
printf(
"
Hello World
\\
n
"
);
\n\t
return
{
n
}
;
\n
}}
'
)
# noqa
programming_language
=
models
.
SubmissionType
.
C
class
UserAccountFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
models
.
UserAccount
django_get_or_create
=
(
'
username
'
,)
role
=
models
.
UserAccount
.
TUTOR
fullname
=
fake
.
name
username
=
fake
.
user_name
password
=
factory
.
PostGenerationMethodCall
(
'
set_password
'
,
'
redrum-is-murder-reversed
'
)
class
StudentInfoFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
models
.
StudentInfo
exam
=
factory
.
SubFactory
(
ExamTypeFactory
)
user
=
factory
.
SubFactory
(
UserAccountFactory
)
class
TestFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
models
.
Test
name
=
'
EmptyTest
'
label
=
'
Empty
'
annotation
=
factory
.
Sequence
(
lambda
n
:
f
'
Test:
{
n
}
This is an annotation
'
)
class
SubmissionFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
models
.
Submission
text
=
factory
.
Sequence
(
lambda
n
:
f
'
#include<stdio.h>
\n\n
int main() {{
\n\t
printf(
"
Hello World
\\
n
"
);
\n\t
return
{
n
}
;
\n
}}
'
)
# noqa
type
=
factory
.
SubFactory
(
SubmissionTypeFactory
)
student
=
factory
.
SubFactory
(
StudentInfoFactory
)
class
FeedbackFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
models
.
Feedback
of_submission
=
factory
.
SubFactory
(
SubmissionTypeFactory
)
class
FeedbackCommentFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
models
.
FeedbackComment
text
=
'
Well, this is bad...
'
of_tutor
=
factory
.
SubFactory
(
UserAccountFactory
)
of_feedback
=
factory
.
SubFactory
(
FeedbackFactory
)
class
SubmissionSubscriptionFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
models
.
SubmissionSubscription
owner
=
factory
.
SubFactory
(
UserAccountFactory
)
class
TutorSubmissionAssignmentFactory
(
DjangoModelFactory
):
class
Meta
:
model
=
models
.
TutorSubmissionAssignment
submission
=
factory
.
SubFactory
(
SubmissionFactory
)
subscription
=
factory
.
SubFactory
(
SubmissionSubscriptionFactory
)
This diff is collapsed.
Click to expand it.
util/format_index.py
View file @
150f024e
...
@@ -6,7 +6,7 @@ file = 'core/templates/index.html'
...
@@ -6,7 +6,7 @@ file = 'core/templates/index.html'
with
open
(
file
,
"
r+
"
)
as
f
:
with
open
(
file
,
"
r+
"
)
as
f
:
s
=
f
.
read
()
s
=
f
.
read
()
f
.
seek
(
0
)
f
.
seek
(
0
)
f
.
write
(
"
{% load static
files
%}
\n
"
+
s
)
f
.
write
(
"
{% load static %}
\n
"
+
s
)
for
i
,
line
in
enumerate
(
fileinput
.
input
(
file
,
inplace
=
1
)):
for
i
,
line
in
enumerate
(
fileinput
.
input
(
file
,
inplace
=
1
)):
sys
.
stdout
.
write
(
line
.
replace
(
'
/static/
'
,
"
{% static
'"
))
sys
.
stdout
.
write
(
line
.
replace
(
'
/static/
'
,
"
{% static
'"
))
...
...
This diff is collapsed.
Click to expand it.
util/importer.py
View file @
150f024e
...
@@ -12,7 +12,7 @@ from core.models import UserAccount as User
...
@@ -12,7 +12,7 @@ from core.models import UserAccount as User
from
util.factories
import
GradyUserFactory
from
util.factories
import
GradyUserFactory
from
util.messages
import
info
,
warn
from
util.messages
import
info
,
warn
WELCOME
=
'''
WELCOME
=
r
'''
______ __ ____ __
______ __ ____ __
/ ____/________ _____/ /_ __ / _/___ ___ ____ ____ _____/ /____ _____
/ ____/________ _____/ /_ __ / _/___ ___ ____ ____ _____/ /____ _____
/ / __/ ___/ __ `/ __ / / / / / // __ `__ \/ __ \/ __ \/ ___/ __/ _ \/ ___/
/ / __/ ___/ __ `/ __ / / / / / // __ `__ \/ __ \/ __ \/ ___/ __/ _ \/ ___/
...
@@ -67,7 +67,7 @@ class chdir_context(object):
...
@@ -67,7 +67,7 @@ class chdir_context(object):
info
(
f
'
Returned to
{
self
.
old_dir
}
'
)
info
(
f
'
Returned to
{
self
.
old_dir
}
'
)
def
i
(
prompt
:
str
,
default
:
str
=
''
,
is_path
:
bool
=
False
,
is_file
:
bool
=
False
):
def
i
(
prompt
:
str
,
default
:
str
=
''
,
is_path
:
bool
=
False
,
is_file
:
bool
=
False
):
if
default
is
YES
or
default
is
NO
:
if
default
is
YES
or
default
is
NO
:
answer
=
valid
[
input
(
f
'
[Q]
{
prompt
}
(
{
default
}
):
'
).
lower
()
or
(
answer
=
valid
[
input
(
f
'
[Q]
{
prompt
}
(
{
default
}
):
'
).
lower
()
or
(
'
y
'
if
YES
==
default
else
'
n
'
)]
'
y
'
if
YES
==
default
else
'
n
'
)]
...
@@ -196,9 +196,9 @@ def do_load_submission_types():
...
@@ -196,9 +196,9 @@ def do_load_submission_types():
$ tree -L 2
$ tree -L 2
.
.
├── code-lsg
├── code-lsg
│ ├── a01
-lsg
.c
│ ├── a01.c
│ ├── a02
-lsg.c
│ ├── a02
.java
│ └── a03
-lsg.c
│ └── a03
.hs
└── html
└── html
├── a01.html
├── a01.html
├── a02.html
├── a02.html
...
@@ -460,12 +460,12 @@ def start():
...
@@ -460,12 +460,12 @@ def start():
else
:
else
:
call_loader
(
call_order
[
int
(
fid
)])
call_loader
(
call_order
[
int
(
fid
)])
except
(
EOFError
,
KeyboardInterrupt
)
as
err
:
except
(
EOFError
,
KeyboardInterrupt
):
print
()
print
()
return
return
except
FileNotFoundError
as
err
:
except
FileNotFoundError
:
raise
raise
except
Exception
as
err
:
except
Exception
:
import
traceback
import
traceback
traceback
.
print_exc
()
traceback
.
print_exc
()
finally
:
finally
:
...
...
This diff is collapsed.
Click to expand it.
Prev
1
2
3
4
Next