How To : Online Instructor Suite (Other) : Submitting Forms Using the Form Server
This page displays the form
capabilities of OIS. This will post a form that is sent to the instructor
by email and saved to a file too. The forms should POST to the address "/ois-bin/formsrv/formsrv.dll":
|
Example 1 |
Sending the contents of
the form to the instructor by email:
<form method="POST" name="Form1" action="/ois-bin/formsrv/formsrv.dll">
<input type="text" name="Answer1"
size="20">
<input type="checkbox" name="Answer2" value="CHECKED">
<input type="radio" value="A" name="Answer3">
<input type="radio" value="B" checked name="Answer3">
<input type="radio" name="Answer3" value="C">
<textarea rows="5" name="Answer4" cols="30"></textarea>
<input type="submit" value="Submit" name="B1">
</form>
The email is sent to the
address defined for the class instructor in Manager. The "From" field
contains the logged-on student's email. |
|
Example 2 |
Defining alternate
emails and the "Subject" line:
<form method="POST"
name="Form1" action="/ois-bin/formsrv/formsrv.dll">
<input type="hidden" name="EmailTo" value="anotheremail@semo.edu">
<input type="hidden" name="EmailFrom" value="yetanotherone@semo.edu">
<input type="hidden" name="EmailSubject" value="Assignment One
Form">
<input type="text"
name="Answer1" size="20">
<input type="checkbox" name="Answer2" value="CHECKED">
<input type="radio" value="A" name="Answer3">
<input type="radio" value="B" checked name="Answer3">
<input type="radio" name="Answer3" value="C">
<textarea rows="5" name="Answer4" cols="30"></textarea>
<input type="submit" value="Submit" name="B1">
</form>
EmailTo:
defines who will be the recipient of the email (when not present,
defaults to the instructor email).
EmailFrom: defines who is the sender of the email (when not
present, defaults to the currently logged on user's email).
EmailSubject: defines the subject of the email (when not
present, defaults to "Results from form <form page address>").
|
|
Example 3 |
Saving the form results
to a file:
<form method="POST"name="Form1"
action="/ois-bin/formsrv/formsrv.dll">
<input type="hidden" name="SaveToFilename" value="myform2.htm">
<input type="hidden" name="FileFormat" value="HTML">
<input type="text"
name="Answer1" size="20">
<input type="checkbox" name="Answer2" value="CHECKED">
<input type="radio" value="A" name="Answer3">
<input type="radio" value="B" checked name="Answer3">
<input type="radio" name="Answer3" value="C">
<textarea rows="5" name="Answer4" cols="30"></textarea>
<input type="submit" value="Submit" name="B1">
</form>
SaveToFilename:
defines the filename where the results will be saved/appended.
This file is always located under the folder "protected" in a
subfolder named "formresults."
FileFormat: defines the type of the file. Valid file
types are:
- CSV: comma-delimited text file; can be imported by Excel and
Access.
- HTML: HTML file; can be viewed by a web browser.
- TEXT: a plain-text .TXT file; can be viewed by any text editor. |
|
Example 4 |
Specifying
post-processing messages and links:
<input
type="hidden" name="SuccessMsg" value="Thank you for your answers, %FirstName%.
Please follow the link below for more exercises.">
<input type="hidden" name="LinkTo" value="http://cstl.semo.edu">
<input type="hidden" name="LinkText" value="Click here to go the CSTL
web site">
SuccessMsg:
defines a message to be displayed to the user after he/she
successfully submits the form. If available, the value of this field
will replace the default message. It accepts the following variables:
FirstName, LastName, MI, ClassName, ClassCode.
LinkTo: When available, the server will put a message to this
address at the end of the confirmation message.
LinkText: When available, the server will make this text
link to the value of LinkTo. If not available the default text will
be "Click here to continue..." |
|
Example 5 |
Redirecting to another
page after submitting the form (if no errors were found):
<input
type="hidden" name="RedirectTo" value="http://cstl.semo.edu">
RedirectTo:
the address to be displayed after the form has been successfully
posted. If an error occurred, the form will display the default
message and the errors. When RedirectTo is present, the server will
ignore the values of LinkTo and SuccessMsg |
|
Example 6 |
Adding the form results
to a file in DropBox so it can be viewed and graded by OIS DropBox:
<input type="hidden" name="AddToDropBox"
value="Category=2;DropBox=2">
<input type="hidden" name="SaveToFilename" value="Form Submission">
OPTIONAL
<input type="hidden" name="FileFormat"
value="HTML">
OPTIONAL
If no other parameters are
present, the student is automatically transferred to the DropBox
specified. Otherwise, the tags "RedirectTo" and "LinkTo" will be
used.
The file format can be CSV, HTML and TEXT. If the file format is not
specified, it defaults to TEXT.
The SaveToFilename tag is optional. If not specified, it
defaults to "Results from form page.htm"
Obtain the category and dropbox numbers from the URL (address bar)
when the drop box is showing in the browser.
Note: set "Accept only
files posted from Form Server" in the category or drop box properties
to prevent students from being able to upload files into the drop box
using the Upload button. |
Example 7
(NOT IMPLEMENTED YET) |
Adding the form results
to a message in Forum so it can be viewed and graded by OIS Forum:
<input type="hidden" name="AddToForum"
value="Discussion=2;Topic=2;InReplyTo=0">
<input type="hidden" name="FileFormat" value="TEXT">
OPTIONAL
If no other parameters are
present, the student is automatically transferred to the Forum thread
specified. Otherwise, the tags "RedirectTo" and "LinkTo" will be
used.
The file format can be HTML and TEXT (no CSV allowed). If the file
format is not specified, it defaults to TEXT.
Obtain the discussion, topic, and thread numbers from the URL (address
bar) when the thread is showing in the browser.
To add a message as a response to a thread, specify InReplyTo=<threadID>
To add a message as a response to a topic, specify InReplyTo=1
To add a message as a topic, specify Topic=0 and InReplyTo=0 (the
discussion must allow students to add topics) |
Notes: some tags take
precendence over others. For example, if "SaveToFilename" and "AddToDropBox"
are in the same form, the latter takes precedence and the file is always
sent to DropBox. If both "AddToDropBox" and "AddToForum" are used, the
first one takes precedence and the file is also sent to DropBox.