Moodle App - Assignment Submission Type

Re: Moodle App - Assignment Submission Type

Dani Palou -
回帖数:0
Core developers的头像 Moodle HQ的头像 Particularly helpful Moodlers的头像 Peer reviewers的头像 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