Answer
Embedding a Google or Microsoft Form into Moodle and customizing it to
capture Moodle user information involves several steps, including HTML
editing and possibly some server-side scripting. Here's how you can
approach this:
Step 1: Embedding the Form
Google Forms:
Create your form in Google Forms.
Click on "Send" and then "Embed" to get the iframe code.
Microsoft Forms:
Create your form in Microsoft Forms.
Click on "Share" then "Embed" to get the iframe code.
Step 2: Modifying the HTML
You'll need to modify the iframe code to include Moodle's user
information. Moodle uses placeholders like 2 which are replaced with
actual user data when the page loads.
Example for Google Forms:
html
Replace entry.123456789 with the actual question ID from your Google
Form where you want the user ID to be inserted.
Step 3: Handling Data Collection
Google Forms:
Responses are automatically collected in Google Sheets if you set it up.
Microsoft Forms:
Responses can be exported to Excel or directly sent to a SharePoint
list.
Step 4: Email Generation
For sending emails based on form submissions, you'll need to use
Moodle's messaging system or integrate with an external service:
Moodle's Messaging:
You might need to write a custom script or plugin to trigger emails
based on form submissions. This would involve Moodle's API to send
messages or emails.
External Service:
Use Zapier or similar services to connect form submissions to an email
service, where you can template emails with Moodle user data.
Step 5: Custom Scripting (Optional)
If you need more control or functionality beyond what Moodle's standard
features offer: