/*
Copyright (c) 2007 Matt Williams matt@milliams.com

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License or (at
your option) version 3 or, at the discretion of KDE e.V. (which shall
act as a proxy as in section 14 of the GPLv3), any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#ifndef KQTIASSESSMENTTEST_H
#define KQTIASSESSMENTTEST_H

#include "kqtiassessmentitem.h"

#include <QString>
#include <QDomDocument>
#include <kqti_export.h>

class KQtiTestPart;

/**
 * \class KQtiAssessmentTest
 * A test is a group of assessmentItems with an associated set of rules that
 * determine which of the items the candidate sees, in what order, and in what
 * way the candidate interacts with them. The rules describe the valid paths
 * through the test, when responses are submitted for response processing and
 * when (if at all) feedback is to be given.
 * 
 * http://www.imsglobal.org/question/qtiv2p1pd2/imsqti_infov2p1pd2.html#element10472
 */

class KQTI_EXPORT KQtiAssessmentTest /*This is a base class*/
{
    Q_PROPERTY(QString mTitle                       READ title      WRITE setFunction)
    Q_PROPERTY(QString mIdentifier                  READ identifier WRITE setIdentifier)
    Q_PROPERTY(QList<KQtiTestPart*> mTestPartList   READ testParts  WRITE addTestPart)
    
    public:
        KQtiAssessmentTest(const QString& identifier, const QString& title);
        KQtiAssessmentTest(const QDomDocument& document);
        ~KQtiAssessmentTest();
        
        void addTestPart(KQtiTestPart* testPart);
        QList<KQtiTestPart*> testParts() const {return mTestPartList;}
        
        void setTitle(const QString& title) {mTitle = title;}
        QString title() const {return mTitle;}
        void setIdentifier(const QString& identifier) {mIdentifier = identifier;}
        QString identifier() const {return mIdentifier;}
        
        QDomDocument document() const;
        
    protected:
        QString mTitle; //[1]
        QString mIdentifier; //[1]
        QList<KQtiTestPart*> mTestPartList; //[1..*]
        //QString mToolName; //[0..1]
        //QString toolVersion; //[0..1]
        //KQtiTimeLimits timeLimits; //[0..1]
        //KQtiOutcomeProcessing outcomeProcessing; //[0..1]
        //KQtiOutcomeDeclaration outcomeDeclaration; //[*]
        //KQtiTestFeeback testFeedback; //[*]
};

#endif
