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

Make heatmap readable when sorted #40

Open
wants to merge 16 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,903 changes: 1,185 additions & 718 deletions package-lock.json

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,8 @@
"@auth/sveltekit": "^1.7.3",
"@floating-ui/dom": "^1.6.12",
"@iconify/svelte": "^4.0.2",
"@iktakahiro/markdown-it-katex": "^4.0.1",
"@skeletonlabs/skeleton": "^2.10.3",
"@skeletonlabs/tw-plugin": "^0.4.0",
"@skeletonlabs/skeleton": "^3.0.0-next.9",
"@skeletonlabs/skeleton-svelte": "^1.0.0-next.14",
"@supabase/supabase-js": "^2.46.1",
"@sveltejs/adapter-auto": "^3.0.0",
"@sveltejs/kit": "^2.0.0",
Expand All @@ -33,6 +32,8 @@
"eslint-plugin-svelte": "^2.36.0",
"file-saver": "^2.0.5",
"globals": "^15.0.0",
"d3": "^7.9.0",
"echarts": "^5.5.1",
"highlight.js": "^11.10.0",
"markdown-it": "^14.1.0",
"markdown-it-anchor": "^9.2.0",
Expand All @@ -44,8 +45,7 @@
"markdown-it-sub": "^2.0.0",
"markdown-it-sup": "^2.0.0",
"markdown-it-table-of-contents": "^0.8.0",
"partysocket": "^1.0.2",
"pdfjs-dist": "^4.8.69",
"@iktakahiro/markdown-it-katex": "^4.0.1",
"prettier": "^3.3.2",
"prettier-plugin-svelte": "^3.2.6",
"prettier-plugin-tailwindcss": "^0.6.5",
Expand Down
3 changes: 0 additions & 3 deletions src/app.css

This file was deleted.

9 changes: 9 additions & 0 deletions src/app.postcss
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
@tailwind base;
@tailwind components;
@tailwind utilities;
@tailwind variants;

html,
body {
@apply h-full overflow-hidden;
}
1 change: 1 addition & 0 deletions src/lib/runes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,4 @@ export const currentCourse = rune<Course | null>(null);
export const courseUrl = rune("");
export const currentLabStepIndex = rune(0);
export const currentTheme = rune("tutors");
export const lightMode = rune("light");
56 changes: 0 additions & 56 deletions src/lib/services/analytics.svelte.ts

This file was deleted.

71 changes: 2 additions & 69 deletions src/lib/services/connect.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,101 +2,34 @@ import { signOut } from "@auth/sveltekit/client";
import { signIn } from "@auth/sveltekit/client";
import { rune } from "./utils/runes.svelte";
import { browser } from "$app/environment";
import type { CourseVisit, TutorsConnectService, TutorsId } from "./types.svelte";
import type { TutorsConnectService, TutorsId } from "./types.svelte";
import { goto } from "$app/navigation";
import type { Course } from "./models/lo-types";
import { localStorageProfile } from "./profiles/localStorageProfile";
import { supabaseProfile } from "./profiles/supabaseProfile.svelte";
import { currentCourse, currentLo } from "$lib/runes";
import { analyticsService } from "./analytics.svelte";
import { presenceService } from "./presence.svelte";

export const tutorsConnectService: TutorsConnectService = {
tutorsId: rune<TutorsId | null>(null),
profile: localStorageProfile,
intervalId: null,

async connect(redirectStr: string) {
if (redirectStr === "/") {
redirectStr = "/dashboard";
}
return await signIn("github", { callbackUrl: redirectStr });
},

reconnect(user: TutorsId) {
if (user) {
this.tutorsId.value = user;
this.profile = supabaseProfile;
if (browser) {
if (!localStorage.share) {
localStorage.share = true;
}
this.tutorsId.value.share = localStorage.share;
console.log("sharing is in connect: " + this.tutorsId.value.share);
if (localStorage.loginCourse) {
const courseId = localStorage.loginCourse;
localStorage.removeItem("loginCourse");
goto(`/course/${courseId}`);
goto(`/${courseId}`);
}
}
}
},

disconnect(redirectStr: string) {
if (redirectStr === "/") {
redirectStr = "/dashboard";
}
signOut({ callbackUrl: redirectStr });
},

toggleShare() {
if (this.tutorsId.value && browser) {
if (this.tutorsId.value.share === "true") {
localStorage.share = this.tutorsId.value.share = "false";
} else {
localStorage.share = this.tutorsId.value.share = "true";
}
}
},

courseVisit(course: Course, student: TutorsId) {
this.profile.logCourseVisit(course);
presenceService.startPresenceListener(course.courseId);
if (course.authLevel! > 0 && !this.tutorsId.value?.login) {
localStorage.loginCourse = course.courseId;
goto(`/auth`);
}
},

deleteCourseVisit(courseId: string) {
this.profile.deleteCourseVisit(courseId);
},

getCourseVisits(): Promise<CourseVisit[]> {
return this.profile.getCourseVisits();
},

learningEvent(params: Record<string, string>): void {
if (currentCourse.value && currentLo.value && this.tutorsId.value) {
analyticsService.learningEvent(currentCourse.value, params, currentLo.value, this.tutorsId.value);
if (this.tutorsId.value.share === "true") {
presenceService.sendLoEvent(currentCourse.value, currentLo.value, this.tutorsId.value);
}
}
},

startTimer() {
this.intervalId = setInterval(() => {
if (!document.hidden && currentCourse.value && currentLo.value && this.tutorsId.value) {
analyticsService.updatePageCount(currentCourse.value, currentLo.value, this.tutorsId.value);
}
}, 30 * 1000);
},

stopTimer() {
if (this.intervalId) {
clearInterval(this.intervalId);
this.intervalId = null;
}
}
};
4 changes: 4 additions & 0 deletions src/lib/services/metrics/db/client.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import { createClient } from "@supabase/supabase-js";
import { PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY } from "$env/static/public";

export const db = createClient(PUBLIC_SUPABASE_URL, PUBLIC_SUPABASE_ANON_KEY);
Loading