Giter Site home page Giter Site logo

h8-moss-checker's Introduction

Code Similarity Checker

Code Checker is a Javascript-based project that checks for any similarities between 2 (or more) strings from all branches (excluding main/master branch) of a selected repository.

This project also uses Moss for second opinion, anti-plagiarism checking.

Background

This project is a continuation from Cheat Detector application, that was developed by isrotrip, made for finding similarities inside each of the student's codes. The project was developed using Javascript and Python.

Features

  • Javascript based, using Dice's Coefficient to find similarities between 2 (or more) different strings.
  • Nearly all processes are asynchronous, making the process faster.
  • Normalized ratio, starting from the base_ratio set in config.js.
  • Also features a second opinion similarity checking from Moss.

How it works

This app utilizes string-similarity package, which uses the Dice's Coefficient algorithm, to check 2 (or more) different strings for similarities. Code Checker will also strips unused comments, which will reduce noise mostly caused by the challenge's template, and improves accuracy during checking.

Setup

config/config.js

Rename config.example.js to config.js, and change its contents as needed:

module.exports = {
  batch_name: "batch-name", // batch/organization/class name
  prefix_name: "prefix-name", // repo prefix name, e.g.: fsjs-p1-v2-c1
  base_ratio: 0.8 // minimum base ratio to be filtered, ranging from 0-1. Default: 0.8
}

moss

Get your Moss script by registering your user email at Moss.

tl;dr - Send email to [email protected] without any subject, shown below:

registeruser
mail <[email protected]>

Change [email protected] with your actual email, without brackets.

After a short while, the script will be sent from Moss, containing the needed scripts along with the instructions. Place the script within the file moss inside the same directory as app.js file.

config/valid-repositories.js

Add your valid repositories in array of objects format. For example:

module.exports = [
  {
    name: "your-repository-name"
  }
]

NOTE:

  • One repository must be enclosed in an object.
  • this is not used when checking for GitHub Classroom

At this time, the object only contains the name property. Additional properties will be added in the future.

config/usernames.js

Add student usernames in an array format. For example:

module.exports = [
    'asep_doradon',
]

NOTE:

  • this file is mandatory for checking repos from GitHub Classroom
  • username(s) can be taken from students tab, if the data is not same with their real gh username or they haven't clone the repo from classroom then it won't be included in the checking process

Usage

Run node app.js to see available commands:

Code Similarity Checker
Version 2.0

Usage

check repo-name <repo> [no-moss]
        Validates repository of a set organization,
        and checks for similarity for each branch(es).
        Submits 2 files to Moss by default, for second opinion.
        - repo-name <repo>      specifies repository name
        - [no-moss]             disables Moss checking
        - [min-ratio] <0-100>   filters normalized ratio

checkClassroom [no-moss]
        Validates repository of a set organization (classroom repo),
        and checks for similarity from each student repositories.
        Submits 2 files to Moss by default, for second opinion.
        - [no-moss]             disables Moss checking
        - [min-ratio] <0-100>   filters normalized ratio

Currently available commands:

  • node app.js check repo-name <repository> [no-moss]

    This command requires repo-name parameter set, followed by the actual repository name from valid-repository.js.

  • node app.js checkClassroom [no-moss]

The results of these processes can be seen at batches/<batch-name>/<prefix-name>/results.json directory.

Contribute

I'm gladly accept your contribution! Just open a new pull request at Pull Requests menu, and make details of what you've made on your branch.

Have an issue?

Glad to help! Just open a new issue at Issues menu when you're facing a bug or suggesting a new feature.

h8-moss-checker's People

Contributors

tedante avatar yudantoanas avatar ziterz avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.