190 likes | 200 Views
Explore the new features of Svetovid, a powerful submission environment for students. Learn about the CodeEditorPane and its advanced functionalities such as syntax highlighting, bracket pairing, line numbering, and cheating prevention. Discover how this Java-based tool can enhance your programming experience.
E N D
Extensions to Svetovidstudents’ submission environment Doni Pracner, Ivan Pribela,Mirjana Ivanović, Zoran Budimac
Presentation contents • Introduction • Overview of Svetovid • Motivation • Goals of the extension • New textual component • Overview of some of the new features • Conclusions
Svetovid • Special Submission Environment for Students Assessment • Developed at the Department of Mathematics and Informatics, Faculty of Science, Novi Sad • Written in Java – cross platform • Successfully used in several courses
Student Student Instructor Instructor Student Student Student Student Server Server Student Student Student Student Svetovid architecture • Server • running on one computer • Any number of clients • running on other computers • Both server and clients are written in Java 5 • Recommended server platform • Windows XP • Windows NT • any UNIX platform
Control (instructor) client • Prompts a login dialog • Set of configuration dialogs • Setting up courses • Managing students • Full control over the conduction of practical exercises • Groups, order, timing
Student client • Prompts a login dialog • IDE allowing the student comfortable work • The files owned by a student are contained in a virtual directory
Motivation • The text component should accommodate the needs of programming • A third party component was built in • Syntax highlight, parenthesis matching,… • Main problems: • No keyboard shortcuts while editing text • No automatic indention
Goals of the extension • Create a new text component • Usage of the ‘Java Swing’ text package • Keep all of the previous features and add new ones
CodeEditorPane • New textual component • Extends JEditorPane • Main features • Syntax highlighting • Marking bracket pairs • Line numbering • Indent preservation • Measures against cheating • Convenience methods for applications
Syntax Highlight (1/2) • Done in a separate object representing the language • Interface ProgramLang • Language properties • Methods for syntax highlighting • Whole document • Segment • Expanded segment
Syntax Highlighting (2/2) • Class DefaultLang – default implementation • an empty language • Flexible scanner, easy to extend into new languages • Currently supported languages: Java, Scheme, Modula2 and TeX • PlainTextLang – for simple textual files • Automatic detection of languages (extensions)
Parenthesis matching • Pairs of parenthesis usually have a meaning in program code • Usage of the Highlighter interface
Line numbering • Made as a separate text pane with line numbers • Should be built in a JScrollPane as a row header
Code indention • Helps to make more readable code • On line breaks, the indent from the previous line is copied
Measures against cheating • Usage of the system clipboard is forbidden • Overriding cut, copy and paste methods • Using a local static clipboard
Convenience methods for visual implementation • Status bar • Row and column of the caret • Currently active language for highlighting • Toolbar • Programming language selection • Manual syntax highlight refresh • Line numbering component • Fully set up JPanel with the component
Conclusion • CodeEditorPane • Support for all existing features, adding new ones • Flexible syntax highlight system • Simple to build in into existing applications • Does not break existing ‘Swing’ text mechanisms • Unfortunately the new component has not yet been implemented into Svetovid