Classroom Activity Endpoints
#student_names
GET /api/v1/classroom_activities/:id/student_names
Returns a hash of the names of students that have activity sessions for the classroom activity, with their activity session uids as keys.
#teacher_and_classroom_name
GET /api/v1/classroom_activities/:id/teacher_and_classroom_name
Returns a hash with the following format, referring to the classroom of the classroom activity:
{teacher: #{classroom owner name}, classroom: #{classroom name}}
#finish_lesson
PUT /api/v1/classroom_activities/:id/finish_lesson
Expects data in the following format:
{
follow_up: Boolean(whether or not there is a follow up lesson),
concept_results: Array({
concept_uid: String,
question_type: String,
metadata: {
correct: Integer,
directions: String,
prompt: String|HTML,
answer: String,
attemptNumber: Integer,
questionNumber: Integer
},
activity_session_uid: String,
?edition_id: String
})
}
This method calls several others, which:
- Mark all activity sessions complete
- Updates the classroom activity to have locked: true, pinned: false, and completed: true
- Saves the concept results passed in the json object to the appropriate activity sessions
- Deletes activity sessions with no saved concept results
- Creates a 'Complete Customized Lesson' Milestone if the classroom activity had an edition id and the user does not have one already
- Assigns the follow up activity if the value is true
It returns a hash with the following format:
{follow_up_url: #{follow up activity URL or the profile url}
#unpin_and_lock_activity
PUT /api/v1/classroom_activities/:id/unpin_and_lock_activity
This method updates the classroom activity from the params to have pinned: false and locked: true.
It returns the new value of the classroom activity's pinned attribute.