Bug fixing for TOZ Grader

TOZ grader always give 1 points before. Fixed.

Still need a script to fix existing gradings.
Weird, for course 99 is not work.

You try
course.find(99).assessments.training.first.submissions.first.answers.unique_attempts(true)?
 my solution works.


On Mon, Sep 1, 2014 at 3:42 PM, Raymoond Tang <notifications@github.com>
wrote:

> In app/modules/auto_grader.rb:
>
> > @@ -21,7 +21,6 @@ def AutoGrader.mcq_grader(submission, ans, mcq, pref_grader)
> >      grading.save unless grading.persisted?
> >      ag = grading.answer_gradings.for_question(mcq.question).first ||
> >          grading.answer_gradings.create({answer_id: ans.id
> })
> > -
> >      unless ag.grade
> >        std_answers = submission.answers.where(question_id: ans.question_id)
> >        if pref_grader != 'two-one-zero' || std_answers.count == 0
>
> No, it's not broken, pluck is more efficient. try:
> Course.find(56).assessments.training.first.submissions.first.answers.unique_attempts(false),
> it will return values.
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Coursemology/coursemology.org/pull/196/files#r16943332>
> .
>