Skip to content

Commit

Permalink
Merge pull request #204 from AI4Bharat/testing
Browse files Browse the repository at this point in the history
minor changes in model interaction evaluation
  • Loading branch information
aparna-aa authored Jan 1, 2025
2 parents 61c6377 + 280c9e5 commit ce5f940
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,12 @@ const ModelInteractionEvaluation = ({
return false;
}

const mandatoryQuestions = questions.filter((question) => {
return question.mandatory && question.mandatory == true;
});
console.log("mandatory questions: " + JSON.stringify(mandatoryQuestions));
// const mandatoryQuestions = questions.filter((question) => {
// return question.mandatory && question.mandatory == true;
// });
// console.log("mandatory questions: " + JSON.stringify(mandatoryQuestions));

const allMandatoryAnswered = mandatoryQuestions.every((question) => {
const allMandatoryAnswered = questions.every((question) => {
let parts = 0;
if (question.question_type === "fill_in_blanks") {
parts = question?.input_question?.split("<blank>")?.length;
Expand Down Expand Up @@ -685,12 +685,12 @@ const ModelInteractionEvaluation = ({
backgroundColor: "white",
fontWeight: "normal",
}}
required={question.mandatory}
required={true}
/>
)}
</span>
))}
{question.mandatory && (
{ (
<span style={{ color: "#d93025", fontSize: "25px" }}>
{" "}
*
Expand All @@ -707,7 +707,7 @@ const ModelInteractionEvaluation = ({
<span style={{ fontSize: "16px" }}>
{i + 1}. {question.input_question}
</span>
{question.mandatory && (
{ (
<span style={{ color: "#d93025", fontSize: "25px" }}>
{" "}
*
Expand Down Expand Up @@ -744,7 +744,7 @@ const ModelInteractionEvaluation = ({
width: "47px",
padding: "13px",
}}
required={question.mandatory}
required={true}
/>
),
)}
Expand All @@ -760,7 +760,7 @@ const ModelInteractionEvaluation = ({
style={{ fontSize: "16px" }}
>
{i + 1}. {question.input_question}
{question.mandatory && (
{ (
<span style={{ color: "#d93025", fontSize: "25px" }}>
{" "}
*
Expand Down Expand Up @@ -802,7 +802,7 @@ const ModelInteractionEvaluation = ({
style={{ fontSize: "16px" }}
>
{i + 1}. {question.input_question}
{question.mandatory && (
{ (
<span style={{ color: "#d93025", fontSize: "25px" }}>
{" "}
*
Expand All @@ -811,7 +811,7 @@ const ModelInteractionEvaluation = ({
</div>
<FormControl
component="fieldset"
required={question.mandatory}
required={true}
>
<RadioGroup
value={
Expand Down Expand Up @@ -850,9 +850,9 @@ const ModelInteractionEvaluation = ({
defaultSize="50px"
placeholder={translate("model_evaluation_notes_placeholder")}
value={
currentInteraction?.additional_note
currentInteraction?.additional_note != ""
? currentInteraction?.additional_note
: null
: ""
}
style={{ minHeight: "50px", maxHeight: "10rem", height: "50px" }}
onChange={handleNoteChange}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1040,9 +1040,9 @@ const PreferenceRanking = ({
defaultSize="50px"
placeholder={translate("model_evaluation_notes_placeholder")}
value={
currentInteraction?.additional_note
currentInteraction?.additional_note!=""
? currentInteraction?.additional_note
: null
: ""
}
style={{ minHeight: "50px", maxHeight: "10rem", height: "50px" }}
onChange={handleNoteChange}
Expand Down
4 changes: 3 additions & 1 deletion src/components/Project/ReportsTable.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ const ReportsTable = (props) => {
const classes = DatasetStyle();
const [radiobutton, setRadiobutton] = useState(isAnnotators?"AnnotatationReports":isReviewer?"ReviewerReports":"SuperCheckerReports");
const [submitted, setSubmitted] = useState(false);
const [title, setTitle] = useState('');

const loggedInUserData = useSelector(
(state) => state.getLoggedInData.data
Expand Down Expand Up @@ -140,6 +141,7 @@ const ReportsTable = (props) => {
setReportRequested(true);
setSubmitted(true);
setLoading(true);
setTitle(radiobutton === "AnnotatationReports" ? "Annotation Report" : (radiobutton === "ReviewerReports" ? "Reviewer Report" : "Super Checker Report"))
setTimeout(() => {
setLoading(false)
}, 1000);
Expand Down Expand Up @@ -299,7 +301,7 @@ const ReportsTable = (props) => {
{
loading ? <CircularProgress style={{marginLeft: "50%"}}/> : reportRequested && (
<MUIDataTable
title={radiobutton === "AnnotatationReports" ? "Annotation Report" : (radiobutton === "ReviewerReports" ? "Reviewer Report" : "Super Checker Report")}
title={title}
data={ProjectReport}
columns={columns.filter(col => selectedColumns.includes(col.name))}
options={options}
Expand Down

0 comments on commit ce5f940

Please sign in to comment.