Title: Virtual Classroom
1Virtual Classroom
- HongBing Kou , Jun Xu , Hu Li
- May, 2001
2Project Overview
- Login
- Teachers role
- Post materials
- Add quiz
- Record Video
- Play Video
- Students role
- Read materials
- Take quiz
- Watch Video Materials
3Register
login
Student
Teacher
Read Materials
Take Quiz
Watch Video
Upload Materials
Add Quiz
Record Video
Watch Video
4Instant DB
Login Servlet
login
Postquiz servlet
Student
addquiz.jsp
Teacher
quiz.xml
quiz.jsp
filelist.jsp
Record applet
Player applet
Video Media
5Login Part
- Inner tier
- LoginManager
- addUser
- userExists
- changeUserLevel
- changePasswords
- UserItem
- Middle layer Servlet
- Login
- Register
- Interface Html
- Teachers main page
- Studentss main page
-
6DB InstantDB
- private Connection con
- private Statement stmt
- String url "jdbcidbC//tomcat//webapps//Fina
l//sample.prp" - String driver "org.enhydra.instantdb.jdbc.idbD
river" - Class.forName(driver)
- con DriverManager.getConnection(url)
7User Structure UserItem class
- public class UserItem
- private String username
- private String password
- private int accessLevel
- public UserItem(String username, String
password) - this.username username
- this.password password
- this.accessLevel 0
-
8Quiz Part
- Teacher
- Create quiz.xml
- Use addquiz servlet to get quiz from webpage
9 toFile.println("ltquestiongt") String
title req.getParameter("title") String
answer1 req.getParameter("a1") String
answer2 req.getParameter("a2") String
answer3 req.getParameter("a3") String
answer4 req.getParameter("a4")
String solution req.getParameter("solution")
toFile.println("lttitlegt" title
"lt/titlegt\n") toFile.println("ltanswer1gt"
answer1 "lt/answer1gt\n") toFile.println(
"ltanswer2gt" answer2 "lt/answer2gt\n") toF
ile.println("ltanswer3gt" answer3
"lt/answer3gt\n") toFile.println("ltanswer4gt"
answer4 "lt/answer4gt\n") toFile.println
("ltsolutiongt" solution "lt/solutiongt\n")
toFile.println("lt/question
gt")
10- Student
- Take a quiz
- Using jsp file to show xml file
- Parse the quiz.xml and save it into DOM tree,
show the tree on webpage - submit the quiz result and report score
11 //Read XML file //try //Open the file for
reading URL u new URL(fileName) InputStrea
m inputXML u.openStream() //Build
document DocumentBuilder builder
factory.newDocumentBuilder() document
builder.parse(inputXML) //Generate the
NodeList org.w3c.dom.NodeList nodeList_q
document.getElementsByTagName("title") listLeng
th nodeList_q.getLength() org.w3c.dom.NodeLis
t nodeList_a1 document.getElementsByTagName("ans
wer1") org.w3c.dom.NodeList nodeList_a2
document.getElementsByTagName("answer2")
org.w3c.dom.NodeList nodeList_a3
document.getElementsByTagName("answer3")
org.w3c.dom.NodeList nodeList_a4
document.getElementsByTagName("answer4")
//Exception Handling //catch(Exception
e) // // msg msg e.toString() //
12lt String parameterValue "" , radioName ""
for(int i 1 i lt nodeList_s.getLength(
) 1 i) radioName "A" i
parameterValue
request.getParameter(radioName)
org.w3c.dom.Node node nodeList_s.item(i-1)
nodeValue (String)node.getFirstChild(
).getNodeValue() //solution gt
ltTRgt ltTDgtltigt.Your
answerltparameterValuegt lt if(
parameterValue.compareTo(nodeValue) 0) gt
ltimg src"tick.gif" width"12"
height"12"gt lt else gt
ltimg src"del.gif" width"12"
height"12"gt lt gt
lt/TDgt lt/TRgt ltTRgt
ltTDgtCorrect answerltnodeValuegtlt/TDgt
lt/TRgt lt gt
13Player
- Function
- Automatically pick up the Video/Audio Materials
by Java Bean - Dynamically create the links to play Video/Audio
by JSP - Player created by JMF 1.0 in Applet type
14Java Bean JSP
- A Bean was created to pick up all files in the
folder. Also provide method to get file info. Ex
created date , size etc - Dynamically create the user page for selecting
the Media file
15Structure JMF API
- Event based Media player by JMF 2.1.1
16Camcorder
- Function
- A user friendly camcorder developed by with
JMF2.1 - Record and save the Video/Audio/Other media
streams as a media file ( Because of Java policy
cant work well in the browser) - Monitor the record process
17Record workflow
- Create the DataSink and Process from the given
Capture Device. Usually its VFW//0 for video or
javasound//0 for Audio - GetoutputSource from the Processor.
- Create the DataSink to write file
- Start the processor and the DataSink
- Block until finish recording work
18Problems with my Camcorder
- Cant work well in the Applet
- Record the Video Audio at the same time ? (
Realized processor ? A solution or Merge
technology)