Skip to content

Commit

Permalink
Merge pull request #66 from SoryRawyer/rds/problems-with-section-names
Browse files Browse the repository at this point in the history
feat: add section names to problem dataset (FC-0051)
  • Loading branch information
Cristhian Garcia authored Apr 17, 2024
2 parents 9e56d80 + 509b17f commit f5ce938
Show file tree
Hide file tree
Showing 4 changed files with 109 additions and 4 deletions.
9 changes: 6 additions & 3 deletions models/problems/fact_problem_responses.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ with
actor_id,
responses,
success,
attempts
attempts,
interaction_type
from {{ ref("problem_events") }}
where verb_id = 'https://w3id.org/xapi/acrossx/verbs/evaluated'
)
Expand All @@ -28,7 +29,8 @@ select
responses.actor_id as actor_id,
responses.responses as responses,
responses.success as success,
responses.attempts as attempts
responses.attempts as attempts,
responses.interaction_type as interaction_type
from responses
join
{{ ref("dim_course_blocks") }} blocks
Expand All @@ -52,4 +54,5 @@ group by
responses,
success,
attempts,
graded
graded,
interaction_type
36 changes: 36 additions & 0 deletions models/problems/fact_problem_responses_extended.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
with
problem_results as (
select
*,
{{ section_from_display("problem_name_with_location") }} as section_number,
{{ subsection_from_display("problem_name_with_location") }}
as subsection_number
from {{ ref("int_problem_results") }}
)
select
results.emission_time as emission_time,
results.org as org,
results.course_key as course_key,
results.course_name as course_name,
results.course_run as course_run,
problems.section_with_name as section_with_name,
problems.subsection_with_name as subsection_with_name,
results.problem_id as problem_id,
results.problem_name as problem_name,
results.problem_name_with_location as problem_name_with_location,
results.problem_link as problem_link,
results.actor_id as actor_id,
results.responses as responses,
results.success as success,
results.attempts as attempts,
results.graded as graded,
results.interaction_type as interaction_type
from problem_results results
join
{{ ref("int_problems_per_subsection") }} problems
on (
results.org = problems.org
and results.course_key = problems.course_key
and results.section_number = problems.section_number
and results.subsection_number = problems.subsection_number
)
4 changes: 3 additions & 1 deletion models/problems/int_problem_results.sql
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ select
actor_id,
responses,
success,
attempts
attempts,
graded,
interaction_type
from {{ ref("fact_problem_responses") }} problem_responses
join responses using (org, course_key, problem_id, actor_id, emission_time)
64 changes: 64 additions & 0 deletions models/problems/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,9 @@ models:
- name: graded
data_type: bool
description: "Boolean indicating this block is graded"
- name: interaction_type
data_type: string
description: "The type of interaction - e.g. multiple choice"

- name: int_problem_hints
description: "Internal table for problem hints"
Expand Down Expand Up @@ -170,6 +173,12 @@ models:
- name: attempts
data_type: int16
description: "Number indicating which attempt this was"
- name: graded
data_type: bool
description: "Boolean indicating this block is graded"
- name: interaction_type
data_type: string
description: "The type of interaction - e.g. multiple choice"

- name: problem_events
description: "Problem events"
Expand Down Expand Up @@ -272,3 +281,58 @@ models:
- name: graded
data_type: bool
description: "Whether the block is graded"

- name: fact_problem_responses_extended
description: "int_problem_results with section and subsection names"
columns:
- name: emission_time
data_type: datetime
description: "The time the event was emitted"
- name: org
data_type: string
description: "The organization that the course belongs to"
- name: course_key
data_type: string
description: "The course key for the course"
- name: course_name
data_type: string
description: "The name of the course"
- name: course_run
data_type: string
description: "The course run for the course"
- name: section_with_name
data_type: string
description: "The name of the section this subsection belongs to, with section_number prepended"
- name: subsection_with_name
data_type: string
description: "The name of the subsection, with section_number prepended"
- name: problem_id
data_type: string
description: "The problem's unique identifier"
- name: problem_name
data_type: string
description: "The problem's name"
- name: problem_name_with_location
data_type: string
description: "The problem's display name with section, subsection, and unit prepended to the name. This provides additional context when looking at problem names and can help data consumers understand which problem they are analyzing"
- name: problem_link
data_type: String
description: "An anchor tag with a link to the problem"
- name: actor_id
data_type: string
description: "The xAPI actor identifier"
- name: responses
data_type: string
description: "The responses for this submission. If a problem has multiple parts, values for all parts will be in this field"
- name: success
data_type: bool
description: "Boolean indicating whether the responses were correct"
- name: attempts
data_type: int16
description: "Number indicating which attempt this was"
- name: graded
data_type: bool
description: "Whether this subsection block is graded"
- name: interaction_type
data_type: string
description: "The type of interaction"

0 comments on commit f5ce938

Please sign in to comment.