Note:

If you want to create a new page for developers, you should create it on the Moodle Developer Resource site.

Assignment submission support in the Mobile app

From MoodleDocs
Assignment submission support in the Mobile app
Project state In Progress
Tracker issue https://tracker.moodle.org/browse/MOBILE-1396
Discussion https://moodle.org/mod/forum/view.php?id=7798
Assignee {{{assignee}}}


Introduction

The current version of the Moodle Mobile app allows teachers to review the student's submissions. This is an interesting feature but the app, right now, is missing the most important feature for normal users: the ability to submit an assignment.

The main objective of this specification is to analyze how this should be implemented in the app.

Expected features

The user should be able to:

  • View a submission status page containing the same information that the web version (your current submission status, feedback - if any - , and your previous attempts - if any too-)
  • Submit assignments for the Moodle 3.0 submission types supported
  • Submit group assignments
  • Edit their assignments submissions (if they are not graded yet)
  • In general, the user should be able to do the same in the app that in a Moodle 3.0 version (without additional submission plugins added)

Moodle requeriments

  • Moodle 3.1 (we are still considering backport the changes to the Moodle Mobile additional features plugin)

Picking files to be submitted in the app

This is the most complex task, mostly because the mobile devices have some limitations when dealing with the file system.

Android

In this case, the user would be able to attach files to a submission using the file picker. The file picker will open the Android default tool for browsing the device's files (it can be the Android native one or, for example, the ES Explorer tool)

iOs

iOs does not allow users to browse the file system, the only way to allow users to select files in iOs is ask them to share those files previously with the app.

This can be done using the "Open in / Share" option in iOs, the user should share all the files he wants to submit first with the Moodle Mobile app (for example, via Pages or a different tool). The Moodle Mobile app would place these files in a temporary folder and, once the user is ready to submit an assignment, instead using the standard HTML file picker (input type file element) he will use a custom file picker that would display the files that the user recently shared with the app.

These local files will be accessible via the "My files" option in the app.

Ideally, for iOs, this should be done if this way: When a user shares a file with the Mobile app, the app should offer the user to submit the file directly to an assignment. The user should be able to browse all the assignments in courses that allow to submit files.

Moodle private files

In a second phase, the user will be able to attach any file from his private files area in Moodle (without having to download first the file)

Additional submission and feedback plugins support

The app will support only the standard (core) submission types, (files and online text), any assignment using non-standard submission plugins won't be supported.

We are planing to support additional Moodle plugins in the Mobile app in a future, but right now, it won't be possible.

The same applies for the feedback, but in this case, the user will be advised to see the feedback in the Moodle web version (he will be able to do the submission).

Moodle Web Services

Existing Web Services that will be used:

  • mod_assign_get_assignments: To list all the assignments in a course (and retrieve information for a particular assignment)
  • mod_assign_save_submission: To save a user submission (including online text and files referenced via draftid)
  • mod_assign_submit_for_grading: In case the assignment is configured to display a Submit button, this WS will be used for processing the submission once save_submission is processed.
  • webservice/upload.php endpoint - To submit files and get a valid draftid

New Web Services required (to be developed):

mod_assign_get_submission_status

For retrieving all the submission required information (grading summary, current attempt status, feedback data and the attempts history).

See MDL-52924

mod_assign_view_submission_status

For triggering the submission viewed event.

See MDL-52974

Files submissions

The Web Service mod_assign_save_submissions accept a drafid where the files the users wants to upload must be present.

This means that previously to call to this Web Service the app must upload the files via the webservice/upload.php endpoint.

Note also that this won't be necessary always:

  • If the assignment is configured for online text only and does not require a "Submit" button, it will be necessary to call only to mod_assign_save_submissions.
  • In case is configured to accept files, it will be necessary to upload files via the endpoint as described before.
  • And, finally, regardless the submission configuration, if the assignment requires a "Submit" button, the mod_assign_submit_for_grading must be called (once the user clicks the Submit button).

Offline submissions

The user should be able to submit an assignment in offline mode (and edit the submission), and when he is back to online mode, the submission should be sent to Moodle.

Implementation plan

1. Reimplement the assignment main page to display all the information returned by mod_assign_get_submission_status (the app should detect if the new WS is available, if not it should use the current way that works for teachers)

2. Implement the submission for Android (via file picker)

3. Implement the submission for iOs via file sharing and (My files option)