\name{TaskListFromSSXML} \alias{TaskListFromSSXML} %- Also NEED an '\alias' for EACH other topic documented here. \title{Find unique TaskIDs in StatShop XML file} \description{ This function scans a StatShop XML file for \code{} elements and gathers a list of the unique task IDs. } \usage{ TaskListFromSSXML(xmlFile) } \arguments{ \item{xmlFile}{A character string giving the name of a StatShop XML file. This works will almost all types of StatShop files (\code{cpd.xml}---calibration pretest data, \code{pd.xml}---pretest description, \code{tdd.xml}---task data description, and \code{amd.xml}---assessment model description. } } \details{ A common problem encountered in StatShop is a mismatch between the list of tasks in a pretest description \code{pd.xml} and a calibration pretest description \code{cpd.xml} file. When this occurs, conversions to CSV format can cause large numbers of \code{NA}s in the CSV file. Unexpected behavior can also occur if there is a mismatch between the list of task in the data file and in the assessment model description \code{amd.xml}. This could cause task outcomes to be scored using generic evidence model rather than task specific links. The \code{TaskListFromSSXML()} function read an XML file and extract the unique \code{} elements. These should be in \link{ECDID} format. The results can be compared using \code{\link[base]{setdiff}}. } \value{ A character vector contating task IDs in the \link{ECDID} format. If the XML file does not contain \code{} elements, then the vector will have length zero. } \author{ Russell Almond } %% ~Make other sections like Warning with \section{Warning }{....} ~ \seealso{ \code{\link{ECDID}}, \code{\link[base]{setdiff}}, \code{\link{xmlTaskList}} } \examples{ # Assumes StatShop is installed on the test machine. StatShop <- Sys.getenv("STATSHOP") if (StatShop == "") { warn("StatShop not installed, skipping test.") } else { #Read in some standard task lists. pdtl <- TaskListFromSSXML(paste(StatShop, "xml", "DataDescription.pd.xml", sep=.Platform$file.sep)) cpdtl <- TaskListFromSSXML(paste(StatShop, "xml", "PreCalibrationSample.cpd.xml", sep=.Platform$file.sep)) amdtl <- TaskListFromSSXML(paste(StatShop, "xml", "BayesscoreAssessmentDescription.amd.xml", sep=.Platform$file.sep)) ##check to make sure they are all the same. stopifnot(length(setdiff(pdtl,cpdtl)==0)) stopifnot(length(setdiff(cpdtl,pdtl)==0)) stopifnot(length(setdiff(amdtl,cpdtl)==0)) stopifnot(length(setdiff(cpdtl,amdtl)==0)) } } % Add one or more standard keywords, see file 'KEYWORDS' in the % R documentation directory. \keyword{interface}