Search in sources :

Example 1 with InstructorFeedbackQuestionCopyPageData

use of teammates.ui.pagedata.InstructorFeedbackQuestionCopyPageData in project teammates by TEAMMATES.

the class InstructorFeedbackQuestionCopyPageAction method execute.

@Override
protected ActionResult execute() throws EntityDoesNotExistException {
    String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID);
    Assumption.assertPostParamNotNull(Const.ParamsNames.COURSE_ID, courseId);
    String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME);
    Assumption.assertPostParamNotNull(Const.ParamsNames.FEEDBACK_SESSION_NAME, feedbackSessionName);
    FeedbackSessionAttributes feedbackSession = logic.getFeedbackSession(feedbackSessionName, courseId);
    gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(courseId, account.googleId), feedbackSession, false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION);
    List<FeedbackQuestionAttributes> copiableQuestions = null;
    copiableQuestions = logic.getCopiableFeedbackQuestionsForInstructor(account.googleId);
    InstructorFeedbackQuestionCopyPageData data = new InstructorFeedbackQuestionCopyPageData(account, sessionToken, copiableQuestions);
    return createShowPageResult(Const.ViewURIs.INSTRUCTOR_FEEDBACK_QUESTION_COPY_MODAL, data);
}
Also used : FeedbackSessionAttributes(teammates.common.datatransfer.attributes.FeedbackSessionAttributes) InstructorFeedbackQuestionCopyPageData(teammates.ui.pagedata.InstructorFeedbackQuestionCopyPageData) FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes)

Example 2 with InstructorFeedbackQuestionCopyPageData

use of teammates.ui.pagedata.InstructorFeedbackQuestionCopyPageData in project teammates by TEAMMATES.

the class InstructorFeedbackQuestionCopyPageDataTest method allTests.

@Test
public void allTests() {
    ______TS("Typical case");
    List<FeedbackQuestionAttributes> copiableQuestions = new ArrayList<>();
    copiableQuestions.addAll(dataBundle.feedbackQuestions.values());
    InstructorFeedbackQuestionCopyPageData data = new InstructorFeedbackQuestionCopyPageData(dataBundle.accounts.get("instructor1OfCourse1"), dummySessionToken, copiableQuestions);
    FeedbackQuestionCopyTable copyForm = data.getCopyQnForm();
    assertEquals(dataBundle.feedbackQuestions.size(), copyForm.getQuestionRows().size());
}
Also used : InstructorFeedbackQuestionCopyPageData(teammates.ui.pagedata.InstructorFeedbackQuestionCopyPageData) FeedbackQuestionCopyTable(teammates.ui.template.FeedbackQuestionCopyTable) ArrayList(java.util.ArrayList) FeedbackQuestionAttributes(teammates.common.datatransfer.attributes.FeedbackQuestionAttributes) Test(org.testng.annotations.Test)

Aggregations

FeedbackQuestionAttributes (teammates.common.datatransfer.attributes.FeedbackQuestionAttributes)2 InstructorFeedbackQuestionCopyPageData (teammates.ui.pagedata.InstructorFeedbackQuestionCopyPageData)2 ArrayList (java.util.ArrayList)1 Test (org.testng.annotations.Test)1 FeedbackSessionAttributes (teammates.common.datatransfer.attributes.FeedbackSessionAttributes)1 FeedbackQuestionCopyTable (teammates.ui.template.FeedbackQuestionCopyTable)1