use of teammates.common.datatransfer.attributes.InstructorAttributes in project teammates by TEAMMATES.
the class BaseActionTest method verifyAccessibleForInstructorsOfTheSameCourse.
protected void verifyAccessibleForInstructorsOfTheSameCourse(String[] submissionParams) {
______TS("course instructor can access");
InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1");
StudentAttributes student1InCourse1 = typicalBundle.students.get("student1InCourse1");
InstructorAttributes otherInstructor = typicalBundle.instructors.get("instructor1OfCourse2");
gaeSimulation.loginAsInstructor(instructor1OfCourse1.googleId);
verifyCanAccess(submissionParams);
verifyCannotMasquerade(addUserIdToParams(student1InCourse1.googleId, submissionParams));
verifyCannotMasquerade(addUserIdToParams(otherInstructor.googleId, submissionParams));
}
use of teammates.common.datatransfer.attributes.InstructorAttributes in project teammates by TEAMMATES.
the class BaseActionTest method verifyUnaccessibleForUnregisteredUsers.
protected void verifyUnaccessibleForUnregisteredUsers(String[] submissionParams) {
______TS("non-registered users cannot access");
String unregUserId = "unreg.user";
InstructorAttributes instructor1OfCourse1 = typicalBundle.instructors.get("instructor1OfCourse1");
StudentAttributes student1InCourse1 = typicalBundle.students.get("student1InCourse1");
gaeSimulation.loginUser(unregUserId);
verifyCannotAccess(submissionParams);
verifyCannotMasquerade(addUserIdToParams(student1InCourse1.googleId, submissionParams));
verifyCannotMasquerade(addUserIdToParams(instructor1OfCourse1.googleId, submissionParams));
}
use of teammates.common.datatransfer.attributes.InstructorAttributes in project teammates by TEAMMATES.
the class BaseActionTest method verifyUnaccessibleWithoutModifySessionCommentInSectionsPrivilege.
protected void verifyUnaccessibleWithoutModifySessionCommentInSectionsPrivilege(String[] submissionParams) {
______TS("without Modify-Session-Comment-In-Sections privilege cannot access");
InstructorAttributes helperOfCourse1 = typicalBundle.instructors.get("helperOfCourse1");
gaeSimulation.loginAsInstructor(helperOfCourse1.googleId);
verifyCannotAccess(submissionParams);
}
use of teammates.common.datatransfer.attributes.InstructorAttributes in project teammates by TEAMMATES.
the class BaseActionTest method verifyUnaccessibleWithoutModifyStudentPrivilege.
protected void verifyUnaccessibleWithoutModifyStudentPrivilege(String[] submissionParams) {
______TS("without Modify-Student privilege cannot access");
InstructorAttributes helperOfCourse1 = typicalBundle.instructors.get("helperOfCourse1");
gaeSimulation.loginAsInstructor(helperOfCourse1.googleId);
verifyCannotAccess(submissionParams);
}
use of teammates.common.datatransfer.attributes.InstructorAttributes in project teammates by TEAMMATES.
the class ErrorUserReportLogActionTest method testExecuteAndPostProcess.
@Override
@Test
protected void testExecuteAndPostProcess() throws Exception {
InstructorAttributes instructor1ofCourse1 = typicalBundle.instructors.get("instructor1OfCourse1");
gaeSimulation.loginAsInstructor(instructor1ofCourse1.googleId);
______TS("Typical Success Case");
final String testErrorReportSubject = "Test Error Subject";
final String testErrorReportContent = "This is a test user-submitted error report.";
final String testErrorReportRequestedUrl = "/page/testurl";
String[] params = new String[] { Const.ParamsNames.ERROR_FEEDBACK_URL_REQUESTED, testErrorReportRequestedUrl, Const.ParamsNames.ERROR_FEEDBACK_EMAIL_SUBJECT, testErrorReportSubject, Const.ParamsNames.ERROR_FEEDBACK_EMAIL_CONTENT, testErrorReportContent };
ErrorUserReportLogAction action = getAction(params);
AjaxResult result = getAjaxResult(action);
assertEquals(Const.StatusMessages.ERROR_FEEDBACK_SUBMIT_SUCCESS, result.getStatusMessage());
// getting basic AccountAttributes because ErrorUserReportLogAction only logs this.
AccountAttributes instructor1ofCourse1AccountAttributes = accountsLogic.getAccount(instructor1ofCourse1.googleId, false);
final String expectedLogMessage = "====== USER FEEDBACK ABOUT ERROR ====== \n" + "REQUESTED URL: " + testErrorReportRequestedUrl + "\n" + "ACCOUNT DETAILS: " + instructor1ofCourse1AccountAttributes.toString() + "\n" + "SUBJECT: " + testErrorReportSubject + "\n" + "FEEDBACK: " + testErrorReportContent;
assertEquals(expectedLogMessage, action.getUserErrorReportLogMessage());
}
Aggregations