當前位置: 首頁>>代碼示例>>Python>>正文


Python Assessment.scores_by_criterion方法代碼示例

本文整理匯總了Python中openassessment.assessment.models.Assessment.scores_by_criterion方法的典型用法代碼示例。如果您正苦於以下問題:Python Assessment.scores_by_criterion方法的具體用法?Python Assessment.scores_by_criterion怎麽用?Python Assessment.scores_by_criterion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在openassessment.assessment.models.Assessment的用法示例。


在下文中一共展示了Assessment.scores_by_criterion方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: get_assessment_median_scores

# 需要導入模塊: from openassessment.assessment.models import Assessment [as 別名]
# 或者: from openassessment.assessment.models.Assessment import scores_by_criterion [as 別名]
def get_assessment_median_scores(submission_uuid):
    """Get the median score for each rubric criterion

    For a given assessment, collect the median score for each criterion on the
    rubric. This set can be used to determine the overall score, as well as each
    part of the individual rubric scores.

    If there is a true median score, it is returned. If there are two median
    values, the average of those two values is returned, rounded up to the
    greatest integer value.

    Args:
        submission_uuid (str): The submission uuid is used to get the
            assessments used to score this submission, and generate the
            appropriate median score.

    Returns:
        dict: A dictionary of rubric criterion names,
        with a median score of the peer assessments.

    Raises:
        PeerAssessmentInternalError: If any error occurs while retrieving
            information to form the median scores, an error is raised.
    """
    try:
        workflow = PeerWorkflow.objects.get(submission_uuid=submission_uuid)
        items = workflow.graded_by.filter(scored=True)
        assessments = [item.assessment for item in items]
        scores = Assessment.scores_by_criterion(assessments)
        return Assessment.get_median_score_dict(scores)
    except DatabaseError:
        error_message = (u"Error getting assessment median scores for submission {uuid}").format(uuid=submission_uuid)
        logger.exception(error_message)
        raise PeerAssessmentInternalError(error_message)
開發者ID:robertgerinlajoie,項目名稱:edx-ora2,代碼行數:36,代碼來源:peer.py

示例2: get_assessment_scores_by_criteria

# 需要導入模塊: from openassessment.assessment.models import Assessment [as 別名]
# 或者: from openassessment.assessment.models.Assessment import scores_by_criterion [as 別名]
def get_assessment_scores_by_criteria(submission_uuid):
    """Get the staff score for each rubric criterion

    Args:
        submission_uuid (str): The submission uuid is used to get the
            assessment used to score this submission.

    Returns:
        (dict): A dictionary of rubric criterion names, with a score of
            the staff assessments.

    Raises:
        StaffAssessmentInternalError: If any error occurs while retrieving
            information from the scores, an error is raised.
    """
    try:
        # This will always create a list of length 1
        assessments = list(
            Assessment.objects.filter(
                score_type=STAFF_TYPE, submission_uuid=submission_uuid
            )[:1]
        )
        scores = Assessment.scores_by_criterion(assessments)
        # Since this is only being sent one score, the median score will be the
        # same as the only score.
        return Assessment.get_median_score_dict(scores)
    except DatabaseError:
        error_message = u"Error getting staff assessment scores for {}".format(submission_uuid)
        logger.exception(error_message)
        raise StaffAssessmentInternalError(error_message)
開發者ID:openfun,項目名稱:edx-ora2,代碼行數:32,代碼來源:staff.py

示例3: get_assessment_scores_by_criteria

# 需要導入模塊: from openassessment.assessment.models import Assessment [as 別名]
# 或者: from openassessment.assessment.models.Assessment import scores_by_criterion [as 別名]
def get_assessment_scores_by_criteria(submission_uuid):
    """Get the median score for each rubric criterion

    Args:
        submission_uuid (str): The submission uuid is used to get the
            assessments used to score this submission, and generate the
            appropriate median score.

    Returns:
        (dict): A dictionary of rubric criterion names, with a median score of
            the peer assessments.

    Raises:
        SelfAssessmentInternalError: If any error occurs while retrieving
            information to form the median scores, an error is raised.
    """
    try:
        assessments = list(
            Assessment.objects.filter(
                score_type=SELF_TYPE, submission_uuid=submission_uuid
            ).order_by('-scored_at')[:1]
        )
        scores = Assessment.scores_by_criterion(assessments)
        return Assessment.get_median_score_dict(scores)
    except DatabaseError:
        error_message = _(u"Error getting self assessment scores for {}").format(submission_uuid)
        logger.exception(error_message)
        raise SelfAssessmentInternalError(error_message)
開發者ID:YoshidaKS,項目名稱:edx-ora2,代碼行數:30,代碼來源:self.py

示例4: get_assessment_scores_by_criteria

# 需要導入模塊: from openassessment.assessment.models import Assessment [as 別名]
# 或者: from openassessment.assessment.models.Assessment import scores_by_criterion [as 別名]
def get_assessment_scores_by_criteria(submission_uuid):
    """Get the score for each rubric criterion

    Args:
        submission_uuid (str): The submission uuid is used to get the
            assessment used to score this submission.

    Returns:
        (dict): A dictionary of rubric criterion names, with a score of
            the example based assessments.

    Raises:
        AIGradingInternalError: If any error occurs while retrieving
            information from the scores, an error is raised.
    """
    try:
        assessments = list(
            Assessment.objects.filter(
                score_type=AI_ASSESSMENT_TYPE, submission_uuid=submission_uuid
            ).order_by('-scored_at')[:1]
        )
        scores = Assessment.scores_by_criterion(assessments)
        return Assessment.get_median_score_dict(scores)
    except DatabaseError:
        error_message = u"Error getting example-based assessment scores for {}".format(submission_uuid)
        logger.exception(error_message)
        raise AIGradingInternalError(error_message)
開發者ID:EDUlib,項目名稱:edx-ora2,代碼行數:29,代碼來源:ai.py


注:本文中的openassessment.assessment.models.Assessment.scores_by_criterion方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。