-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Resource Geogebra #131
base: master
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
return [ | ||
'name' => $faker->word, | ||
'type' => $faker->text, | ||
'link' => $faker->url | ||
'link' => $faker->url, | ||
'geogebra' => $faker->GGBApplet | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Esto no funciona, porque no existe en Faker, que genere un id de Geogebra. Lo que se puede hacer aca es poner o un ID fijo de un recurso de geogebra que conozcas. Porque esto nos esta rompiendo los tests. |
||
]; | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
|
||
@section('pagespecificscripts') | ||
<script src="{{ asset('js/resources.js') }}"></script> | ||
<script src="https://www.geogebra.org/apps/deployggb.js"></script> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. aca no lo necesitamos a esto. |
||
@stop | ||
|
||
@section('content') | ||
|
@@ -42,6 +43,13 @@ | |
</div> | ||
</div> | ||
|
||
<div class="form-group ggb-element"> | ||
<label for="ggb-element" class="col-md-2 control-label"><p>Geogebra</p></label> | ||
<div class="col-md-6"> | ||
<input id="ggb-element" type="GGBApplet" class="form-control" name="ggb.element" > | ||
</div> | ||
</div> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. tenes que agregar ademas un input para el otro campo que creaste geogebra_code. Es un input de tipo text |
||
|
||
<div class="form-group"> | ||
<div class="col-md-6 col-md-offset-4"> | ||
<button type="submit" class="btn btn-primary"> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,16 +22,26 @@ | |
<p>{!!$resource->type!!} </p> | ||
</div> | ||
|
||
@if(isset($resource->path)) | ||
<div class="container"> | ||
<h4>Archivo</h4> | ||
<a href="{{asset('/storage/'.$resource->path)}}" download="{{$resource->name}}">Bajar archivo actual</a> | ||
</div> | ||
@if ($resource->type == "Geogebra") | ||
<div id="ggb-element"></div> | ||
<script> | ||
var ggbApp = new GGBApplet({"appName": "graphing", "width": 800, "height": 600, "showToolBar": true, "showAlgebraInput": true, "showMenuBar": true, "material_id":"{$resource->geogebra_id)}" }, true); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Aca en appName, vamos a tener que poder modificarlo. Si miras en la ayuda https://wiki.geogebra.org/es/Referencia:Incrustaci%C3%B3n_de_Aplicaciones_GeoGebra dependiendo el recurso que uses, si es uno 3d o uno de graficos o uno de geometria, hay que configurar la app bien. Entonces, deberiamos modificar el recurso para que cuando se selecciona Geogebra, le podamos seleccionar el tipo de app que queremos: graphing a geometry o 3d |
||
window.addEventListener("load", function() { | ||
ggbApp.inject('ggb-element'); | ||
}); | ||
</script> | ||
@else | ||
<div class="container"> | ||
<h4>Link</h4> | ||
<a href="{{asset($resource->link)}}" target="popup" onclick="window.open('', 'popup', 'width = 800, height = 600')">{{$resource->link}}</a> | ||
</div> | ||
@if(isset($resource->path)) | ||
<div class="container"> | ||
<h4>Archivo</h4> | ||
<a href="{{asset('/storage/'.$resource->path)}}" download="{{$resource->name}}">Bajar archivo actual</a> | ||
</div> | ||
@else | ||
<div class="container"> | ||
<h4>Link</h4> | ||
<a href="{{asset($resource->link)}}" target="popup" onclick="window.open('', 'popup', 'width = 800, height = 600')">{{$resource->link}}</a> | ||
</div> | ||
@endif | ||
@endif | ||
|
||
</form> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,6 +55,13 @@ | |
</div> | ||
@endif | ||
|
||
<div class="form-group ggb-element"> | ||
<label for="ggb-element" class="col-md-2 control-label"><p>Geogebra</p></label> | ||
<div class="col-md-6"> | ||
<input id="ggb-element" type="text" class="form-control" value="{{$resource->geogebra_id}}" name="ggb-element" autofocus> | ||
</div> | ||
</div> | ||
|
||
Comment on lines
+58
to
+64
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Esto te tiene que quedar igual a lo que pusiste en el tempate de show, la diferencia es que tenes que agregar en el select, que se seleccione el geogebra_type que esta grabado en la base y en el geogebra_code, se complete el valor de la base tambien. |
||
<div class="form-group"> | ||
<div class="col-md-6 col-md-offset-4"> | ||
<button type="submit" class="btn btn-primary"> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lo que no veo es la migracion que agrega esa columna. Deberiamos, como te comente en otro comentario, agregar ademas una geogebra_app_type para que se pueda guardar el ID del recurso con el tipo de app para mostrarlo bien.