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


Java Assignment.getDueDate方法代码示例

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


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

示例1: removeGradebookItem

import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
/**
 * Remove an assignment using the external id to locate it,
 * will only remove assignments which actually are externally managed by us
 * 
 * @param gradebookId the gradebook unique id (can also be the siteId)
 * @param externalId the external id for the assignment (must be externally controlled)
 * @return the Assignment if found and removed OR null if not found and NOT removed
 */
public GradebookItem removeGradebookItem(String gradebookId, String externalId) {
    GradebookItem removed = null;
    Assignment a = findAssignmentByExternalId(gradebookId, externalId);
    if (a != null) {
        /* NOTES:
         * (1) Removing the Assignment only does not work, adding external ones later will cause exceptions (externalId in use)
         *      gradebookService.removeAssignment(a.getId());
         * (2) Breaking the connection only does not actually remove the Assignment
         *      gradebookExternalAssessmentService.setExternalAssessmentToGradebookAssignment(gradebookId, externalId);
         * (3) The correct way which seems to remove the external assessment, Assignment, and scores is removeExternalAssessment
         *      gradebookExternalAssessmentService.removeExternalAssessment(gradebookId, externalId);
         */
        gradebookExternalAssessmentService.removeExternalAssessment(gradebookId, externalId);
        removed = new GradebookItem(gradebookId, a.getName(), a.getPoints(), a.getDueDate(), a.getCategoryName(), a.isReleased(), a.isCounted());
        removed.id = a.getId();
        removed.deleted = true;
    }
    return removed;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:28,代码来源:ExternalLogic.java

示例2: getEntitiesForContext

import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
public Map<String, String> getEntitiesForContext(String gradebookUid) {

		Map<String, String> rv = new LinkedHashMap<String, String>();

		if (!gbs.isGradebookDefined(gradebookUid)) {
			return rv;
		}
		
		List<Assignment> assignments = gbs.getAssignments(gradebookUid, SortType.SORT_BY_NAME);
		for (Assignment asn : assignments) {
			String assignmentName = asn.getName();
			String assignmentPoints = asn.getPoints().toString();
			boolean isReleasedToStudents = asn.isReleased();
			boolean isUsedInGradeCalculation = asn.isCounted();
			Date dueDate = asn.getDueDate();
			long dueDateMillis = 0;
			if (dueDate != null) dueDateMillis = dueDate.getTime();
			// event resource of the form: /gradebook/[gradebook id]/[assignment name]/[points possible]/[due date millis]/[is released]/[is included in course grade]/[has authz]
			rv.put("/gradebook/"+ gradebookUid + "/" + assignmentName + "/" + assignmentPoints + "/" + dueDateMillis + "/" + isReleasedToStudents + "/" + isUsedInGradeCalculation , assignmentName + " (" + assignmentPoints + " points)");
		}
		return rv;
	}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:23,代码来源:GradebookConditionsProvider.java

示例3: GradebookItem

import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
public GradebookItem(Assignment assignment) {
	this.id = assignment.getId();
	this.name = assignment.getName();
	this.points = assignment.getPoints();
	this.dueDate = assignment.getDueDate();
	if(assignment.isExternallyMaintained()) {
		this.externalInfo = new ExternalInfo(assignment);
	}
	this.grades = new ArrayList<>();
	this.categoryId = assignment.getCategoryId();
	this.released = assignment.isReleased();
	this.extraCredit = assignment.isExtraCredit();
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:14,代码来源:GradebookItem.java

示例4: 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


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