Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/wrench-project/eduwrench
Browse files Browse the repository at this point in the history
…into feature_dev_derrick
  • Loading branch information
derrickluyen committed Sep 4, 2022
2 parents 29bb43d + 93f1532 commit 36caf0b
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 31 deletions.
36 changes: 19 additions & 17 deletions web/src/components/charts/global_statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,54 +37,54 @@ const GlobalStatistics = ({ data }) => {
feedback: ["Very Useful"],
count: 0,
},
"Kinda Useful": {
"Useful": {
feedback: ["Useful"],
count: 0,
},
"Sorta Useful": {
feedback: ["Neutral"],
"Of Little Use": {
feedback: ["Of Little Use"],
count: 0,
},
"Useless": {
feedback: ["Useless"],
"Not Useful at all": {
feedback: ["Not Useful at all"],
count: 0,
},
}

let qualityMap = {
"Excellent Quality": {
feedback: ["Excellent Quality"],
feedback: ["Excellent"],
count: 0,
},
"Good Quality": {
feedback: ["Good Quality"],
feedback: ["Good"],
count: 0,
},
"Fair Quality": {
feedback: ["Fair Quality"],
feedback: ["Fair"],
count: 0,
},
"Poor Quality": {
feedback: ["Poor Quality"],
feedback: ["Poor"],
count: 0,
},
}

let simFeedbackMap = {
"Perfect Experience": {
feedback: ["Perfect"],
"Excellent Experience": {
feedback: ["Excellent"],
count: 0,
},
"Good Experience": {
feedback: ["Good"],
count: 0,
},
"Poor Experience": {
feedback: ["Poor"],
"Fair Experience": {
feedback: ["Fair"],
count: 0,
},
"Bad Experience": {
feedback: ["Bad"],
"Poor Experience": {
feedback: ["Poor"],
count: 0,
},
}
Expand Down Expand Up @@ -240,6 +240,8 @@ const GlobalStatistics = ({ data }) => {
}
}

minMonth = (["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"])[minMonth]

let simFeedbackChartData = {
labels: [],
datasets: [],
Expand Down Expand Up @@ -307,13 +309,13 @@ const GlobalStatistics = ({ data }) => {
<>
<Segment.Group>
<Segment color="purple">
<strong>Practice Questions</strong> (since {minMonth}/{minYear})
<strong>Practice Questions</strong> (since {minMonth} {minYear})
</Segment>
<Segment>
<Bar type="bar" width={100} height={200} data={questionChartData} options={option} />
</Segment>
<Segment color="green">
<strong>Feedback provided by EduWRENCH users</strong> (since {minMonth}/{minYear})
<strong>Feedback provided by EduWRENCH users</strong> (since {minMonth} {minYear})
</Segment>
<div className="ui segments">
<div className="ui segment">
Expand Down
8 changes: 7 additions & 1 deletion web/src/components/charts/usage_statistics.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ const UsageStatistics = ({ data }) => {
"simulation": ["workflow_distributed", "workflow_fundamentals", "workflow_task_data_parallelism"],
"count": 0
},
"C.2 Cloud Functions": {
"simulation": ["cloud_functions"],
"count": 0
},
"D.1 Case Study: Energy-Aware Workflow Execution": {
"simulation": ["thrustd_cloud", "thrustd"],
"count": 0
Expand All @@ -56,6 +60,7 @@ const UsageStatistics = ({ data }) => {
let usage = data[idx]
let time = new Date(usage["time"] * 1000)
minMonth = Math.min(minMonth, time.getMonth())
console.log("MINMONTH = " + minMonth)
minYear = Math.min(minYear, time.getFullYear())

for (let m in simulationModulesMap) {
Expand All @@ -66,6 +71,7 @@ const UsageStatistics = ({ data }) => {
}
}
}
minMonth = (["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"])[minMonth]

let chartData = {
labels: [],
Expand Down Expand Up @@ -119,7 +125,7 @@ const UsageStatistics = ({ data }) => {
return (
<>
<Segment.Group>
<Segment color="yellow"><strong>Total Number of Simulation Runs</strong> (since {minMonth}/{minYear})</Segment>
<Segment color="yellow"><strong>Total Number of Simulation Runs</strong> (since {minMonth} {minYear})</Segment>
<Segment>
<Bar type="bar" data={chartData} options={options} />
</Segment>
Expand Down
8 changes: 4 additions & 4 deletions web/src/components/feedback/feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import FeedbackSignIn from "./feedback_signin"
const Feedback = ({tabkey}) => {
const [auth, setAuth] = useState("false")
const [completed, setCompleted] = useState(false)
const useful = ['Very Useful', 'Useful', 'Neutral', 'Useless']
const quality = ['Excellent Quality', 'Good Quality', 'Fair Quality', 'Poor Quality']
const useful = ['Very Useful', 'Useful', 'Of Little Use', 'Not Useful at all']
const quality = ['Excellent', 'Good', 'Fair', 'Poor']

useEffect(() => {
setAuth(localStorage.getItem("login"))
Expand Down Expand Up @@ -126,7 +126,7 @@ const Feedback = ({tabkey}) => {
<Message negative>{errors.quality}</Message> : ''
}
<p>
<strong>[#3]</strong> Optionally provide constructing comments.
<strong>[#3]</strong> Optionally provide constructive comments.
</p>
<Form.TextArea
fluid
Expand Down Expand Up @@ -155,4 +155,4 @@ const Feedback = ({tabkey}) => {
)
}

export default Feedback
export default Feedback
14 changes: 7 additions & 7 deletions web/src/components/simulation/simulation_feedback.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@ import { Formik } from "formik"
import axios from "axios"
import "./simulation_feedback.css"


const SimulationFeedback = ({simulationID, trigger}) => {
const userEmail = localStorage.getItem("currentUser")
const userName = localStorage.getItem("userName")
const ratings = ['Perfect', 'Good', 'Poor', 'Bad']
const ratings = ['Excellent', 'Good', 'Fair', 'Poor']
const [open, setOpen] = useState(false)
const [complete, setComplete] = useState(false)
useEffect(() => {
Expand Down Expand Up @@ -40,7 +39,7 @@ const SimulationFeedback = ({simulationID, trigger}) => {
<Modal.Content>
<Formik
initialValues={{
rating: '',
rating: 'Excellent',
feedback: ''
}}
onSubmit={(values, {setSubmitting}) => {
Expand Down Expand Up @@ -84,22 +83,23 @@ const SimulationFeedback = ({simulationID, trigger}) => {
<Form onSubmit={handleSubmit}>
<p className="feedback">How was your experience with this simulation?</p>
{ratings.map((rating) =>
<Form.Field key={rating}>
<Form.Field key={"sim_" + rating}>
<Form.Radio
name="rating"
label={rating}
id={rating}
id={"sim_" + rating}
value={rating}
checked={values.rating === rating}
onChange={handleChange}
onBlur={handleBlur}
/>
</Form.Field>
)}

{errors.rating ?
<Message negative>{errors.rating}</Message> : ''
}
<p className="feedback">Optionally provide us with additional feedback</p>
<p className="feedback">Additional constructive feedback:</p>
<Form.TextArea
placeholder='Enter text here...'
name="feedback"
Expand Down Expand Up @@ -132,4 +132,4 @@ const SimulationFeedback = ({simulationID, trigger}) => {
)
}

export default SimulationFeedback
export default SimulationFeedback
4 changes: 2 additions & 2 deletions web/src/pages/about.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ const About = () => {
</Segment>

<Segment>
<h3>Usage Statistics</h3>
<h3>Simulation Usage Statistics</h3>
{usageStatisticsResults}
</Segment>
<Segment>
<h3>Global Statistics</h3>
<h3>Practice Questions and Feedback Statistics</h3>
{globalStatisticsResults}
</Segment>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import PracticeQuestionNumeric from "../../../components/practice-questions/nume
import PracticeQuestionMultiChoice from "../../../components/practice-questions/multichoice";

const ClientServerBasics = ({module, tab}) => {


return (
<>
<LearningObjectives module={module} tab={tab}
Expand All @@ -35,6 +37,7 @@ const ClientServerBasics = ({module, tab}) => {
actual processing.
</p>


<p>
The performance of a client-server setup thus depends on the network on
which the data is transferred back and forth, and on the hardware at the
Expand Down

0 comments on commit 36caf0b

Please sign in to comment.