These past few months of social distancing and quarantine has lead us to feel isolated from the outside world. This "cabin fever," hence the name of our project, is what inspired us to create a pen pal matching service with prompts and activities to facilitate remote cultural immersion. We wanted a way to connect and travel without posing a risk to others.

What it does

Cabin Fever has two parts: a quiz and prompts. The quiz matches you with 2-3 potential pen pals based on the preferences you select, while the prompts inspire deeper discussion on current issues, culture, and feelings amidst a global pandemic.

How we built the quiz

The quiz is an HTML form that is connected to a php file through a Jquery ajax post method. The first two questions ask for your name and email and are just there to identify you and provide contact info. The next two questions ask for languages you are fluent in and languages you are learning. The php will separate your input to these two questions by whitespaces or commas, convert them to indices of a constant language name array, and create two arrays, one for fluent languages and the other for learning languages. Then, it will check each User in the database and add only Users that share either a fluent language or learning language in common with either the inputted fluent languages or learning languages. These Users will be added to the possible matches array. Then, the form will assign a distance to each possible match in the database based on the data from the last 2 questions. Each possible User match in the database in addition to the current form inputter can be represented by a position in 7 dimensional space.The question that asks how frequent you would like to talk with your pen pal has 4 options, so its answer can be represented by 0, 1, 2, or 3, with higher values corresponding to less frequent conversations. This value will be the first element of the position array for the form inputter. The last question asks what interests you have, and since you can select any combination of the 6 interests, this question can be represented by 6 binary values. These 6 binary values will be put into the position array as either 0 or 1, making the position array have 7 dimensions. After calculating the position array for the form inputter, the code will go through each User in the list of possible matches and calculate the distance from the User to the form inputter. Distance between 2 position arrays will be calculated as the Euclidean distance between each corresponding element in the 2 position arrays. Then the code will sort this array by increasing distance. Finally, the code will use this sorted array to output the K closest users' names and emails.

How we built the start talking page

I created an array to represent the potential values for each of the discussion question, activity, and video buttons. When one of these buttons was clicked, I made the code trigger a function that would randomly generate an index i and then through jQuery append the ith element of the array to the content display (or replace the content in the case of the video button).

Challenges we ran into

“Initially, I wanted to make it use machine learning to calculate which questions should have more weight when determining the best match for the form inputter. This could work if each user gives feedback to the website about how well they connected with their penpal, and then the neural network would adjust the weights accordingly. I didn't have enough time to implement this but in the future I could." - Zachary

"After the K closest Users were calculated in PHP, I needed to get the PHP to edit an empty HTML element to replace it with the K closest Users. I found out AJAX was a way to run javascript code based on PHP echos. I was not very familiar with AJAX, but using jQuery I could edit the HTML relatively simply.” - Zachary

"I had to figure out to make a header that is fixed on the top of the screen, and how to make an array of embedded youtube videos." - Zoe

Accomplishments we’re proud of

“I’m proud of the jQuery AJAX that I used to run JavaScript.” - Zachary

“I’m proud of my jQuery DOM manipulation and the p5.js animation.” - Zoe

What's next for Cabin Fever

We would really like to implement machine learning like mentioned in the Challenges section. We also would like to implement a sign in feature so we can save user data.

Share this project: