Virtual Environment and Instruments for Student Olympiad on Cybernetics Andrey V. Lyamin*. Oleg E. Vashenkov** * St.Petersburg State University of IT, Mechanics and Optics, Kronverkskiy 49, St.Petersburg, Russia, 197101 (Tel: +7 812 2325914; e-mail:
[email protected]). ** St.Petersburg State University of IT, Mechanics and Optics, Kronverkskiy 49, St.Petersburg, Russia, 197101 (Tel: +7 812 2325914; e-mail:
[email protected]). Abstract: This paper describes technology of virtual laboratories in Learning Management System AcademicNT. Answer checking techniques, algorithms and data transfer protocol are examined in this paper. The virtual laboratory on cybernetics illustrates main results of the paper. 1. INTRODUCTION The tendency to increase the quality of education requires the rejection of conventional methods of learning and the conversion towards individual training. However, the mass education requirement makes individual education ineffective. Solution of the problem is to transfer to electronic learning realized on specialized Learning Management System (LMS, Vasilev, Lyamin, Chegin). Such environment is built on IT to present and transfer knowledge. To achieve the best results, environment should provide complex approach in organization and quality assessment of learning materials. LMS has to support virtual laboratories and simulators, adaptive learning dialogs, wide communication possibilities. Virtual laboratories in LMS are necessary to form and assessment of skills (Lisicina & Lyamin 2008; Lyamin & Vashenkov 2009; Vashenkov & Lyamin 2008). They are distinguished from electronic tests by unsolvable set of right answers. For such tasks it is impossible to describe right answer by finite set or formal expression. Virtual laboratories have wide application and can be used in different fields (Vashenkov, Volkova, Lyamin) allowing to realize experiments. The good example of virtual laboratory implementation is Virtual Laboratory on Cybernetics, which is being used in Open Olympiad of St.-Petersburg on Cybernetics among School Teams (CYBER-NET). The Olympiad needs the knowledge and skills on physics, mathematics and computer science simultaneously. In general, virtual laboratory answer contains the description of some system with definition of input and output sets. This system is constructed on specialized virtual laboratory bench with conformance to entities and relations derived from subject domain. Knowledge about each right answer can be presented as input and output reference data set. To validate the answer it is necessary to obtain the system response with given reference input set and compare the system output with reference output set. The system output and reference output coincidence will mean the right answer. A special virtual machine is used to obtain the response of system, which
described in the student answer with given reference input set. The functions of LMS are the virtual bench and virtual machine interaction, the generation of tasks, reference data sets, the logging of actions and results. This paper offers and describes an original mechanism to build virtual laboratories in LMS AcademicNT (Vasilev, Lyamin, Chegin). This environment has been developed in St.Petersburg State University of IT, Mechanics and Optics. The main results are illustrated on a basis of Virtual Laboratory on Cybernetics. 2. COMMON INTERACTION SCHEME The virtual laboratory implementation provides interaction between different modules of LMS. After task request, AcademicNT transfers to client interactive element as an applet. Interaction between client and server is organized by HTTP protocol. Common tasks are represented as a web page with applet. Answer submission is a responsibility of web page controls. Interaction between web page and applet is originated by web page that requests user answer from applets data. Thus subject domain system described by a student is transferred to server as a text data. Web page transfers data to web server though HTTP protocol. Web server is a container for web applications. It transfers HTTP request to web application implemented as Java Servlet. Servlet prepares call to database stored procedure with parameters from request and it has been stored earlier. Assessment laboratory server is realized as a separate application that listens custom TCP port for Remote Laboratory Control Protocol (RLCP, Lyamin & Vashenkov 2009) request. Stored procedure forms a special cursor to inform servlet on transfer of RLCP request to assessment server, process response and a call another stored procedure for result preservation. RLCP message contains student answers, reference data sets and additional parameters. Assessment server response is a XML RLCP message that contains result and time of execution for each reference data set. Servlet parses RLCP response and calls stored procedure for each result. The couples diagram is presented at Fig.1.
Client request to web server casts to stored procedure call on DBMS. In general, stored procedures generate XML answer that translates into HTML of next web page. However, in case of laboratory answer assessment, stored procedure returns a special command cursor instead of XML answer. Assessment can occupy long time and increase the load of system servers. Therefore, in some cases it is appropriate to suspend validation process. So when we have mixed test with simple question frames and virtual laboratory frames the simple frames evaluates immediately and laboratory frames evaluates later. Immediate assessment can be used for testing scenarios when it is required to receive immediate result. However, in case of informatics and programming task, assessment time depends on answer complexity. Sequence diagram of immediate assessment is presented on Fig.2. Apparently from the figure, at immediate assessment there are many interactions between system modules that lead to a considerable delay of response. Lazy assessment allows answer preservation, assessment execution scheduling and delivery of next question or test results. Immediate results will be calculated only for simple question frames, not a laboratory frames. The full statistics and results on laboratory will be accessible through means of monitoring of system. Sequence diagram of lazy assessment is presented on Fig.3. In AcademicNT execution time of lazy assessment is distributed randomly between 5 and 60 minutes. Thus, it is provided simultaneously assessment of deferred tasks while testing process that decrease a load of servers and response time.
Fig.2. Sequence diagram of immediate assessment process
Internet Browser
Servlet
DBMS
Submit answer
Function call
HTML
Next web page
Store answer Select next task
Fig.3. Sequence diagram of lazy assessment process
Servlet
Scheduler
DBMS
Assessment Server
Get task
The scheduler module is a part of AcademicNT web application. It is periodically polls DBMS for new tasks for which execution time has come. Tasks executes sequentially, therefore, actual time of execution can differ from the planned. Scheduler actions while lazy assessment is presented at sequence diagram on Fig.4. Originator of activity is a Scheduler that chooses a new task with help of stored procedure. Stored procedure returns task description in XML document that contains all necessary data.
XML
Function call
Function call Evaluation request RLCP request RLCP response
In error case, scheduler terminates the task and holds it to later execution, after a time in web application configuration. After several errors, there is a sending of e-mail message to the system administrator.
Store result
Complete
Save status
Fig.4. Sequence diagram of execution of scheduling events 3. REMOTE LABORATORY CONTROL PROTOCOL
Fig. 1. LMS modules interaction scheme
The interaction between AcademicNT web application and assessment servers is organized through RLCP protocol. This protocol was specially developed to provide a transition of
data that is required for answer assessment and for result presentation in XML format. Sequence of assessment is the following: • Establishment of TCP connection; • Sending a request from Servlet to Assessment Server; • Receiving response from Assessment Server; • Closing of TCP connection. Request to assessment server consists of header and body. Header is separated from body with a new line. The first line of header is a work mode (check or calculate). The next line defines fields conforms to format "name: value". The description of this fields presented in Table 1. The Check mode means laboratory task assessment and the calculate means server calculations.
Table 1. RLCP request fields Name url conte ntlength
Example url: rlcp://test:test@ 127.0.0.1:2005 content-length: 12345
Description Points an URL of assessment server Describes a size of RLCP-message (in bytes)
RLCP response has the following format: • Response status code; • Header fields; • Empty line; • Response body. Response status is a response numeric code. Available response codes are described in Table 2. Header fields are described in Table 3.
Table 2. Server response codes Status code XXX
Description
100
The server continues to process request Request is successfully processed and response contains results Requested resource is temporary moved Incorrect request Incorrect reference sets Authentication failed Unsupported method (supported only Check or Calculate) Absence of necessary header field Absence of necessary header field value Requested resource is temporary unavailable
200 300 400 401 402 403 404 405 500
501
Method is supported by protocol but not by this server
Table 3. RLCP response fields Name
Description
content-length
Size of body (in bytes). Only if when response code is 200 Points to real URL. Only if response code is 300
location
Each line in response or request should ends up with carriage return and new line symbols (with character codes 10 and 13 respectively). RLCP message includes reference data sets identifiers, time of assessment, laboratory output and boolean result for each data set. Assessment server is a regular desktop application and can interact with external programs in any way. XML-messages of RLCP have different structures for request and response. Request elements description is presented in Table 4. DTD for RLCP request is a following:
Table 4. RLCP request elements Element Request Request/Conditions
Request/Conditions/ ConditionForChecking/@id Request/Conditions/ ConditionForChecking/@Time Request/Conditions/ ConditionForChecking/Input Request/Conditions/ ConditionForChecking/Output
Description Root element of message Encapsulates reference data sets and assessment parameters Reference data pair identifier Time limit for assessment (seconds) Reference input data Reference data
output
|
Request/Conditions/ ConditionForCalculating/@Time Request/Conditions/ ConditionForCalculating/Input
Time limit for calculation (seconds) Reference input data set for calculations
Request/Instructions
User answer
that case limited by that operating system which works on a web-server. Besides, compilation and execution of arbitrary program on a web server represents danger to all servers work. The architectural decision offered on the Fig.5 allows to solve these problems. On the Fig.1 the standard decision is presented.
Response XML elements are described in Table 5. DTD for RLCP response is following:
|
Table 5. RLCP response elements Element Response Response/CheckingResult Response/CheckingResult/@id Response/CheckingResult/@Time Response/CheckingResult/@Result
Response/CalculationResult
Description Root element Container for results of single reference data pair Reference data set identifier Time of assessment Boolean result as a an indication of coincidence reference data set with laboratory output Result of calculations
4. VIRTUAL LABORATORY ON CYBERNETICS The Virtual Laboratory on cybernetics has been developed for Open Olympiad of St.-Petersburg on Cybernetics among School Teams (CYBER-NET). The Olympiad needs the knowledge and skills on physics, mathematics and computer science simultaneously. Some examples of tasks of the Olympiad are given on the page "Examples of tasks" at cyber-net.spb.ru. According to the AcademicNT architecture requirements, the laboratory implemented as an applet and an assessment server. The basic difference of the given work from others is possibility to debug the program. Preliminary compilation and debugging of programs demands on execution of foreign programs: compilers and linkers. However, considering the simplified requirements to the client's environment, execution of external programs is required to be organized on a server. It that gives the uniform list of compilers for all students. AcademicNT architecture does not give possibility of intermediate interaction between the applet and an assessment server. On the other hand, on safety rules, the applet can co-operate only with a server from which it has been loaded. The list of compilers would be in
Fig.5. Virtual laboratory module diagram Second solution allows the applet to send the data directly on checking server and to process the response. Interaction occurs by Remote Laboratory Control Protocol (RLCP), but passing interaction with web application (Servlet) and database management system (DBMS). Apparently from the figure, the assessment server is located on the separate computer, on purpose to remove restrictions of a web server operating system and to reduce risk of an overload of a web server and the web application. Assessment server (proxy) and Assessment server is the same application, but with a different configuration. Only the configuration defines, whether an application will redirect requests to other host or will independently check up the answer. Another reason of installation of Assessment server (proxy) is that the applet can address only to that server from which it has been loaded.
>
In "proxy" mode there is only Redirect element and ExecuteConfigs sub-element set is empty. DTD elements are described in Table 6.
In this case real assessment server is located at 192.168.0.12 and listens to 20005 TCP port. There is time limit of 60 seconds for whole operation of sending/receiving data. Assessment server configuration, which has been adjusted for work with java-programs only following:
Table 6. Assessment server configuration elements Elements XPath Config/Port/@value Config/UserInfo Config/DebugRunTimeout/@timeOut Config/Redirect
ExecuteConfig/@type ExecuteConfig/CompileDir
ExecuteConfig/ProgramFile ExecuteConfig/CommandsEnv ExecuteConfig/Command
ExecuteConfig/Command/Args
Proxy configuration example following:
Description TCP port number for inbound connections User account information Time limit for compilation Redirection parameters (host and port of remote server) Name of subconfiguration for different languages Folder where sources and temporary compilation files are stored Name of executable file (often duplicates compiler option) Additional required environment variables Operation system command or path to external program to be executed. @timeOut attribute is used to specify additional time limit Full command line to execute external program with arguments
In the presented example commands for compilation and execution of the received program are realized. The environment variable JAVA_HOME is added. The file name (Main.java) which will be kept on a disk is underlined. The folder compile-trunk-java is used for storage of an initial code. The laboratory is realized in such a manner that each new program before compilation remains in the temporary folder (in which the subdirectory compile-trunk-java is created), is compiled, executed, and then the temporary catalogue leaves. The interface of a client part (applet) represents text area for editing of a code with syntax highlighting, controls for debugging of the program and area of editing and viewing of standard input/output streams.
AcademicNT web page with task description, applet and other control elements is presented in Fig.6.
3 4 5 6
> “ Line breaks (single characters and sequences of characters with codes 10 и 13)
> − "
5. CONCLUSION LMS AcademicNT is intended for organization and realization of education process. One of the main advantages of the system is a virtual laboratory technology. It is used for formation and assessment of skills. This paper describes modules interaction scheme, introduces assessment algorithms and data exchange protocol. Main results are illustrated on a basis of virtual laboratory on cybernetics. This virtual laboratory is intended for programming skills assessment with coding possibility in the most widespread programming languages. Fig.6. Virtual laboratory user interface The buttons located in the left top corner serve for undo or redo last actions and for program sending on a server for debugging. The dropdown list on the right above allows to choose the programming language (for example, GNU C ++, Free Pascal, Java 6). There is an area for code manipulation with syntax highlighting and numbering of lines is located in the center. There is tabbed panel located at bottom. This panel allows setting up input and previewing output data from standard output and error streams. Mixing of standard output and error streams allows showing both output data and compilation or runtime errors. Applet controls are used only for debugging. For real answer submission the standard control elements located on a page with the task are used. The RLCP request is sending to assessment server during debugging. This request includes program text and test input data as an reference input data in RLCP packet. The server response is transferring in comments in element CheckingResult during debugging. This data represented in "Output stream" panel. During debugging or submitting laboratory answer is encoded in RLCP XML message. This message can be enclosed in HTTP package or is sent at once on an assessment server. Therefore the message is required to be escaped taking into account symbols, significant in XML and for HTTP. XML parsing errors and assessment stop is occurred without escaping. Escaping occurs in an order presented in the Table 7.
Table 7. Special characters and corresponding entities № 1 2
Character & <
Entity & <
REFERENCES Lisicina L.S., Lyamin А.V. (2008) Network Technologies for Training School Students in Computer Science. Computer Instruments in School. Volume 6. pp.15-23. (in Russian). Lyamin A.V., Vashenkov O.E. (2009) Virtual Laboratory: Multi-style code editor. Proceedings of 23rd ICDE World Conference on Open Learning and Distance Education including the 2009 EADTU Annual Conference, 7-10 June 2009, Maastricht. (http://www.ou.nl/icde2009). Vashenkov O.E., Lyamin A.V. (2008) Technology of Virtual Laboratories Developing in AcademicNT Environment on a Work Example on Computer Science. Materials of interuniversity scientifically-methodical conference "Problems of learning maintenance of transition to twolevel system in an engineering education" / MISIS. pp.239-249. (in Russian). Vashenkov O.E., Volkova A.A., Lyamin A.V. (2007) Examples of Implementation of Network Virtual Laboratories in the Environment of Learning Management System. Proceedings of St.Petersburg State University of IT, Mechanics and Optics. Volume 45. Information technology. pp.157-164. (in Russian). Vasilev V.N., Lyamin A.V., Chegin M.S. (2007) Learning Management System of Second Generation. Proceedings of St.Petersburg State University of IT, Mechanics and Optics. Volume 45. Information Technology. pp.148-157. (in Russian).