Submit portfolios via Moodle through Ouriginal for similarity checking

Bug #1940346 reported by Kristina Hoeppner
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fix Released
Robert Lyon

Bug Description

This is an integration project between Mahara and Moodle. The specs here refer mainly to Mahara and the Moodle work will be conducted on the Ouriginal (formerly Urkund) Moodle plugin.


Currently, the Mahara assignment submission plugin doesn't store portfolios in Moodle. Archives are created after the grading process has been completed for a number of reasons:

- Portfolios can be revoked and another one submitted without making an archive first.
- Comments can be left on the portfolio (and not just in Moodle) and become part of the archived submission.
- The archive is not looked at but the actual live portfolio to which the grader looses access once the grading has been completed.

Mahara can be connected to Moodle via LTI. The connection is only Moodle to Mahara and not reverse, i.e. Moodle is the IdP. The Mahara assignment submission plugin uses LTI only for authentication. The rest is done via (other) web services.

The Mahara portfolio archive contains all available export formats, i.e. Leap2A (XML), HTML, and PDF (experimental, if turned on).

Ouriginal cannot process ZIP files at the moment.

Envisaged high level workflow

1. Lecturer sets up assignment in Moodle, marks it as Mahara assignment and that it needs to go through the Ouriginal workflow on portfolio submission when a portfolio is locked.

Note: For this first implementation we assume that only portfolios that are locked from editing are submitted to Ouriginal because it is clearer then that the portfolio is ready for review.

2. Student submits their portfolio to that Moodle assignment.

3. Student's portfolio is routed to Ouriginal to be checked before the lecturer reviews the portfolio.

4. Ouriginal presents its report in the usual way in Moodle.

When a portfolio is resubmitted to the same assignment because the lecturer wants the student to make some changes, then the portfolio goes through the same steps, and a new report is generated in Ouriginal and presented in Moodle. Only the latest report is displayed in Moodle.


- Mahara does not connect to Ouriginal, but sends files to Moodle, which already has all web services connections in place to connect to Ouriginal.
- Ouriginal can only check textual information, e.g. plain text, text processing documents, PDFs where text can be highlighted, presentation files.
- Conserve resources as best as possible and only send files that Ouriginal can process, in particular because Ouriginal cannot process ZIP files.
- The similarity score does not need to be displayed in Mahara or on the live portfolio. Having it available in Moodle only for the files in question is sufficient.
- Moodle assignments are set up to lock the portfolio upon submission.
- The normal Ouriginal functionality as available in the Moodle assignment plugin will not be altered.
- The normal Mahara archiving workflow is not affected by this functionality. Currently, an archive is not possible via the plugin.

When a portfolio has been submitted to the Moodle assignment, a web services call is made to Mahara by a cron job that initiates the export of the portfolio (a single page or a single collection). This export is a 'light' version of the PDF export and only contains the PDF of the portfolio and files included in the portfolio that are of file types supported by Ouriginal.

Mahara stores this 'light' export in a temporary directory. It exposes that file to Moodle via a web services call that allows Moodle to access it and unzip it for transfer to Ouriginal, and the temporary file on Mahara is deleted. If Ouriginal failed to send a positive response to Moodle, the export is attempted again on the next cron job run as per normal Moodle workflow.

After that, it's the existing Ouriginal workflow with Moodle: A similarity score is generated and displayed in the gradebook, and the files are made accessible as well in Moodle as well so that their actual score can be reviewed.


1. Higher similarity score

Issue: When students use templates to create their portfolio, their similarity score may be quite high when the template contains instructions and other text that is the same on every portfolio.

Mitigation: We don't include page description and instruction fields, i.e. page instructions and text block instructions. This won't help if a regular text block is added to a portfolio and instructions written in there rather than the instruction functionality used, however, it should cut down on general instructions.

2. Display

Issue: Portfolios may contain a large number of items that return a similarity report – displaying these all within the assignment overview report may make the page quite busy.

Mitigation: Consider limiting the number of reports that are displayed for a student's submission on the overview report and provide a different method to view the full list of reports for a student's submission.

3. Performance

Issue: Large portfolios can contain a lot of different media and thus slow down the system or the export because certain elements are not exported, and they need to be extracted.

Mitigation: We can look into performance tuning and the new PHP zip streaming library if it became a problem.

4. Reports out of date

Issue: Portfolios are not always 'locked' when submitting them as an assignment – if a student is allowed to continually update their portfolio, this would quickly mean the export would be out of date, and it would be hard to identify when or if a new export should be generated and sent to generate a similarity report.

Mitigation: The first phase of this project requires the portfolio is locked while grading is underway. This is already dealt with in the solution design.


This work is sponsored by Dublin City University

Tags: newfeature
Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch:

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch:

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "master" branch:

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "main" branch:

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "main" branch:

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Patch for "main" branch:

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
tags: added: newfeature
Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Submitter: Robert Lyon (<email address hidden>)
Branch: main

commit 7005c9a619994fb713d92cf695f61f8fd8ae70aa
Author: Robert Lyon <email address hidden>
Date: Fri Aug 27 15:35:16 2021 +1200

Bug 1940346: Clear temp files from dataroot outside artefacts/ dir

There are a number of processes in Mahara that create temp files that
need to be around for a short period of time.

Some temp files like the langpack tar.gz files need to stay longer than
others so the file_cleanup_old_temp_files() function has different
time options to work out what is 'old' and can be cleaned up

Change-Id: If3f245f5bf294e5ca3286eb0a42370c1c4a1ce0e
Signed-off-by: Robert Lyon <email address hidden>

Revision history for this message
Mahara Bot (dev-mahara) wrote :

Submitter: "Robert Lyon <email address hidden>"
Branch: main

commit 9438e08c5e2e40902c9f7f4e96aef827e3c18d92
Author: Robert Lyon <email address hidden>
Date: Tue Aug 10 15:45:14 2021 +1200

Bug 1940346: Creating new pdflite exporter

To be used with the Ouriginal plagiarism software

Change-Id: I3deaa6c5a6509973fe0f22107a851deaa865d7d8
Signed-off-by: Robert Lyon <email address hidden>

Gold (gold.catalyst)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.