<commit_before>/**********************************************************************************
 *
 * $Id$
 *
 ***********************************************************************************
 *
 * Copyright (c) 2005, 2006, 2007, 2008, 2009 The Sakai Foundation, The MIT Corporation
 *
 * Licensed under the Educational Community License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.opensource.org/licenses/ECL-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 **********************************************************************************/
package org.sakaiproject.service.gradebook.shared;

import java.math.MathContext;
import java.math.RoundingMode;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

/**
 * This is the externally exposed API of the gradebook application.
 * 
 * This interface is principally intended for clients of application services --
 * that is, clients who want to "act like the Gradebook would" to automate what
 * would normally be done in the UI, including any authorization checks.
 * 
 * As a result, these methods may throw security exceptions. Call the service's
 * authorization-check methods if you want to avoid them.
 * 
 * <p>WARNING: For documentation of the deprecated methods, please see the
 * service interfaces which own them.
 */
public interface GradebookService {
	// Application service hooks.
	public static final int GRADE_TYPE_POINTS = 1;
	public static final int GRADE_TYPE_PERCENTAGE = 2;
	public static final int GRADE_TYPE_LETTER = 3;
	
	public static final int CATEGORY_TYPE_NO_CATEGORY = 1;
	public static final int CATEGORY_TYPE_ONLY_CATEGORY = 2;
	public static final int CATEGORY_TYPE_WEIGHTED_CATEGORY = 3;

	public static final String[] validLetterGrade = {"a+", "a", "a-", "b+", "b", "b-",
    "c+", "c", "c-", "d+", "d", "d-", "f"};
	
	// These Strings have been kept for backwards compatibility as they are used everywhere,
	// however the {@link GraderPermission} enum should be used going forward.
	@Deprecated public static final String gradePermission = GraderPermission.GRADE.toString();
	@Deprecated public static final String viewPermission = GraderPermission.GRADE.toString();
	
	public static final String enableLetterGradeString = "gradebook_enable_letter_grade";
	
	public static final MathContext MATH_CONTEXT = new MathContext(10, RoundingMode.HALF_DOWN);
	
	/** 
     * An enum for defining valid/invalid information for a points possible/relative weight
     * value for a gradebook item. See {@link GradebookService#isPointsPossibleValid(String, Assignment, Double)}
     * for usage
     */
    public enum PointsPossibleValidation {
        /**
         * The points possible/relative weight is valid
         */
        VALID,
        /**
         * The points possible/relative weight is invalid because it is null 
         * and a value is required.
         */
        INVALID_NULL_VALUE,
        /**
         * The points possible/relative weight is invalid because it
         * is a value <= 0
         */
        INVALID_NUMERIC_VALUE,
        /**
         * The points possible/relative weight is invalid because it contains
         * more than 2 decimal places<commit_msg>Fix bug in permission strings.<commit_after>/**********************************************************************************
 *
 * $Id$
 *
 ***********************************************************************************
 *
 * Copyright (c) 2005, 2006, 2007, 2008, 2009 The Sakai Foundation, The MIT Corporation
 *
 * Licensed under the Educational Community License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *       http://www.opensource.org/licenses/ECL-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 **********************************************************************************/
package org.sakaiproject.service.gradebook.shared;

import java.math.MathContext;
import java.math.RoundingMode;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

/**
 * This is the externally exposed API of the gradebook application.
 * 
 * This interface is principally intended for clients of application services --
 * that is, clients who want to "act like the Gradebook would" to automate what
 * would normally be done in the UI, including any authorization checks.
 * 
 * As a result, these methods may throw security exceptions. Call the service's
 * authorization-check methods if you want to avoid them.
 * 
 * <p>WARNING: For documentation of the deprecated methods, please see the
 * service interfaces which own them.
 */
public interface GradebookService {
	// Application service hooks.
	public static final int GRADE_TYPE_POINTS = 1;
	public static final int GRADE_TYPE_PERCENTAGE = 2;
	public static final int GRADE_TYPE_LETTER = 3;
	
	public static final int CATEGORY_TYPE_NO_CATEGORY = 1;
	public static final int CATEGORY_TYPE_ONLY_CATEGORY = 2;
	public static final int CATEGORY_TYPE_WEIGHTED_CATEGORY = 3;

	public static final String[] validLetterGrade = {"a+", "a", "a-", "b+", "b", "b-",
    "c+", "c", "c-", "d+", "d", "d-", "f"};
	
	// These Strings have been kept for backwards compatibility as they are used everywhere,
	// however the {@link GraderPermission} enum should be used going forward.
	@Deprecated public static final String gradePermission = GraderPermission.GRADE.toString();
	@Deprecated public static final String viewPermission = GraderPermission.VIEW.toString();
	
	public static final String enableLetterGradeString = "gradebook_enable_letter_grade";
	
	public static final MathContext MATH_CONTEXT = new MathContext(10, RoundingMode.HALF_DOWN);
	
	/** 
     * An enum for defining valid/invalid information for a points possible/relative weight
     * value for a gradebook item. See {@link GradebookService#isPointsPossibleValid(String, Assignment, Double)}
     * for usage
     */
    public enum PointsPossibleValidation {
        /**
         * The points possible/relative weight is valid
         */
        VALID,
        /**
         * The points possible/relative weight is invalid because it is null 
         * and a value is required.
         */
        INVALID_NULL_VALUE,
        /**
         * The points possible/relative weight is invalid because it
         * is a value <= 0
         */
        INVALID_NUMERIC_VALUE,
        /**
         * The points possible/relative weight is invalid because it contains
         * more than 2 decimal places
{'fraction_non_alphanumeric': 0.14212565734846389, 'fraction_numerical': 0.00941046221976197, 'mean_word_length': 3.7421259842519685, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3639590', 'n_tokens_mistral': 1935, 'n_tokens_neox': 1783, 'n_words': 749}