Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
Automatické vyhodnocování odpovědních dotazníkových formulářů - The Garbage Collectors
Manage
Activity
Members
Labels
Plan
Wiki
Redmine
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
ASWI
ASWI 2024
Automatické vyhodnocování odpovědních dotazníkových formulářů - The Garbage Collectors
Merge requests
!16
issue
#11224
Příprava python api
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
issue
#11224
Příprava python api
api_prepare_endpoints
into
main
Overview
0
Commits
6
Pipelines
4
Changes
5
Closed
David Šavel
requested to merge
api_prepare_endpoints
into
main
11 months ago
Overview
0
Commits
6
Pipelines
4
Changes
5
Expand
1
0
Merge request reports
Compare
main
version 1
b088153b
11 months ago
main (base)
and
latest version
latest version
a810e2bc
6 commits,
11 months ago
version 1
b088153b
2 commits,
11 months ago
5 files
+
171
−
23
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
5
Search (e.g. *.vue) (Ctrl+P)
ai/src/api/api_gateway.py
0 → 100644
+
39
−
0
Options
from
flask
import
Flask
,
request
,
jsonify
from
ai.src.generator_handler
import
generate_sheets
app
=
Flask
(
__name__
)
@app.route
(
'
/get_print_data
'
,
methods
=
[
'
POST
'
])
def
get_data
():
file_data
=
request
.
get_json
()
generate_sheets
(
file_data
)
return
jsonify
({
'
message
'
:
'
JSON file processed successfully
'
})
@app.route
(
'
/test_evaluation
'
,
methods
=
[
'
POST
'
])
def
evaluate_answers
():
if
'
file
'
not
in
request
.
files
:
return
jsonify
({
'
error
'
:
'
No file part
'
})
file
=
request
.
files
[
'
file
'
]
if
file
.
filename
==
''
:
return
jsonify
({
'
error
'
:
'
No selected file
'
})
if
file
and
file
.
filename
.
endswith
(
'
.pdf
'
):
file
.
save
(
'
naskenovane.pdf
'
)
# Extract text from the PDF
# Convert text to JSON
json_data
=
{
'
text
'
:
'
answers
'
}
return
jsonify
(
json_data
)
else
:
return
jsonify
({
'
error
'
:
'
Invalid file format. Please upload a PDF file
'
})
if
__name__
==
'
__main__
'
:
app
.
run
(
debug
=
True
)
Loading