我在Acrobat 9中使用JavaScript为我的美国历史学生创建测试。我想不计算他们没有回答的答案。以下是我到目前为止的情况:
var arrTest = "cell.1", "cell.2", "cell.3" , "cell.4"); //Will have more than four
count = 0, i = arrTest.length; while (i--) {
if (typeof arrTest[i] === "undefined")
count++;
}
顺便说一下,有什么好的学习资料吗?
答案 0 :(得分:0)
我不知道Acrobat如何允许访问答案,但您的JavaScript有点错误:
var arrTest = [ "cell.1", "cell.2", "cell.3" , "cell.4"],
count = 0,
i = arrTest.length;
while (i--) {
//Assume PDFdoc is a var referencing your Acrobat document - not sure how it works there.
if (typeof PDFdoc.getField(arrTest[i]).value === "undefined") {
count++;
}
}