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

Commit 7abcd90

Browse files
authored
only check answerkey names if validate = TRUE (#117)
1 parent 95bc4a9 commit 7abcd90

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

R/CreateQualificationType.R

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ function (name, description, status, keywords = NULL, retry.delay = NULL,
4040
warning("'answerkey' object does not validate against MTurk schema")
4141
return(validation)
4242
}
43-
}
44-
t.temp <- as.character(unique(as.data.frame.QuestionForm(xmlParse(test))$Question$QuestionIdentifier))
45-
a.temp <- as.character(unique(as.data.frame.AnswerKey(xmlParse(answerkey))$Questions$QuestionIdentifier))
46-
if (!sum(a.temp %in% t.temp) == length(a.temp)) {
47-
stop("One or more QuestionIdentifiers in AnswerKey not in QuestionForm")
48-
}
49-
if (!sum(t.temp %in% a.temp) == length(t.temp)) {
50-
stop("One or more QuestionIdentifiers in QuestionForm not in AnswerKey")
43+
t.temp <- as.character(unique(as.data.frame.QuestionForm(xmlParse(test))$Question$QuestionIdentifier))
44+
a.temp <- as.character(unique(as.data.frame.AnswerKey(xmlParse(answerkey))$Questions$QuestionIdentifier))
45+
if (!sum(a.temp %in% t.temp) == length(a.temp)) {
46+
stop("One or more QuestionIdentifiers in AnswerKey not in QuestionForm")
47+
}
48+
if (!sum(t.temp %in% a.temp) == length(t.temp)) {
49+
stop("One or more QuestionIdentifiers in QuestionForm not in AnswerKey")
50+
}
5151
}
5252
GETparameters <- paste(GETparameters, "&AnswerKey=",
5353
curl_escape(answerkey), sep = "")

0 commit comments

Comments
 (0)