add metrics to tasks
This commit is contained in:
@@ -73,10 +73,12 @@ func BaseQuestions(interfaceType InterfaceType) Questions {
|
||||
return Questions{
|
||||
huh.NewGroup(
|
||||
huh.NewConfirm().
|
||||
Key("task_completed").
|
||||
Title("Did you complete the task?"),
|
||||
),
|
||||
huh.NewGroup(
|
||||
huh.NewSelect[int]().Value(&taskRating).
|
||||
Key("task_difficulty").
|
||||
Options(
|
||||
huh.NewOption("Very easy", 1),
|
||||
huh.NewOption("Easy", 2),
|
||||
|
||||
@@ -51,22 +51,35 @@ func (t *CodingTask) Questions(interfaceType InterfaceType) (questions Questions
|
||||
return BaseQuestions(interfaceType).
|
||||
With(
|
||||
ReplQuestion(interfaceType,
|
||||
huh.NewConfirm().Title("Question only for REPL interface")),
|
||||
huh.NewConfirm().Key("repl_experience").Title("Question only for REPL interface")),
|
||||
).
|
||||
With(
|
||||
WebQuestion(interfaceType,
|
||||
huh.NewInput().Title("Question only for Web interface")),
|
||||
huh.NewInput().Key("web_feedback").Title("Question only for Web interface")),
|
||||
).
|
||||
With(
|
||||
TUIQuestion(interfaceType,
|
||||
huh.NewConfirm().Title("Question only for TUI interface")),
|
||||
huh.NewConfirm().Key("tui_experience").Title("Question only for TUI interface")),
|
||||
).
|
||||
With(
|
||||
Question(
|
||||
huh.NewConfirm().Title("One last question for all interfaces!")),
|
||||
huh.NewConfirm().Key("final_confirmation").Title("One last question for all interfaces!")),
|
||||
)
|
||||
}
|
||||
|
||||
func (t *CodingTask) QuestionnaireKeys(interfaceType InterfaceType) []string {
|
||||
keys := []string{"task_completed", "task_difficulty", "final_confirmation"}
|
||||
switch interfaceType {
|
||||
case InterfaceTypeREPL:
|
||||
keys = append(keys, "repl_experience")
|
||||
case InterfaceTypeWeb:
|
||||
keys = append(keys, "web_feedback")
|
||||
case InterfaceTypeTUI:
|
||||
keys = append(keys, "tui_experience")
|
||||
}
|
||||
return keys
|
||||
}
|
||||
|
||||
func (t *CodingTask) Setup(ctx context.Context) error {
|
||||
if err := ClearIssues(t.app); err != nil {
|
||||
return err
|
||||
|
||||
@@ -42,6 +42,11 @@ func (t *CreateIssueTask) Questions(interfaceType InterfaceType) Questions {
|
||||
return BaseQuestions(interfaceType)
|
||||
}
|
||||
|
||||
func (t *CreateIssueTask) QuestionnaireKeys(interfaceType InterfaceType) []string {
|
||||
_ = interfaceType
|
||||
return []string{"task_completed", "task_difficulty"}
|
||||
}
|
||||
|
||||
func (t *CreateIssueTask) Setup(ctx context.Context) error {
|
||||
if err := ClearIssues(t.app); err != nil {
|
||||
return err
|
||||
|
||||
@@ -47,6 +47,7 @@ func (t *GitTask) Questions(interfaceType InterfaceType) Questions {
|
||||
return BaseQuestions(interfaceType).With(
|
||||
huh.NewGroup(
|
||||
huh.NewSelect[string]().Title("What Git Interface did you use?").
|
||||
Key("git_interface_used").
|
||||
Options(
|
||||
huh.Option[string]{Value: "cli", Key: "Command Line Interface"},
|
||||
huh.Option[string]{Value: "tui", Key: "Terminal User Interface"},
|
||||
@@ -56,6 +57,11 @@ func (t *GitTask) Questions(interfaceType InterfaceType) Questions {
|
||||
)
|
||||
}
|
||||
|
||||
func (t *GitTask) QuestionnaireKeys(interfaceType InterfaceType) []string {
|
||||
_ = interfaceType
|
||||
return []string{"task_completed", "task_difficulty", "git_interface_used"}
|
||||
}
|
||||
|
||||
func (t *GitTask) Setup(ctx context.Context) error {
|
||||
if err := ClearIssues(t.app); err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user