This program makes an excel file. In that excel file there's a column for each question and a row for each student. Actually, there's two columns for each question: one for the score and one for the answer. Those two columns stay together, though, so think of them like one column. This section explains what order the questions' columns will be in.
If you didn't randomize your question order, then it's simple. The questions appear in the same order they are in your D2L student information file. In that case, stop reading this explanation.
If you did randomize your question order, then it's more complex. Randomized question numbers are useless and we want to look at the actual questions. So, this program throws away the question numbers. It uses the actual text of the questions to figure out what columns to make.
If you edited a question's text, the different versions will become separate questions. This program only looks at question text, so it doesn't know that a question used to say something else. It doesn't try to judge which questions are similar enough to be the same.
Once we define the questions, how should we order the columns in the output? You can upload an optional Word docx file to help with ordering if you want.
If you don't upload a Word file, then this program uses the order from your D2L student information file. A question may appear on a lot of rows in the D2L file, but only the first time matters. That is, of all the row numbers, only the smallest one matters. The questions get ordered according to when they first appeared in the D2L file.
If you do upload a Word file, this program uses the order from it. This program searches for each question in the Word file. If a question is in the Word file more than once, only the first location matters. The order in the Word file decides the order of the columns. When it looks for questions in the Word file, this program only considers letters and numbers. So, punctuation, formatting and spaces don't matter. If a question isn't in the Word file, then it goes to the end (in columns at the right). Those questions are in the same order as if you hadn't uploaded a Word file.