JavaGrades - Student Grades Website and Personalized Email Generator
This class parses a comma-separated spreadsheet (.CSV) representing
a set of grades (typically created with Microsoft Excell)
and creates one file for each student with the relevant information.
The files can then be put on the class webpage and accessed by students
who presumably know the URL of their file.
Usage:
java Grades grades-file.csv
Installing and using
I've written everything in a single file Grades.java.
Compile it as usual with the command
javac Grades.java
Then to create the entire grades website and send out emails to all the students (if this is what you specify in the
grades file) with the command
java Grades gradefile.csv
assuming that you have well defined grades file (see the next section).
You'll probably want to add a bit of java-script to your website to allow students to enter login and password
instead of just remembing their URL directly. Supposing you have the
following directory structure at your website:
URL_PATH_TO_YOUR_SITE
|
+--- index.html
|
+--- syllabus.html and other top level pages
|
+--- grades/ (Grades.java creates this directory)
|
+--- index.html (Grades.java creates dummy file to obscure the directory listing
| even when you forget the proper chmod'ing -but don't forget!!!!)
|
+--- student1_password1.html
|
+--- student2_password2.html
|
+--- etc.
Then you'll need to modify your top level index.html (inside URL_PATH_TO_YOUR_SITE)
with the following JavaScript:
- First inside your "HEAD" section you'll need to define the JavaScript password functions:
<head>
<script language="JavaScript">
<!--
function gradescheck() {
var theURL;
// Prompt user for the login...
login = prompt('Please enter login name (usually this is your Columbia UNI)','');
// Prompt user for the password ...
pwd = prompt('Please enter password (should NOT be your acis password)','');
// ... then set the browser location. (change the line below this one!)
//MODIFY FOLLOWING LINE APPROPRIATELY:
scrambled = scramble(escape(login),escape(pwd));
theURL = 'grades/' + scrambled + '.html';
window.open(theURL,'new');
}
// currently a dummy function:
function scramble(login,pwd) {
return login+'_'+pwd;
}
//-->
</script>
<title>PUT YOUR COURSE TITLE OR WHATEVER HERE</title>
</head>
- Then inside the BODY, at the point where you want students to access their grades,
use something like the following HTML code:
<a name="grades" href="javascript:gradescheck()">GET MY GRADES</a>
The Grades File
To see how a grades file should look like, download
ClassTemplate.csv
I use Excel to generate the the comma seperated valued file, but any spreadsheet
program which converts to CSV in a standard fashion should work as well.
Grade file specification
If you modify the above template in obvious ways, you will probably produce a
file that adheres to the requirements of JavaGrades and that will
be processed correctly. If you are doing something more complicated,
you should read the following rules and adhere to them:
- A cell is the contents between commas
- DATA MUST NOT CONTAIN COMMAS!!!
- All contents are treated as Strings. No data processing occurs here.
- An empty line contains no commas
- First line contains column header names
- Second line contains maximum achievable for each column
- The first empty line defines the end of the header section
- After the first empty line (or empty line block), the first non-empty
line is the first student's information.
- Student columns are formatted as follows:
1) Last name
2) First Name (and other names such as middle/jr/sr etc.)
3) College
4) Year
5) Email (first part of individualized grades URL)
6) Password (second part of individualized grades URL)
>6) Grade information with no special behavior
- The next empty line represents the end of the student block
- The last section is the footer section. In this section, empty lines
are ignored after the first block. Lines starting in a String
whose first character is '#' (except for global stats) represent special instructions.
There are specific instructions (#COURSE, #PRINT, #KEY) which produce
specific behavior as detailed below:
-
NON-SPECIFIC INSTRUCTION (MUST BE THE FIRST SUB-BLOCK):
Assumed to represent a global information, such as median scores, etc.
This information will be printed in rows under the student's information
With each row named by the special instruction itself.
- #COURSE - next cell is the name of the course
- #PRINT - next sequence of cells represent columns that are to be printed^M
each range is represented by a range of the form m_n. This ^M
specification ends at the first empty cell.
NOTE: if you need to specify a single column, e.g. 27, set m=n, e.g. "27_27"
- #EMAIL - next cell determines whether to send out emails:
No email is sent-out unless the word "SEND" or"SENDLINKONLY" appears in the cell. If emails
are sent, a link to the grade info is sent, along with all the information.
If SENDLINKONLY chosen, only the link is sent and the message in the file.
No further information is included in the file under the SENDLINKONLY option.
Also, if SENLKINKONLY is specified, a link to a directory is sent rather than to a specific html file
- #HOST - default email host to send emails to. For example if no "@" appears in
an email name, this host will be appended to the email name with "@" in the middle.
- #URL - names the directory where grades will reside
- #STUDENTDIR - if "PASSWORDONLY" then do not use student's email in directory name.
if anything else, directories are named "email_password"
- #MAILFILTER - string to pre-pend "SUBJECT:" header of emails to make it easy to filter.
- #KEY - starting from the next line, until the next special instruction is
encountered. Each line is of the form
NAME,information
so that a legend can be created with the given information for each NAME
- #COMMENTS - ignore everything past this point
Last modified: Wed Oct 26 13:20:19 2005