本文整理汇总了Java中org.sakaiproject.service.gradebook.shared.Assignment.getName方法的典型用法代码示例。如果您正苦于以下问题:Java Assignment.getName方法的具体用法?Java Assignment.getName怎么用?Java Assignment.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sakaiproject.service.gradebook.shared.Assignment
的用法示例。
在下文中一共展示了Assignment.getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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;
}
示例3: getAssignmentsForCategories
import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
/**
*
* @param categoryDefinition
* @return basic information for assignments in the given category
*/
private List<SparseGradebookItem> getAssignmentsForCategories(CategoryDefinition categoryDefinition) {
List<Assignment> assignmentList = categoryDefinition.getAssignmentList();
List<SparseGradebookItem> assignmentsRest = new ArrayList<SparseGradebookItem>();
for (Assignment assign : assignmentList) {
SparseGradebookItem gbItem = new SparseGradebookItem(assign.getId(), assign.getName());
assignmentsRest.add(gbItem);
}
return assignmentsRest;
}
示例4: 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();
}
示例5: 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;
}
示例6: GradeAssignmentItem
import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
public GradeAssignmentItem(Assignment assignment) {
this.itemName = assignment.getName();
this.points = assignment.getPoints();
}