javaunittest

Question types ::: qtype_javaunittest
Maintained by Gergely Bertalan, Michael Rumler
Hallo Moodle Users. We have developed a new question-type called javaunittest and want to share it with the community. The plugin is a new version of the sojunit questtion type developed by Süreç Özcan for Moodle 1.8 (https://moodle.org/mod/forum/discuss.php?d=102690).
Latest release:
34 sites
5 downloads
4 fans
Current versions available: 3

For computer science courses this question type allows a teacher to create Java questions and test the knowledge of students about Java programming. The students type source code for a given interface in Java and the response gets graded automatically. This way the teacher can save time for corrections, which is particularly important when large number of students visiting the course.

Figure 1. illustrates the editing view of the javaunittest question type. In this example the teacher created two javaunittest questions. In the first, the students have to implement the factorial function, in the second, the reverse string function. Every question has its own answer field with an interface given by the teacher.

The student implements the javaunitttest question on the question editing form and writes the response in the answer-field. Figure 2. illustrates an attempt.

After finishing the attempt the student submits the response. In case the student response compiles the response gets graded automatically with a JUnit test implemented by the teacher. The JUnit test evaluates the response and returns a value between 0 and 100%, which represents the correctness of the student's Java code. After that, the student's grade is computed automatically by Moodle from this percentage value. With compilation error the student's answer is graded as ,,wrong” with 0% correctness. After executing the grading, the student can view his given answer with a feedback about the test. The student gets all the questions with question text, the student-response and the compiler- or JUnti execution-output. This is illustrated in figures 3 and 4.

You need the following to use this question type:

Java and JUnit have to be installed on your server. In the configuration file the javac, java and junit variables have to be initialized with the proper value. Fore more information see the README.txt file in the plugin's directory.

In order to get an automatic grading for this question you need to create and implement a JUnit test-file. This file needs to match exactly the class and function names used in the source code given by the teacher. This code serves as interface between the JUnit test and the student's response. In the EXAMPLE_FILES directory, three examples were defined. For more information see the README.txt file in the EXAMPLE_FILES directory.

Screenshots

Screenshot #0
Screenshot #1
Screenshot #2
Screenshot #3

Contributors

Gergely Bertalan (Lead maintainer)
Please login to view contributors details and/or to contact them

Comments RSS

Comments

  • Anthony Borrow
    Mon, 26 Aug 2013, 7:10 AM
    Gergely - Many thanks for sharing this plugin with the Moodle community. Just a couple of things to start off with. First, please make sure to specify what version of Moodle the plugin is designed to work with. Second, there are a couple of validation warnings that should be easy to patch up:

    Release name ($plugin->release) not found in version.php
    Release notes not found (searched for files README, README.*)

    I would also encourage you to provide the source control, tracker and documentation URLs for the Useful links section. This helps to encourage folks to collaborate with you in reporting issues, making code improvements, etc. Thanks for your attention to these details and for your patience with the approval process. My goal is to give folks a consistent experience with installing plugins. For now, I am going to mark the plugin as needing a little more work but once you get things tidied up submit a new version and I'll try installing it and give any other feedback I have. Please do not hesitate to let me know if there is anything I can do to be supportive of your efforts.

    Peace - Anthony
  • Anthony Borrow
    Tue, 28 Jan 2014, 1:18 AM
    I received the following email from Gergely:

    I have updated for six months a moodle plug-in for Java unit testing. I would like that someone reviews my code so we can use the plug-in at the TU-Berlin in our moodle learning system. The plug-in would be interesting for other universities as well, since it makes possible to easily test students' code in Java .

    Could You help me with the review process? I think that the plug-in fulfills all the requirements to be reviewed and I have been waiting for the plug-in to be reviewed since august. Is there any chance that someone tests my code and the plug-in will be accepted as official moodle plug-in?


    Thank You for Your help.


    Yours sincerely,

    Gergely Bertalan
  • Anthony Borrow
    Tue, 28 Jan 2014, 1:22 AM
    Gergely - Thanks for fixing up the validation issues. The best place to ask questions about or provide updates regarding the status of this plugin is here in comments. I have marked the plugin as ready to be reviewed. As mentioned previously, it would help if you could provide the source control and tracker URLs. I like to ensure things are properly named before approving a plugin for the community. Peace - Anthony
  • Anthony Borrow
    Tue, 28 Jan 2014, 1:30 AM
    p.s. - I believe I read that this plugin has been tested with Moodle 2.3 and 2.5 - any reasons to thing that it might not work with 2.4 and 2.6? You may want to do some simple testing with 2.4 and 2.6 and then we can update the current zip file as working for versions 2.3 to 2.6
  • Anthony Borrow
    Tue, 28 Jan 2014, 9:08 AM
    I was able to install this in to Moodle 2.5 without any issues. Peace - Anthony
  • MD shot of me from his iphone4
    Mon, 24 Feb 2014, 12:26 PM
    Hi Gergely,
    Please have a read through : http://docs.moodle.org/dev/Plugin_validation#Recommended_URLs , this is important in providing a plugin for the community. Do let us know if you are having problems with providing those urls.
  • Gergely Bertalan
    Wed, 12 Mar 2014, 12:20 AM
    Hi Aparup,

    I created a git repository. Could we continue the review process??
  • MD shot of me from his iphone4
    Wed, 12 Mar 2014, 10:17 AM
    Thats great - what is the url? please add it to this plugin (edit the plugin and in the form fields for 'urls' add it to 'repository url')
  • Gergely Bertalan
    Wed, 12 Mar 2014, 11:37 AM
    I updated a new version. You can find the URL there. Please use the new version: javaunittest 1.2
  • MD shot of me from his iphone4
    Wed, 19 Mar 2014, 10:13 AM
    Thanks, i downloaded and used git to find out the remote. I've added it to your plugin entry here now. It's generally preferred not to include '.git' directory in zips, you may want to address that by adding a line with the git url to README.txt. I shan't delay this any longer.
Please login to post comments