0% found this document useful (0 votes)
401 views13 pages

User Manual

Uploaded by

weihaolixu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
401 views13 pages

User Manual

Uploaded by

weihaolixu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

USER MANUAL

JOKITOT

Abstract
A complete guide to installing and using tool 1 and tool 2

Team 21
Contents
Overview ................................................................................................................................................ 2
Installation ............................................................................................................................................. 2
1. Get Repository ............................................................................................................................ 2
2. Open a terminal in the directory where the code is stored .......................................................... 2
3. Create a virtual environment ......................................................................................................... 2
4. Open the virtual environment ....................................................................................................... 2
Using Windows PowerShell ........................................................................................................... 3
Using Windows Command Prompt ................................................................................................ 3
Using Linux/MacOS ........................................................................................................................ 3
5. Install the Required libraries .......................................................................................................... 3
6. Run the tool.................................................................................................................................... 3
Creating AWS LightSail Service ............................................................................................................. 3
Requirements ..................................................................................................................................... 3
1. Delete the virtual environment...................................................................................................... 3
2. Navigate to the folder containing the code in your terminal ........................................................ 3
3. Build docker container ................................................................................................................... 4
(Optional) Test the docker build. ................................................................................................... 4
4. Create container service ................................................................................................................ 5
5. Push image to LightSail .................................................................................................................. 5
6. Change deployment version .......................................................................................................... 6
7. Deploy the image ........................................................................................................................... 6
8. Check status ................................................................................................................................... 6
9. Open website ................................................................................................................................. 7
(Optional) Delete container................................................................................................................ 8
Updating AWS LightSail ......................................................................................................................... 8
1. Download the new code from the repository ............................................................................... 8
2. Follow the steps from create AWS LightSail service ...................................................................... 9
Tool 1 ...................................................................................................................................................... 9
File Upload ......................................................................................................................................... 9
Interaction Menu ............................................................................................................................... 9
Multiple Documents Analysis .......................................................................................................... 10
Tool 2 .................................................................................................................................................... 11
At a glance ........................................................................................................................................ 11
Upload Your CSV File: ................................................................................................................... 11
Choose Your Analysis: .................................................................................................................. 11

Overview
Jokitot is a plagiarism detection tool consisting of two tools. Tool 1 is designed to analyse word documents and
present its metadata. Tool 2 is designed to detect contract cheating using lms logs to determine the location of
users from their IP addresses.

The GitHub repo to the code can be found at https://github.com/lujor20/CITS3200_Project

Installation
1. Get Repository
This step is to get the latest code from the repository, which can be done by a command in the
terminal:
git clone https://github.com/lujor20/CITS3200_Project.git
Or by downloading the zip file by going to the website https://github.com/lujor20/CITS3200_Project and clicking
the download zip button under the button “Code”.

2. Open a terminal in the directory where the code is stored


For example, my terminal is in the directory called CITS3200_Project

3. Create a virtual environment


This creates a virtual environment to run the code in.
python3 -m venv dev-env

4. Open the virtual environment


The next step is to enter the virtual environment. A different version of the same command will
need to be run depending on the type of terminal used.
Using Windows PowerShell
dev-env\Scripts\Activate.ps1
Using Windows Command Prompt
dev-env\bin\activate.bat
Using Linux/MacOS
source dev-env/bin/activate

5. Install the Required libraries


This will install all dependencies the code needs to run. It will take approximately 3 to 5 minutes.
pip install -r requirements.txt

6. Run the tool


flask run

Creating AWS LightSail Service


Note: This is not required to run the code on a single machine!! This will deploy the website using AWS so the
website can be accessed by anyone.
Requirements
For the tool to be deployed using LightSail, the requirements needed are:
• AWS account
o https://aws.amazon.com/getting-started/guides/setup-environment/
o You will need to use a debit/credit card when creating your account.
• Configured AWS Command Line Interface (CLI)
o https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
• Docker installation
o https://docs.docker.com/engine/install/
• LightSail control (lightsailctl) plugin
o https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-install-software

Note: If installing on a university computer, you will need to contact the University IT department for temporary
admin privileges to install the above requirements

Once all the requirements are installed and the code within this repo downloaded, we can start the steps below.

1. Delete the virtual environment

We will no longer need the virtual environment since building the docker container will download all the
requirements again.

Delete the folder called dev-env from the folder containing the code. If you don't have this folder, skip this step.

2. Navigate to the folder containing the code in your terminal

I have my code stored in the folder CITS3200_Project


3. Build docker container

Run the command in the terminal

docker build -t flask-container .

This may take from 15 mins to 30 mins to finish.

If you see this error:

Open the docker application and run the command again.

This is what will be displayed if successful.

(Optional) Test the docker build.

To test the build, run the following command.

docker run -p 5000:5000 flask-container

Click on the http://127.0.0.1:5000 and the website should work as intended.


Close the server by clicking the stop (square) button in the docker application.

4. Create container service


This step will create a container on your LightSail account. The name of the container is
team21plagiarismdetection.

aws lightsail create-container-service --service-name


team21plagiarismdetection --power small --scale 1

If it responds with a configuration error, make sure to configure (login) to the AWS CLI first and run the command
again. (This is extremely complicated and there are guides that explains it better on the internet). See below
websites for more detail.
• https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-authentication.html
• https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-sso.html
The container will appear as "team21plagiarismdetection" in the LightSail
website https://lightsail.aws.amazon.com/ls/webapp/home/containers

The "cits3200project" container was created previously.

5. Push image to LightSail


This will upload the docker image to the AWS container. It may take from 5 mins to 10 mins.

aws lightsail push-container-image --service-name team21plagiarismdetection --


label flask-container --image flask-container

If successful, it will output:


Take a note of the output. In this case, it tells me I should refer to this image as :team21plagiarismdetection.flask-
container.7

6. Change deployment version

Open the file "containers.json" in the folder containing the code (with notepad)

Edit the line:

"image": ":cits3200project.flask-container.6"

and replace with the deployment version the terminal just outputted from the step above. In my case, this is my
new file.

7. Deploy the image


This will make the website for you. This could take from 5 mins to 10 mins.

aws lightsail create-container-service-deployment --service-name


team21plagiarismdetection --containers file://containers.json --public-
endpoint file://public-endpoint.json

8. Check status
Open the LightSail website.

https://lightsail.aws.amazon.com/ls/webapp/home/instances
Navigate to the containers and click on the container. You will see in the deployments tab (when you scroll to the
bottom) that the status is deploying.

Wait until it is active. It usually takes around 3 mins.

9. Open website
At the top of the page, there is a hyperlink labelled "public domain:".
Clicking on the link will lead you to the website.

IMPORTANT!! By having a container (either running or disabled), you will pay a monthly fee ($15 aud/month for
this one). The only way to stop paying is to delete the container, which is outlined below.

(Optional) Delete container.


To delete the container, go to the container menu on the LightSail website, click the three dots and choose
“Delete”.

This is irreversible and can only be installed again by following the instructions.

Updating AWS LightSail


Go through these steps ONLY to update LightSail to a newer version of the code.

1. Download the new code from the repository


The new version of the code can be found at:

https://github.com/lujor20/CITS3200_Project/tree/main
Click Code (Green button), then download zip.

Extract the folder from the zip format and store the folder in a permanent location.

2. Follow the steps from create AWS LightSail service

The next steps are the same as the steps to set up the AWS LightSail service EXCEPT for step 4,
which can be skipped. To clarify, follow steps 1, 2, 3, 5, 6, 7, 8 and 9.

Tool 1
File Upload
- Tool 1 allows docx document to be uploaded by clicking on the ‘Browse..’ button or by drag
and drop the file to the specified area.
- ‘Submit File’ button will start the analysis of the document uploaded by the user

Interaction Menu
- User has the ability to click on a specific part of the text and change the text’s corresponding
colour on the Interaction Menu by clicking ‘Change Colour’ button
- ‘Hide this’ button allows user to unhighlight a specific RSID value from the result
- ‘hide all’ and ‘unhide all’ buttons allow users to remove and reapply colour coding to the
output
- ‘toggle collapse’ button is a functionality that toggles between a formatted view and non-
formatted view. A non-formatted view will remove any spaces between paragraphs, while a
formatted view maintains the structure of the document.
- User also has the options to increase, decrease, and reset font size of the output.
- ‘Download PDF’ button allows user to download the result as a PDF for further investigation.
Tool 1 page – shows an example of a docx document being analysed

Multiple Documents Analysis


- Tool 1 also offers the ability to upload multiple files at once
- Statistics such as ‘Characters per unique RSID’ and ‘Characters per run’ are provided
Tool 2
At a glance
Upload Your CSV File:
o Drag and drop your CSV file into the designated box.
o Rows will be displayed with relevant information under the box.
Choose Your Analysis:
o Click on either "International Analysis" or "Distance Analysis," or download the current data.

Figure 2- website before any file dropped in

Preparation
• Tool 2 relies on specific keywords to proceed with its analysis, ensure the csv file has:
o Headers for each column
o Two headers “Last Edited by: IP
Address” and “Last Edited by:
Username” respectively. Figure 1- initialClean.py code snippet
o Refer to 4. Errors in your csv file doesn’t satisfy the above

Initial analysis
• To begin, Drag-drop the csv file into input box.
• The initial analysis filters out unnecessary data and geolocates each IP address.
• The geolocation process duration depends on the number of rows in the CSV.
• After the initial analysis, you'll see a table with country, city, longitude, latitude, and a flag indicating
international/domestic.
• You can download the current data or click on a row to visualize the IP location on a map.

In depth analysis
• Choose between "International Analysis" or "Distance Analysis."
• International Analysis identifies higher-risk international countries for academic integrity breaches.
• Distance Analysis finds rows with the same user ID but different IPs, suggesting tests taken at
different locations.
• These in-depth analyses are quick to perform.

Seach
• Entering the id in the search box and clicking search will filter out other users.
• Click "Reset" to redisplay all ids.
Clean
• Click the "Clean" button before dropping another csv file.

Errors
• If your csv file lacks the 2 headers, or headers in general, you can replicate this by adding “, ,” for each
non important column and “Last Edited by: IP Address” or “Last Edited by: Username” for
corresponding columns. Note: when inputting, please leave out the “”
• Due to budget restrictions, tool 2 utilises a free geolocating database which limits lookups. Too many
lookups within given time frame leads to it temporarily blocking its services. Generally, 1000 lookups
within 1 day is safe. If your csv file has more than such rows, this can be solved by dividing csv file into
<=1000 and >= 1000 and running respective csv files on different days.
• If interface is stuck on loading, please don’t worry, the geolocating process often takes around 40m
for 1000 rows.

You might also like