package meerkat.voting.controller.selector;

import meerkat.protobuf.Voting.*;
import java.util.List;

/**
 * An interface for the question-selection component.
 * This component handles the connection between the channel choice questions and the race questions.
 * It gets the answers for the channel choice questions and determines which race question to put in the voter's ballot.
 * It also creates an identifier for this chosen channel. This identifier should appear in the plaintext of the ballot.
 * The channel identifier does not identify a specific voter, but rather it identifies a specific voting channel
 */
public interface QuestionSelector {

    /**
     * determines an identifier for the channel of the voter
     * @param channelChoiceAnswers The answers given by the voter to the channel choice questions
     * @return an identifier of the channel. To be used by selectQuestionsForVoter(). This identifier should also appear on the plaintext of the ballot
     */
    public byte[] getChannelIdentifier (List<BallotAnswer> channelChoiceAnswers);

    /**
     * determines which race questions to present to the voter according to its channel
     * @param channelIdentifier the identifier of this specific channel
     * @return the race questions (to present to the voter)
     */
    public List<BallotQuestion> selectQuestionsForVoter (byte[] channelIdentifier);

}
