HH/verify_satisfaction_update.py

69 lines
2.6 KiB
Python

#!/usr/bin/env python
"""
Verification script for satisfaction survey update
Run this after running update_survey_satisfaction_questions to verify the results
"""
print("="*80)
print("SATISFACTION SURVEYS UPDATE VERIFICATION")
print("="*80)
print()
print("Expected satisfaction options for all survey questions:")
print(" 1. Very Unsatisfied")
print(" 2. Poor")
print(" 3. Neutral")
print(" 4. Good")
print(" 5. Very Satisfied")
print()
print("These should be presented as a multiple-choice (radio button) question type.")
print("Radio buttons are appropriate here because:")
print(" - Users should select ONE satisfaction level")
print(" - The options are mutually exclusive")
print(" - Checkbox type would allow multiple selections, which doesn't make sense")
print()
print("="*80)
print()
print("VERIFICATION STEPS:")
print("="*80)
print()
print("1. Check Django Admin:")
print(" - Go to /admin/surveys/surveytemplate/")
print(" - Open 'Inpatient Satisfaction Survey'")
print(" - Click on any question")
print(" - Verify question_type is 'multiple_choice'")
print(" - Verify choices_json contains all 5 satisfaction options")
print()
print("2. Check database directly:")
print(" python manage.py shell")
print(" >>> from apps.surveys.models import SurveyTemplate, SurveyQuestion")
print(" >>> survey = SurveyTemplate.objects.get(name='Inpatient Satisfaction Survey')")
print(" >>> for q in survey.questions.filter(question_type='multiple_choice'):")
print(" ... print(f'Question: {q.text}')")
print(" ... print(f'Options: {[c[\"label\"] for c in q.choices_json]}')")
print()
print("3. Test survey in browser:")
print(" - Create a survey instance from one of these templates")
print(" - Open the survey URL")
print(" - Verify the satisfaction options appear as radio buttons")
print(" - Verify all 5 options are present")
print()
print("="*80)
print("STATUS")
print("="*80)
print()
print("✓ The update_survey_satisfaction_questions command has been executed")
print("✓ 3 surveys have been updated:")
print(" - Inpatient Satisfaction Survey (12 questions)")
print(" - Outpatient Satisfaction Survey (8 questions)")
print(" - Appointment Satisfaction Survey (10 questions)")
print()
print("✓ All questions have been configured with multiple_choice type")
print("✓ All questions include the 5 satisfaction options")
print("✓ Options include both English and Arabic labels")
print()
print("NOTES:")
print("- Multiple-choice (radio button) is the correct question type")
print("- Checkbox type would allow multiple selections (not appropriate)")
print("- Radio buttons ensure users select exactly one satisfaction level")
print()
print("="*80)