Monday, October 29, 2007

Week 9 : 10/23/07 - 10/29/07( Implementation of check.properties generation)

This week was focussed on generating a check.properties file, if it is has not been included in the problem.

The solution was to develop a wizard like interface and ask the user a set of questions. Each page thereafter is driven by the answers to the current set of questions or prompts. The set of questions that will be asked are the following:

1. Page 1 ( Start page )

Question 1. Does this assignment needs to include a main class to be submitted by the student ?

2. Page 2

Prompt 1. Select the java class that will be marked as the main class.(The selection will be a set of radio button and the labels will be derived from the *.java classes that is present in the */student/ directory of the assigment that was uploaded.)

Prompt 2. Enter comma-separated list of required classes that a student must submit.
Prompt 3. Enter comma-separated list of required files that a student must submit.

Question 1. Is this assignment a GUI application ?
Question 2. Should the assignment's main class be run and its output captured and compared with an instructure supplied output file ?

Question 3. Should the assignment's main class be run with external inputs like *test*.in and the corresponding outputs of the program compared with instructor supplied output file like *test*.out ?

3. Page 3 ( If the submitted assignment is a GUI application )

Prompt 1: Enter the command line arguments to pass to the application when taking a snapshot.

Prompt 2: Enter the key strokes to execute before taking the snapshot of the application

Prompt 2: Enter the name of the program to run when taking a snapshot(Default is mainclass)

4. Page 4 ( if property test.run is true)

Prompt 1: Enter the command-line arguments to pass to the application when running it and capturing its output.

Prompt 2: Please specify the input to the application.

Prompt 3: Select the name of the file containing the expected output file ( The file names will be displayed will be ones which has extension *.expected and is present in the */student/ directory of the uploaded assignment )

5. Page 5 ( if property test.test-inputs is true )

Prompt 1 : Enter the command line arguments to pass to the application when testing inputs.

Prompt 2 : Please specify the classpath.

6. Page 6 ( if one of the properties test.run or test.test-inputs is true)

Prompt 1: Select the type of output comparision to use ( Available options are line,number,word)

Prompt 2: Please enter the tolerance factor.


After Page 6, the check.properties will be generated and written to the */student/ dirctory of the uploaded assignment.

If multiple assignments are loaded, then the process of generating check.properties will be done for each assignment.

Design
------


1. The ExerciseMB.java will keep track of the directory structure and the name of the files that were uploaded for an assignment. Each uploaded assignment will encapsulated in a class Exercise. The structure of the class is given below

Exercise
String name ( name of the exercise)
Directory for student
Directory for solution
Directory for grader
Directory for description


Each Directory object will have the set of file names that is part of the assignment

Directory
String name ( name of the directory)
String[] dirPath ( path of the directory from the root)
String rootPrefix ( root of the directory which will be repositorypath)
List of *.java files
List of *.html files
List of *.in and *.out files
List of *.expected files

Properties properties( check.properties values)

boolean hasProperties( boolean to indicate whether a check.properties is present in the Directory


2. When the assignment upload is complete, it will check if the assignment has a check.properties file by introspecting the */student/ directory. If no check.properties has been found, the the property

currentExercise
of ExerciseMB will be set to the name of the exercise and then the wizard will process will kick in for generating the check.properties for the */student/ directory of the uploaded assignment.

3. The various properties of the check.properties will be filled in by accessing the member Properties object of the Directory whose name is "student". For example to the set the property that an assignment has a main class, the jsf code is as follows:


<html:selectBooleanCheckbox value="#{exerciseUpload.currentExercise.studentDir.mainClassRequired}" /> <html:outputText value="Does this assignment have a main class to be submitted by student?" />




The property "currentExercise" will always point to the uploaded assignment which doesn;'t have a check.properties defined.

4. Each Exercise is associated with a wizard interface. The wizard has the information about its set of pages and it forwards to the relevant pages by introspecting the current page and the set of properties that has been enabled in the Properties object of Directory "student" as a result of questions/prompts from previous pages.

5. At the end of the wizard phase, a check.properties will be generated and written to the */student/ directory of the assignment.



Issues
---------

1. I am using tiles to define templates for a page. Unfortunately I cannot forward to a tile name. I have to create another .jspx page and then insert the tile definition in that page.

2. Initially I thought that extra path info can be passed to an assignment url. For example

http://localhost:8080/labrat-web/exercise_submit_files.faces/fjfjfjf9riwiwiw*&gdh2535/course name/exercise name

This looks more elegant than passing parameters in the URL. A tiles controller can be developed to parse this URL and then pass it as request parameters for downstream handling of the particular exercise. (This will be used as submit urls by the students)

It doesn't seem to work with jsf servlet mapping.
The error, predictably, is resource not found.

3. How do I encode a JSF view with parameters ? For example If I need to forward to a view

"some_view" with certain set of request parameters, how do I do it ?

Monday, October 22, 2007

Week 8 : 10/16/2007 - 10/22/2007 ( Implementation of additional labrat features)

The following was implemented

1. The upload feature was implemented and the result page showed the files and directories
uploaded to the repository.
2. Integrated the submit files page with the new UI.
3. Traced the debugger problem.
4. Fixed the tile layout issues.

Work in progress
-------------------
1. Implementing the check.properties discovery and generation.

Tuesday, October 16, 2007

Week 7: 10/09 - 10/15 Implementation of additional Labrat features ( 20+ hours)

The following was done

1. Converted the UI to a tiles implementation.
2. Implemented the upload and upload results screen. Will need to debug it.
3. After converting to equivalent JSF tags, the UI hasn't come out as I wanted it to be. Will need
to figure out by loading the HTML output in a designer.

ISSUES

1. Cannot attach a debugger. It is crapping out with this error

Incrementally deploying web_localhost:4848_serverCompleted incremental distribution of webDuplicated project name in import. Project labrat-web-impl defined first in C:\projects\labrat\web\nbproject\ant-deploy.xml and again in C:\projects\labrat\web\nbproject\build-impl.xmlconnect-debugger:Non-existing path "C:\projects\labrat\web\build\ear-module\WEB-INF\classes" provided.C:\projects\labrat\web\nbproject\build-impl.xml:553: The following error occurred while executing this line:C:\projects\labrat\web\nbproject\build-impl.xml:557: org.netbeans.api.debugger.jpda.DebuggerStartException: Connection refused: connectBUILD FAILED (total time: 1 second)

It started happening once again. Tried uninstalling and installing 5.5.1 and V2. Didn't work.

I resolved the earlier message. It happens if Tomcat is running in non-debug mode. I am getting this success message.

deployment started : 0%deployment finished : 100%Deploying application in domain completed successfullyTrying to create reference for application in target server completed successfullyTrying to start application in target server completed successfullyDeployment of application web completed successfullyDuplicated project name in import. Project labrat-web-impl defined first in C:\projects\labrat\web\nbproject\ant-deploy.xml and again in C:\projects\labrat\web\nbproject\build-impl.xmlconnect-debugger:Non-existing path "C:\projects\labrat\web\build\ear-module\WEB-INF\classes" provided.
Attached JPDA debugger to localhost:9009

Duplicated project name in import. Project labrat-web-impl defined first in C:\projects\labrat\web\nbproject\ant-deploy.xml and again in C:\projects\labrat\web\nbproject\build-impl.xmldebug-display-browser:BUILD SUCCESSFUL (total time: 3 seconds)

The debugger is getting attached, but IDE cannot connect to it. Connection refused.

Monday, October 8, 2007

Week 6 : 10/02 - 10/08 - Design of Additional Labrat features

This week was focused on marking up the design for additional features for Labrat in HTML.

Summary
------------
Repository Structure

Each instructor will be identified based on the following fields:


  • name

  • email

  • title

  • university name

If the instructor wishes to register, these fields will be hashed to form a unique string. This "unique string" will be labelled as the root directory of the repository.


The repository directory structure is as follows







The meta directory will be used to store "close" match hash strings from instructor profiles.


UI Interface



  1. Registration Page ( Instructor view)

The fields that were put in this page to uniquely identify an instructor were: name, email, title, university name. These fields will be used generate a hash, which will be the root directory in the repository for uploaded assignments for that instructor.


If the instructor doesn't wish to register then he/she has to input that information during upload of assignments.



2. Assignment Upload (Instructor view)


An instructor will come to this page to upload assignments. If the check.properties file is missing from the jar file, then one will be generated from the instructor's input.


A successful upload will generate a link for the instructor to be given to the student. The format of the link is given below:



http://www.labrat.sjsu.edu/ieo987$#jkiolp09*djdjjdjdjdj/CS101/Exercise_1


The unique token string is the one that will belong to the instructor. It includes the course id nunber and the name of the assignement.



3. check.properties generation page


This page will take the instructor input to generate a check.properties file. Since the number of properties are large, it will make sense to separate out the properties into required and optional ones. And within each of the categories it will be further divided into functional regions like


display,documentation,build,test/execute



4. Assignment Submit ( Student view)


Students will come to this page via the link that may have been provided by their instructors. A link will look like


http://www.labrat.sjsu.edu/ieo987$#jkiolp09*djdjjdjdjdj/CS101/Exercise_1


This page will display the files that needs to be submitted for that assigment by introspecting the check.properties file.

Monday, October 1, 2007

Week 5 : 09/26 - 10/01 (JSF, Web Labrat and Upload exercise)(12 hrs)

This week concentrated on getting comfortable with JSF and Exercise Upload Tag.


Netbeans 5.5.1 and V2

Downloaded and installed Netbeans 5.5.1 and Glassfish V2.

Web labrat

Ran the labrat web interface
1. I commented out the Mail session and the mail functionality. It does seem to work after that.
A UI came up to paste the required files. No "cyclic errors".

Upload tag

1. Integrated the upload tag from core jsf into web labrat
2. Tailored it to upload exercises and create the path in the repository directory.
3. Need to add a parameter whether the user is uploading a zip file with UNIX or WINDOWS style path entries.