Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Playground: Side-by-Side Expert Evaluation #345

Merged
merged 77 commits into from
Nov 18, 2024
Merged
Changes from 1 commit
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
bafba4b
Add support for icons
DominikRemo Sep 16, 2024
114a20c
Optionally hide details from inline feedback
DominikRemo Sep 23, 2024
b9db380
Add expert view and temporary auxilaries
DominikRemo Sep 23, 2024
97b77a6
extend side-by-side-tool
laadvo Oct 3, 2024
350809a
fetch submissions and feedback together with exercises
laadvo Oct 4, 2024
aedab07
Implemented UI for Evaluation Config
DominikRemo Oct 4, 2024
899b763
Add option for html in metrics
DominikRemo Oct 4, 2024
3a8678f
Merge branch 'develop' into feature/side-by-side-tool
DominikRemo Oct 7, 2024
833a3db
Add Markdown Support for Metric Descriptions
DominikRemo Oct 7, 2024
455546d
Consolidate Metric and ExpertEvaluationConfig Definitions in Model
DominikRemo Oct 7, 2024
1d848e5
Refactor Exercise Selection Logic and Fix Config Sync Bug
DominikRemo Oct 7, 2024
291a0f8
Improve format for Evaluation Management Component
DominikRemo Oct 7, 2024
8c6bad3
Improvements to ExpertEvaluationConfig
DominikRemo Oct 8, 2024
18702d1
remove feedback details and distinguish editors
laadvo Oct 9, 2024
249c5f8
Make Header Sticky and Optimize Layout in Expert View Header
DominikRemo Oct 9, 2024
ed75936
load data from config json
laadvo Oct 13, 2024
a661d15
save and load expert evaluation progress
laadvo Oct 14, 2024
1bbc3dd
Attempt at saving config
DominikRemo Oct 15, 2024
d9c5fa4
Attempt at saving config
DominikRemo Oct 15, 2024
92502f0
Added started attribute to EvaluationConfig
DominikRemo Oct 15, 2024
9c54297
support multiple experts
laadvo Oct 15, 2024
c69d83f
Expert Link Generation
DominikRemo Oct 15, 2024
50f1e29
Merge branch 'feature/side-by-side-tool' of https://github.com/ls1int…
DominikRemo Oct 15, 2024
af54e7f
Update metrics_form.tsx
DominikRemo Oct 15, 2024
8c51d61
Hide buttons if disabled
DominikRemo Oct 15, 2024
8c15ca5
improve config saving and anonymize when sending to client
laadvo Oct 21, 2024
3da3ef6
undo part of anonymization
laadvo Oct 21, 2024
25a23c5
Replace Exercise Selection with Import
DominikRemo Oct 21, 2024
9c82b87
Improve Metrics form
DominikRemo Oct 21, 2024
c573e81
Remove temporary header with redirect to expert view
DominikRemo Oct 21, 2024
f6738d3
Improve markdown in popup
DominikRemo Oct 21, 2024
6402a92
Add Exercise Details to Popup
DominikRemo Oct 22, 2024
232e680
Merge branch 'develop' into feature/side-by-side-tool
DominikRemo Oct 22, 2024
fadfc0c
add anonymization
laadvo Oct 22, 2024
c82d41a
Merge remote-tracking branch 'origin/feature/side-by-side-tool' into …
laadvo Oct 22, 2024
65b78d3
Introduce Metric Ids
DominikRemo Oct 22, 2024
288eb06
Merge branch 'feature/side-by-side-tool' of https://github.com/ls1int…
DominikRemo Oct 22, 2024
b42a6cf
Adapted likert scale with better UI and UX
DominikRemo Oct 23, 2024
1fa25b8
Merge branch 'develop' into feature/side-by-side-tool
DominikRemo Oct 24, 2024
dc13d66
Implemented download button
DominikRemo Oct 26, 2024
c7361a3
Implemented endpoint for download
DominikRemo Oct 26, 2024
b4e2561
Removing some lava flow
DominikRemo Oct 26, 2024
6307158
Remove redundant states from EvaluationManagement
DominikRemo Oct 26, 2024
141ec5d
Improve Evaluation Management UX
DominikRemo Oct 26, 2024
77f8432
Add progress bar to Evaluation Management
DominikRemo Oct 27, 2024
b023c4c
Minor improvements in evaluation management
DominikRemo Oct 27, 2024
ebdf6cd
add welcome and congratulation screen
laadvo Oct 28, 2024
1bebc08
Merge remote-tracking branch 'origin/feature/side-by-side-tool' into …
laadvo Oct 28, 2024
b6675c3
save config state on start
laadvo Oct 28, 2024
d6c4f3d
add react confetti to package.json
laadvo Oct 28, 2024
7a81e36
add screens
laadvo Oct 28, 2024
30ab9c1
add tutorial
laadvo Oct 29, 2024
640dd47
remove TODOs
laadvo Oct 29, 2024
b7f816c
undo tailwind.config change
laadvo Oct 29, 2024
754e5b4
add highlighting and confirmations
laadvo Oct 30, 2024
a87d710
add buttons to tutorial
laadvo Oct 30, 2024
5cd0694
make buttons reusable
laadvo Oct 30, 2024
0732771
fix adding new expert after evaluation defined bug
laadvo Oct 30, 2024
c208a9d
remove unneeded code
laadvo Nov 3, 2024
646706d
authorization using secret
laadvo Nov 4, 2024
508da73
remove button export check
laadvo Nov 4, 2024
30c8a0b
Remove window.close()
DominikRemo Nov 5, 2024
2610656
Convert images to jpeg and optimize them
DominikRemo Nov 5, 2024
cc2b271
Merge branch 'develop' into feature/side-by-side-tool
DominikRemo Nov 5, 2024
3066a74
welcome screen corrections
laadvo Nov 5, 2024
f669003
Merge remote-tracking branch 'origin/feature/side-by-side-tool' into …
laadvo Nov 5, 2024
0b8daa9
remove secret authorization
laadvo Nov 8, 2024
ca11105
Fix build
DominikRemo Nov 11, 2024
baf3867
Code formatting.
DominikRemo Nov 11, 2024
308ef5d
Restore .env.example
DominikRemo Nov 11, 2024
d4238ae
Unchange .env.example
DominikRemo Nov 11, 2024
1438780
Add missing newline
DominikRemo Nov 11, 2024
af8c89e
add gitkeep to expert_evaluation data folder
laadvo Nov 12, 2024
d73a07f
fix confirmation and is_finished
laadvo Nov 12, 2024
b1856f2
Fix off by one fault
DominikRemo Nov 12, 2024
bd3fba8
Remove redundant data mode constant.
DominikRemo Nov 18, 2024
9d9c852
Pin dependencies
DominikRemo Nov 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update metrics_form.tsx
When an experiment is started, no new metrics can be added. Therefor, the new metric form is now hidden accordingly.
  • Loading branch information
DominikRemo committed Oct 15, 2024
commit af54e7fecad182f6adf61af1d7524a9e6e9106f5
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ type MetricsFormProps = {
disabled: boolean; // New prop to control whether the form is disabled
};

export default function MetricsForm({ metrics, setMetrics, disabled }: MetricsFormProps) {
export default function MetricsForm({metrics, setMetrics, disabled}: MetricsFormProps) {
const [editIndex, setEditIndex] = useState<number | null>(null);
const [editingMetric, setEditingMetric] = useState<Metric>({
title: "",
Expand All @@ -29,7 +29,7 @@ export default function MetricsForm({ metrics, setMetrics, disabled }: MetricsFo
e: React.ChangeEvent<HTMLInputElement | HTMLTextAreaElement>,
isEditing: boolean = false
) => {
const { name, value } = e.target;
const {name, value} = e.target;
if (isEditing) {
setEditingMetric((prevMetric) => ({
...prevMetric,
Expand All @@ -50,7 +50,7 @@ export default function MetricsForm({ metrics, setMetrics, disabled }: MetricsFo
}

setMetrics([...metrics, newMetric]);
setNewMetric({ title: "", summary: "", description: "" }); // Reset form
setNewMetric({title: "", summary: "", description: ""}); // Reset form
};

// Start editing a metric in place
Expand Down Expand Up @@ -80,13 +80,15 @@ export default function MetricsForm({ metrics, setMetrics, disabled }: MetricsFo
: ""; // Style for disabled input fields

const buttonDisabledStyle = disabled
? "bg-gray-300 text-gray-600 cursor-not-allowed"
? "hidden"
: ""; // Style for disabled buttons

return (
<label className="flex flex-col">
<span className="text-lg font-bold">Metrics</span>
<div className="flex flex-col gap-4">

{/* List of Metrics */}
{metrics.map((metric, index) => (
<div key={index} className="flex flex-col gap-2 border p-4 rounded-md shadow-sm">
{editIndex === index ? (
Expand Down Expand Up @@ -123,7 +125,7 @@ export default function MetricsForm({ metrics, setMetrics, disabled }: MetricsFo
className={`bg-green-500 text-white rounded-md p-2 hover:bg-green-600 flex items-center gap-2 ${buttonDisabledStyle}`}
disabled={disabled}
>
<FontAwesomeIcon icon={faSave} />
<FontAwesomeIcon icon={faSave}/>
Save
</button>
</div>
Expand All @@ -144,7 +146,7 @@ export default function MetricsForm({ metrics, setMetrics, disabled }: MetricsFo
placeholder="Metric Summary"
/>
<div className="border border-gray-300 rounded-md p-2 w-full">
<ReactMarkdown rehypePlugins={[rehypeRaw]} className="prose prose-sm max-w-none" >
<ReactMarkdown rehypePlugins={[rehypeRaw]} className="prose prose-sm max-w-none">
{metric.description}
</ReactMarkdown>
</div>
Expand All @@ -154,15 +156,15 @@ export default function MetricsForm({ metrics, setMetrics, disabled }: MetricsFo
className={`bg-gray-500 text-white rounded-md p-2 hover:bg-gray-600 flex items-center gap-2 ${buttonDisabledStyle}`}
disabled={disabled}
>
<FontAwesomeIcon icon={faEdit} />
<FontAwesomeIcon icon={faEdit}/>
Edit
</button>
<button
onClick={() => removeMetric(index)}
className={`bg-red-500 text-white rounded-md p-2 hover:bg-red-600 flex items-center gap-2 ${buttonDisabledStyle}`}
disabled={disabled}
>
<FontAwesomeIcon icon={faTrash} />
<FontAwesomeIcon icon={faTrash}/>
Remove
</button>
</div>
Expand All @@ -171,63 +173,65 @@ export default function MetricsForm({ metrics, setMetrics, disabled }: MetricsFo
</div>
))}

<div className="flex flex-col gap-2 border p-4 rounded-md shadow-sm mt-4">
<div>
<label className="block text-sm">
<span className="text-gray-700">Title</span>
<input
type="text"
name="title"
value={newMetric.title}
onChange={(e) => handleChange(e, false)}
className={`mt-1 block w-full border border-gray-300 rounded-md p-2 ${inputDisabledStyle}`}
placeholder="Enter Metric Title"
disabled={disabled}
/>
</label>
</div>
{/* New Metric Form */}
{!disabled && (
<div className="flex flex-col gap-2 border p-4 rounded-md shadow-sm mt-4">
<div>
<label className="block text-sm">
<span className="text-gray-700">Title</span>
<input
type="text"
name="title"
value={newMetric.title}
onChange={(e) => handleChange(e, false)}
className={`mt-1 block w-full border border-gray-300 rounded-md p-2 ${inputDisabledStyle}`}
placeholder="Enter Metric Title"
disabled={disabled}
/>
</label>
</div>

<div>
<label className="block text-sm">
<span className="text-gray-700">Summary</span>
<input
type="text"
name="summary"
value={newMetric.summary}
onChange={(e) => handleChange(e, false)}
className={`mt-1 block w-full border border-gray-300 rounded-md p-2 ${inputDisabledStyle}`}
placeholder="Enter Metric Summary"
disabled={disabled}
/>
</label>
</div>
<div>
<label className="block text-sm">
<span className="text-gray-700">Summary</span>
<input
type="text"
name="summary"
value={newMetric.summary}
onChange={(e) => handleChange(e, false)}
className={`mt-1 block w-full border border-gray-300 rounded-md p-2 ${inputDisabledStyle}`}
placeholder="Enter Metric Summary"
/>
</label>
</div>

<div>
<label className="block text-sm">
<span className="text-gray-700">Description</span>
<textarea
name="description"
value={newMetric.description}
onChange={(e) => handleChange(e, false)}
className={`mt-1 block w-full border border-gray-300 rounded-md p-2 ${inputDisabledStyle}`}
rows={3}
placeholder="Enter Metric Description"
disabled={disabled}
/>
</label>
</div>
<div>
<label className="block text-sm">
<span className="text-gray-700">Description</span>
<textarea
name="description"
value={newMetric.description}
onChange={(e) => handleChange(e, false)}
className={`mt-1 block w-full border border-gray-300 rounded-md p-2 ${inputDisabledStyle}`}
rows={3}
placeholder="Enter Metric Description"
/>
</label>
</div>

<div className="flex gap-2">
<button
onClick={addMetric}
className={`bg-green-600 text-white rounded-md p-2 hover:bg-green-700 flex items-center gap-2 ${buttonDisabledStyle}`}
>
<FontAwesomeIcon icon={faPlus}/>
Add Metric
</button>
</div>

<div className="flex gap-2">
<button
onClick={addMetric}
className={`bg-green-600 text-white rounded-md p-2 hover:bg-green-700 flex items-center gap-2 ${buttonDisabledStyle}`}
disabled={disabled}
>
<FontAwesomeIcon icon={faPlus}/>
Add Metric
</button>
</div>
</div>
)}

</div>
</label>
);
Expand Down
Loading