当前位置: 首页>>代码示例>>Java>>正文


Java Assignment.getExternalAppName方法代码示例

本文整理汇总了Java中org.sakaiproject.service.gradebook.shared.Assignment.getExternalAppName方法的典型用法代码示例。如果您正苦于以下问题:Java Assignment.getExternalAppName方法的具体用法?Java Assignment.getExternalAppName怎么用?Java Assignment.getExternalAppName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.sakaiproject.service.gradebook.shared.Assignment的用法示例。


在下文中一共展示了Assignment.getExternalAppName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getIconClass

import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
/**
 * Helper to determine the icon class to use depending on the assignment external source
 *
 * @param assignment
 * @return
 */
public String getIconClass(final Assignment assignment) {
	final String externalAppName = assignment.getExternalAppName();

	String iconClass = getDefaultIconClass();
	if (StringUtils.equals(externalAppName, externalAppLoader.getString("sakai.assignment.title"))) {
		iconClass = getAssignmentsIconClass();
	} else if (StringUtils.equals(externalAppName, externalAppLoader.getString("sakai.samigo.title"))) {
		iconClass = getSamigoIconClass();
	} else if (StringUtils.equals(externalAppName, externalAppLoader.getString("sakai.lessonbuildertool.title"))) {
		iconClass = getLessonBuilderIconClass();
	}
	return iconClass;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:20,代码来源:GradebookNgBusinessService.java

示例2: makeGradebookItemFromAssignment

import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
private GradebookItem makeGradebookItemFromAssignment(String gbID, Assignment assignment,
        Map<String, String> studentUserIds, ArrayList<String> studentIds) {
    // build up the items listing
    GradebookItem gbItem = new GradebookItem(gbID, assignment.getName(), assignment
            .getPoints(), assignment.getDueDate(), assignment.getExternalAppName(),
            assignment.isReleased(), assignment.isCounted());
    gbItem.id = assignment.getId();
    /*
     *  We have to iterate through each student and get the grades out... 
     *  2.6 gradebook service has some issues
     */
    for (String studentId : studentIds) {
        // too expensive: if (gradebookService.getGradeViewFunctionForUserForStudentForItem(gbID, assignment.getId(), studentId) == null) {
        String grade = gradebookService.getAssignmentScoreString(gbID, assignment.getId(), studentId);
        if (grade != null) {
            GradebookItemScore score = new GradebookItemScore(assignment.getId().toString(),
                    studentId, grade );
            score.username = studentUserIds.get(studentId);
            CommentDefinition cd = gradebookService.getAssignmentScoreComment(gbID, assignment
                    .getId(), studentId);
            if (cd != null) {
                score.comment = cd.getCommentText();
                score.recorded = cd.getDateRecorded();
                score.graderUserId = cd.getGraderUid();
            }
            gbItem.scores.add(score);
        }
    }
    /* This is another post 2.5 way
    List<GradeDefinition> grades = gradebookService.getGradesForStudentsForItem(siteId,
            assignment.getId(), studentIds);
    for (GradeDefinition gd : grades) {
        String studId = gd.getStudentUid();
        String studEID = studentUserIds.get(studId);
        GradebookItemScore score = new GradebookItemScore(assignment.getId().toString(),
                studId, gd.getGrade(), studEID, gd.getGraderUid(), gd.getDateRecorded(),
                gd.getGradeComment());
        gbItem.scores.add(score);
    }
    **/
    return gbItem;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:43,代码来源:ExternalLogic.java

示例3: ExternalInfo

import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
public ExternalInfo(Assignment assignment) {
	this.externalId = assignment.getExternalId();
	this.externalApp = assignment.getExternalAppName();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:5,代码来源:ExternalInfo.java

示例4: determineStatus

import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
private static ProcessedGradeItemStatus determineStatus(ImportColumn column, Assignment assignment, ImportedGradeWrapper importedGradeWrapper,
                                   Map<Long, AssignmentStudentGradeInfo> transformedGradeMap) {
    ProcessedGradeItemStatus status = new ProcessedGradeItemStatus(ProcessedGradeItemStatus.STATUS_UNKNOWN);
    if (assignment == null) {
        status = new ProcessedGradeItemStatus(ProcessedGradeItemStatus.STATUS_NEW);
    } else if (assignment.getExternalId() != null) {
        status = new ProcessedGradeItemStatus(ProcessedGradeItemStatus.STATUS_EXTERNAL, assignment.getExternalAppName());
    } else {
        for (ImportedGrade importedGrade : importedGradeWrapper.getImportedGrades()) {
            AssignmentStudentGradeInfo assignmentStudentGradeInfo = transformedGradeMap.get(assignment.getId());
            ImportedGradeItem importedGradeItem = importedGrade.getGradeItemMap().get(column.getColumnTitle());

            String actualScore = null;
            String actualComment = null;

            if (assignmentStudentGradeInfo != null) {
                GbGradeInfo actualGradeInfo = assignmentStudentGradeInfo.getStudentGrades().get(importedGrade.getStudentEid());

                if (actualGradeInfo != null) {
                    actualScore = actualGradeInfo.getGrade();
                    actualComment = actualGradeInfo.getGradeComment();
                }
            }
            String importedScore = null;
            String importedComment = null;

            if (importedGradeItem != null) {
                importedScore = importedGradeItem.getGradeItemScore();
                importedComment = importedGradeItem.getGradeItemComment();
            }

            if (column.getType() == ImportColumn.TYPE_ITEM_WITH_POINTS) {
                String trimmedImportedScore = StringUtils.removeEnd(importedScore, ".0");
                String trimmedActualScore = StringUtils.removeEnd(actualScore, ".0");
                if (trimmedImportedScore != null && !trimmedImportedScore.equals(trimmedActualScore)) {
                    status = new ProcessedGradeItemStatus(ProcessedGradeItemStatus.STATUS_UPDATE);
                    break;
                }
            } else if (column.getType() == ImportColumn.TYPE_ITEM_WITH_COMMENTS) {
                if (importedComment != null && !importedComment.equals(actualComment)) {
                    status = new ProcessedGradeItemStatus(ProcessedGradeItemStatus.STATUS_UPDATE);
                    break;
                }
            }
        }
        // If we get here, must not have been any changes
        if (status.getStatusCode() == ProcessedGradeItemStatus.STATUS_UNKNOWN) {
            status = new ProcessedGradeItemStatus(ProcessedGradeItemStatus.STATUS_NA);
        }

        //TODO - What about if a user was added to the import file?
        // That probably means that actualGradeInfo from up above is null...but what do I do?

    }
    return status;
}
 
开发者ID:steveswinsburg,项目名称:gradebookNG,代码行数:57,代码来源:ImportGradesHelper.java


注:本文中的org.sakaiproject.service.gradebook.shared.Assignment.getExternalAppName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。