我给你测试!您的测试就是测试。测试是用测试人员提供给您的测试来测试被测者,其中包含少量测试代码。具体来说,您将提供选择输入的多选测试。
在此挑战中,您必须输入如下内容:
1. Our site is called Programming Puzzles & Code ________.
A: Debugging
*B: Golf
C: Hockey
D: Programming
2. What is the *most* popular tag on our site?
A: [debug]
B: [program]
*C: [code-golf]
D: [number]
E: [c++]
3. We are part of the ________ Exchange network.
*A: Stack
B: Code
C: Programmer
D: Hockey
4. Is this the first question?
A: Yes
*B: No
5. Is this the last question?
*A: Yes
B: No
这是正在进行测试的示例:
1. Our site is called Programming Puzzles & Code ________.
A: Debugging
B: Golf
C: Hockey
D: Programming
answer: B
correct!
2. What is the *most* popular tag on our site?
A: [debug]
B: [program]
C: [code-golf]
D: [number]
E: [c++]
answer: C
correct!
3. We are part of the ________ Exchange network.
A: Stack
B: Code
C: Programmer
D: Hockey
answer: B
incorrect! the answer was A
4. Is this the first question?
A: Yes
B: No
answer: B
correct!
5. Is this the last question?
A: Yes
B: No
answer: B
incorrect! the answer was A
overview:
3 correct, 2 incorrect (60%)
3. We are part of the ________ Exchange network.
you chose B: Code
the answer was A: Stack
5. Is this the last question?
you chose B: No
the answer was A: Yes
正式规格:
- 输入值
- 如果一行以数字开头,后接点和空格,则表示该数字是一个问题。数字始终从1开始,每个问题最多上升1。
- 如果一行以可选的星号,字母,冒号和空格开头,则为答案。答案也将始终是顺序的。每个问题只有一个正确答案。
- 除了前面提到的方式,一行不会以任何其他方式开始。
- 可以以任何方式(从文件,stdin等读取)接受输入,但不得将其硬编码到程序中。
- 输出(考试阶段)
- 首先,顺序打印每个问题。根据输入内容打印问题及其答案,但不要打印表示正确答案的星号。
- 然后,打印换行符和
"answer: "。等待用户输入。用户输入将始终对应于答案。 - 如果正确答案(带星号的答案)与用户输入的答案相同,请输出
"correct!"。否则,输出"incorrect! the answer was " + correct_letter。 - 用空白行分隔每个问题,然后重复前面的输出步骤,直到没有其他问题为止。
- 输出(概述阶段)
- 打印
"overview: ",然后换行。 - 打印
"{number of correct answers} correct, {incorrect answers} incorrect ({percent correct, rounded to the nearest whole number}%)"(当然,用大括号将短语替换为相应的值)。然后打印空白行以保持间距。 - 现在,对于每个错误的问题,先打印问题(而不是答案),然后在新行上
"you chose " + answer_you_chose,然后在另一行上"the answer was " + correct_answer。用空白行分隔每个错误答案的概述。
- 打印
- 为了通过按字面解释来减少作弊,当在此处给出相同的输出,并且在考试阶段提供相同的输入时,程序必须输出与示例输出完全相同的东西。
这是代码高尔夫球;最短的代码胜出!(并获得一个A +(绿色复选标记)!)
我们需要允许行继续吗?我的意思是,会有几行不是以“ 1。”或“ A:”?如果是,请在样本测试中包括此类情况。
—
manatwork 2013年
@manatwork(第一条评论)好的,编辑(第二条评论)不,您不要。我会澄清。
—
门把手
那么您将如何测试该测试?
—
Joe Z.
@JoeZ。嗯...不确定您的意思...我确实为测试人员提供了测试用例以测试您的测试人员
—
Doorknob

\d\.,\w:并且\*在问题/答案中间。(例如,当前*可以用消除y/*//,而正确的方法冗长如s/^\*//。)