Guest User

Untitled

a guest
Feb 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1.  
  2. def sol1_create
  3. @reponse = Reponse.new(params[:reponse])
  4. @reponse.id_videos = "1"
  5. @reponse.id_candidats = session[:candidat]
  6. @reponse.save
  7.  
  8. @expert = Reponse.find(:all,:conditions => ['id_candidats = :id_candidats and id_videos = :id_videos', { :id_candidats => '1' , :id_videos => '1' }] )
  9. @expert.each { |l| @res_exec = l.execution}
  10. @diff = @res_exec - @reponse.execution
  11. @reponse.res_exec = @diff
  12. breakpoint
  13. flash[:notice] = 'Reponse was successfully created.'
  14. redirect_to :action => 'sol2'
  15. end
  16.  
  17.  
  18. irb(#<UserController:0xa79596f4>):003:0* @diff
  19. => 0.8
  20. irb(#<UserController:0xa79596f4>):004:0> @reponse.res_exec
  21. => 0
Add Comment
Please, Sign In to add comment