moss: Haskell client for Moss

[ library, mit, web ] [ Propose Tags ]

Please see the README on Github at https://github.com/mbg/moss#readme


[Skip to Readme]

Modules

[Index] [Quick Jump]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.2.0.0, 0.2.0.1
Change log ChangeLog.md
Dependencies base (>=4.7 && <5), bytestring, conduit-extra, mtl, network, network-simple, unix-compat [details]
License MIT
Copyright Copyright (c) 2022 Michael B. Gale
Author Michael B. Gale
Maintainer github@michael-gale.co.uk
Category Web
Home page https://github.com/mbg/moss#readme
Bug tracker https://github.com/mbg/moss/issues
Source repo head: git clone https://github.com/mbg/moss
Uploaded by mbg at 2022-05-20T18:53:37Z
Distributions LTSHaskell:0.2.0.1, NixOS:0.2.0.1, Stackage:0.2.0.1
Downloads 1129 total (19 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2022-05-20 [all 1 reports]

Readme for moss-0.2.0.1

[back to package description]

Haskell client library for Moss

GitHub CI stackage-nightly Hackage

Haskell client library for Moss which is an online service for checking for code similarity, primarily aimed at detecting plagiarism.

Example

In order to use Moss, you need to register on the Moss website. Once you have your access token, using the library is fairly easy:

import Stanford.Moss

cfg :: MossCfg
cfg = defaultMossCfg{
    mossLanguage = Haskell,
    mossUser = "[YOUR ACCESS TOKEN HERE]"
}

main :: IO ()
main = do
    url <- withMoss cfg $ do
        addBaseFile "Skeleton" "Skeleton.hs"
        addFile "StudentA" "StudentA.hs"
        addFile "StudentB" "StudentB.hs"
        query "Test"
    print url

This example establishes a connection with Moss using Haskell as the selected programming language. We assume that some skeleton code (Skeleton.hs) has been made available to students and relevant parts from that file should be ignored for plagiarism checking. The example then uploads two students' submissions (StudentA.hs and StudentB.hs) before telling Moss to run the plagiarism check with query which eventually returns a URL to the results.