diff --git a/Frontend Angular 4/src/app/layout/archivos/archivos.component.html b/Frontend Angular 4/src/app/layout/archivos/archivos.component.html index 0b99729c18ba1e81d76ce9eb48d1b4cc31520eb4..95961a2a019f0bc236c56f5ebb2709f9242f788f 100755 --- a/Frontend Angular 4/src/app/layout/archivos/archivos.component.html +++ b/Frontend Angular 4/src/app/layout/archivos/archivos.component.html @@ -171,7 +171,7 @@ {{archivoSeleccionado.estado}} - </div> <button - *ngIf="esAlumno && archivoSeleccionado?.estado == 'Corregido'" + *ngIf="esAlumno && (archivoSeleccionado?.estado == 'Corregido' || archivoSeleccionado?.estado == 'Devuelto')" class="btn btn-sm btn-secondary pull-left mr-2" (click)="verCalificacion()"> {{ "i18n.msg.file.viewCalification" | translate }} diff --git a/Frontend Angular 4/src/app/layout/grupos/calificarEntrega.component.ts b/Frontend Angular 4/src/app/layout/grupos/calificarEntrega.component.ts index e5dc97ed9ff10e19afc43dd0ae3d3fb8f95ab388..0d627e959d52d9174562d015002effbc04acbf07 100755 --- a/Frontend Angular 4/src/app/layout/grupos/calificarEntrega.component.ts +++ b/Frontend Angular 4/src/app/layout/grupos/calificarEntrega.component.ts @@ -7,6 +7,7 @@ export interface ConfirmModel { cedula:string; archivo: Archivo; parentContext: any; + } @Component({ selector: 'confirm', @@ -28,6 +29,14 @@ export interface ConfirmModel { <label for="message-text" class="form-control-label">{{ "i18n.object.detail" | translate | titleCase }}:</label> <textarea class="form-control" id="message-text" [(ngModel)]="descripcion" [ngModelOptions]="{standalone: true}" ></textarea> </div> + <div class="form-group"> + <label for="message-text" class="form-control-label">{{ "i18n.object.state" | translate | titleCase }}:</label> + <select name="estado" id="estado" class="form-control" + [(ngModel)]="estado"> + <option *ngFor="let st of estados" [value]="st.value">{{ st.label }}</option> + </select> + </div> + </form> </div> @@ -44,12 +53,16 @@ export class CalificarEntrega extends DialogComponent<ConfirmModel, boolean> imp cedula: string; archivo: Archivo; nota: number = 0; + estado : string = "Corregido"; + estados : any ; translateService: any; parentContext: any; constructor(dialogService: DialogService, public translate: TranslateService) { super(dialogService); this.translateService = translate; + this.estados = [ {value : "Corregido", label : this.translateService.get('i18n.msg.file.evaluated').value } + , {value : "Devuelto", label : this.translateService.get('i18n.msg.file.returned').value }]; } ngOnInit() { @@ -65,7 +78,7 @@ export class CalificarEntrega extends DialogComponent<ConfirmModel, boolean> imp evaluacion.descripcion = this.descripcion; evaluacion.nota = this.nota; if(this.nota>=0 && this.nota<=100){ - this.parentContext.haskellService.calificarArchivo(this.archivo.id,evaluacion ) + this.parentContext.haskellService.calificarArchivo(this.archivo.id,this.estado,evaluacion ) .subscribe( evaluacion => { this.parentContext.notifService.success(this.translateService.get('i18n.msg.file.evaluated').value); diff --git a/Frontend Angular 4/src/app/shared/config.ts b/Frontend Angular 4/src/app/shared/config.ts index 655cce7e4b6341319798c3964f016c8a0ec358c1..04b68e29637b9a935ae96d498bf75aa120cc725f 100755 --- a/Frontend Angular 4/src/app/shared/config.ts +++ b/Frontend Angular 4/src/app/shared/config.ts @@ -1,28 +1,3 @@ -//export const SERVER = 'https://matefun.mybluemix.net'; -//export const GHCI_URL = 'wss://matefun.mybluemix.net/endpoint'; - -//export const SERVER = 'http://localhost:9090'; -//export const GHCI_URL = 'ws://localhost:9090/endpoint'; - -// export const SERVER = 'http://localhost:9090'; -// export const GHCI_URL = 'ws://localhost:9090/endpoint'; - -//Configuracion dinamica pensando en servidor con ip dinamica - -// export const SERVER = window.location.protocol + '//' + window.location.host;//'http://localhost:9090'; -// export const GHCI_URL = window.location.protocol == 'http:'? 'ws://'+window.location.host+'/endpoint': 'wss://'+window.location.host+'/endpoint'; - -// Linux Nacho -// export const SERVER = 'http://192.168.129.3:9090'; -// export const GHCI_URL = 'ws://192.168.129.3:9090/endpoint'; - -// Google cloud platform -// export const SERVER = 'http://35.199.110.129:9090'; -// export const GHCI_URL = 'ws://35.199.110.129:9090/endpoint'; - -// Google cloud platform v2 -// export const SERVER = 'http://35.199.87.61:9090'; -// export const GHCI_URL = 'ws://35.199.87.61:9090/endpoint'; // psico // export const SERVER = 'https://matefun.math.psico.edu.uy'; @@ -32,16 +7,10 @@ export const SERVER = 'https://www.fing.edu.uy/proyectos/matefun'; export const GHCI_URL = 'wss://www.fing.edu.uy/proyectos/matefun/endpoint'; -// fing-pru -//export const SERVER = 'https://localhost:9443/proyectos/matefun'; -//export const GHCI_URL = 'wss://localhost:9443/proyectos/matefun/endpoint'; -//diego docker +// local // export const SERVER = 'http://localhost:8080'; // export const GHCI_URL = 'ws://localhost:8080/endpoint'; -//local proyectos/matefun -//export const SERVER = 'http://localhost:9990'; -//export const GHCI_URL = 'ws://localhost:9990/endpoint'; diff --git a/Frontend Angular 4/src/app/shared/services/haskell.service.ts b/Frontend Angular 4/src/app/shared/services/haskell.service.ts index 0d4a3cf3c2b4f6b0b66e7b1eac104904edaab512..baa28211cb6a6255504cfbcd6f70a5891d78fa12 100755 --- a/Frontend Angular 4/src/app/shared/services/haskell.service.ts +++ b/Frontend Angular 4/src/app/shared/services/haskell.service.ts @@ -93,10 +93,10 @@ export class HaskellService { .catch(this.handleError); } - calificarArchivo(archivoId, evaluacion): Observable<Evaluacion> { + calificarArchivo(archivoId, estado, evaluacion): Observable<Evaluacion> { let headers = new Headers({ 'Content-Type': 'application/json', 'Authorization':'Bearer '+this.authService.getToken() }); let options = new RequestOptions({ headers: headers }); - return this.http.post(SERVER+'/servicios/archivo/'+archivoId+'/evaluacion', evaluacion, options) + return this.http.post(SERVER+'/servicios/archivo/'+archivoId+'/'+estado+'/evaluacion', evaluacion, options) .map((res: Response) => res.json()) .catch(this.handleError); } diff --git a/Frontend Angular 4/src/assets/i18n/en.json b/Frontend Angular 4/src/assets/i18n/en.json index fcc7ce5710c839af62ac89a7616903ca29a43c53..40bef673247851636f4eae2a10d1f15dfc262e80 100644 --- a/Frontend Angular 4/src/assets/i18n/en.json +++ b/Frontend Angular 4/src/assets/i18n/en.json @@ -57,7 +57,8 @@ "qualification" : "qualification", "date" : "date", "detail" : "detail", - "score" : "score" + "score" : "score", + "state" : "state" }, "codemirror" : { "command" : { @@ -105,7 +106,9 @@ "move" : "Where do you want to move the file?", "create" : "Where do you want to create the file?", "qualify" : "Qualify the delivered file", - "evaluated" : "Evaluated file" + "evaluated" : "Evaluated file", + "returned" : "Evaluated file (re-send)" + }, "folder" : { "delete" : "Are you want to delete the {{fileName}} folder?" diff --git a/Frontend Angular 4/src/assets/i18n/es.json b/Frontend Angular 4/src/assets/i18n/es.json index 95434059a9d33c4780c3422bdf69f9b5f3d4c3d1..e3e3976969eee6406e3f309815fb6acc2a3d24de 100644 --- a/Frontend Angular 4/src/assets/i18n/es.json +++ b/Frontend Angular 4/src/assets/i18n/es.json @@ -57,7 +57,8 @@ "qualification" : "calificación", "date" : "fecha", "detail" : "detalle", - "score" : "puntaje" + "score" : "puntaje", + "state" : "estado" }, "codemirror" : { "command" : { @@ -105,7 +106,8 @@ "move" : "¿Dónde quieres mover el archivo?", "create" : "¿Dónde quieres crear el archivo?", "qualify" : "Calificar entrega", - "evaluated" : "Archivo evaluado" + "evaluated" : "Archivo evaluado", + "returned" : "Archivo evaluado (re-entrega)" }, "folder" : { "delete" : "¿Está seguro que desea eliminar la carpeta {{fileName}}?" diff --git a/Servidor JEE/WebContent/index.html b/Servidor JEE/WebContent/index.html index 18d0dfc4cc96e88cb07cad39b9f8e7952ac5b008..bcffd5017cc26e78df71ec6aafc5a2d58f263a09 100644 --- a/Servidor JEE/WebContent/index.html +++ b/Servidor JEE/WebContent/index.html @@ -1,4 +1,4 @@ <!doctype html><html><head><meta charset="utf-8"><title>Proyecto MateFun</title><base href="/proyectos/matefun/"><meta name="viewport" content="width=device-width,initial-scale=1"><link rel="icon" type="image/x-icon" href="favicon.ico"><!-- despues lo saco de aca --><!-- <link rel="stylesheet" type="text/css" href="node_modules/codemirror/addon/hint/show-hint.css"> --><script src="https://code.jquery.com/jquery-3.1.1.slim.min.js" integrity="sha384-A7FZj7v+d/sdmMqp/nOQwliLvUsJfDHW+k9Omg/a/EheAdgtzNs3hpfag6Ed950n" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/tether/1.4.0/js/tether.min.js" integrity="sha384-DztdAPBWPRXSA/3eYEEUWrWCy7G5KFbe8fFjk5JAIxUYHKkDx6Qin1DkWx51bBrb" crossorigin="anonymous"></script><script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/js/bootstrap.min.js" integrity="sha384-vBWWzlZJ8ea9aCX4pEW3rVHjgjt7zpkNpZk+02D9phzyeVkE+jo0ieGizqPLForn" crossorigin="anonymous"></script><script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.5/d3.min.js" crossorigin="anonymous"></script><!-- <script src="https://wzrd.in/standalone/function-plot@1.18.1" crossorigin="anonymous"></script> - --><link href="styles.1dc6715c59e708068692.bundle.css" rel="stylesheet"/></head><body><app-root><div class="loading"><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div></div></app-root><script type="text/javascript" src="inline.b6f342c3bceccf578c39.bundle.js"></script><script type="text/javascript" src="polyfills.d50ac7c762e2eb4097d9.bundle.js"></script><script type="text/javascript" src="scripts.d01654a9119059a68b2b.bundle.js"></script><script type="text/javascript" src="vendor.d3c1758890cc7548bc7b.bundle.js"></script><script type="text/javascript" src="main.98a532e0b59061522b75.bundle.js"></script></body></html> \ No newline at end of file + --><link href="styles.1dc6715c59e708068692.bundle.css" rel="stylesheet"/></head><body><app-root><div class="loading"><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div><div class="loading-bar"></div></div></app-root><script type="text/javascript" src="inline.8cfebe1df0508124ae25.bundle.js"></script><script type="text/javascript" src="polyfills.d50ac7c762e2eb4097d9.bundle.js"></script><script type="text/javascript" src="scripts.d01654a9119059a68b2b.bundle.js"></script><script type="text/javascript" src="vendor.d3c1758890cc7548bc7b.bundle.js"></script><script type="text/javascript" src="main.98a532e0b59061522b75.bundle.js"></script></body></html> \ No newline at end of file diff --git a/Servidor JEE/src/main/java/edu/proygrado/ejb/ArchivosEJB.java b/Servidor JEE/src/main/java/edu/proygrado/ejb/ArchivosEJB.java index f3cfb9fe6f82b3fae9bbac96439c19229af74e06..306986f739a3ee78763790cff56b3829b02ed43c 100644 --- a/Servidor JEE/src/main/java/edu/proygrado/ejb/ArchivosEJB.java +++ b/Servidor JEE/src/main/java/edu/proygrado/ejb/ArchivosEJB.java @@ -182,7 +182,7 @@ public class ArchivosEJB { } } - public EvaluacionDTO evaluarArchivo(Long archivoId, EvaluacionDTO evaluacion) throws Exception { + public EvaluacionDTO evaluarArchivo(Long archivoId, String estado, EvaluacionDTO evaluacion) throws Exception { Archivo archivo = em.find(Archivo.class, archivoId); if (archivo == null) { throw new Exception("No se encuentra el archivo con id: " + archivoId); @@ -203,7 +203,8 @@ public class ArchivosEJB { eval.setFecha(new Date()); eval.setNota(evaluacion.getNota()); archivo.setEvaluacion(eval); - archivo.setEstado(EstadoArchivo.Corregido); + if (estado.equals("Devuelto")) { archivo.setEstado(EstadoArchivo.Devuelto); } + else {archivo.setEstado(EstadoArchivo.Corregido);} return evaluacion; } diff --git a/Servidor JEE/src/main/java/edu/proygrado/servicios/archivos/ArchivosRS.java b/Servidor JEE/src/main/java/edu/proygrado/servicios/archivos/ArchivosRS.java index bbc7030b2da9bdd844ea8201e5f0090d0cceaa98..409145c27702e7585c9aaae8259ff77ab664e93b 100644 --- a/Servidor JEE/src/main/java/edu/proygrado/servicios/archivos/ArchivosRS.java +++ b/Servidor JEE/src/main/java/edu/proygrado/servicios/archivos/ArchivosRS.java @@ -101,11 +101,11 @@ public class ArchivosRS{ } @POST - @Path("/{archivoId}/evaluacion") + @Path("/{archivoId}/{estado}/evaluacion") @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) - public EvaluacionDTO evaluarArchivo(@PathParam("archivoId") long archivoId, EvaluacionDTO evaluacion) throws Exception { - return archivosEJB.evaluarArchivo(archivoId, evaluacion); + public EvaluacionDTO evaluarArchivo(@PathParam("archivoId") long archivoId, @PathParam("estado") String estado, EvaluacionDTO evaluacion) throws Exception { + return archivosEJB.evaluarArchivo(archivoId, estado, evaluacion); } private boolean esInvitado(){ diff --git a/addToGrupo.sh b/addToGrupo.sh index 583332228d87fcfc05e30ccd40c0b92f4dc9cc4c..080ba6137ab601e484b3baa4e8c6685886ea833d 100644 --- a/addToGrupo.sh +++ b/addToGrupo.sh @@ -4,7 +4,8 @@ # todas las filas tienen que terminar con enter INPUT=usersGroup.csv -SERVER=http:/localhost:8080/servicios #https://www.fing.edu.uy/proyectos/matefun/servicios +SERVER=https://www.fing.edu.uy/proyectos/matefun/servicios +#http:/localhost:8080/servicios # parametros del script: usuario y pass read USER # = $1 diff --git a/addUsers.sh b/addUsers.sh index 1a91d7d3d2f96b528a9922b9f1133ab209ef7fc9..af0d8feae5ef8cdf79bffa07baecd222a7b4f353 100644 --- a/addUsers.sh +++ b/addUsers.sh @@ -5,7 +5,8 @@ # todas las filas tienen que terminar con enter INPUT=users.csv -SERVER=http:/localhost:8080/servicios #https://www.fing.edu.uy/proyectos/matefun/servicios +SERVER=https://www.fing.edu.uy/proyectos/matefun/servicios +# http:/localhost:8080/servicios # parametros del script: usuario y pass read USER # = $1 @@ -13,6 +14,8 @@ stty -echo read PASS # = $2 stty echo +echo "//$USER//$PASS//" + token=$(curl --header "Content-Type: application/json" \ --request POST \ --data '{"cedula":"'$USER'","password":"'$PASS'"}' \ diff --git a/generate-war.sh b/generate-war.sh index bc5cb83618dbc3973eb942b565afc77d8dd98d27..9ff7b7289c4ab0aacbc97a14748c42e1a4a47976 100644 --- a/generate-war.sh +++ b/generate-war.sh @@ -1,3 +1,4 @@ +# editar tambien: Frontend\ Angular\ 4/src/app/shared/config.ts cd Frontend\ Angular\ 4/ ng build --prod --base-href /proyectos/matefun/ cd ..