Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 69 additions & 36 deletions src/main/webapp/app/scanexam/voircopie/voircopie.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,6 @@ export class VoirCopieComponent implements OnInit, AfterViewInit {
constructor(
protected applicationConfigService: ApplicationConfigService,
private http: HttpClient,

public examService: ExamService,
public studentService: StudentService,
protected activatedRoute: ActivatedRoute,
Expand Down Expand Up @@ -331,6 +330,7 @@ export class VoirCopieComponent implements OnInit, AfterViewInit {
this.router.navigateByUrl('/copie/' + this.uuid + '/' + q);
}
}

@HostListener('window:keydown.shift.ArrowRight', ['$event'])
nextQuestion(event: KeyboardEvent): void {
event.preventDefault();
Expand Down Expand Up @@ -551,7 +551,13 @@ export class VoirCopieComponent implements OnInit, AfterViewInit {
width: finalW,
height: finalH,
})
.subscribe(res => resolve({ i: new ImageData(new Uint8ClampedArray(res), finalW, finalH), w: finalW, h: finalH }));
.subscribe(res =>
resolve({
i: new ImageData(new Uint8ClampedArray(res), finalW, finalH),
w: finalW,
h: finalH,
}),
);
});
}

Expand Down Expand Up @@ -615,44 +621,28 @@ export class VoirCopieComponent implements OnInit, AfterViewInit {
const examName = this.exam!.name!;
const questionNumero = this.questions![0].numero!;
const url = window.location.href;
const ten = `Dear Prof,%0D%0A
My name is ${firsName} ${lastName},%0D%0A
I have the exam ${examName}. Looking at the answer key for this question ${questionNumero} available here (${url}), I could not understand my mistake.%0D%0A
%0D%0A%0D%0A
///EXPLAIN YOUR PROBLEM///%0D%0A
%0D%0A%0D%0A
Thank you in advance for the time taken to answer this email.%0D%0A
Best regards,%0D%0A
${firsName}
`;
const tfr = `Bonjour,%0D%0A
je m'appelle ${firsName} ${lastName},%0D%0A
J'ai passé l'examen ${examName}. En regardant le corrigé de la question ${questionNumero} accessible ici (${url}), je ne comprends pas mon erreur.%0D%0A
%0D%0A%0D%0A
///EXPLIQUER VOTRE PROBLEME///%0D%0A
%0D%0A%0D%0A
Merci par avance pour le temps pris pour répondre à cet email.%0D%0A
Cordialement,%0D%0A
${firsName}
`;
let emailSubject: string;
let emailBody: string;

if (this.translateService.currentLang === 'fr') {
this.email =
'mailto:' +
emails.filter(e => e !== undefined && e !== '').join(',') +
"?subject=Retour sur l'examen " +
this.exam!.name +
'&body=' +
tfr;
emailSubject = "Retour sur l'examen ";
emailBody = frenchMessageBody(firsName, lastName, examName, questionNumero, url);
} else if (this.translateService.currentLang === 'pt') {
emailSubject = 'Esclarecimentos sobre a avaliacao ';
emailBody = portugueseMessageBody(firsName, lastName, examName, questionNumero, url);
} else {
this.email =
'mailto:' +
emails.filter(e => e !== undefined && e !== '').join(',') +
'?subject=Feedback on your ewam ' +
this.exam!.name +
'&body=' +
ten;
emailSubject = 'Review of the on your exam ';
emailBody = englishMessageBody(firsName, lastName, examName, questionNumero, url);
}

this.email =
'mailto:' +
emails.filter(e => e !== undefined && e !== '').join(',') +
'?subject=' +
emailSubject +
this.exam!.name +
'&body=' +
emailBody;
} else {
this.email = '';
}
Expand Down Expand Up @@ -688,3 +678,46 @@ ${firsName}
this.displayBasic = true;
}
}

function englishMessageBody(firsName: string, lastName: string, examName: string, questionNumero: number, url: string) {
return `Dear Prof,%0D%0A
My name is ${firsName} ${lastName},%0D%0A
I have the exam ${examName}. Looking at the answer key for this question ${questionNumero} available here (${url}), I could not understand my mistake.%0D%0A
%0D%0A%0D%0A
///EXPLAIN YOUR PROBLEM///%0D%0A
%0D%0A%0D%0A
Thank you in advance for the time taken to answer this email.%0D%0A
Best regards,%0D%0A
${firsName}
`;
}

function frenchMessageBody(firsName: string, lastName: string, examName: string, questionNumero: number, url: string) {
return `Bonjour,%0D%0A
je m'appelle ${firsName} ${lastName},%0D%0A
J'ai passé l'examen ${examName}. En regardant le corrigé de la question ${questionNumero} accessible ici (${url}), je ne comprends pas mon erreur.%0D%0A
%0D%0A%0D%0A
///EXPLIQUER VOTRE PROBLEME///%0D%0A
%0D%0A%0D%0A
Merci par avance pour le temps pris pour répondre à cet email.%0D%0A
Cordialement,%0D%0A
${firsName}
`;
}

function portugueseMessageBody(firsName: string, lastName: string, examName: string, questionNumero: number, url: string) {
return `Caro professor, %0D%0A

Eu me chamo ${firsName} ${lastName} e fiz a prova ${examName}.
Após uma ampla e detalhada análise da correção da questão ${questionNumero}, disponível aqui (${url}), eu não consegui entender o meu erro.%0D%0A

%0D%0A%0D%0A
///EXPLIQUE SEU PROBLEMA///%0D%0A
%0D%0A%0D%0A

Desde já agradeço pelo tempo dedicado a responder este email.%0D%0A

Atenciosamente,%0D%0A
${firsName}
`;
}
4 changes: 2 additions & 2 deletions src/main/webapp/i18n/fr/scanexammodule.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@
"total": "Total",
"titleSummary": "État courant de la correction de l'examen :",
"errorExamId": "Numéro de l'examen invalide",
"align": "Aligner scans",
"align": "Redresser scans",
"gobackexam": "Retourner à l'examen",
"gobackcorrection": "Retourner à la correction",
"gobackue": "Retourner au module",
"alignscan": "Alignement des scans",
"alignscan": "Aligner les scans",
"alignscanalgo": "Algorithme d'alignement",
"alignscanbrpage": "Nombre de page à utiliser dans le template d'examen",
"selectmove": "Sélectionner et déplacer des formes/textes",
Expand Down
6 changes: 3 additions & 3 deletions src/main/webapp/i18n/pt/exam.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
"name": "Nome da avaliação:",
"template": "Modelo de avaliação",
"idzone": "Idzone",
"namezone": "Zona do sobrenome",
"firstnamezone": "Zona do nome",
"notezone": "Zona da nota",
"namezone": "Região do sobrenome",
"firstnamezone": "Região do nome",
"notezone": "Região da nota",
"scanfile": "Documento digitalizado dos estudantes",
"question": "Questão",
"course": "Disciplina"
Expand Down
8 changes: 4 additions & 4 deletions src/main/webapp/i18n/pt/global.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"finalResult": "Final Result",
"studentResponse": "Resposta ao Estudante",
"comments": "Comentários",
"zone": "Zona",
"zone": "Região",
"questionType": "Tipo de Questão",
"textComment": "Texto de comentário",
"gradedComment": "Comentário com nota",
Expand All @@ -42,7 +42,7 @@
"configuration": "Configuração",
"logs": "Logs",
"apidocs": "API",
"database": "Base de données",
"database": "Base de dados",
"jhipster-needle-menu-add-admin-element": "JHipster will add additional menu entries here (do not translate!)"
},
"language": "Idioma"
Expand All @@ -56,8 +56,8 @@
"newpassword.placeholder": "Nova senha",
"confirmpassword.label": "Confirmação da nova senha",
"confirmpassword.placeholder": "Confirmação da nova senha",
"email.label": "Email",
"email.placeholder": "Seu email"
"email.label": "E-mail",
"email.placeholder": "Seu e-mail"
},
"messages": {
"info": {
Expand Down
Loading