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: ORA staff grader endpoints upgrade #10

Draft
wants to merge 3 commits into
base: FG/ORA_staff_grader_initialize_upgrade
Choose a base branch
from

Conversation

nandodev-net
Copy link

@nandodev-net nandodev-net commented Oct 18, 2023

ORA staff grader endpoints upgrade

For this PR we have the following goals:

  • Create the /api/ora_staff_grader/assessments/feedback endpoint in order to list the assessments grades based on the type (received or given) for a specific submission.
  • Update the /api/ora_staff_grader/initialize endpoint in order to add the fullname and email fields.

Descriptions

/api/ora_staff_grader/assessments/feedback

This endpoint fetches assessment details for a given submission UUID, assessment_fillter [given, received] and ORA_location, including scorer information and scoring details in order to fill the following Staff Grade MFE table:

Descripción alternativa 1

edx-ora2

  • openassessment/staffgrader/staff_grader_mixin.py
  • openassessment/data.py

edx-platform

  • lms/djangoapps/ora_staff_grader/constants.py
  • lms/djangoapps/ora_staff_grader/ora_api.py
  • lms/djangoapps/ora_staff_grader/serializers.py
  • lms/djangoapps/ora_staff_grader/urls.py
  • lms/djangoapps/ora_staff_grader/views.py
Click here! to see `/api/ora_staff_grader/assessments/feedback` output
  {
      "assessments": [
          {
              "id_assessment": "17",
              "scorer_name": "Fernando Gonzalez",
              "scorer_username": "admin",
              "scorer_email": "[email protected]",
              "assesment_date": "17-10-2023",
              "assesment_scores": [
                  {
                      "criterion_name": "Ideas",
                      "score_earned": 5,
                      "score_type": "Good"
                  },
                  {
                      "criterion_name": "Content",
                      "score_earned": 5,
                      "score_type": "Excellent"
                  }
              ],
              "problem_step": "Staff",
              "feedback": "OVERALL WENO"
          },
      ]
  }

 

 

/api/ora_staff_grader/initialize

This is a pre-existing endpoint to which two extra fields are added [fullname, email].

Descripción alternativa 2

Modifications were made in the following directories:

edx-ora2

  • /openassessment/staffgrader/tests/test_list_staff_workflows.py
  • openassessment/staffgrader/serializers/submission_list.py
  • openassessment/staffgrader/staff_grader_mixin.py
  • openassessment/data.py

edx-platform

  • lms/djangoapps/ora_staff_grader/serializers.py
Click here! to see `/api/ora_staff_grader/initialize` output
...
...
    "submissions": {
        "619b8fb2-ebc0-49ed-9b35-4700efb28f66": {
            "submissionUUID": "619b8fb2-ebc0-49ed-9b35-4700efb28f66",
            "username": "admin",
            "email": "[email protected]",
            "fullname": "Fernando Gonzalez",
            "teamName": null,
            "dateSubmitted": "2023-10-13 15:36:13.781179+00:00",
            "dateGraded": "2023-10-17 20:26:07.146547+00:00",
            "gradedBy": "admin",
            "gradeStatus": "graded",
            "lockStatus": "unlocked",
            "score": {
                "pointsEarned": 10,
                "pointsPossible": 10
            }
        }
    },

 

Testing

In order to test this, you can use the API platform Postman:

  1. Get an auth token from /oauth2/access_token/
  • /api/ora_staff_grader/initialize: params: oraLocation
  • /api/ora_staff_grader/assessments/feedback: params: oraLocation, submissionUUID, assessmentFilter = [given, received]

 

This upgrade will consist of two PRs: one for ORA and the other for edx-platform. This is because the main serializer of the service resides in the platform. To test it, you'll need to fetch and set up the version of the platform with the serializer modification.

Comment on lines 224 to 227
if data['assessment_type'] == "received":
return generate_received_assessment_data(subission_uuid)
else:
return generate_given_assessment_data(item_id, subission_uuid)
Copy link
Member

@mariajgrimaldi mariajgrimaldi Oct 18, 2023

Choose a reason for hiding this comment

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

is this given and received as the assessment type present elsewhere? can we elaborate on the meaning of each?

Copy link
Member

Choose a reason for hiding this comment

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

I believe the default should be list all assessments for the submission uuid, so received.

Copy link
Member

Choose a reason for hiding this comment

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

why is a single handler better than separating concerns? list_assessments_received or list_assessments_given are more explicit than list_assessments..., but I don't have other strong arguments

Copy link
Author

Choose a reason for hiding this comment

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

In the MFE, it's just a table with a filter button; the data output has the same format. At the backend level, it's just a design decision that, compared to having two handlers, neither adds nor subtracts anything; it's pretty much the same.

Copy link
Member

@mariajgrimaldi mariajgrimaldi Oct 23, 2023

Choose a reason for hiding this comment

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

It's not the same. When using a single handler with a variable assessment_type, which defaults to given, you are making a decision there, you're saying the defaults assessments returned are given by students on the submission. When using two handlers, the client can actively decide which one to call without guessing the system's default. Don't you think?

Copy link
Author

Choose a reason for hiding this comment

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

Yeah! that's true... but it does not exists a request without assessment_type (now called assessment_filter), it will always be given or received...

image

In fact, it is a required param in the AssessmentFeedbackView of edx-platform and declared in lms/djangoapps/ora_staff_grader/constants.py so, list_assessments() would be never called without assessment_filter...

jeje, but now tha you are saying this... I think that in form, this will look even better 😃

        filter_value = data['assessment_filter']

        if filter_value == "received":
            return generate_received_assessment_data(subission_uuid)
        elif filter_value == "given":
            return generate_given_assessment_data(item_id, subission_uuid)
        else:
            raise ValueError("Invalid assessment_filter value")

openassessment/data.py Outdated Show resolved Hide resolved
for optimized user data retrieval.
@nandodev-net nandodev-net changed the title feat: generate assessment data handler created feat: ORA staff grader endpoints upgraded Oct 23, 2023
@nandodev-net nandodev-net changed the title feat: ORA staff grader endpoints upgraded feat: ORA staff grader endpoints upgrade Oct 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants