(WIP) Cdodge/course surveys

Just setting this up to get build reports going. Coding still in progress.

@jimabramson will code review Python files (from TNL team). @cahrens will code review JavaScript.

@explorerleslie FYI

Sandbox information:

chrisndodge.m.sandbox.edx.org

To test:

- Create a new Account
- Register for the edX Demo Course
- Go to Dashboard
- Click 'View Course' 
- Click 'Courseware' tab

This will bring up the required survey. When you complete it, you will get into the course (and will not see the survey again).

If you need to re-test, you'll have to create a new account.

Marco, I could use a few CSS tips on the Survey page. The Course ORG/Course/Display Name up towards the top of the page, I think should be a tad bit bigger in terms of font size/prominence.

Can you all give it a spin and let me know if this fulfills the requirements we have? I've done some light testing.

I'll start the Pull Request process tomorrow but I need to add some more automated test harnessing. My hope is to be able to do a patch release on Thursday, if possible. Otherwise, we'll have to think about patching on Monday, the day before the course starts.
Ok yeah, looks like exists() optimizes for the case where there is no result which i assume is the more likely outcome. 


> On Oct 28, 2014, at 11:44 AM, chrisndodge <notifications@github.com> wrote:
> 
> In lms/djangoapps/survey/models.py:
> 
> > +                survey.form = form
> > +            else:
> > +                raise SurveyFormNameAlreadyExists()
> > +
> > +        survey.save()
> > +        return survey
> > +
> > +    @classmethod
> > +    def get(cls, name, throw_if_not_found=True):
> > +        """
> > +        Helper class method to look up a Survey Form, throw FormItemNotFound if it does not exists
> > +        in the database, unless throw_if_not_found=False then we return None
> > +        """
> > +
> > +        survey = None
> > +        exists = SurveyForm.objects.filter(name=name).exists()
> I thought that I read that exists() is more performant.
> 
> —
> Reply to this email directly or view it on GitHub.