use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.
the class InstructorFeedbackSessionsPageData method getFeedbackSessionTypeOptions.
/**
* Creates a list of options (STANDARD and TEAMEVALUATION). If defaultSessionType is null,
* TEAMEVALUATION is selected by default.
* @param defaultSessionType either STANDARD or TEAMEVALUATION, the option that is selected on page load
*/
private List<ElementTag> getFeedbackSessionTypeOptions(String defaultSessionType) {
ArrayList<ElementTag> result = new ArrayList<>();
ElementTag standardFeedbackSession = createOption("session with my own questions", "STANDARD", "STANDARD".equals(defaultSessionType));
ElementTag evaluationFeedbackSession = createOption("session using template: team peer evaluation", "TEAMEVALUATION", defaultSessionType == null || "TEAMEVALUATION".equals(defaultSessionType));
result.add(standardFeedbackSession);
result.add(evaluationFeedbackSession);
return result;
}
use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.
the class InstructorFeedbackSessionsPageData method buildCopyFromModal.
private void buildCopyFromModal(List<CourseAttributes> courses, String courseIdForNewSession, List<FeedbackSessionAttributes> existingFeedbackSessions, Map<String, InstructorAttributes> instructors, FeedbackSessionAttributes newFeedbackSession, String feedbackSessionNameForSessionList) {
List<FeedbackSessionAttributes> filteredFeedbackSessions = new ArrayList<>();
for (FeedbackSessionAttributes existingFeedbackSession : existingFeedbackSessions) {
if (instructors.get(existingFeedbackSession.getCourseId()).isAllowedForPrivilege(Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION)) {
filteredFeedbackSessions.add(existingFeedbackSession);
}
}
List<FeedbackSessionsTableRow> filteredFeedbackSessionsRow = convertFeedbackSessionAttributesToSessionRows(filteredFeedbackSessions, instructors, feedbackSessionNameForSessionList, courseIdForNewSession);
String fsName = newFeedbackSession == null ? "" : newFeedbackSession.getFeedbackSessionName();
List<ElementTag> courseIdOptions = getCourseIdOptions(courses, courseIdForNewSession, instructors, newFeedbackSession);
addPlaceholderIfEmpty(courseIdOptions, determinePlaceholderMessage(!courses.isEmpty()));
copyFromModal = new FeedbackSessionsCopyFromModal(filteredFeedbackSessionsRow, fsName, courseIdOptions);
}
use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.
the class InstructorFeedbackSessionsPageData method convertFeedbackSessionAttributesToSessionRows.
private List<FeedbackSessionsTableRow> convertFeedbackSessionAttributesToSessionRows(List<FeedbackSessionAttributes> sessions, Map<String, InstructorAttributes> instructors, String feedbackSessionNameForSessionList, String courseIdForNewSession) {
List<FeedbackSessionsTableRow> rows = new ArrayList<>();
for (FeedbackSessionAttributes session : sessions) {
String courseId = session.getCourseId();
String name = sanitizeForHtml(session.getFeedbackSessionName());
String submissionsTooltip = getInstructorSubmissionsTooltipForFeedbackSession(session);
String publishedTooltip = getInstructorPublishedTooltipForFeedbackSession(session);
String submissionStatus = getInstructorSubmissionStatusForFeedbackSession(session);
String publishedStatus = getInstructorPublishedStatusForFeedbackSession(session);
String href = getInstructorFeedbackStatsLink(session.getCourseId(), session.getFeedbackSessionName());
InstructorFeedbackSessionActions actions = getInstructorFeedbackSessionActions(session, Const.ActionURIs.INSTRUCTOR_FEEDBACK_SESSIONS_PAGE, instructors.get(courseId));
ElementTag elementAttributes;
if (session.getCourseId().equals(courseIdForNewSession) && session.getFeedbackSessionName().equals(feedbackSessionNameForSessionList)) {
elementAttributes = new ElementTag("class", "sessionsRow warning");
} else {
elementAttributes = new ElementTag("class", "sessionsRow");
}
rows.add(new FeedbackSessionsTableRow(courseId, name, submissionsTooltip, publishedTooltip, submissionStatus, publishedStatus, href, actions, elementAttributes));
}
return rows;
}
use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.
the class InstructorCourseEditPageData method createDeleteInstructorButton.
private ElementTag createDeleteInstructorButton(InstructorAttributes instructor, int panelIndex, boolean isDisabled) {
String buttonContent = "<span class=\"glyphicon glyphicon-trash\"></span> Delete";
String buttonId = "instrDeleteLink" + panelIndex;
String href = getInstructorCourseInstructorDeleteLink(instructor.courseId, instructor.email);
boolean isDeleteSelf = instructor.email.equals(this.account.email);
ElementTag button = createBasicButton(buttonContent, buttonId, href, Const.Tooltips.COURSE_INSTRUCTOR_DELETE, isDisabled);
button.setAttribute("data-is-delete-self", String.valueOf(isDeleteSelf));
button.setAttribute("data-instructor-name", instructor.getName());
button.setAttribute("data-course-id", instructor.getCourseId());
return button;
}
use of teammates.ui.template.ElementTag in project teammates by TEAMMATES.
the class InstructorCourseEditPageData method createAddInstructorButton.
private ElementTag createAddInstructorButton(boolean isDisabled) {
// addInstructorButton is an actual <input> button and is thus created differently from the rest of
// the buttons created with <a> tags
ElementTag button = new ElementTag();
button.setAttribute("type", "button");
button.setAttribute("id", "btnShowNewInstructorForm");
button.setAttribute("class", "btn btn-primary");
if (isDisabled) {
button.setAttribute("disabled", null);
}
return button;
}
Aggregations