How to Import questions in a Question Bank from XML

I already have questions in another format. Does ETS Editor support importing questions from another format such as XML?

ETS Editor provides a powerful import facility that can be used to import questions from any format including an XML file.

Since there can be numerous formats for question data, ETS Editor abstracts out the question data using a Java class named etsloader.NonETSQuestion. This class is available in etseditor.jar. It is a very straight forward data object that has various fields pertaining to a question such as problem statement, options, explanation, code, toughness, and section. etseditor.jar also contains an interface named etsloader.AnyFormatQuestionFileLoader. This has only two methods as shown below.

public interface etsloader.AnyFormatQuestionFileLoader{
    //Map of Image Name-Image data
    public HashMap<String, byte[]> getImages() throws Exception;
    //List of all the questions
    public ArrayList<NonETSQuestion> loadFile(String fileName) throws Exception;

Now, all you need to do is to write a java class that implements this interface. In your class, you can parse an XML file, or connect to a database, and create NonETSQuestion objects.

Use ETS Editor's Tools->Load From File menu and select your class to load all your questions. This option is enabled when you have a question bank already opened for editing. Click on the Help button on the resulting dialog to learn how it works. The following is a code for a Sample Loader:

import com.enthuware.ets.loader.NonETSQuestion;
import java.util.ArrayList;
import java.util.Collections;

* This loader is for a fictious format where each line contains data for a question.

public class SampleMockLoader implements com.enthuware.ets.loader.AnyFormatQuestionFileLoader {
    public SampleMockLoader() {

    public static void main(String[] args) throws Exception{
        SampleMockLoader jml = new SampleMockLoader();
    public ArrayList<NonETSQuestion> loadFile(String fileName) throws Exception
        LineByLineTransformer.Command command = new MyCommand();
        ArrayList<NonETSQuestion> questions = new ArrayList<NonETSQuestion>();
        LineByLineTransformer lbl = new LineByLineTransformer(fileName, command, null, questions);
        return questions;
    public static class MyCommand implements LineByLineTransformer.Command
        static final int QUESTION_INDEX = 5;
        static final int EXPANDED_ANSWER_INDEX = 7;
        static final int NUMBER_OF_ANSWERS_INDEX = 2;
        static final int CORRECT_ANSWER_INDEX = 6;
        static final int STARTING_INDEX_OF_WRONG_ANSWERS = 8;
        public Object execute(Object obj)
            String line = (String) obj;
            if(line.length()<10return null;
            System.out.println("Processing :"+line);
            String[] sa = line.split("\\|");
            NonETSQuestion neq = new NonETSQuestion();
            ArrayList ops = new ArrayList();
            ops.add(new String[]{sa[CORRECT_ANSWER_INDEX], null"true"});
            for(int i=STARTING_INDEX_OF_WRONG_ANSWERS; i<sa.length; i++){
                if(sa[i] == null|| sa[i].trim().equals("")) break;
                ops.add(new String[]{sa[i], null"false"});
            return neq;

Success Guaranteed

We are confident about the quality of our products. We will refund your money in full if you fail the exam after passing any one of our standard tests or even if you find any three mistakes in our material within 3 months of purchase.

Screen Shots

How may we help you?

Please enter the followingpqjhywo
 Help us prevent SPAM!
 Send me a copy

Customer Reviews

Sanjay Singh

Enthuware mock exams helped a lot to make me ready for the exam. This is worth every penny you pay. Their support team is very prompt to answer your any question. My all questions had been answered just in a day and till now I didn’t find any single question which I can say is given wrong. I su...


 Platform Independent
 Convenient Licensing
 Advanced DnD Support 
 Chat with and see Average Scores of other users
 Allows you to take notes while taking a test
 Store your resources and urls

Customer Care

We have over a million satisfied users since 1999. We are known for our helpful and prompt customer service.

We were also the first to offer complete money back guarantee.

Volume Discounts

If you are a training institute or a company looking to buy multiple licenses, we do offer volume discounts. Please contact us at