courseware/views.py index function position value integer error correction and test

LMS-2844