aabroukh's picture
Add files using upload-large-folder tool
b136cbe verified
Raw History Blame Contribute Delete
9.75 kB
import { useState } from "react";
const Instructions = ({ modality, onComplete }) => {
const [currentPage, setCurrentPage] = useState(0);
const textInstructions = [
{
title: "Welcome to the Text Response Evaluation Study",
content: (
<div>
<p>Thank you for participating in our research study. You will be evaluating AI-generated text responses to various questions.</p>
<p><strong>What you'll be doing:</strong></p>
<ul>
<li>You'll see a user question followed by two different AI responses</li>
<li>Your task is to rate each response on how helpful and appropriate it is</li>
<li>There will be 21 trials total (including 1 practice trial)</li>
<li>Each trial should take about 1-2 minutes</li>
</ul>
</div>
)
},
{
title: "How to Rate Responses",
content: (
<div>
<p><strong>Rating Scale:</strong> You'll use a slider from 1 to 100 to rate each response.</p>
<ul>
<li><strong>1-20:</strong> Terrible - Completely unhelpful, wrong, or inappropriate</li>
<li><strong>21-40:</strong> Poor - Somewhat unhelpful or partially wrong</li>
<li><strong>41-60:</strong> Average - Okay but could be better</li>
<li><strong>61-80:</strong> Good - Helpful and mostly accurate</li>
<li><strong>81-100:</strong> Perfect - Excellent, very helpful response</li>
</ul>
<p><strong>Consider:</strong> Accuracy, helpfulness, completeness, and appropriateness of each response.</p>
</div>
)
},
{
title: "Important Guidelines",
content: (
<div>
<p><strong>Please remember:</strong></p>
<ul>
<li>Read each response carefully before rating</li>
<li>Rate responses independently - don't compare them directly</li>
<li>Use the full scale (1-100) based on response quality</li>
<li>There are no right or wrong ratings - we want your honest opinion</li>
<li>Some questions may have conversation history for context</li>
</ul>
<p><strong>Technical notes:</strong></p>
<ul>
<li>The survey will remember your progress if you need to take a break</li>
<li>Please complete the survey in one session if possible</li>
<li>Make sure you have a stable internet connection</li>
</ul>
</div>
)
}
];
const audioInstructions = [
{
title: "Welcome to the Audio Response Evaluation Study",
content: (
<div>
<p>Thank you for participating in our research study. You will be evaluating AI-generated audio responses to various questions.</p>
<p><strong>What you'll be doing:</strong></p>
<ul>
<li>You'll see a user question followed by two different AI audio responses</li>
<li>Your task is to rate each response on both content quality and audio quality</li>
<li>There will be 21 trials total (including 1 practice trial)</li>
<li>Each trial should take about 2-3 minutes</li>
</ul>
<p><strong>Audio requirements:</strong></p>
<ul>
<li>Please use headphones or speakers</li>
<li>Make sure your volume is at a comfortable level</li>
<li>Find a quiet environment for best evaluation</li>
</ul>
</div>
)
},
{
title: "How to Rate Audio Responses",
content: (
<div>
<p>You'll rate each audio response on <strong>two dimensions</strong>:</p>
<p><strong>1. Response Rating (Content Quality):</strong></p>
<ul>
<li><strong>1-20:</strong> Terrible content - Unhelpful, wrong, or inappropriate</li>
<li><strong>21-40:</strong> Poor content - Somewhat unhelpful or partially wrong</li>
<li><strong>41-60:</strong> Average content - Okay but could be better</li>
<li><strong>61-80:</strong> Good content - Helpful and mostly accurate</li>
<li><strong>81-100:</strong> Perfect content - Excellent, very helpful response</li>
</ul>
<p><strong>2. Audio Quality Rating:</strong></p>
<ul>
<li><strong>1-20:</strong> Terrible audio - Very hard to understand, robotic</li>
<li><strong>21-40:</strong> Poor audio - Somewhat hard to understand</li>
<li><strong>41-60:</strong> Average audio - Understandable but not natural</li>
<li><strong>61-80:</strong> Good audio - Clear and fairly natural sounding</li>
<li><strong>81-100:</strong> Perfect audio - Very natural, human-like speech</li>
</ul>
</div>
)
},
{
title: "Audio Controls & Guidelines",
content: (
<div>
<p><strong>Audio Controls Available:</strong></p>
<ul>
<li><strong>Play/Pause:</strong> Start or stop the audio</li>
<li><strong>Replay:</strong> Start the audio over from the beginning</li>
<li><strong>Skip Back (-10s):</strong> Jump back 10 seconds</li>
<li><strong>Progress Bar:</strong> Click or drag to jump to any point in the audio (unlocked after first full listen)</li>
</ul>
<p><strong>Important Guidelines:</strong></p>
<ul>
<li><strong>You must listen to each audio response completely at least once before the progress bar unlocks</strong></li>
<li><strong>You cannot move on until both audio clips have been fully listened to AND all ratings are provided</strong></li>
<li>After the first full listen, you can replay or skip around as much as needed</li>
<li>Rate content and audio quality independently</li>
<li>Use the full scale (1-100) for both ratings</li>
<li>There are no right or wrong ratings - we want your honest opinion</li>
</ul>
<p><strong>Technical notes:</strong></p>
<ul>
<li>Audio files will load automatically</li>
<li>If audio doesn't play, try refreshing the page</li>
<li>The survey remembers your progress</li>
</ul>
</div>
)
}
];
const instructions = modality === "text" ? textInstructions : audioInstructions;
const isLastPage = currentPage === instructions.length - 1;
const handleNext = () => {
if (isLastPage) {
onComplete();
} else {
setCurrentPage(prev => prev + 1);
}
};
const handlePrevious = () => {
setCurrentPage(prev => Math.max(0, prev - 1));
};
return (
<div style={{
maxWidth: '800px',
margin: '0 auto',
padding: '40px 20px',
fontFamily: 'Arial, sans-serif',
lineHeight: '1.6'
}}>
<div style={{ marginBottom: '30px' }}>
<h1 style={{
fontSize: '24px',
color: '#333',
marginBottom: '10px',
textAlign: 'center'
}}>
{instructions[currentPage].title}
</h1>
<div style={{
textAlign: 'center',
color: '#666',
fontSize: '14px',
marginBottom: '30px'
}}>
Page {currentPage + 1} of {instructions.length}
</div>
</div>
<div style={{
backgroundColor: '#f9f9f9',
padding: '30px',
borderRadius: '8px',
border: '1px solid #ddd',
marginBottom: '30px',
minHeight: '400px'
}}>
<div style={{ fontSize: '16px', color: '#333' }}>
{instructions[currentPage].content}
</div>
</div>
<div style={{
display: 'flex',
justifyContent: 'space-between',
alignItems: 'center'
}}>
<button
onClick={handlePrevious}
disabled={currentPage === 0}
style={{
padding: '12px 24px',
fontSize: '16px',
backgroundColor: currentPage === 0 ? '#ccc' : '#6c757d',
color: 'white',
border: 'none',
borderRadius: '5px',
cursor: currentPage === 0 ? 'not-allowed' : 'pointer',
minWidth: '100px'
}}
>
Previous
</button>
<div style={{
display: 'flex',
gap: '8px'
}}>
{instructions.map((_, index) => (
<div
key={index}
style={{
width: '12px',
height: '12px',
borderRadius: '50%',
backgroundColor: index === currentPage ? '#007bff' : '#ddd'
}}
/>
))}
</div>
<button
onClick={handleNext}
style={{
padding: '12px 24px',
fontSize: '16px',
backgroundColor: '#007bff',
color: 'white',
border: 'none',
borderRadius: '5px',
cursor: 'pointer',
minWidth: '100px',
fontWeight: isLastPage ? 'bold' : 'normal'
}}
>
{isLastPage ? 'Start Survey' : 'Next'}
</button>
</div>
{isLastPage && (
<div style={{
marginTop: '20px',
padding: '15px',
backgroundColor: '#e7f3ff',
border: '1px solid #007bff',
borderRadius: '5px',
textAlign: 'center'
}}>
<strong>Ready to begin?</strong> Click "Start Survey" to proceed to the {modality} evaluation tasks.
</div>
)}
</div>
);
};
export default Instructions;