Moodle App - Assignment Submission Type

Re: Moodle App - Assignment Submission Type

de Dani Palou -
Number of replies: 0
Imachen de Core developers Imachen de Moodle HQ Imachen de Particularly helpful Moodlers Imachen de Peer reviewers Imachen de Plugin developers
Thanks for the examples sonrisa

In the app, when the user is editing the assign we put all the plugin's HTML inside a form. When the user submits, we get all the data from the form (using 
form.elements) and that's the data that is then passed to prepareSubmissionData. The data is indexed by the name you set to the input.

So for example if you add this text input:

<ion-item>
<ion-label position="stacked">My label</ion-label>
    <ion-input type="text" name="mytext" autocorrect="off"></ion-input>
</ion-item>

Then I think the prepareSubmissionData should receive an object containing a "mytext" entry with the value the user entered in the text input. For simple types maybe you don't need to convert the data inside prepareSubmissionData.

Cheers,
Dani