/**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function edit($id)
 {
     $pregunta_leccion = PreguntaLeccion::find($id);
     if (is_null($pregunta_leccion)) {
         App::abort(404);
     }
     $form_data = array('route' => array('pregunta_leccion.update', $pregunta_leccion->id_pregunta_leccion), 'method' => 'PATCH');
     $action = 'Editar';
     return View::make('Pregunta_leccion/form', compact('pregunta_leccion', 'form_data', 'action'));
 }
 public function getPreguntasRelacionadas()
 {
     $preguntas = PreguntaLeccion::where('relacion', '=', $this->id_pregunta)->orderBy('fecha_creacion', 'ASC')->get();
     return $preguntas;
 }
Example #3
0
            Usuario::where('id', '=', $usuario)->update(array('tipo_inteligencia' => 'Lingüístico'));
            Session::put('inteligencia', 'Lingüístico');
        }
    }
    return $respuesta;
});
Route::get('postear-en-microforo', function () {
    $data = Input::all();
    $leccion = $data['leccion'];
    $mensaje = $data['mensaje'];
    $pregunta = $data['pregunta'];
    $usuario = Session::get('user_id');
    if ($pregunta == '') {
        $pregunta_leccion = PreguntaLeccion::create(array('id_usuario' => $usuario, 'id_leccion' => $leccion, 'pregunta' => $mensaje, 'fecha_creacion' => date('Y-m-d H:i:s'), 'relacion' => 0));
    } else {
        $pregunta_leccion = PreguntaLeccion::create(array('id_usuario' => $usuario, 'id_leccion' => $leccion, 'pregunta' => $mensaje, 'relacion' => intval($pregunta), 'fecha_creacion' => date('Y-m-d H:i:s')));
    }
    return Session::get('user');
});
Route::get('guardar_color', function () {
    $data = Input::all();
    $curso = $data['curso'];
    $color1 = $data['color1'];
    $color2 = $data['color2'];
    Badge::where('id_curso', '=', $curso)->update(array('color1' => $color1, 'color2' => $color2));
    return $curso . " " . $color1 . " " . $color2;
});
//
//RUTAS PARA EL ACCESO A LOGIN
//
Route::get('login-facebook', array('as' => 'login-facebook', 'uses' => 'LoginController@loginWithFacebook'));
Example #4
0
 public function getPreguntasLeccion()
 {
     $preguntas = PreguntaLeccion::where('id_leccion', '=', $this->id_leccion)->where('relacion', '=', 0)->orderBy('fecha_creacion', 'ASC')->get();
     return $preguntas;
 }