Prototype Lesson: G2-U1-L1
<div class='G2'>
<div class='g2-text-column'>| // Use Gists to store code you would like to remember later on | |
| console.log(window); // log the "window" object to the console |
| complete_assessment = (e) -> | |
| $.ajax( | |
| type: "PATCH" | |
| url: $('#student_view_assessment').attr('data-updateurl') | |
| success: (data) -> | |
| if data.error | |
| $('<div id="flash" class="alert">').html('<p>' + data.error + '</p>').insertBefore('#student_content') | |
| e.preventDefault() | |
| $('#student_view_assessment').html('Submit Answers') | |
| else |
| class Shared::AnswersController < ApplicationController | |
| before_filter :authenticate_student_or_teacher! | |
| def create | |
| @lesson = Lesson.where(id: params[:lesson_id]).first | |
| authorize! :read, @lesson | |
| @challenge = @lesson.challenge | |
| @challenge_result = current_student ? @challenge.result_for_student(current_student) : @challenge.result_for_staffer(current_staffer) | |
| @max_num_attempts = false |
| # remove "Guides" if a trial | |
| if current_staffer_trial?(current_staffer.id, @program.id) | |
| @student_handouts = student_handouts_unfiltered.select { |sh| sh.title !~ /guide/i } | |
| else | |
| @student_handouts = student_handouts_unfiltered | |
| end |
| @student_handouts = student_handouts_unfiltered.select { |sh| sh.title !~ /guide/i } | |
| puts "X__" * 64 | |
| @student_handouts.each {|x| puts "#{x.title}"} | |
| puts "X__" * 64 |
I hereby claim:
To claim this, I am signing this object: