Package so.tio.inlearn.common.testing

Examples of so.tio.inlearn.common.testing.TaskItem


        allAnswers.put(taskId, answers);
    }

    public boolean isTaskValid(long taskId){
        Map<String, List<String>> answers = allAnswers.get(taskId);
        TaskItem validTask = findTask(test, taskId);
        if (validTask == null) {
            System.err.println("task #" + taskId + " not found!");
            return false;
        }
        int answersCount = 0;
        // Counting answers
        for(Entry<String, List<String>> a : answers.entrySet()){
            answersCount += a.getValue().size();
        }
        List<HashMap<String, String>> validAnswers = validTask.getAnswers();
        // Counting valid answers and check answers
        int validAnswersCount = 0;
        for (HashMap<String, String> validPairs : validAnswers) {
            boolean isBad = false;
            for(Entry<String, String> entry: validPairs.entrySet()){
View Full Code Here


        allTasks = test.getTasks().size();
        maximumMark = test.getMaximumMark();
        this.validTasks = validTasks;
    }
    private int getTaskCost(long taskId){
        TaskItem task = findTask(test, taskId);
        if(task == null){
            return 0;
        }
        return task.getCost();
    }
View Full Code Here

            return 0;
        }
        return task.getCost();
    }
    private TaskItem findTask(TestVariant test, long taskId){
        TaskItem task = null;
        // Finding task in current test
        for (TaskItem currentItem : test.getTasks()) {
            if (currentItem.getTaskId() == taskId) {
                task = currentItem;
            }
View Full Code Here

TOP

Related Classes of so.tio.inlearn.common.testing.TaskItem

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.