本文整理汇总了Java中org.sakaiproject.service.gradebook.shared.Assignment.isExternallyMaintained方法的典型用法代码示例。如果您正苦于以下问题:Java Assignment.isExternallyMaintained方法的具体用法?Java Assignment.isExternallyMaintained怎么用?Java Assignment.isExternallyMaintained使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sakaiproject.service.gradebook.shared.Assignment
的用法示例。
在下文中一共展示了Assignment.isExternallyMaintained方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getGradebookAssignmentsForStudent
import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
/**
* Special operation to get a list of assignments in the gradebook that the specified student has access to. This taked into account
* externally defined assessments that may have grouping permissions applied.
*
* This should only be called if you are wanting to view the assignments that a student would see (ie if you ARE a student, or if you
* are an instructor using the student review mode)
*
* @param studentUuid
* @return a list of assignments or empty list if none/no gradebook
*/
public List<Assignment> getGradebookAssignmentsForStudent(final String studentUuid) {
final Gradebook gradebook = getGradebook(getCurrentSiteId());
final List<Assignment> assignments = getGradebookAssignments();
// NOTE: cannot do a role check here as it assumes the current user but this could have been called by an instructor (unless we add
// a new method to handle this)
// in any case the role check would just be a confirmation that the user passed in was a student.
// for each assignment we need to check if it is grouped externally and if the user has access to the group
final Iterator<Assignment> iter = assignments.iterator();
while (iter.hasNext()) {
final Assignment a = iter.next();
if (a.isExternallyMaintained()) {
if (this.gradebookExternalAssessmentService.isExternalAssignmentGrouped(gradebook.getUid(), a.getExternalId()) &&
!this.gradebookExternalAssessmentService.isExternalAssignmentVisible(gradebook.getUid(), a.getExternalId(),
studentUuid)) {
iter.remove();
}
}
}
return assignments;
}
示例2: 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();
}
示例3: setUpGradebookAssignments
import org.sakaiproject.service.gradebook.shared.Assignment; //导入方法依赖的package包/类
public void setUpGradebookAssignments(){
try {
assignments = new ArrayList<SelectItem>();
assignments.add(new SelectItem(DEFAULT_GB_ITEM, getResourceBundleString(SELECT_ASSIGN)));
//Code to get the gradebook service from ComponentManager
GradebookService gradebookService = getGradebookService();
if(getGradebookExist()) {
List gradeAssignmentsBeforeFilter = gradebookService.getAssignments(toolManager.getCurrentPlacement().getContext());
for(int i=0; i<gradeAssignmentsBeforeFilter.size(); i++) {
Assignment thisAssign = (Assignment) gradeAssignmentsBeforeFilter.get(i);
if(!thisAssign.isExternallyMaintained()) {
try {
assignments.add(new SelectItem(Integer.toString(assignments.size()), thisAssign.getName()));
} catch(Exception e) {
log.error("DiscussionForumTool - processDfMsgGrd:" + e);
}
}
}
}
} catch(SecurityException se) {
log.debug("SecurityException caught while getting assignments.", se);
} catch(Exception e1) {
log.error("DiscussionForumTool&processDfMsgGrad:" + e1);
}
}