sk.stuba.fiit.foo07.genex.generator
Class TestGenerator

java.lang.Object
  extended by sk.stuba.fiit.foo07.genex.generator.TestGenerator

public class TestGenerator
extends java.lang.Object

Author:
Martin Michalek This class represents a test generator which selects questions based on the desired difficulty of generated test.

Constructor Summary
TestGenerator(java.sql.Connection con, java.util.ArrayList<java.lang.Integer> questionCategoryIDs, java.util.ArrayList<java.lang.Integer> keywordIDs, java.util.ArrayList<java.lang.Integer> questionTypeIDs, int questionCount, int pointsSummDesired, boolean containsPictures, java.util.ArrayList<java.lang.Integer> difficultiesCount)
           
TestGenerator(java.sql.Connection con, java.util.ArrayList<java.lang.Integer> questionCategoryIDs, java.util.ArrayList<java.lang.Integer> keywordIDs, java.util.ArrayList<java.lang.Integer> questionTypeIDs, int difficultyDesired, int questionCount, int pointsSummDesired, boolean containsPictures)
           
 
Method Summary
 void assembleTest()
           
 void generateTest()
          Generates test based on input parameters.
 Test getGeneratedTest()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TestGenerator

public TestGenerator(java.sql.Connection con,
                     java.util.ArrayList<java.lang.Integer> questionCategoryIDs,
                     java.util.ArrayList<java.lang.Integer> keywordIDs,
                     java.util.ArrayList<java.lang.Integer> questionTypeIDs,
                     int difficultyDesired,
                     int questionCount,
                     int pointsSummDesired,
                     boolean containsPictures)
Parameters:
con - database connection
questionCategoryIDs - list of category IDs which specify the initial set of questions for test generating
keywordIDs - list of keyword IDs which specify the initial set of questions for test generating
questionTypeIDs - types of questions for the test
difficultyDesired - test difficulty that we want to achieve
questionCount - number of questions in the test
pointsSummDesired - the point value of the test we want to achieve
containsPictures - false if the test must not contain questions with pictures

TestGenerator

public TestGenerator(java.sql.Connection con,
                     java.util.ArrayList<java.lang.Integer> questionCategoryIDs,
                     java.util.ArrayList<java.lang.Integer> keywordIDs,
                     java.util.ArrayList<java.lang.Integer> questionTypeIDs,
                     int questionCount,
                     int pointsSummDesired,
                     boolean containsPictures,
                     java.util.ArrayList<java.lang.Integer> difficultiesCount)
Method Detail

getGeneratedTest

public Test getGeneratedTest()
Returns:
the generatedTest

generateTest

public void generateTest()
                  throws NotEnoughQuestionsException,
                         java.sql.SQLException
Generates test based on input parameters. Results are stored in class fields and can be obtained using getter methods: getGeneratedTest(), getDifficultyAchieved(), getPointsSummAchieved()

Throws:
NotEnoughQuestionsException
java.sql.SQLException

assembleTest

public void assembleTest()
                  throws NotEnoughQuestionsException,
                         java.sql.SQLException
Throws:
NotEnoughQuestionsException
java.sql.SQLException


Copyright © 2008 Faculty of Informatics and Information Technologies, STU Bratislava. All Rights Reserved.