Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
hektor
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
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
hektor
Commits
a43082d0
There was a problem fetching the pipeline summary.
Verified
Commit
a43082d0
authored
7 years ago
by
Jan Maximilian Michal
Browse files
Options
Downloads
Patches
Plain Diff
Readable code now disabled by default.
parent
68872e76
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hektor.py
+13
-2
13 additions, 2 deletions
hektor.py
lib/qti.py
+3
-3
3 additions, 3 deletions
lib/qti.py
with
16 additions
and
5 deletions
hektor.py
+
13
−
2
View file @
a43082d0
...
...
@@ -97,7 +97,6 @@ def setup_argparse():
parser
.
add_argument
(
'
-r
'
,
'
--readable-code
'
,
action
=
'
store_true
'
,
default
=
True
,
help
=
'
make student code readable by inserting artificial line breaks
'
)
args
=
parser
.
parse_args
()
...
...
@@ -166,10 +165,22 @@ def do_verify(structured_data: Dict[str, Any]) -> Dict[str, Any]:
assert
'
students
'
in
structured_data
,
'
No students found
'
assert
'
tasks
'
in
structured_data
,
'
No tasks found
'
def
assert_task
(
task
):
assert
'
type
'
in
task
,
'
Task has no type
'
assert
'
title
'
in
task
,
'
Task must have a title
'
try
:
base_assert
()
students
=
structured_data
[
'
students
'
]
number_of_submissions
=
len
(
structured_data
[
'
tasks
'
])
tasks
=
structured_data
[
'
tasks
'
]
number_of_submissions
=
len
(
tasks
)
for
task
in
tasks
:
try
:
assert_task
(
task
)
except
AssertionError
as
err
:
raise
err
for
student
in
students
:
try
:
...
...
This diff is collapsed.
Click to expand it.
lib/qti.py
+
3
−
3
View file @
a43082d0
...
...
@@ -69,10 +69,10 @@ def process_results(tree, qti=(), **kwargs):
id2user
=
{
user
[
'
active_id
'
]:
user
for
user
in
users
}
for
user
in
users
:
user
[
'
submissions
'
]
=
[]
for
question
in
questions
:
solutions
=
process_solutions
(
tree
,
question
)
for
question_key
,
question
in
questions
.
items
()
:
solutions
=
process_solutions
(
tree
,
question
_key
)
for
user_id
,
solution
in
solutions
.
items
():
id2user
[
user_id
][
'
submissions
'
].
append
({
'
type
'
:
question
,
id2user
[
user_id
][
'
submissions
'
].
append
({
'
type
'
:
question
[
'
title
'
]
,
'
code
'
:
solution
,
'
tests
'
:
{}})
return
users
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment