From 99a2f607320ca70bd082e98d0cd123c60eb8e510 Mon Sep 17 00:00:00 2001 From: Robin Olsen Date: Fri, 3 Apr 2026 15:36:40 +0200 Subject: [PATCH] Enhance survey start command to support resuming latest session and update README with resume instructions --- build/PARTICIPANT_README.md | 5 ++++- internal/commands/survey/start.go | 8 ++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/build/PARTICIPANT_README.md b/build/PARTICIPANT_README.md index 35d8a77..ed4aee6 100644 --- a/build/PARTICIPANT_README.md +++ b/build/PARTICIPANT_README.md @@ -33,6 +33,8 @@ You'll answer a short questionnaire about: 3. **Read Carefully**: Each task has specific requirements that will be validated 4. **Exit Anytime**: Press q (depending on interface) to skip a task early if needed 5. **Interface Help**: Each interface has built-in help - look for it! +6. **Resume Later**: If you need to stop a task you can resume to the latest task when running + `pm start` again or opening the file on the desktop. ## Troubleshooting @@ -41,7 +43,8 @@ You'll answer a short questionnaire about: - **No database connection**: You can continue without submitting responses and submit later with `pm submit` - **Terminal too small**: Resize your terminal window to at least 55x16 characters, we recommend to keeping the terminal as large as possible for best experience. -- **Interface not responding**: Press Ctrl+C to exit, then restart the survey +- **Interface not responding**: Press Ctrl+C to exit, then restart the "PM Survey" executable, + you can then resume the latest task. ## Interfaces You'll Use diff --git a/internal/commands/survey/start.go b/internal/commands/survey/start.go index a7a9cfd..9211e17 100644 --- a/internal/commands/survey/start.go +++ b/internal/commands/survey/start.go @@ -15,7 +15,10 @@ var ( // StartCmd is the start command - RunE is set in cmd/survey/ var StartCmd = &cobra.Command{ Use: "start", - Short: "Start the user survey", + Short: "Start the user survey, or resume latest session", + Long: `Start the survey. + +If you have a previous started session, it will resume to the latest task.`, } func init() { @@ -23,5 +26,6 @@ func init() { StartCmd.Flags().StringVarP(&InterfaceType, "interface", "i", "", "Specify interface.") StartCmd.RegisterFlagCompletionFunc("task", shellcomp.CompletionFunc(task.ListTasks())) StartCmd.RegisterFlagCompletionFunc("interface", shellcomp.CompletionFunc(task.ListInterfaces())) - StartCmd.Flags().BoolVar(&DevFlag, "dev", false, "Enable development mode, which skips database connection, submission and intro") + StartCmd.Flags(). + BoolVar(&DevFlag, "dev", false, "Enable development mode, which skips database connection, submission and intro") }