Skip to content

Commit

Permalink
chore: remove components related to live session and question instance (
Browse files Browse the repository at this point in the history
  • Loading branch information
sjschlapbach authored Nov 6, 2024
1 parent 9a82194 commit cf9198f
Show file tree
Hide file tree
Showing 145 changed files with 9,173 additions and 15,668 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ All notable changes to this project will be documented in this file. See [standa

### Bug Fixes

* ensure that validation in quesiton edit modal works properly ([#4251](https://github.com/uzh-bf/klicker-uzh/issues/4251)) ([5e26453](https://github.com/uzh-bf/klicker-uzh/commit/5e2645381465ccfbf26dac17d2f36b380ef9e4bf))
* ensure that validation in question edit modal works properly ([#4251](https://github.com/uzh-bf/klicker-uzh/issues/4251)) ([5e26453](https://github.com/uzh-bf/klicker-uzh/commit/5e2645381465ccfbf26dac17d2f36b380ef9e4bf))
* require that the user specifies sample solutions for open questions when activated ([#4252](https://github.com/uzh-bf/klicker-uzh/issues/4252)) ([0c5aa6b](https://github.com/uzh-bf/klicker-uzh/commit/0c5aa6b1c15e00813f4485e9380d53728ca527c7))

## [3.2.0-alpha.20](https://github.com/uzh-bf/klicker-uzh/compare/v3.2.0-alpha.19...v3.2.0-alpha.20) (2024-09-06)
Expand Down
2 changes: 0 additions & 2 deletions apps/auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,8 @@
"next": "15.0.0",
"next-auth": "4.24.8",
"next-intl": "3.21.1",
"nookies": "2.5.2",
"react": "18.3.1",
"react-dom": "18.3.1",
"sharp": "0.33.5",
"tailwind-merge": "2.5.4"
},
"devDependencies": {
Expand Down
5 changes: 0 additions & 5 deletions apps/frontend-control/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
"@klicker-uzh/shared-components": "workspace:*",
"@socialgouv/matomo-next": "1.9.1",
"@uzh-bf/design-system": "3.0.0-alpha.32",
"body-parser": "1.20.3",
"cross-env": "7.0.3",
"dayjs": "1.11.13",
"deepmerge": "4.3.1",
Expand All @@ -31,25 +30,21 @@
"localforage": "1.10.0",
"next": "15.0.0",
"next-intl": "3.21.1",
"nookies": "2.5.2",
"react": "18.3.1",
"react-dom": "18.3.1",
"remeda": "2.15.0",
"sharp": "0.33.5",
"tailwind-merge": "2.5.4",
"yup": "1.4.0"
},
"devDependencies": {
"@tailwindcss/aspect-ratio": "~0.4.2",
"@tailwindcss/forms": "~0.5.9",
"@tailwindcss/typography": "~0.5.15",
"@types/body-parser": "^1.19.2",
"@types/js-cookie": "^3.0.6",
"@types/jsonwebtoken": "^9.0.7",
"@types/node": "^20.16.1",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@types/web-push": "^3.6.3",
"autoprefixer": "~10.4.20",
"cross-env": "~7.0.3",
"cssnano": "~6.0.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend-control/src/components/common/LoginForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ interface LoginFormProps {
installIOS?: string
}

export function LoginForm({
function LoginForm({
header,
labelIdentifier,
fieldIdentifier,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { useTranslations } from 'next-intl'
import { useRouter } from 'next/router'
import { useState } from 'react'
import EmbeddingModal from '../../components/sessions/EmbeddingModal'
import EmbeddingModal from '../liveQuizzes/EmbeddingModal'
import MenuButton from './MenuButton'

interface MobileMenuBarProps {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useTranslations } from 'next-intl'
import { useMemo } from 'react'
import { twMerge } from 'tailwind-merge'

interface SessionBlockProps {
interface LiveQuizBlockProps {
block?: Omit<ElementBlock, 'elements'> & {
elements?:
| (Omit<ElementInstance, 'elementData' | 'type' | 'elementType'> & {
Expand All @@ -22,7 +22,7 @@ interface SessionBlockProps {
active?: boolean
}

function SessionBlock({ block, active = false }: SessionBlockProps) {
function LiveQuizBlock({ block, active = false }: LiveQuizBlockProps) {
const t = useTranslations()

// compute the time until expiration in seconds + 20 seconds buffer from now
Expand Down Expand Up @@ -107,4 +107,4 @@ function SessionBlock({ block, active = false }: SessionBlockProps) {
)
}

export default SessionBlock
export default LiveQuizBlock
20 changes: 10 additions & 10 deletions apps/frontend-control/src/pages/course/[id].tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useQuery } from '@apollo/client'
import {
GetControlCourseDocument,
SessionStatus,
PublicationStatus,
} from '@klicker-uzh/graphql/dist/ops'
import Loader from '@klicker-uzh/shared-components/src/Loader'
import { UserNotification } from '@uzh-bf/design-system'
Expand All @@ -10,7 +10,7 @@ import { useTranslations } from 'next-intl'
import { useRouter } from 'next/router'
import { useEffect } from 'react'
import Layout from '../../components/Layout'
import SessionLists from '../../components/sessions/SessionLists'
import SessionLists from '../../components/liveQuizzes/SessionLists'

function Course() {
const t = useTranslations()
Expand Down Expand Up @@ -49,20 +49,20 @@ function Course() {

const { controlCourse } = data

const runningSessions = controlCourse.sessions?.filter(
(session) => session.status === SessionStatus.Running
const runningQuizzes = controlCourse.liveQuizzes?.filter(
(quiz) => quiz.status === PublicationStatus.Published
)
const plannedSessions = controlCourse.sessions?.filter(
(session) =>
session.status === SessionStatus.Prepared ||
session.status === SessionStatus.Scheduled
const plannedQuizzes = controlCourse.liveQuizzes?.filter(
(quiz) =>
quiz.status === PublicationStatus.Draft ||
quiz.status === PublicationStatus.Scheduled
)

return (
<Layout title={controlCourse.name}>
<SessionLists
runningSessions={runningSessions || []}
plannedSessions={plannedSessions || []}
runningSessions={runningQuizzes || []}
plannedSessions={plannedQuizzes || []}
/>

<div className="mt-4 text-base italic">
Expand Down
2 changes: 1 addition & 1 deletion apps/frontend-control/src/pages/course/unassigned.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { GetStaticPropsContext } from 'next'
import { useTranslations } from 'next-intl'
import { useMemo } from 'react'
import Layout from '../../components/Layout'
import SessionLists from '../../components/sessions/SessionLists'
import SessionLists from '../../components/liveQuizzes/SessionLists'

function UnassignedLiveQuizzes() {
const t = useTranslations()
Expand Down
8 changes: 4 additions & 4 deletions apps/frontend-control/src/pages/session/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { useRouter } from 'next/router'
import { useEffect, useState } from 'react'
import { sort } from 'remeda'
import Layout from '../../components/Layout'
import SessionBlock from '../../components/sessions/SessionBlock'
import LiveQuizBlock from '../../components/liveQuizzes/LiveQuizBlock'

function RunningSession() {
const t = useTranslations()
Expand Down Expand Up @@ -130,7 +130,7 @@ function RunningSession() {
<div key={`${currentBlockOrder}-${nextBlockOrder}-child`}>
<H3>{t('control.session.activeBlock')}</H3>

<SessionBlock
<LiveQuizBlock
block={blocks.find((block) => block.order === currentBlockOrder)}
active
/>
Expand All @@ -144,7 +144,7 @@ function RunningSession() {
size="2xl"
/>

<SessionBlock
<LiveQuizBlock
block={blocks.find(
(block) => block.order === nextBlockOrder
)}
Expand Down Expand Up @@ -182,7 +182,7 @@ function RunningSession() {
className="mx-auto w-full"
/>
)}
<SessionBlock
<LiveQuizBlock
block={blocks.find((block) => block.order === nextBlockOrder)}
/>
{nextBlockOrder < blocks.length - 1 && (
Expand Down
10 changes: 0 additions & 10 deletions apps/frontend-manage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,37 +20,29 @@
"@klicker-uzh/shared-components": "workspace:*",
"@socialgouv/matomo-next": "1.9.1",
"@uzh-bf/design-system": "3.0.0-alpha.32",
"d3": "7.9.0",
"dayjs": "1.11.13",
"deepmerge": "4.3.1",
"formik": "2.4.6",
"generate-password": "1.7.1",
"graphql": "16.9.0",
"graphql-codegen-persisted-query-ids": "0.2.0",
"graphql-ws": "5.16.0",
"html-to-image": "1.11.11",
"is-hotkey": "0.2.0",
"js-cookie": "3.0.5",
"js-search": "2.0.1",
"localforage": "1.10.0",
"lodash": "4.17.21",
"next": "15.0.0",
"next-intl": "3.21.1",
"nookies": "2.5.2",
"react": "18.3.1",
"react-d3-speedometer": "2.2.1",
"react-dnd": "16.0.1",
"react-dnd-html5-backend": "16.0.1",
"react-dom": "18.3.1",
"react-dropzone": "14.2.9",
"react-qrcode-logo": "3.0.0",
"react-resizable-panels": "2.1.4",
"react-select": "5.8.1",
"react-sizeme": "3.0.2",
"recharts": "2.13.0",
"remark-slate": "1.8.6",
"remeda": "2.15.0",
"sharp": "0.33.5",
"slate": "0.110.2",
"slate-history": "0.109.0",
"slate-react": "0.110.2",
Expand All @@ -62,9 +54,7 @@
"@tailwindcss/container-queries": "~0.1.1",
"@tailwindcss/forms": "~0.5.9",
"@tailwindcss/typography": "~0.5.15",
"@types/d3": "^7.4.3",
"@types/is-hotkey": "^0.1.10",
"@types/js-cookie": "^3.0.6",
"@types/js-search": "^1.4.4",
"@types/lodash": "^4.17.10",
"@types/node": "^20.16.1",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import {
import Loader from '@klicker-uzh/shared-components/src/Loader'
import { useTranslations } from 'next-intl'
import { useMemo } from 'react'
import GroupActivityWizard from './groupActivity/GroupActivityWizard'
import LiveQuizWizard from './liveQuiz/LiveQuizWizard'
import MicroLearningWizard from './microLearning/MicroLearningWizard'
import PracticeQuizWizard from './practiceQuiz/PracticeQuizWizard'
import GroupActivityWizard from './creation/groupActivity/GroupActivityWizard'
import LiveQuizWizard from './creation/liveQuiz/LiveQuizWizard'
import MicroLearningWizard from './creation/microLearning/MicroLearningWizard'
import PracticeQuizWizard from './creation/practiceQuiz/PracticeQuizWizard'

export enum WizardMode {
LiveQuiz = 'liveQuiz',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormikErrors, FormikTouched } from 'formik'
import { SetStateAction, useEffect } from 'react'
import { ElementSelectCourse } from './ElementCreation'
import { ElementSelectCourse } from '../ElementCreation'
import { GroupActivityFormValues } from './WizardLayout'

function CourseChangeMonitor({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormikErrors, FormikTouched } from 'formik'
import { SetStateAction, useEffect } from 'react'
import { ElementSelectCourse } from './ElementCreation'
import { ElementSelectCourse } from '../ElementCreation'
import { MicroLearningFormValues } from './WizardLayout'

function CourseSelectionMonitorMicrolearning({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormikErrors, FormikTouched } from 'formik'
import { SetStateAction, useEffect } from 'react'
import { ElementSelectCourse } from './ElementCreation'
import { ElementSelectCourse } from '../ElementCreation'
import { PracticeQuizFormValues } from './WizardLayout'

function CourseSelectionMonitorPracticeQuiz({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import {
faUsersLine,
} from '@fortawesome/free-solid-svg-icons'
import { useTranslations } from 'next-intl'
import CreationButton from '../../sessions/creation/CreationButton'
import { WizardMode } from './ElementCreation'
import { WizardMode } from '../ElementCreation'
import CreationButton from './CreationButton'

interface CreationButtonsProps {
setCreationMode: (mode: WizardMode) => void
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ import { useRouter } from 'next/router'
import { Dispatch, SetStateAction, useCallback, useRef, useState } from 'react'
import * as yup from 'yup'
import ElementCreationErrorToast from '../../../toasts/ElementCreationErrorToast'
import { ElementSelectCourse } from '../../ElementCreation'
import CompletionStep from '../CompletionStep'
import { ElementSelectCourse } from '../ElementCreation'
import WizardLayout, {
GroupActivityClueFormValues,
GroupActivityFormValues,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FormikErrors } from 'formik'
import { useEffect } from 'react'
import { ElementSelectCourse } from '../ElementCreation'
import { ElementSelectCourse } from '../../ElementCreation'
import { LiveQuizFormValues } from '../WizardLayout'

function LiveQuizCourseMonitor({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import { useRouter } from 'next/router'
import { Dispatch, SetStateAction, useCallback, useRef, useState } from 'react'
import * as yup from 'yup'
import ElementCreationErrorToast from '../../../toasts/ElementCreationErrorToast'
import { ElementSelectCourse } from '../../ElementCreation'
import CompletionStep from '../CompletionStep'
import { ElementSelectCourse } from '../ElementCreation'
import WizardLayout, { LiveQuizFormValues } from '../WizardLayout'
import LiveQuizDescriptionStep from './LiveQuizDescriptionStep'
import LiveQuizInformationStep from './LiveQuizInformationStep'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ import { useRouter } from 'next/router'
import { Dispatch, SetStateAction, useCallback, useRef, useState } from 'react'
import * as yup from 'yup'
import ElementCreationErrorToast from '../../../toasts/ElementCreationErrorToast'
import { ElementSelectCourse } from '../../ElementCreation'
import CompletionStep from '../CompletionStep'
import StackCreationStep from '../StackCreationStep'
import WizardLayout, { MicroLearningFormValues } from '../WizardLayout'
import { ElementSelectCourse } from './../ElementCreation'
import MicroLearningDescriptionStep from './MicroLearningDescriptionStep'
import MicroLearningInformationStep from './MicroLearningInformationStep'
import MicroLearningSettingsStep from './MicroLearningSettingsStep'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import { useRouter } from 'next/router'
import { Dispatch, SetStateAction, useCallback, useRef, useState } from 'react'
import * as yup from 'yup'
import ElementCreationErrorToast from '../../../toasts/ElementCreationErrorToast'
import { ElementSelectCourse } from '../../ElementCreation'
import CompletionStep from '../CompletionStep'
import { ElementSelectCourse } from '../ElementCreation'
import StackCreationStep from '../StackCreationStep'
import WizardLayout, { PracticeQuizFormValues } from '../WizardLayout'
import PracticeQuizDescriptionStep from './PracticeQuizDescriptionStep'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -547,7 +547,7 @@ const MarkButton = ({
)
}

export const SlateButton = React.forwardRef<
const SlateButton = React.forwardRef<
HTMLSpanElement,
PropsWithChildren<{
active: boolean
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Button, Dropdown, H1, Toast } from '@uzh-bf/design-system'
import dayjs from 'dayjs'
import { useTranslations } from 'next-intl'
import { useState } from 'react'
import CourseQRModal from '../sessions/cockpit/CourseQRModal'
import CourseQRModal from '../liveQuiz/cockpit/CourseQRModal'
import { getLTIAccessLink } from './PracticeQuizElement'
import CourseManipulationModal, {
CourseManipulationFormData,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import dayjs from 'dayjs'
import { useTranslations } from 'next-intl'
import { useRouter } from 'next/router'
import React, { useState } from 'react'
import { WizardMode } from '../sessions/creation/ElementCreation'
import { WizardMode } from '../activities/ElementCreation'
import StatusTag from './StatusTag'
import PublishGroupActivityButton from './actions/PublishGroupActivityButton'
import GroupActivityExtensionButton from './groupActivity/GroupActivityExtensionButton'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import { Dropdown } from '@uzh-bf/design-system'
import { useTranslations } from 'next-intl'
import { useRouter } from 'next/router'
import { useState } from 'react'
import { WizardMode } from '../sessions/creation/ElementCreation'
import { WizardMode } from '../activities/ElementCreation'
import CopyConfirmationToast from '../toasts/CopyConfirmationToast'
import { getAccessLink, getLTIAccessLink } from './PracticeQuizElement'
import StatusTag from './StatusTag'
Expand Down
13 changes: 7 additions & 6 deletions apps/frontend-manage/src/components/courses/LiveQuizList.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { SessionStatus } from '@klicker-uzh/graphql/dist/ops'
import { PublicationStatus } from '@klicker-uzh/graphql/dist/ops'
import { useTranslations } from 'next-intl'
import { sort } from 'remeda'
import LiveQuizElement, { LiveQuizListElementType } from './LiveQuizElement'

const sortingOrderSessions: Record<string, number> = {
[SessionStatus.Running]: 0,
[SessionStatus.Scheduled]: 1,
[SessionStatus.Prepared]: 2,
[SessionStatus.Completed]: 3,
const sortingOrderSessions: Record<PublicationStatus, number> = {
[PublicationStatus.Published]: 0,
[PublicationStatus.Scheduled]: 1,
[PublicationStatus.Draft]: 2,
[PublicationStatus.Ended]: 3,
[PublicationStatus.Graded]: 4,
}

function LiveQuizList({
Expand Down
Loading

0 comments on commit cf9198f

Please sign in to comment.