========================================================== Todo in order to get this question type running properly: ========================================================== You may try out this question type with some given example files in the folder EXAMPLE_FILES. 1. Module Path: Put this module into this sub directory: moodle\question\type\ 2. Compilation and execution: In config.php set the proper 'PATH_TO_JAVAC' and 'PATH_TO_JAVA'! Note: There is also a security manager which checks for non-proper student-responses. This way you should not worry about the student messing up the system (polfile-file). 3. Syntax-Highlighting: If you don't have set Syntax-Highlighting already you should go through README_syntHighl.txt-file in order to get syntax highlighting configured. This way the source codes will be displayed syntax highlighted after taking the quiz. 4. styles.css If you use Moodle 1.9 you won't need to do the following. If you use Moodle 1.8 do following for nice styling outputs: copy following into moodle/theme/YOURUSEDTHEME(e.g. standardlogohighlighting)/geshi.css e.g. on the top --------------- /*********** styles for JUnit-question-type nice outputs*/ .que .studentscode { background: #ffa; } .que .compileroutput, .que .executionoutput{ background: #acf; /*ccc*/ } /***********/ --------------- 5. Module Documentation: In Moodle versions lower than 1.8.3 the linking to the local language files doesn't work properly. In order to get the linking work correct you need to replace some lines in two files (you may take a look at http://moodle.org/mod/forum/discuss.php?d=90801#p441439 for details): In moodle/question/question2.php replace --------------- $streditingquestion = get_string('editingquestion', 'question'); --------------- with --------------- list($streditingquestion,) = $QTYPES[$question->qtype]->get_heading(); --------------- In moodle/question/type/questiontype.php replace --------------- function display_question_editing_page(&$mform, $question, $wizardnow){ $name = $this->name(); $strheading = get_string('editing' . $name, 'qtype_' . $name); if ($strheading[0] == '[') { // Legacy behavior, if the string was not in the proper qtype_name // language file, look it up in the quiz one. $strheading = get_string('editing' . $name, 'quiz'); } print_heading_with_help($strheading, $name, 'quiz'); $mform->display(); } --------------- with --------------- /** * This method should be overriden if you want to include a special heading or some other * html on a question editing page besides the question editing form. * * @param question_edit_form $mform a child of question_edit_form * @param object $question * @param string $wizardnow is '' for first page. */ function display_question_editing_page(&$mform, $question, $wizardnow){ list($heading, $langmodule) = $this->get_heading(); print_heading_with_help($heading, $this->name(), $langmodule); $mform->display(); } /** * Method called by display_question_editing_page and by question.php to get heading for breadcrumbs. * * @return array a string heading and the langmodule in which it was found. */ function get_heading(){ //TODO new for language linking $name = $this->name(); $langmodule = 'qtype_' . $name; $strtoget = 'editing' . $name; $strheading = get_string($strtoget, $langmodule); if ($strheading[0] == '[') { // Legacy behavior, if the string was not in the proper qtype_name // language file, look it up in the quiz one. $langmodule = 'quiz'; $strheading = get_string($strtoget, $langmodule); } return array($strheading, $langmodule); } --------------- 6. Use in Moodle version < Moodle 1.9 In file edit_sojunit_form.php-file change --------------- function validation($data, $files) { $errors = parent::validation($data, $files); return $errors; } --------------- to --------------- function validation($data) { $errors = parent::validation($data); return $errors; } --------------- ===========================================