import com.rigiresearch.examgen.ClosedEnded;
import com.rigiresearch.examgen.CompoundQuestion;
import com.rigiresearch.examgen.OpenEnded;
import com.rigiresearch.examgen.TextSegment;
import java.util.Arrays;

/**
 * Copyright 2017 University of Victoria
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to
 * deal in the Software without restriction, including without limitation the
 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 * sell copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 * IN THE SOFTWARE.
 */

/**
 * Main program.
 * @author Miguel Jimenez (miguel@uvic.ca)
 * @date 2017-08-12
 * @version $Id$
 * @since 0.0.1
 */
public final class Application {

    public static void main(final String[] args) {
        new CompoundQuestion(
            new TextSegment.Simple("This is a group of questions"),
            Arrays.asList(
                new ClosedEnded(
                    new TextSegment.Simple("This is a question with options"),
                    Arrays.asList(
                        new ClosedEnded.Option(
                            true,
                            new TextSegment.Simple("This is an option")
                        ),
                        new ClosedEnded.Option(
                            false,
                            new TextSegment.Simple("This is another option")
                        )
                    )
                ),
                new OpenEnded(
                    new TextSegment.Simple("Is this an open question?")
                )
            )
        );
    }

}

@@ -88,16 +88,107 @@
 estion;%0A
+import com.rigiresearch.examgen.CompoundText;%0Aimport com.rigiresearch.examgen.Examination;%0A
 import c
@@ -291,16 +291,42 @@
 .Arrays;
+%0Aimport java.util.HashMap;
 %0A%0A/**%0A *
@@ -1602,16 +1602,48 @@
 tion %7B%0A%0A
+    @SuppressWarnings(%22serial%22)%0A
     publ
@@ -1701,26 +1701,606 @@
 new 
-CompoundQuestion(%0A
+Examination(%0A            new CompoundText(%0A                Arrays.asList(%0A                    new TextSegment.Simple(%22Quiz 1%22),%0A                    new TextSegment.Simple(%22CSC 111%22),%0A                    new TextSegment.Simple(%22Fall 2017%22)%0A                )%0A            ),%0A            new TextSegment.Simple(%22Quiz 1%22),%0A            new HashMap%3CString, String%3E()%7B%7B%0A                put(%22V Number%22, %22%22);%0A                put(%22Name%22, %22%22);%0A                put(%22Lab Section%22, %22B01%22);%0A                put(%22Grade%22, %22%22);%0A            %7D%7D,%0A            Arrays.asList(%0A                new CompoundQuestion(%0A        
     
@@ -2367,32 +2367,40 @@
 %22),%0A            
+        
 Arrays.asList(%0A 
@@ -2406,32 +2406,40 @@
                 
+   
+     
 new ClosedEnded(
@@ -2435,24 +2435,32 @@
 losedEnded(%0A
+        
             
@@ -2538,32 +2538,40 @@
                 
+        
 Arrays.asList(%0A 
@@ -2585,32 +2585,40 @@
                 
+   
+     
 new ClosedEnded.
@@ -2657,14 +2657,30 @@
     
+       
+ 
 true,%0A
+        
     
@@ -2763,35 +2763,51 @@
                 
+   
-),%0A
+     ),%0A        
                 
@@ -2866,16 +2866,24 @@
         
+        
 false,%0A 
@@ -2901,32 +2901,40 @@
                 
+  
+      
 new TextSegment.
@@ -2982,34 +2982,50 @@
                 
-)%0A
+        )%0A        
                 
@@ -3038,35 +3038,51 @@
                 
+  
-),%0A
+      ),%0A        
                 
@@ -3092,24 +3092,32 @@
  OpenEnded(%0A
+        
             
@@ -3176,16 +3176,64 @@
 tion?%22)%0A
+                        )%0A                    )%0A
         

Update sample code