Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
…9345) * add API to get a list of feedback sessions of current user * add API to get courses of the current user * add API to create a feedback session delete copy action as it can be achieved by session/question GET/POST APIs * add API to restore feedback session in the recycle bin * add API to delete a feedback session * modify get session response rate API to enable instructor to access * add API to publish/unpublish session * add/modify frontend components * add API to remind students for result/submission * add API to get instructor privilege * abstract out the magic feedback session name max length * fix bug in submission status tooltip * fix typo in status message * move template questions/template sessions to separate JSON file
- Loading branch information
1 parent
090401c
commit de975cf
Showing
123 changed files
with
4,424 additions
and
852 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
75 changes: 0 additions & 75 deletions
75
src/main/java/teammates/ui/controller/InstructorFeedbackCopyAction.java
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
72 changes: 72 additions & 0 deletions
72
src/main/java/teammates/ui/newcontroller/CreateFeedbackSessionAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
package teammates.ui.newcontroller; | ||
|
||
import java.time.Instant; | ||
|
||
import teammates.common.datatransfer.attributes.CourseAttributes; | ||
import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; | ||
import teammates.common.datatransfer.attributes.InstructorAttributes; | ||
import teammates.common.exception.EntityAlreadyExistsException; | ||
import teammates.common.exception.InvalidHttpRequestBodyException; | ||
import teammates.common.exception.InvalidParametersException; | ||
import teammates.common.util.Const; | ||
import teammates.common.util.SanitizationHelper; | ||
|
||
/** | ||
* Create a feedback session. | ||
*/ | ||
public class CreateFeedbackSessionAction extends Action { | ||
|
||
@Override | ||
protected AuthType getMinAuthLevel() { | ||
return AuthType.LOGGED_IN; | ||
} | ||
|
||
@Override | ||
public void checkSpecificAccessControl() { | ||
String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); | ||
|
||
InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); | ||
CourseAttributes course = logic.getCourse(courseId); | ||
|
||
gateKeeper.verifyAccessible(instructor, course, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); | ||
} | ||
|
||
@Override | ||
public ActionResult execute() { | ||
String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); | ||
|
||
InstructorAttributes instructor = logic.getInstructorForGoogleId(courseId, userInfo.getId()); | ||
CourseAttributes course = logic.getCourse(courseId); | ||
|
||
FeedbackSessionInfo.FeedbackSessionCreateRequest createRequest = | ||
getAndValidateRequestBody(FeedbackSessionInfo.FeedbackSessionCreateRequest.class); | ||
|
||
String feedbackSessionName = SanitizationHelper.sanitizeTitle(createRequest.getFeedbackSessionName()); | ||
|
||
FeedbackSessionAttributes fs = | ||
FeedbackSessionAttributes | ||
.builder(feedbackSessionName, course.getId(), instructor.getEmail()) | ||
.withTimeZone(course.getTimeZone()) | ||
.withInstructions(createRequest.getInstructions()) | ||
.withStartTime(createRequest.getSubmissionStartTime()) | ||
.withEndTime(createRequest.getSubmissionEndTime()) | ||
.withGracePeriodMinutes(createRequest.getGracePeriod()) | ||
.withSessionVisibleFromTime(createRequest.getSessionVisibleFromTime()) | ||
.withResultsVisibleFromTime(createRequest.getResultsVisibleFromTime()) | ||
.withOpeningEmailEnabled(true) | ||
.withClosingEmailEnabled(createRequest.isClosingEmailEnabled()) | ||
.withPublishedEmailEnabled(createRequest.isPublishedEmailEnabled()) | ||
.withCreatedTime(Instant.now()) | ||
.build(); | ||
|
||
try { | ||
logic.createFeedbackSession(fs); | ||
} catch (EntityAlreadyExistsException | InvalidParametersException e) { | ||
throw new InvalidHttpRequestBodyException(e.getMessage(), e); | ||
} | ||
|
||
fs = logic.getFeedbackSession(fs.getFeedbackSessionName(), fs.getCourseId()); | ||
return new JsonResult(new FeedbackSessionInfo.FeedbackSessionResponse(fs)); | ||
} | ||
|
||
} |
37 changes: 37 additions & 0 deletions
37
src/main/java/teammates/ui/newcontroller/DeleteFeedbackSessionAction.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package teammates.ui.newcontroller; | ||
|
||
import teammates.common.datatransfer.attributes.FeedbackSessionAttributes; | ||
import teammates.common.util.Const; | ||
|
||
/** | ||
* Delete a feedback session. | ||
*/ | ||
public class DeleteFeedbackSessionAction extends Action { | ||
|
||
@Override | ||
protected AuthType getMinAuthLevel() { | ||
return AuthType.LOGGED_IN; | ||
} | ||
|
||
@Override | ||
public void checkSpecificAccessControl() { | ||
String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); | ||
String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); | ||
FeedbackSessionAttributes feedbackSession = logic.getFeedbackSessionFromRecycleBin(feedbackSessionName, courseId); | ||
|
||
gateKeeper.verifyAccessible(logic.getInstructorForGoogleId(courseId, userInfo.getId()), | ||
feedbackSession, | ||
Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); | ||
} | ||
|
||
@Override | ||
public ActionResult execute() { | ||
String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); | ||
String feedbackSessionName = getNonNullRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); | ||
|
||
logic.deleteFeedbackSession(feedbackSessionName, courseId); | ||
|
||
return new JsonResult("The feedback session is deleted."); | ||
} | ||
|
||
} |
Oops, something went wrong.