Skip to content

Commit

Permalink
Merge pull request #13 from AniketSinghShaktawat/view_grades_page_setup
Browse files Browse the repository at this point in the history
author feedback functionality
  • Loading branch information
pankhis authored Apr 21, 2024
2 parents 87ca595 + 882482d commit 7cef707
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 10 deletions.
85 changes: 85 additions & 0 deletions src/pages/ViewTeamGrades/Data/authorFeedback.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
[
[
{
"questionNumber": "1",
"questionText": "This reviewer appeared to understand my work.",
"reviews": [
{ "score": 5, "comment": "The reviewer demonstrated a deep understanding of the work, providing insightful feedback." },
{ "score": 3, "comment": "While the reviewer grasped the main points, some aspects could have been clarified further." },
{ "score": 4, "comment": "The reviewer's understanding was evident, although certain nuances could have been explored more." },
{ "score": 5, "comment": "The reviewer showcased a comprehensive understanding of the work, offering valuable insights." },
{ "score": 4, "comment": "The reviewer's comprehension was evident, but a few minor details could have been addressed." }
],
"RowAvg": 0,
"maxScore": 5
},
{
"questionNumber": "2",
"questionText": "This reviewer's comments helped me improve my work.",
"reviews": [
{ "score": 5, "comment": "The reviewer's comments were insightful and contributed significantly to the improvement of the work." },
{ "score": 5, "comment": "The reviewer's feedback was instrumental in refining various aspects of the work." },
{ "score": 5, "comment": "The reviewer's constructive criticism was invaluable in enhancing the quality of the work." },
{ "score": 5, "comment": "The reviewer's suggestions were practical and directly led to improvements in the work." },
{ "score": 5, "comment": "The reviewer's feedback played a crucial role in refining the work and addressing potential shortcomings." }
],
"RowAvg": 0,
"maxScore": 5
},
{
"questionNumber": "3",
"questionText": "The tone of this review was respectful.",
"reviews": [
{ "score": 5, "comment": "The reviewer maintained a respectful tone throughout the review, fostering a positive exchange of ideas." },
{ "score": 5, "comment": "The review was conducted in a respectful manner, acknowledging the efforts put into the work." },
{ "score": 5, "comment": "The reviewer's tone was consistently respectful, contributing to a constructive review process." },
{ "score": 5, "comment": "The tone of the review remained respectful, focusing on constructive criticism." },
{ "score": 5, "comment": "Throughout the review, the tone remained respectful and professional." }
],
"RowAvg": 0,
"maxScore": 5
}
],
[
{
"questionNumber": "1",
"questionText": "This reviewer appeared to understand my work.",
"reviews": [
{ "score": 4, "comment": "The reviewer demonstrated a good understanding of the work, providing valuable insights." },
{ "score": 5, "comment": "The reviewer's understanding of the work was evident, contributing to meaningful feedback." },
{ "score": 3, "comment": "While the reviewer grasped the main points, certain aspects could have been explained more clearly." },
{ "score": 4, "comment": "The reviewer showcased a solid understanding of the work, offering constructive feedback." },
{ "score": 5, "comment": "The reviewer's comprehension was evident, providing insightful comments." }
],
"RowAvg": 0,
"maxScore": 5
},
{
"questionNumber": "2",
"questionText": "This reviewer's comments helped me improve my work.",
"reviews": [
{ "score": 4, "comment": "The reviewer's comments offered valuable insights that contributed to improving the work." },
{ "score": 5, "comment": "The reviewer provided constructive criticism that directly led to enhancements in the work." },
{ "score": 3, "comment": "While the reviewer's feedback was helpful, certain suggestions could have been elaborated further." },
{ "score": 4, "comment": "The reviewer's suggestions were practical and contributed to refining various aspects of the work." },
{ "score": 5, "comment": "The reviewer's feedback played a crucial role in refining the work and addressing potential weaknesses." }
],
"RowAvg": 0,
"maxScore": 5
},
{
"questionNumber": "3",
"questionText": "The tone of this review was respectful.",
"reviews": [
{ "score": 4, "comment": "While the review was generally respectful, there were a few instances where the tone could have been more considerate." },
{ "score": 5, "comment": "The reviewer maintained a respectful tone throughout the review, fostering a positive exchange of ideas." },
{ "score": 3, "comment": "While most of the review was conducted with a respectful tone, certain sections could have been phrased more diplomatically." },
{ "score": 4, "comment": "The review was conducted with a respectful tone, focusing on constructive criticism." },
{ "score": 5, "comment": "Throughout the review, the tone remained respectful and professional." }
],
"RowAvg": 0,
"maxScore": 5
}
]
]

35 changes: 25 additions & 10 deletions src/pages/ViewTeamGrades/ReviewTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useState } from 'react';
import ReviewTableRow from './ReviewTableRow'; // Importing the ReviewTableRow component
import RoundSelector from './RoundSelector'; // Importing the RoundSelector component
import dummyDataRounds from './Data/heatMapData.json'; // Importing dummy data for rounds
import dummyauthorfeedback from './Data/authorFeedback.json'; // Importing dummy data for author feedback
import dummyData from './Data/dummyData.json'; // Importing dummy data
import { calculateAverages, getColorClass } from './utils'; // Importing utility functions
import './grades.scss'; // Importing styles
Expand All @@ -21,6 +22,7 @@ const ReviewTable: React.FC = () => {
const [showToggleQuestion, setShowToggleQuestion] = useState(false); // State for showing question column
const [open, setOpen] = useState(false);
const [showReviews, setShowReviews] = useState(false);
const [ShowAuthorFeedback, setShowAuthorFeedback] = useState(false);

// Function to toggle the sort order for rows
const toggleSortOrderRow = () => {
Expand Down Expand Up @@ -56,10 +58,17 @@ const ReviewTable: React.FC = () => {
setShowReviews(!showReviews);
};


// Function to toggle the visibility of ShowAuthorFeedback component
const toggleAuthorFeedback = () => {
setShowAuthorFeedback(!ShowAuthorFeedback);
};

const toggleShowQuestion = () => {
setShowToggleQuestion(!showToggleQuestion);
};


// JSX rendering of the ReviewTable component
return (

Expand All @@ -77,7 +86,7 @@ const ReviewTable: React.FC = () => {
aria-controls="example-collapse-text"
aria-expanded={open}
>
Show Submission
{open ? 'Hide Submission' : 'Show Submission'}
</Button>

{/* Collapsible content */}
Expand Down Expand Up @@ -188,16 +197,22 @@ const ReviewTable: React.FC = () => {
Comment: {dummyData.comment}<br></br>
Late Penalty: {dummyData.late_penalty}<br></br>
</p>
<div>
<button onClick={toggleShowReviews}>Show Reviews</button>
{/* {isVisible && renderQuestionReviews()} */}
{/* <h1>Review Table</h1> */}
{showReviews && <ShowReviews data={dummyDataRounds} />}
{/* <ReviewTable data={dummyData} /> */}
</div>


<div style={{ display: 'flex' }}>
<div>
<button onClick={toggleShowReviews}>
{showReviews ? 'Hide Reviews' : 'Show Reviews'}
</button>
{showReviews && <ShowReviews data={dummyDataRounds} />}
</div>

<div>
<button onClick={toggleAuthorFeedback}>
{ShowAuthorFeedback ? 'Hide Author Feedback' : 'Show Author Feedback'}
</button>
{ShowAuthorFeedback && <ShowReviews data={dummyauthorfeedback} />}
</div>
</div>

<Link to="/">Back</Link>
</div>
);
Expand Down

0 comments on commit 7cef707

Please sign in to comment.