Forum archive 2000-2006

David K. Watson - Order on show past answers pages

David K. Watson - Order on show past answers pages

by Arnold Pizer -
Number of replies: 0
inactiveTopicOrder on show past answers pages topic started 3/1/2006; 3:44:53 PM
last post 3/2/2006; 12:23:22 PM
userDavid K. Watson - Order on show past answers pages  blueArrow
3/1/2006; 3:44:53 PM (reads: 400, responses: 2)
We have come up on an irritating behavior on the page you get when you click on the "show past answers" button on a problem page. This behavior only happens if the problem has a large number of answers. As an example, there is a linear algebra problem that has 18 answer blanks to fill in, and if the order for the answers is #1, #2, ... ,#18 as they appear in the problem, the answers appear on the "show past answers" page in the order

#1, #10, #11, #12, ..., #18, then #2, #3, ... , #9,

i.e., you see the first answer, then the second half of correct answers in order, followed by the rest of first half of correct answers in order.

My interpretation is that there is some code that is intended to wrap the display in two rows as

#1, #2, #3, ... , #9,

#10, #11, #12, ..., #18,

but instead this somehow got flattened into one row with the intended second row after the first entry. This makes it very difficult to check on a student's past answers to see how they have gone wrong.

Has this been fixed in a recent version of webwork? We are using some point release of 2.1.

<| Post or View Comments |>


userArnold K. Pizer - Re: Order on show past answers pages  blueArrow
3/1/2006; 4:02:00 PM (reads: 486, responses: 0)
Hi David,

It looks like an ascii sort rather than a numerical sort is being used.

We'll look into it.

Arnie

<| Post or View Comments |>


userArnold K. Pizer - Re: Order on show past answers pages  blueArrow
3/2/2006; 12:23:22 PM (reads: 486, responses: 0)
Hi David,

This is not fixed in the recently released version 2.2.0

It is fixed in the most recent CVS version but you may not want to download this version.

If you want to edit two lines in one file, the bug fix is easy.

In the file .../webwork2/lib/WeBWorK/ContentGenerator/Problem.pm edit the following two lines:

line 35: append "sortByName" to the qw list. 



If you have the lastest version this means
replacing
use WeBWorK::Utils qw(readFile writeLog writeCourseLog encodeAnswers decodeAnswers ref2string makeTempDirectory path_is_subdir);
by
use WeBWorK::Utils qw(readFile writeLog writeCourseLog encodeAnswers decodeAnswers ref2string makeTempDirectory path_is_subdir sortByName);



but if your qw list if different from the above, just add "sortByName" to the end.



line 937
replace
foreach (sort keys %answerHash) {
by
foreach (sortByName(undef, keys %answerHash)) {

<| Post or View Comments |>