Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(Get Classmate Work): Create endpoint for classmate Discussion work #54

Merged
merged 2 commits into from
Nov 10, 2021

Conversation

geoffreykwan
Copy link
Member

  1. Log in as a student
  2. Launch a run that contains a Discussion component
  3. Go to a Discussion component
  4. In a different tab, go to the Discussion student work endpoint (shown below) using the id values from your Discussion
  5. Make sure the endpoint returns all the Discussion work for that period
  6. Modify the endpoint to point to a component that is not a Discussion
  7. Make sure the endpoint returns Access Denied
  8. Go to the Discussion annotations endpoint (shown below) using the id values from your Discussion
  9. Make sure the endpoint returns all the Discussion annotations for that period. If you need to create a Discussion annotation, sign in as the teacher and delete a post.
  10. Modify the endpoint to point to a component that is not a Discussion
  11. Make sure the endpoint returns Access Denied

Discussion student work endpoint example

http://localhost:81/api/classmate/discussion/student-work/20/43/node295/gilppbbnym

Discussion annotations endpoint example

http://localhost:81/api/classmate/discussion/annotations/20/43/node295/gilppbbnym

Closes #51

Comment on lines 29 to 31
Run run = runService.retrieveById(runId);
Group period = groupService.retrieveById(periodId);
if (isAllowedToGetData(auth, run, period, nodeId, componentId)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines are also in getClassmateDiscussionAnnotations(). Extract to method?

Copy link
Member

@hirokiterashima hirokiterashima left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Functionality works as described.

Here are my suggestions for improving code readability/testing:

  • See comments/questions inline
  • Revert changes where comments add extra lines
  • Add tests for
    • HibernateStudentWorkDao.getStudentWork()
    • HibernateRunDao.isUserInRunAndPeriod()
    • HibernateAnnotationDao.getAnnotations()
    • ClassmatedataController methods

import org.json.JSONException;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unused import?

import org.wise.vle.domain.annotation.wise5.Annotation;
import org.wise.vle.domain.work.StudentWork;

public class ClassmateDataController {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would this class ever be instantiated by itself? Make into abstract class?

@hirokiterashima hirokiterashima merged commit 3c29b7e into develop Nov 10, 2021
@hirokiterashima hirokiterashima deleted the issue-51-classmate-work-endpoints branch November 10, 2021 20:49
@geoffreykwan
Copy link
Member Author

🎉 This PR is included in version 1.0.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create endpoint for retrieving Discussion classmate work
2 participants