Skip to content

Instantly share code, notes, and snippets.

View marialecodes's full-sized avatar
🎯
Focusing

Maria A. Mata marialecodes

🎯
Focusing
View GitHub Profile

Keybase proof

I hereby claim:

  • I am mariale-codes on github.
  • I am mariadev (https://keybase.io/mariadev) on keybase.
  • I have a public key ASBgTs2dTbFgbnO8fe3SIhgRCZMRDuyP2hQG-1LCGRNMcAo

To claim this, I am signing this object:

n_conceptos_nivel = conceptos_nivel.count
conceptos_conocidos_nivel = conocimientos
.joins(:concepto)
.where(concepto: conceptos_nivel)
.order('
CASE
WHEN conocido = TRUE then 1
WHEN conocido = FALSE then 2
WHEN conocido IS NULL then 3
END
$('#leccion-modal').on 'show.bs.modal', (e) =>
concepto_id = $(e.relatedTarget).data('concepto-id', 'red-id')
$('#leccion-modal a').attr('href', "lecciones/crear/#{concepto_id}")
<% if revision == true && conocido == true %>
<%= link_conocimiento_a_repasar(@concepto_id) %>
<% elsif revision == true && conocido == false %>
<%= link_conocimiento_fallo(@concepto_id) %>
<% elsif revision == false && conocido == true %>
<%= link_conocimiento_encontrado(@concepto_id) %>
<% elsif revision == false && conocido == false %>
<%= link_conocimiento_desbloqueado(@concepto_id) %>
<% else %>
<%= render 'conocimiento_bloqueado', locals: {concepto_id: @concepto_id} %>
En modelo User:
def crear_curso(user_id)
for i in 1..34
i == 1 ? (conocido = false) : (conocido = nil)
conocimiento = Conocimiento.new(
user_id: user_id,
conocido: conocido,
concepto_id: i,
intentos: 0,
# /controllers/tutor_controller.rb
def index
@conceptos = Concepto.all
@conocimientos_usuario = current_user.conocimientos
@nivel = 0
@i = 1
@conceptos_por_nivel = Concepto.group(:nivel).count
@conocidos_por_nivel = Concepto.joins(:conocimientos).where(conocimientos: { conocido: true }).where(conocimientos: { user_id: current_user.id }).group(:nivel).count
end
package com.xxx;
import com.parse.CountCallback;
import com.parse.ParseException;
import com.parse.ParseQuery;
import com.parse.ParseUser;
public class ParseList {
// getGames() Busca partidas donde el "player1" o "player2" sea el usuario actual.
package com.xxx;
import com.parse.CountCallback;
import com.parse.ParseException;
import com.parse.ParseQuery;
import com.parse.ParseUser;
public class ParseList {
// getGames() Busca partidas donde el "player1" sea el usuario actual.