Welcome to Spytopia

Evelyn Liu

Demo Interface

Interface

Demo screenshots for 2 Run-throughs.

Interface Interface2

Video of Robotic Demo

C++ Coding of Demo

#include <string> #include #include #include #include #include using namespace std; //compile command: g++ `myro-cpp-config --cflags` demo.cpp `myro-cpp-config --libs` -o demo int main() { ifstream problemSet("ProblemSet.txt"); /*Problem set format: line 1: problem 1 line 2: misspelled letter in 1 line 3: problem 2 line 4: misspelled letter in 2 etc. */ if(problemSet.fail()) { cout << "Problem set did not open correctly."; return 1; } ofstream wrongAnswers("WrongAnswers.txt"); //records #wrong answers per question til correct ofstream timeDoc("TimeDoc.txt"); //records how much time it takes to answer questions if(!wrongAnswers.is_open()) { cout << "WrongAnswers.txt did not open correctly."; return 1; } if(!timeDoc.is_open()) { cout << "TimeDoc.txt did not open correctly."; return 1; } // wrongAnswers << "New user: "; GraphWin interface("Interface", 550, 390); PicturePtr bg = loadPicture("interface.jpg"); // background = interface img interface.setBackground(bg); cout << "HI" << endl; string problemText; getline(problemSet, problemText);//stores new problem string correctAnswer; getline(problemSet, correctAnswer); //the misspelled letter string commentText = ""; //gives user feedback if their answer's right or wrong. bool startGame = false; int numberOfWrongAnswers = 0; time_t startTime; double previousTimer = 0; //to store temporary time for each answer so it can be subtracted. time_t endTime; while(!interface.isClosed()) { // if(click.getX()>525 && click.getX() < 550 && click.getY()> 0 && click.getY()<21) // interface.close();//quits if presses x if(!startGame) { Point click = interface.getMouse(); if(click.getX()>380 && click.getX() < 523 && click.getY()>32 && click.getY()<100) { startGame = true; //starts game if presses button time(&startTime); } } else { Point commentCoord(290, 285); Text comment(commentCoord, commentText); comment.setSize(16); comment.setTextColor("red"); comment.draw(interface); //update comment Point problemCoord(42,312);//position of the problem Text problem(problemCoord, problemText); problem.setSize(38); problem.setTextColor("black"); problem.draw(interface); string answer; cout << "Enter misspelled letter here then press 'Enter': "; cin >> answer; if(answer == correctAnswer) // correct answer { wrongAnswers << numberOfWrongAnswers << "\t"; commentText = "Correct! Moving onto next question."; numberOfWrongAnswers = 0; getline(problemSet, problemText); //update problem getline(problemSet, correctAnswer); //update answer time(&endTime); double timer = difftime(endTime, startTime); timeDoc << timer - previousTimer; // time per question in seconds previousTimer = timer; if(problemText == "Complete") { timeDoc << "Total Time: " << timer << " seconds" << endl; interface.close(); } } else { commentText = "Wrong!"; numberOfWrongAnswers++; } problem.undraw(); comment.undraw(); } } // interface.waitWinClosed(); // connect(); // disconnect(); wrongAnswers.close(); problemSet.close(); }

HW 6: Design Document

1. Write a description of your CS topic that you are trying to teach/demonstrate.

The topic is security, and using computer science to battle against any encrypted messages. I will be demonstrating the time sensitivity of decrypting information and also using English as the theme of encryption, while my partners would use math, science, and history. I will use misspelled words as my English topic.

2. Write a description of how your program will engage the user.

There will be a pop up window with questions or statements that include spelling mistakes. The objective is to find 10 mistakes before the time bomb goes off. For multiplayer mode, the objective is to race with the other robots to get to the finish line first.

3. Describe your process for developing your human--computer interface

I will have to make a pop up window first. Then, I will have to figure out how to put text in it. Then, I need to add in an input box where users could put in their answers. I will also need another section in the window to display correct answers to the hang-man word/phrase/message that will be completed to stop the time bomb. I also need to generate questions and randomize their order. I will have to adjust the number of questions to be generated for each user so that they can possibly complete the message under 2 minutes.

4. Describe how you will evaluate your human--computer interface.

I will have my friends try out the interface before presenting it to the middle schoolers. If my friends find it easy to use, then it should work for the kids, too.

5. Describe how you will evaluate the user's interaction.

I can collect how many wrong answers it took for them to answer each question. This might test their patience. I will record the time if the time bomb does not go off, and also how long it took them to answer each question. I will also record which question number they're on. I will have them rate the game in the end. 1 to 5 stars.

6. Write a description of how your program will collect user interaction information

Every time you type in a wrong answer and submit it per question, the number of wrong answers will recorded into an array in the order of the questions. In the end, everything will be outputted into a file. It will also have a timer that will start running as soon as the user presses start. And the time will also be recorded into an array per question. In the end, it checks if the bomb goes off. If not, then it also records the end time. (Or it could just record 1 minutes, which would indicate game over.) If the bomb goes off, the number of questions answered will be recorded.

7. How will you generate an evaluation report based on the user data collected?

Since the questions are not arranged in difficulty, I can come up with a table of average time per question, average wrong answers per question, and also time of completion and questions answered for every single user. Combine them into an output file. I could also make them into a bar graphs.

Thoughts on my design:

I could also make them into bar graphs, but I think just the data table itself is the best because I can use it to find out a lot of different statistics. Maybe bar graphs are not the best way to go because they cannot really say much. We can see more pattern from just looking at the table of numbers of wrong answers and the time it takes to complete each question for each user.

When I was trying out the demo today, I felt like my questions were too hard, so I changed all my questions to easier versions immediately. I am glad I had a problem set file and that everything was flexible.