Skip to content
This repository was archived by the owner on May 24, 2019. It is now read-only.

Commit 3edfc3b

Browse files
committed
fix option setting in simple wizard
1 parent 72cd426 commit 3edfc3b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

R/wizard.simple.R

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ function (graphics = FALSE, sandbox = NULL, ...)
1616
credentials(keypair)
1717
}
1818
else {
19-
message("Your current MTurk Credentials are: ", keypair)
19+
message("Your current MTurk Credentials are: ",
20+
paste(keypair, collapse = "\n"))
2021
}
2122
if (is.null(sandbox))
2223
sandbox <- readline(prompt = "Use Sandbox? (Y/N): ")
23-
if (sandbox %in% c("Yes", "YES", "yes", "TRUE", "true", "True",
24-
"1", TRUE))
25-
sandbox <- TRUE
24+
if (sandbox %in% c("Yes", "YES", "yes", "TRUE", "true", "True", "1", TRUE))
25+
options(MTurkR.sandbox = TRUE)
2626
else
27-
sandbox <- FALSE
27+
options(MTurkR.sandbox = FALSE)
2828
wizard.menu <- function() {
2929
menu.opts <- c("Check Account Balance", "Check Sufficient Funds",
3030
"Create HIT", "Check HIT Status", "Get Assignment(s)",
@@ -52,8 +52,10 @@ function (graphics = FALSE, sandbox = NULL, ...)
5252
number <- readline("How many assignments per HIT: ")
5353
funds <- try(SufficientFunds(amount = pay, assignments = number,
5454
hits = hit, verbose = TRUE, ...), silent = TRUE)
55-
if (class(funds) == "try-error")
55+
if(class(funds) == "try-error")
5656
warning("An error occurred: ", funds)
57+
else
58+
print(funds)
5759
message()
5860
wizard.menu()
5961
}

0 commit comments

Comments
 (0)