Skip to content

Commit

Permalink
fix: [wip] learning objective completion
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeaturner committed Jun 21, 2024
1 parent 5dc4e00 commit 34d72a0
Show file tree
Hide file tree
Showing 17 changed files with 404 additions and 198 deletions.
21 changes: 21 additions & 0 deletions app/(authorized)/learning-curves/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import PageHeader from "@/components/PageHeader";
import GenericPageContainer from "@/components/GenericPageContainer";
import VisualizationContainer from "@/components/VisualizationContainer";
import NoData from "@/components/NoData";

export default async function LearningCurves() {
return (
<GenericPageContainer>
<PageHeader
title="Learning Curves"
subtitle="Understand how students are performing over time."
/>
<VisualizationContainer
title="Learning Curve"
description="Performance vs. opportunity for each student"
>
<NoData width={1200} height={400} />
</VisualizationContainer>
</GenericPageContainer>
);
}
16 changes: 16 additions & 0 deletions app/(authorized)/learning-objectives/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import PageHeader from "@/components/PageHeader";
import GenericPageContainer from "@/components/GenericPageContainer";
import LearningObjectiveCompletion from "@/components/Visualizations/LearningObjectiveCompletion";
import { getLearningObjectiveCompletion } from "@/lib/analytics-functions";

export default async function LearningObjectives() {
return (
<GenericPageContainer>
<PageHeader
title="Learning Objective Completion"
subtitle="Understand student grasp of learning objectives based on their performance."
/>
<LearningObjectiveCompletion getData={getLearningObjectiveCompletion} />
</GenericPageContainer>
);
}
1 change: 0 additions & 1 deletion app/api/courses/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { NextRequest } from "next/server";
export async function GET(request: NextRequest) {
try {
const searchParams = request.nextUrl.searchParams;
console.log(searchParams)
const course_id = searchParams.get("course_id");

if (!course_id) {
Expand Down
21 changes: 2 additions & 19 deletions components/InstructorDashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const InstructorDashboard = ({
</VisualizationContainer> */}
<VisualizationContainer
title="Time on Task"
description="Class average vs. selected student's time on task"
description="Class average vs. selected student's cumulative time on task"
tooltipDescription="Time on task is the student's time spent working on a question before they submit it."
>
<TimeOnTask
Expand All @@ -88,7 +88,7 @@ const InstructorDashboard = ({
</VisualizationContainer>
<VisualizationContainer
title="Time in Review"
description="Class average vs. selected student's time in review"
description="Class average vs. selected student's cumulative time in review"
tooltipDescription="Time in review is the student's time spent reviewing questions after they have been submitted."
>
<TimeInReview
Expand Down Expand Up @@ -120,23 +120,6 @@ const InstructorDashboard = ({
>
<TextbookEngagement getData={getTextbookEngagement} />
</VisualizationContainer> */}
<VisualizationContainer
title="Learning Curve"
description="Performance vs. opportunity for each student"
>
<NoData width={1200} height={400} />
</VisualizationContainer>
<VisualizationContainer
title="Learning Objective Completion"
description="Breakdown of completion for the selected learning objective"
tooltipDescription="Learning objective completion is determined by the number of questions answered correctly by the student, where those questions have been aligned with a framework's learning objective(s)."
>
<LearningObjectiveCompletion
getData={(assignment_id) =>
getLearningObjectiveCompletion(course_id, assignment_id)
}
/>
</VisualizationContainer>
{letter_grades_released ? (
<>
<VisualizationContainer
Expand Down
2 changes: 2 additions & 0 deletions components/Links.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ const Links = {
EarlyWarning: "/early-warning",
RawData: "/raw-data",
CourseSettings: "/course-settings",
LearningObjectives: "/learning-objectives",
LearningCurves: "/learning-curves",
},
API: {},
};
Expand Down
25 changes: 23 additions & 2 deletions components/NavMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,31 @@ const NavMenu = () => {
onClick={() => router.push(Links.CLIENT.Dashboard)}
>
<span className="tw-text-link-blue">
{globalState.viewAs === "instructor" ? "Instructor" : "Student"}{" "}
Dashboard
{globalState.viewAs === "instructor"
? "Performance & Activity"
: "Student Dashboard"}
</span>
</ListGroup.Item>
{globalState.viewAs === "instructor" && (
<ListGroup.Item
active={isActive("learning-curves")}
className={isActive("learning-curves") ? ACTIVE_CLASSES : ""}
action
onClick={() => router.push(Links.CLIENT.LearningCurves)}
>
<span className="tw-text-link-blue">Learning Curves</span>
</ListGroup.Item>
)}
{globalState.viewAs === "instructor" && (
<ListGroup.Item
active={isActive("learning-objectives")}
className={isActive("learning-objectives") ? ACTIVE_CLASSES : ""}
action
onClick={() => router.push(Links.CLIENT.LearningObjectives)}
>
<span className="tw-text-link-blue">Learning Objectives</span>
</ListGroup.Item>
)}
{globalState.viewAs === "instructor" && (
<ListGroup.Item
active={isActive("early-warning")}
Expand Down
14 changes: 1 addition & 13 deletions components/RawDataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,21 +119,9 @@ const RawDataTable: React.FC<RawDataTableProps> = ({ getData }) => {
filterFn: "fuzzy",
sortingFn: fuzzySort,
}),
columnHelper.accessor("pagesAccessed", {
cell: (info) => <div>{info.getValue()}</div>,
header: "Pages Accessed",
}),
columnHelper.accessor("uniqueInteractionDays", {
cell: (info) => <div>{info.getValue()}</div>,
header: "Unique Interaction Days",
}),
columnHelper.accessor("coursePercent", {
cell: (info) => <div>{info.getValue()}</div>,
header: "Avg % Assignment",
}),
columnHelper.accessor("classPercentile", {
cell: (info) => <div>{info.getValue()}</div>,
header: "Class Percentile",
header: "Un-weighted Avg %",
}),
columnHelper.accessor("classQuartile", {
cell: (info) => <div>{transformQuartile(info.getValue())}</div>,
Expand Down
14 changes: 9 additions & 5 deletions components/Visualizations/LearningObjectiveCompletion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,14 @@ import {
useReactTable,
} from "@tanstack/react-table";
import VisualizationTable from "../VisualizationTableView";
import { useGlobalContext } from "@/state/globalContext";

const MARGIN = { ...DEFAULT_MARGINS, bottom: 40 };
const BUCKET_PADDING = DEFAULT_BUCKET_PADDING;

type LOCProps = VisualizationBaseProps & {
selectedAssignmentId?: string;
getData: (assignmentId: string) => Promise<LOCData[]>;
getData: (course_id: string) => Promise<LOCData[]>;
};

const LearningObjectiveCompletion: React.FC<LOCProps> = ({
Expand All @@ -50,6 +51,7 @@ const LearningObjectiveCompletion: React.FC<LOCProps> = ({
getSVG: () => svgRef.current,
}));

const [globalState] = useGlobalContext();
const containerRef = useRef<HTMLDivElement>(null);
const chartsRef = useRef<HTMLDivElement>(null);
const svgRef = useRef(null);
Expand All @@ -65,7 +67,7 @@ const LearningObjectiveCompletion: React.FC<LOCProps> = ({

useEffect(() => {
handleGetData();
}, [selectedAssignmentId]);
}, []);

useEffect(() => {
// if (
Expand All @@ -81,10 +83,12 @@ const LearningObjectiveCompletion: React.FC<LOCProps> = ({
async function handleGetData() {
try {
setLoading(true);
if (!selectedAssignmentId) return;
if (!globalState.courseID) return;

const _assignmentData = await getData(selectedAssignmentId);
console.log(_assignmentData)
const _assignmentData = await getData(
globalState.courseID,
);
console.log(_assignmentData);

setAssignmentData(_assignmentData);
} catch (err) {
Expand Down
32 changes: 26 additions & 6 deletions lib/ADAPTInstructorConnector.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import axios, { AxiosInstance, Method } from "axios";
import * as jose from "jose";
import { ADAPTAssignmentScoresRes, ADAPTCourseAssignmentsRes, ADAPTEnrollmentDetailsRes, ADAPTSubmissionTimestampDataRes } from "./types";
import {
ADAPTAssignmentScoresRes,
ADAPTCourseAssignmentsRes,
ADAPTEnrollmentDetailsRes,
ADAPTFrameworkQuestionSyncRes,
ADAPTFrameworksRes,
ADAPTSubmissionTimestampDataRes,
} from "./types";

class ADAPTInstructorConnector {
private axiosInstance: AxiosInstance | null = null;
Expand Down Expand Up @@ -78,18 +85,31 @@ class ADAPTInstructorConnector {
);
}

public async getAssignmentScores(assignmentID: string){
public async getAssignmentScores(assignmentID: string) {
return this.makeRequest<ADAPTAssignmentScoresRes>(
"/scores/assignment/get-assignment-questions-scores-by-user/" + assignmentID + '/on_task/0',
"/scores/assignment/get-assignment-questions-scores-by-user/" +
assignmentID +
"/on_task/0",
"GET"
)
);
}

public async getAssignmentSubmissionTimestamps(assignmentID: string){
public async getAssignmentSubmissionTimestamps(assignmentID: string) {
return this.makeRequest<ADAPTSubmissionTimestampDataRes>(
`/auto-graded-and-file-submissions/${assignmentID}/get-submission-times-by-assignment-and-student`,
"GET"
)
);
}

public async getFrameworks() {
return this.makeRequest<ADAPTFrameworksRes>("/frameworks", "GET");
}

public async getFrameworkQuestionSync(questionID: string) {
return this.makeRequest<ADAPTFrameworkQuestionSyncRes>(
"/framework-item-sync-question/question/" + questionID,
"GET"
);
}
}

Expand Down
Loading

0 comments on commit 34d72a0

Please sign in to comment.