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

Commit

Permalink
fix option setting in simple wizard
Browse files Browse the repository at this point in the history
  • Loading branch information
leeper committed Oct 6, 2014
1 parent 72cd426 commit 3edfc3b
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions R/wizard.simple.R
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@ function (graphics = FALSE, sandbox = NULL, ...)
credentials(keypair)
}
else {
message("Your current MTurk Credentials are: ", keypair)
message("Your current MTurk Credentials are: ",
paste(keypair, collapse = "\n"))
}
if (is.null(sandbox))
sandbox <- readline(prompt = "Use Sandbox? (Y/N): ")
if (sandbox %in% c("Yes", "YES", "yes", "TRUE", "true", "True",
"1", TRUE))
sandbox <- TRUE
if (sandbox %in% c("Yes", "YES", "yes", "TRUE", "true", "True", "1", TRUE))
options(MTurkR.sandbox = TRUE)
else
sandbox <- FALSE
options(MTurkR.sandbox = FALSE)
wizard.menu <- function() {
menu.opts <- c("Check Account Balance", "Check Sufficient Funds",
"Create HIT", "Check HIT Status", "Get Assignment(s)",
Expand Down Expand Up @@ -52,8 +52,10 @@ function (graphics = FALSE, sandbox = NULL, ...)
number <- readline("How many assignments per HIT: ")
funds <- try(SufficientFunds(amount = pay, assignments = number,
hits = hit, verbose = TRUE, ...), silent = TRUE)
if (class(funds) == "try-error")
if(class(funds) == "try-error")
warning("An error occurred: ", funds)
else
print(funds)
message()
wizard.menu()
}
Expand Down

0 comments on commit 3edfc3b

Please sign in to comment.