Search in sources :

Example 21 with ElementTag

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;
}
Also used : ArrayList(java.util.ArrayList) ElementTag(teammates.ui.template.ElementTag)

Example 22 with ElementTag

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);
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) ArrayList(java.util.ArrayList) FeedbackSessionsTableRow(teammates.ui.template.FeedbackSessionsTableRow) ElementTag(teammates.ui.template.ElementTag) FeedbackSessionsCopyFromModal(teammates.ui.template.FeedbackSessionsCopyFromModal)

Example 23 with ElementTag

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;
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) InstructorFeedbackSessionActions(teammates.ui.template.InstructorFeedbackSessionActions) ArrayList(java.util.ArrayList) FeedbackSessionsTableRow(teammates.ui.template.FeedbackSessionsTableRow) ElementTag(teammates.ui.template.ElementTag)

Example 24 with ElementTag

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;
}
Also used : ElementTag(teammates.ui.template.ElementTag)

Example 25 with ElementTag

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;
}
Also used : ElementTag(teammates.ui.template.ElementTag)

Aggregations

ElementTag (teammates.ui.template.ElementTag)30 ArrayList (java.util.ArrayList)16 CourseAttributes (teammates.common.datatransfer.attributes.CourseAttributes)3 FeedbackQuestionDetails (teammates.common.datatransfer.questions.FeedbackQuestionDetails)3 InstructorFeedbackResultsResponseRow (teammates.ui.template.InstructorFeedbackResultsResponseRow)3 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)2 FeedbackSessionsTableRow (teammates.ui.template.FeedbackSessionsTableRow)2 InstructorFeedbackResultsModerationButton (teammates.ui.template.InstructorFeedbackResultsModerationButton)2 HashMap (java.util.HashMap)1 LinkedHashMap (java.util.LinkedHashMap)1 InstructorAttributes (teammates.common.datatransfer.attributes.InstructorAttributes)1 StudentAttributes (teammates.common.datatransfer.attributes.StudentAttributes)1 ActiveCoursesTable (teammates.ui.template.ActiveCoursesTable)1 ActiveCoursesTableRow (teammates.ui.template.ActiveCoursesTableRow)1 ArchivedCoursesTable (teammates.ui.template.ArchivedCoursesTable)1 ArchivedCoursesTableRow (teammates.ui.template.ArchivedCoursesTableRow)1 FeedbackSessionsCopyFromModal (teammates.ui.template.FeedbackSessionsCopyFromModal)1 InstructorFeedbackResultsQuestionTable (teammates.ui.template.InstructorFeedbackResultsQuestionTable)1 InstructorFeedbackSessionActions (teammates.ui.template.InstructorFeedbackSessionActions)1