Stanford-Online/class2go — pull request #2381 by jbau (2013-03-18 07:38:10+00:00)
Title: Jbau random psets

@sefk

This PR basically encompasses 2 sets of functionality.
Most of the code was written to do the random problem selection. You will see the added dependency on html5lib (https://code.google.com/p/html5lib/), which is used to parse HTML on the server into a DOM object that gets manipulated using the minidom library.

This an implementation and tests for the random selection of problem divs (which is mostly implemented in c2g/models.py and c2g/tests). Scoring also had to be altered here, because we are showing less than the full set of questions, so exam.total_score is not accurate. So the autograder has functionality that will tell you the total number of points for the question ```question_id```. There are also tests for this.

When you take a randomized question exam, the ```json_score_data``` of ExamRecord contains a field which tells which questions were rendered (for later display after "saving" and "submitting"). Another field tells the total possible points of a scored ExamRecord, which is used in the randomized case.

That is the big functionality. The smaller one just allows instructors to hide scores from students. This can be done either with a checkbox, or a "Graded Survey" will do the same thing. There is one migration to support this.