Skip to content

Commit 9e1106a

Browse files
committed
New changes with randomQuestion
1 parent fb8b26e commit 9e1106a

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

package-lock.json

Lines changed: 2 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/Table/index.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,26 @@ const Table = () => {
362362
},
363363
Filter: SelectColumnFilter,
364364
},
365+
// button to display a random question
366+
{
367+
randomQuestion: () => {
368+
const random = Math.floor(Math.random() * questions.length);
369+
const questionId = questions[random].id;
370+
return questionId;
371+
},
372+
Header: () => {
373+
return (
374+
<Button
375+
onClick={() => {}}
376+
color="success"
377+
id="random-question-button"
378+
>
379+
Random Question
380+
</Button>
381+
);
382+
},
383+
accessor: 'randomQuestion',
384+
},
365385
],
366386
},
367387
],

0 commit comments

Comments
 (0)