Welcome to the Grenz-er-fahrung!¶
As part of the WirvsVirus hackathon we join the fight against COVID-19.
The last couple of weeks were defined by the spread of the virus around the world. Europe, in particular, rapidly became the epicenter of the current epidemic. As a consequence, borders throughout Europe were closed in a rush leading to heavy traffic jams. Europe’s free and borderless market, risks being halted due to merchants, commuters, and truckers being stuck attempting to cross a border.
For this weekend we chose to hack together a prototype app that allows officials to provide questionnaires digitally, enabling border crossers to answer questions in advance and reduce the work of border policemen. Checkout our video on YouTube to see what we have achieved!
Introduction¶
Consider the following user story:
A truck driver delivering goods throughout Europe
On his journey, the truck driver travels from country A to B but does not speak the language spoken in country B fluently.
How can the time of the border crossing be minimized?
A policeman of country B at the border will want to know the truck driver’s identity, his destination, and reasons for travel. Most of the time will be lost communicating and answering questions while overcoming the language barrier.
Note
What if the truck driver could answer the questions in advance, in his own language?
The time it would take for the policeman to verify the answers would be only a fraction of the time it currently takes and seriously reduces traffic jams all over Europe’s closed borders.

Mock Up of the questions a person crossing the border from Germany to Switzerland might answer answer using our application.¶
Application¶
We took this scenario as a guideline for our application and decided to write the following tools:
A questionnaire generator allowing officials to upload and distribute questionnaires to people who want to cross their border.
A client webapp that allows anyone to answer the questions in their own language and generate a QR-Code containing the answers as a URL.
A website containing the answers in the policeman’s language.
Therefore allowing policemen to get answers to all questions they are supposed to ask just by scanning a QR-Code!
In the following the details of our implementation are documented.
Questionnaire Generator¶
The questionnaire generator is a simple qt based python program that allows officials to generate questionnaires in the shape of a JSON File. The JSON File contains questions and language information.

Image of the Questionnaire Generator¶
project.dict_generator module¶
Summary¶
Functions:
Add language dialog to left window. |
|
Go into inspection mode. |
|
Change view. |
|
Initialize a new dict. |
|
Create a new table. |
|
Fill new language adding it to the dict_state. |
|
Forward button when adding new language. |
|
Open dialog to add a new dictionary and start with entering a new language. |
|
Switch to new dict dialog window. |
|
Forward button when adding new language. |
|
Open a file dialog to read json dict from file. |
|
Back button when adding new language. |
|
Open a file dialog to save json dict to file. |
|
Go into inspection mode. |
|
Update language table. |
|
Updated table. |
|
Write |
Border Crosser Webapp¶
The border crosser’s web app consists of only one website that, once opened, downloads the correct questionnaire and allows us to generate the resulting QR-Code without any further internet connection.
Our current state looks like this:

Image of the Border Crosser App¶
This is how we imagine the app to be used on a mobile device:
Border Police Website¶
Encoded in the QR code is an URL containing all answers of the border crosser. The border police can then simply scan the QR code and open the website to see the answers on her/his device.

Image of the Police Website¶
Backend: Connecting the Pieces¶
A flask webserver connects the individual parts of our application. A flask web server is used to serve the questionnaire to border crossers and answers the requests that are triggered when the border police scan’s a QR code.
project.questionaire module¶
Summary¶
Classes:
hols a localized question |
|
hold the description of a question |
|
holds all relevant data of a questionaire |
Reference¶
-
class
project.questionaire.
Questionaire
(global_id, language_map, questions)[source]¶ Bases:
object
holds all relevant data of a questionaire
-
global_questionaire_id
= ''¶
-
__init__
(global_id, language_map, questions)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
language_map
= {}¶
-
questions
= []¶ initialization
:paran str global_id – the globally unique identifier of this questionaire. This is needed to connect questionaires with anwsers. :param dict language_map – (dict of str: (str: str)) – containes the text-snippets used in this questionaire in every supported language. The mapping is “language” -> “id” -> “text :param list questions – (list of Question)the actual questions in the questionaire
-
-
class
project.questionaire.
Question
(question_id, anwser_type, options=[])[source]¶ Bases:
object
hold the description of a question
-
__init__
(question_id, anwser_type, options=[])[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
question_id
= ''¶
-
anwser_type
= ''¶
-
options
= []¶ initialization
:param str question_id – the identifier of the question. This is needed to idenitify the corresponing question test stored in the Questionaire’S language_map and associate questions with anwsers :param str anwser_type – which kind of anwser is expected (string, date, PLZ,…) :param list options – optional (array of strings) specifies all possible anwsers
-
-
class
project.questionaire.
LocalizedQuestion
(question, question_text, options_texts)[source]¶ Bases:
project.questionaire.Question
hols a localized question
-
__init__
(question, question_text, options_texts)[source]¶ Initialize self. See help(type(self)) for accurate signature.
-
question_text
= ''¶
-
options_texts
= []¶ initialization
:param Question question – the question :param str question_text – the text of the question :param options_texts – (list of str) the texts of the options
-