dodona icon indicating copy to clipboard operation
dodona copied to clipboard

Add dolos plagiarism detection

Open jorg-vr opened this issue 11 months ago • 8 comments

This pull request adds a button to detect plagiarism on the submissions of an activity.

TODO:

  • [x] https://github.com/dodona-edu/dolos/issues/1398
  • [x] Dolos api should return report frontend url
  • [x] Update to new url variable in this pr
  • [x] https://github.com/dodona-edu/dolos/issues/1399

Peek 2024-04-29 10-50

image

I would suggest handling #2503 as a separate pr after this one.

Closes #5338

jorg-vr avatar Mar 06 '24 15:03 jorg-vr

@rien we should discuss how we want to handle cors

Let me know when you have found the time for the dolos modifications

jorg-vr avatar Mar 06 '24 15:03 jorg-vr

I'm getting less fond of Dolos downloading arbitrary URL's. We are essentially implementing Server-Side Request-Forgery. Malicious users could exploit this to download any file using a Ghent University server if they can convince Dolos it is a valid ZIP-file.

I think it is much safer if Dodona would POST the ZIP directly to Dolos after the export has been made. This does require storing the Dolos report URL somehow on the Dodona-side though. @jorg-vr @bmesuere what do you think?

If you still prefer submitting the export URL, I think I will create an allowlist that initially only includes dodona.be.

rien avatar Mar 08 '24 10:03 rien

I have no strong opinion on this.

bmesuere avatar Mar 08 '24 14:03 bmesuere

@rien, performing a post request from dodona is fine for me. I'll adjust this implementation in dodona

It is not clear for me why Dodona needs to store the report URL in this case?

jorg-vr avatar Mar 11 '24 09:03 jorg-vr

Update of the sequence diagram

sequenceDiagram
  Dodona Front ->> Dodona Back: POST create export
  Note over Dodona Back: collect submissions
  Dodona Back -->> Dodona Front: export status URL
  loop untill ready
    Dodona Front -->> Dodona Back: GET export status
    Dodona Back -->> Dodona Front: status
  end
  Dodona Front ->> Dodona Back: POST create report with export ID
  Dodona Back ->> Dolos API: POST create report with zip file
  Note over Dolos API: download export & start analysis job
  Dolos API -->> Dodona Back: report URL 
  Dodona Back -->> Dodona Front: report URL
  Dodona Front ->> Dolos Front: GET report URL
  Note over Dolos Front: save report URL in LocalStorage
  loop untill ready
    Dolos Front ->> Dolos API: GET report status
    Dolos API -->> Dolos Front: status
  end
  Note over Dolos Front: show report

jorg-vr avatar Mar 11 '24 09:03 jorg-vr

I have added some documentation of the Dolos API on our website: https://dolos.ugent.be/docs/api.html

rien avatar Mar 15 '24 15:03 rien

Dolos will now show a loading page when redirected to the html_url if the report is not finished yet. You can validate if this PR works and release when ready :tada:

rien avatar Apr 24 '24 16:04 rien

This button is currently on the submissions list page. This is not ideal as it does not interact with the search functionality.

Other possibilities are on the activity information page, or replacing the right chevron with a three dot menu on activity lists. image

image

jorg-vr avatar Apr 29 '24 08:04 jorg-vr