mcqscript.cgi is a Perl script that generates multiple choice questions from a question data file. The questions are presented to the user who must enter a class number and student id number for data logging purposes. Once the user answers the question, the script evaluates the answer and will log the results into a data file that has the same name as the class number. Answers are either right or wrong, 1 or 0. Users are only allowed to answer each question once, the program will prevent further attempts to change an incorrect answer. The question data file is in the same format as the mcsimple data files. To see the examples in action click on a question below.
View the script
StId,Class 1232134234,Freshman 2134213443,Freshman 2134213412,Senior 3214236324,JuniorThe file is comma delimited, that is, each field is separated by a comma. Create this file and save it, giving it a 4 character name that corresponds to the class number. This is the same number that the students will type in to identify the file so that the script can determine if they're enrolled or not.
After the file is created, you must decide where you will keep the roster file. I suggest a directory outside of Webspace, that is, not viewable to visitors of your Website. You will need to modify the mclog script to point to this directory. The variable $roster_path in the script will have to be changed to reflect your site. Also, at this time you might want to change the $data_path variable to reflect your site (see mcsimple).
Once this is done, create a link to the script with a question file and give it a try. Each time a particular question is tried the script will add a column to the roster file to store student responses. For example, take a look at the roster file 5467 which has 2 students. The file will start out looking like this:
StId,Class 21342343234,Freshman 23412451234,FreshmanAfter the first student tries a question, say Question1.qdf, and answers it correctly. That question will be added to the file along with that students' grades. Students that haven't tried that particular question will have a NA (not applicable) stored as their grade until they complete it. The file would then look like this:
StId,Class,Question1 21342343234,Freshman,1 23412451234,Freshman,NAIf the second student then tries Question3.qdf, and answers it incorrectly, the file will then look like this:
StId,Class,Question1,Question3 21342343234,Freshman,1,NA 23412451234,Freshman,NA,0The program will only allow each student one attempt to answer the question. Since the file is a comma delimited format, it is quite simple to import the file into a spreadsheet for manipulation.
1. Cannot find the roster file - Either the student entered a class number for a file that doesn't exist or the enviroment variable in the script, $roster_path, is pointing in the wrong place.
2. Cannot find student id number - The student entered the id number incorrectly or it doesn't exist in the roster file. The student id's must occupy the first column in the roster file.
3. Cannot fine file:XXXXXXXXXXXX - Can't find the question data file. Check the enviroment varible that points to the question directory and check your A HREF link.
If the script encounters any of these problems it will not log any data into the roster file.
Let us know you're using the scripts.