remember that this code path is in the click handler for the "check answer" button… =)

The "submit" answers button code path get all inputs/textareas in exam-pane.

On Jan 9, 2013, at 6:45 PM, Sef Kloninger <notifications@github.com> wrote:

> In main/templates/exams/view_exam.html:
> 
> > -                            tmpObj.questionreport = $(this).closest('tr').attr('data-report');
> > -                        }
> > -                        userSelections[$(this).attr('name')].push(tmpObj);
> > -                    } else if (($(this).prop('type') == 'text' || $(this).prop('type') == 'textarea') 
> > -                            && $(this).val() != "") {
> > -                        var tmpObj = {};
> > -                        tmpObj.value = $(this).val();
> > -                        tmpObj.associatedText = $(this).parent().text().trim().substr(0,40);
> > -                        tmpObj.report = $(this).attr('data-report');
> > -                        tmpObj.questionreport = $(this).closest('.question').attr('data-report');
> > -                        userSelections[$(this).attr('name')]=tmpObj;
> > -                    }
> > -                });
> > -                return userSelections;
> > +            var getAllUserAnswers = function () {
> > +                var inputCollection = $(checkBtn).closest('.question').find('input,textarea');
> So we will only save the state of any question that has a Check button. I guess that works, but seems a bit fragile. Why not select all divs of class question or something like that?
> 
> —
> Reply to this email directly or view it on GitHub.
> 
>