From 43ae50e716e257192ad3c5d6adaeeb0a5a583f35 Mon Sep 17 00:00:00 2001 From: Roosted7 <thomasroos@live.nl> Date: Wed, 9 May 2018 19:06:10 +0200 Subject: [PATCH] Show statistics summary --- client/index.jsx | 2 +- client/views/Statistics.jsx | 30 ++++++++++++++++++++++-------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/client/index.jsx b/client/index.jsx index f68e6f890..ca21444da 100644 --- a/client/index.jsx +++ b/client/index.jsx @@ -128,7 +128,7 @@ class App extends React.Component { exam.submissions.length ? <Grade exam={exam} updateSubmission={this.updateSubmission}/> : <Fail message="No exams uploaded. Please do not bookmark URLs" /> )} /> <Route path="/statistics" render={() => ( - exam.submissions.length ? <Statistics /> : <Fail message="No exams uploaded. Please do not bookmark URLs" /> + exam.submissions.length ? <Statistics exam={exam} /> : <Fail message="No exams uploaded. Please do not bookmark URLs" /> )} /> <Route path="/graders" component={Graders} /> <Route path="/reset" component={Reset} /> diff --git a/client/views/Statistics.jsx b/client/views/Statistics.jsx index 756e617dd..78e8f9919 100644 --- a/client/views/Statistics.jsx +++ b/client/views/Statistics.jsx @@ -2,16 +2,30 @@ import React from 'react'; import Hero from '../components/Hero.jsx'; -const StatisticsDashboard = () => { - return ( - <div> +class Statistics extends React.Component { - <Hero title='Statistics Dashboard' subtitle='Review the grading' /> + render() { + return ( + <div> - <h1>React Router demo</h1> + <Hero title='Statistics' subtitle="Analyse how to the exam was made" /> + + <section className="section"> + + <div className="container"> + + <figure className="image is-4by3"> + <img src={'api/images/summary/' + this.props.exam.id} /> + </figure> + + </div> + + </section> + + </div > + ) + } - </div> - ) } -export default StatisticsDashboard; +export default Statistics; -- GitLab