Issue Details (XML | Word | Printable)

Key: CONTRIB-689
Type: New Feature New Feature
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Anthony Borrow
Reporter: Süreç Özcan
Votes: 0
Watchers: 2
Operations

Add/Edit UI Mockup to this issue
If you were logged in you would be able to see more operations.
Non-core contributed modules

This is a new junit-question-type-plugin used in a quiz

Created: 28/Aug/08 05:27 PM   Updated: 04/Feb/09 05:46 AM
Return to search
Component/s: QuestionType: Sojunit
Affects Version/s: 1.9.1
Fix Version/s: None

File Attachments: 1. Text File fixes.patch.txt (4 kB)
2. Zip Archive sojunit 2008_10_10.zip (136 kB)
3. Zip Archive sojunit.zip (664 kB)
4. Zip Archive tracker_modules.zip (157 kB)

Environment:
I have been developing this on Linux, but it should work on Windows as well. I have tried it out on Firefox. It should definitely work on Moodle 1.9.2+ and with some changes described in help.txt-file it should work on 1.8.2+ (haven't tested it again though).

Database: MySQL
URL: http://moodle.org/mod/forum/discuss.php?d=102690#p460596
Participants: Anthony Borrow, Süreç Özcan and Tim Hunt
Security Level: None
Resolved date: 26/Oct/08
Affected Branches: MOODLE_19_STABLE


 Description  « Hide
I have developed a new question-type called sojunit and want to share it with the community.

Tim Hunt suggested me putting it into the contrib-tracker in order to have the latest version to work on - while still debugging.
I want to thank Tim Hunt for his great help while implementing this question-type!

Note:
In the question-type there is a section that includes 'Source Code' and 'Selected Source Code'. This won't work without installing the Source-Code-question-type (see attachment).
I have been thinking about creating quizzes for computer science classes and created a new architecture for this purpose with following idea:
In computer science classes the usage of source codes is essential. Corresponding to a given Source-Code-question-type (which I am still working on) which simply displays a nicely syntax-highlighted source code you can create a following group of questions. So the idea is to separate the source code from the questions.
You may display a Source-Code with its corresponding questions on one page and make a page break before the next group while organizing the questions for a quiz.
You may reference from this single question e.g. to special code lines of code fragments of the displayed Source Code to ask questions. Be creative! wink
Maybe this feature matches more for for example the multichoice or regexp question types (which I will post soon). But I wanted to enable this also in this question type.

The following is a copy of my Readme.txt-file inside of my plugin - this way you can get an idea of what it does:

For computer science courses this question type allows a student to type source code for a given interface in Java.

In case the student response compiles the response gets graded automatically. This way the teacher can save time for corrections. Otherwise the teacher needs to grade the student response manually (in Results-tab -> Overview-tab -> click on a students attempt -> a questions "Make comment or override grade"-link) in order to give partial scores instead of none.

After the quiz has been taken the given source code can be seen nicely syntax-highlighted in the gradings. In the quizzes "Results->Item analysis" the compiler or execution output get displayed for each students attempt. This way you can get a better overview about the problems of your students in coding.

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.
General Quiz settings

It is required to leave the quiz in Adaptive Mode in order to get the compiler outputs displayed. In dependence of the Adaptive Mode used you need to leave "Penalty factor" to "0" in question-settings. This way the student won't get penalties subtracted when pressing the "Submit"-button in order to see if his/her code compiles.

For an "exam" and "exercise with grading" in quiz-options set e.g. "Attempts allowed" to "1 attempt" and "Grading method" to "Last attempt". This way the student can send in their final answer once using "Submit all and finish"-button but because of the Adaptive Mode they can "Submit" their code several times for compilation tests.

If several Junit-questions used in a quiz - for usability reasons it is recommended to put one question on a page at a time using "page breaks". It is also possible to put several Junit-questions on one page though.

The idea of which output to display at what time for which test type is as follows:

compiler output:
    * Types: exams, exercise-sheets with grading and exercises without grading:
       gets displayed always

execution output:
    * Types: exams, exercise-sheets with grading:
      Gets displayed allways after the quiz has been taken.
      Settings: In "Students may review" in quiz-options uncheck in "Immediately after the attempt" "Feedback" so that the execution output does not get displayed and the student does not get extracted or demotivated while taking an exam. In the "exercise-sheets with grading" the student should not get to see this until after the quiz.

    * Type: exercises without grading:
      Display "immediately after the attempt" to student.
      Settings: In "Students may review" in quiz-options in "Immediately after the attempt" leave "Feedback" selected in order to display also the execution output after an attempt to the student.


Given code for student:
Make sure the class and method names used in "Given code for student" are identical with the ones in your test class you want to use for this question. Otherwise the student response won't be executed and you will have to grade each student response manually.

The class names need to be non-public in order to allow several classes to be used in one JUnit-test-file.


Load test class:
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 written in the "Given code for student" HTML-editor.

The number of your implemented test cases need to match the number in "Default question grade". For each test case the student can get 1 point. If you have for example five test cases in your test-file you should set the "Default question grade" to "5". If the response of the student passes all test cases he/she will get 5 points out of 5. Otherwise each failed test case will subtract 1 point of the possible.

 All   Comments   Change History   Version Control      Sort Order: Ascending order - Click to sort in descending order
Tim Hunt made changes - 28/Aug/08 05:45 PM
Field Original Value New Value
Assignee Tim Hunt [ timhunt ] Anthony Borrow [ aborrow ]
Tim Hunt made changes - 29/Aug/08 01:19 PM
Attachment fixes.patch.txt [ 15019 ]
Süreç Özcan made changes - 10/Oct/08 08:12 PM
Attachment sojunit 2008_10_10.zip [ 15368 ]
Anthony Borrow made changes - 26/Oct/08 08:55 AM
Component/s QuestionType: Sojunit [ 10348 ]
Component/s QuestionType: {none of the above} [ 10211 ]
Anthony Borrow made changes - 26/Oct/08 08:59 AM
Status Open [ 1 ] Resolved [ 5 ]
Resolution Fixed [ 1 ]
Süreç Özcan made changes - 28/Jan/09 01:03 AM
Attachment sojunit.zip [ 16148 ]