-
Notifications
You must be signed in to change notification settings - Fork 1
Add current quiz position in stats #306
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
Open
Derstilon
wants to merge
16
commits into
develop
Choose a base branch
from
add-current-quiz-position-in-stats
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
b64f53a
Add quiz in progress to stats view (#280)
Derstilon 1517403
Merge branch 'develop' into feature/add-current-quiz-position-in-stats
Derstilon c80af12
Add ID usaged and quiz result parsing
Derstilon 277b518
fix use effect
ostatni5 b6aa744
fix server bug after closing lecture during quiz
michal367 3a66a09
fix not working stats computing
michal367 5d28a56
Merge branch 'feature/add-current-quiz-position-in-stats' into featur…
Derstilon cce6ba3
Merge branch 'feature/add-current-quiz-position-in-stats' into featur…
Derstilon fe507a3
fix question adding
ostatni5 6ce656b
fix quiz answers sending and hide button in sen quiz view
ostatni5 c9b2981
Merge branch 'develop' into feature/add-current-quiz-position-in-stats
Derstilon bc19088
Merge branch 'develop' into feature/add-current-quiz-position-in-stats
Derstilon c66f1b9
fix reconnection
michal367 5ae6aa1
fix student removing from list
ostatni5 ec25866
remove unlimited time and fix texts
ostatni5 ad0b9ef
fix packages
ostatni5 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| import { IconButton, ListItem, ListItemIcon, ListItemSecondaryAction, ListItemText, makeStyles, useTheme } from "@material-ui/core"; | ||
| import React, { useCallback, useContext, useEffect } from "react"; | ||
| import { useState } from "react"; | ||
| import { StoreContext } from "../../services/StoreService"; | ||
| import { formatTime } from "../../util/time"; | ||
| import AssignmentIcon from "@material-ui/icons/Assignment"; | ||
| import BackspaceIcon from '@material-ui/icons/Backspace'; | ||
| import useInterval from 'use-interval' | ||
|
|
||
| interface StatsListProps { | ||
| isSelected: boolean; | ||
| onSelect: () => void; | ||
| onDelete: () => void; | ||
| onEnded: () => void; | ||
| inProgress: boolean; | ||
| timeToEnd: number; | ||
| title: string; | ||
| index: number; | ||
| } | ||
|
|
||
| export function StatsListItem(props: StatsListProps) { | ||
| const [clock, setClock] = useState(props.timeToEnd - Date.now()); | ||
|
|
||
| const theme = useTheme(); | ||
| const classes = makeStyles({ | ||
| quizStatRow: { | ||
| paddingTop: 16, | ||
| paddingBottom: 16, | ||
| }, | ||
| })(); | ||
|
|
||
| useInterval(() => { | ||
| if (props.timeToEnd - Date.now() > 0) | ||
| setClock(props.timeToEnd - Date.now()); | ||
| else { | ||
| setClock(0); | ||
| props.onEnded(); | ||
| } | ||
| }, props.inProgress ? 1000 : null); | ||
|
|
||
| return (<ListItem | ||
| button | ||
| selected={props.isSelected} | ||
| onClick={(event) => props.onSelect()} | ||
| className={classes.quizStatRow} | ||
| divider | ||
| disabled={props.inProgress} | ||
| > | ||
| <ListItemIcon> | ||
| {props.isSelected && ( | ||
| <AssignmentIcon /> | ||
| )} | ||
| </ListItemIcon> | ||
| <ListItemText primary={props.title} secondary={props.inProgress ? formatTime(clock) : ""} /> | ||
| {!props.inProgress && (<ListItemSecondaryAction> | ||
| <IconButton edge="end" onClick={(event) => props.onDelete()}> | ||
| <BackspaceIcon /> | ||
| </IconButton> | ||
| </ListItemSecondaryAction>)} | ||
| </ListItem>); | ||
|
|
||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.