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);
}
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());
}
Aggregations