Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
108 commits
Select commit Hold shift + click to select a range
441ebec
Merge pull request #83 from correctexam/develop
barais Jul 25, 2023
13a189a
Merge pull request #84 from correctexam/develop
barais Jul 25, 2023
6bd372f
Merge pull request #85 from correctexam/develop
barais Sep 26, 2023
564830b
Merge pull request #86 from correctexam/develop
barais Sep 29, 2023
36a088d
Merge pull request #87 from correctexam/develop
barais Sep 29, 2023
1cc5230
Merge pull request #88 from correctexam/develop
barais Oct 7, 2023
1079315
Merge pull request #89 from correctexam/develop
barais Oct 8, 2023
2ff588d
Merge pull request #90 from correctexam/develop
barais Oct 8, 2023
3fd46a7
Merge pull request #91 from correctexam/develop
barais Oct 11, 2023
97db863
Merge pull request #92 from correctexam/develop
barais Oct 11, 2023
1ce3317
Merge pull request #93 from correctexam/develop
barais Oct 12, 2023
b7bbfbd
Merge pull request #94 from correctexam/develop
barais Oct 19, 2023
8dd27bc
Merge pull request #95 from correctexam/develop
barais Oct 19, 2023
5758cb8
Merge pull request #96 from correctexam/develop
barais Oct 19, 2023
52877a0
Merge pull request #97 from correctexam/develop
barais Oct 20, 2023
4ac75b1
Merge pull request #98 from correctexam/develop
barais Oct 30, 2023
700c52c
Merge pull request #99 from correctexam/develop
barais Nov 1, 2023
89a5ab8
Merge pull request #100 from correctexam/develop
barais Nov 3, 2023
0eeb526
Merge pull request #101 from correctexam/develop
barais Nov 23, 2023
49df4b1
Merge pull request #102 from correctexam/develop
barais Nov 28, 2023
a1b7750
Merge pull request #103 from correctexam/develop
barais Nov 29, 2023
4b6de7f
Merge pull request #105 from correctexam/develop
barais Dec 11, 2023
3ef4062
Merge pull request #107 from correctexam/develop
barais Dec 11, 2023
9252863
Merge pull request #108 from correctexam/develop
barais Dec 11, 2023
b5f9d84
Merge pull request #109 from correctexam/develop
barais Dec 13, 2023
86f31bf
Merge pull request #110 from correctexam/develop
barais Dec 20, 2023
59c1784
Merge pull request #111 from correctexam/develop
barais Dec 21, 2023
0f8cc43
Merge pull request #112 from correctexam/develop
barais Dec 21, 2023
2b8b64a
Merge pull request #113 from correctexam/develop
barais Dec 24, 2023
e369c6a
Merge pull request #114 from correctexam/develop
barais Dec 24, 2023
e7dfe75
Merge pull request #115 from correctexam/develop
barais Jan 3, 2024
60094be
Merge pull request #116 from correctexam/develop
barais Jan 4, 2024
7a05f0b
Merge pull request #117 from correctexam/develop
barais Jan 10, 2024
3bb085c
Merge pull request #118 from correctexam/develop
barais Jan 10, 2024
bf9392a
Merge pull request #119 from correctexam/develop
barais Jan 10, 2024
b442b96
Merge pull request #120 from correctexam/develop
barais Jan 24, 2024
6b61df9
Merge pull request #121 from correctexam/develop
barais Jan 24, 2024
474906b
Merge pull request #122 from correctexam/develop
barais Jan 24, 2024
3004ec7
Merge pull request #123 from correctexam/develop
barais Jan 28, 2024
eca1f70
Merge pull request #124 from correctexam/develop
barais Feb 5, 2024
75fd304
Merge pull request #125 from correctexam/develop
barais Feb 12, 2024
79f944b
Merge pull request #126 from correctexam/develop
barais Feb 12, 2024
b28e2c3
Merge pull request #127 from correctexam/develop
barais Feb 13, 2024
debb0d1
Merge pull request #128 from correctexam/develop
barais Feb 20, 2024
78427dc
Merge pull request #129 from correctexam/develop
barais Mar 6, 2024
b72155a
Merge pull request #130 from correctexam/develop
barais Mar 6, 2024
fbe1a78
Merge pull request #131 from correctexam/develop
barais Mar 13, 2024
e8cc596
Merge pull request #132 from correctexam/develop
barais Mar 14, 2024
049c555
Merge pull request #133 from correctexam/develop
barais Mar 15, 2024
63ade8c
Merge pull request #134 from correctexam/develop
barais Mar 24, 2024
b46148c
Merge pull request #135 from correctexam/develop
barais Apr 2, 2024
cd8858c
Merge pull request #136 from correctexam/develop
barais Apr 2, 2024
82bf241
Merge pull request #137 from correctexam/develop
barais Apr 3, 2024
cfc8668
doc(readme): updating the readme with install infos
arnobl Apr 11, 2024
6b95a4e
fix(doc): useless commands removed from the readme
arnobl Apr 11, 2024
57f87b9
Merge pull request #138 from arnobl/readme-install
barais May 7, 2024
4db424c
Merge pull request #140 from correctexam/develop
barais Oct 23, 2024
fdf950e
Merge pull request #142 from correctexam/develop
barais Jan 13, 2025
ac94f96
update
barais Feb 24, 2025
f079dca
add dan in corriger can not write output
Oct 21, 2024
3fe9900
add DAN in corriger without output
Oct 21, 2024
774176d
prediction_entity
Oct 30, 2024
8d7c4d8
created properly
Nov 1, 2024
d42311b
stock-delete-load prediction
Nov 1, 2024
4cae088
added student_id and exam_id
Nov 3, 2024
6b84451
change hardcoded path to relative path
Humilokaki Nov 4, 2024
bc377ef
Modif de python controller
totox35 Nov 4, 2024
15dca53
Ptite correction pour faire marcher la recherche
totox35 Nov 5, 2024
4ae8e87
hotfix
Humilokaki Nov 6, 2024
63893a9
Chunking, Embedding and ES CLient in python with example scripts
ElectricCooper Nov 10, 2024
412d05d
type de question manuscrit
Nov 13, 2024
594c0d0
update
barais Feb 24, 2025
c77ed56
acces to user
Nov 14, 2024
90f11f2
prediction with imagedata
Nov 17, 2024
6945026
dan_server
Nov 18, 2024
8ae399c
using gpu
Nov 18, 2024
e3dcdf0
run in back
Nov 20, 2024
a0082f6
coupage dimage (besoin damelioration)
Dec 13, 2024
db77614
some adjustements
Dec 18, 2024
fc16a13
different coupage dimage nothing is optimal
Jan 14, 2025
9f33ba8
Added SQL changes to initial_version file for docker
ElectricCooper Jan 19, 2025
4f7591b
ajout script découpe d'image utilisant Taliesin
totox35 Jan 20, 2025
84c2464
deleting dan
Feb 13, 2025
bde3115
update import
barais Feb 24, 2025
7c8fbb5
Merge remote-tracking branch 'refs/remotes/origin/143-danintegration'…
barais Feb 24, 2025
3ec8afd
clean python script
barais Feb 24, 2025
50d8353
improve readme top prepare migrationb
barais Feb 24, 2025
c16d79a
update
barais Feb 24, 2025
090cdf4
clean data model for prediction
barais Feb 25, 2025
c7fb11b
correct a smal inconsistency in the data model
barais Feb 26, 2025
f8c52a0
update for filtering prediction with existing student answer
barais Feb 27, 2025
80a7714
update predictionmodel
barais Feb 27, 2025
63c592e
add route to synchronize comment
barais Mar 5, 2025
76988e6
add grade Synchronization
barais Mar 6, 2025
c2216f5
update annoation
barais Mar 6, 2025
ce4dcbb
add archived project
barais Mar 7, 2025
3fd10a9
update boxcasename
barais Mar 7, 2025
79cbe7e
update log
barais Mar 7, 2025
73a0160
clean file
barais Mar 7, 2025
0d1502c
update
barais Mar 7, 2025
2c9ac61
clean
barais Mar 7, 2025
48cf6d3
Merge pull request #145 from correctexam/143-danintegration
barais Mar 7, 2025
95f9c5d
update
barais Mar 7, 2025
ac292c0
Merge pull request #148 from correctexam/143-danintegration
barais Mar 7, 2025
752b940
add missing dto
barais Mar 7, 2025
9a5e953
Merge pull request #149 from correctexam/143-danintegration
barais Mar 7, 2025
bad1c0b
update archived
barais Mar 10, 2025
55fff64
Merge pull request #150 from correctexam/143-danintegration
barais Mar 10, 2025
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,5 @@ Desktop.ini
# ESLint
######################
.eslintcache

danenv/
130 changes: 59 additions & 71 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# correctExamBack
# CorrectExam back-end

Deliver and Grade Your Assessments Anywhere
The back-end of the app CorrectExam.

## CorrectExam

**Deliver and Grade Your Assessments Anywhere**

This application helps you seamlessly administer and grade all of your in-class assessments (long exam or short). Save time grading and get a clear picture of how your students are doing. Provide a clear feedback to your students.

# Feature
### Feature

Main feature are:

Expand All @@ -15,29 +19,65 @@ Main feature are:
- use your tablet and your pen to annotate student sheet
- provide clear feedback to your students

# Technical stack
### Technical stack


This application was generated using JHipster 6.10.5 and JHipster Quarkus 1.1.1 (manually upgraded to quarkus 2.9.2.Final), you can find documentation and help at [https://www.jhipster.tech/documentation-archive/v6.10.5](https://www.jhipster.tech/documentation-archive/v6.10.5).


## Build and deploy
### Build and deploy

Documenttion to deploy your own instance is available [here](https://correctexam.readthedocs.io/en/latest/Install.html)
Documentation to deploy your own instance is available [here](https://correctexam.readthedocs.io/en/latest/Install.html)



## Development

To start your application in the dev profile, run:
### Install

The back-end requires Minio to store the PDF files.
An easy way to install and launch Minio on your computer is to use an official Docker image:

```
podman run -p 9000:9000 -d -p 9090:9090 -e "MINIO_ROOT_USER=admin" -e "MINIO_ROOT_PASSWORD=minioadmin" -v /media/data/miniofiles:/data:Z quay.io/minio/minio server /data --console-address ":9090"
```

The back-end also requires a database.
On Linux you can install MariaDB.
On Fedora, you can run:

```
sudo dnf install mariadb-server
sudo systemctl enable mariadb
sudo systemctl start mariadb
sudo mysql_secure_installation

sudo mysql -u root
CREATE DATABASE gradeScopeIstic;
```

The first run of the back-end must initial and populate the DB with fake data. To do so, run:
```
./mvnw quarkus:dev -Dquarkus.liquibase.migrate-at-start=true
```

It creates two users `user:user` and `admin:admin`.
After that you can launch the back-end classically `./mvnw`

./mvnw

### Run in development mode

To start your application in the dev profile, run:

```
./mvnw
```

For further instructions on how to develop with JHipster, have a look at [Using JHipster in development][].

## Building for production
### Building for production

### Packaging as thin jar
#### Packaging as thin jar

To build the final jar and optimize the correctExam application for production, run:

Expand All @@ -51,7 +91,7 @@ To ensure everything worked, run:

Refer to [Using JHipster in production][] for more details.

### Packaging as native executable
#### Packaging as native executable

_Targeting your Operation System_
In order to build a native image locally, your need to have [GraalVM](https://www.graalvm.org/) installed and `GRAALVM_HOME` defined.
Expand All @@ -72,15 +112,15 @@ If you plan to run your application in a container, run:

It will use a Docker container with GraalVM installed and produce an 64 bit Linux executable.

## Testing
### Testing

To launch your application's tests, run:

./mvnw verify

For more information, refer to the [Running tests page][].

## Using Docker to simplify development (optional)
### Using Docker to simplify development (optional)

You can use Docker to improve your JHipster development experience. A number of docker-compose configuration are available in the [src/main/docker](src/main/docker) folder to launch required third party services.

Expand All @@ -103,66 +143,14 @@ To stop it and remove the container, run:



update question set point = point * 4;

update `student_response` set note = note * 4;
ALTER TABLE `question` ADD `libelle` VARCHAR(255) NULL DEFAULT NULL AFTER `valid_expression`;
ALTER TABLE `gradeScopeIstic`.`final_result` ADD UNIQUE `UniqueStudentIdAndExamId` (`student_id`, `exam_id`);


create table answer_2_hybrid_graded_comment (id bigint not null auto_increment, step_value integer, hybridcomments_id bigint, student_response_id bigint, primary key (id)) engine=InnoDB;
create table hybrid_graded_comment (id bigint not null auto_increment, description longtext, grade integer, relative bit, step integer, text varchar(255), question_id bigint, primary key (id)) engine=InnoDB;


alter table final_result add column frozen bit;
alter table question add column defaultpoint integer;
alter table answer_2_hybrid_graded_comment add constraint FK9ijm3itpjwpgf534m94df8dt6 foreign key (hybridcomments_id) references hybrid_graded_comment (id);
alter table answer_2_hybrid_graded_comment add constraint FKqxflsw40s622dtyt99himou2k foreign key (student_response_id) references student_response (id);
alter table hybrid_graded_comment add constraint FKrrl2y7dngtnqlklwt0scsy8jq foreign key (question_id) references question (id);

ALTER TABLE `gradeScopeIstic`.`answer_2_hybrid_graded_comment` ADD UNIQUE `UniqueHybridcommentsIdAndStudentResponseId` (`student_response_id`, `hybridcomments_id`);

ALTER TABLE `student_response` ADD UNIQUE(`question_id`, `sheet_id`);


alter table student_response add column lastmodified datetime(6);
alter table student_response add column correctedby_id bigint;
alter table student_response add constraint FKinrpshecm7c6aiqo6000ju87c foreign key (correctedby_id) references jhi_user (id);

alter table question add column randomhorizontalcorrection bit default 0;



[x] unique constraint for answer_2_hybrid_graded_comment
[x] delete correctly when removing exam or course
[x] Import Export with HybridComment
[x] Test import and export
[x] check delete
[x] Export PDF with HybridComment

[x] update question or hybridComment => recompute score4 linked StudentResponse
[x] test update question or hybridComment => recompute score4 linked StudentResponse
[x] update maximal step from 5 to 12.
[x] Allow direct grading when clicking to star
[x] Update view copie4student
[x] update show all with this hybridComment
[x] update apply to all the same grade



SELECT resp.id FROM `student_response` as resp WHERE EXISTS( SELECT * FROM `student_response` as resp2 WHERE resp.id <> resp2.id and resp.question_id = resp2.question_id and resp.sheet_id = resp2.sheet_id);

select * from student_response_textcomments as st3 where st3.student_response_id IN(
SELECT resp.id FROM `student_response` as resp WHERE EXISTS( SELECT * FROM `student_response` as resp2 WHERE resp.id <> resp2.id and resp.question_id = resp2.question_id and resp.sheet_id = resp2.sheet_id));

-- upgrade database script


DELETE from answer_2_hybrid_graded_comment as an where an.student_response_id IN(
SELECT resp.id FROM `student_response` as resp WHERE EXISTS( SELECT * FROM `student_response` as resp2 WHERE resp.id <> resp2.id and resp.question_id = resp2.question_id and resp.sheet_id = resp2.sheet_id));
create table prediction (id bigint not null auto_increment, json_data tinytext, confidence float(53), question_number varchar(255), text varchar(2048), question_id bigint, sheet_id bigint, primary key (id));
alter table template add column casename bit DEFAULT 1;
alter table course add column archived bit not null DEFAULT 0;

select an.* from answer_2_hybrid_graded_comment as an where an.student_response_id IN(SELECT resp.id FROM `student_response` as resp WHERE EXISTS( SELECT * FROM `student_response` as resp2 WHERE resp.id <> resp2.id and resp.question_id = resp2.question_id and resp.sheet_id = resp2.sheet_id));

delete an.* from answer_2_hybrid_graded_comment as an where an.student_response_id IN(
SELECT resp.id FROM `student_response` as resp WHERE EXISTS( SELECT * FROM `student_response` as resp2 WHERE resp.id <> resp2.id and resp.question_id = resp2.question_id and resp.sheet_id = resp2.sheet_id));
alter table prediction add constraint FK1xsmwx00gk7213kwfeah9lcjx foreign key (question_id) references question (id);
alter table prediction add constraint FK8nv2hkm3mhxll6be9mwj5402t foreign key (sheet_id) references exam_sheet (id);

DELETE FROM `student_response` WHERE id in (53044,53045,53046,53047,53050,53051,53052,53053,53054,53055,53056,53057,53058,53059,53061,53062,53063,53064,53065,53066,53067,53068,53106,53107,53108,53109,53110,53111,53112,53113,53114,53115,53117,53118,53119,53120,53121,53122,53124,53125,53126,53127,53128,53129,53130,53131,53133,53134,53135,53136,53184,53185,53240,53241,53242,53243,53244,53245,53248,53249,53250,53251);
2 changes: 0 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
</dependencyManagement>
<dependencies>



<dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
Expand Down
17 changes: 17 additions & 0 deletions src/main/docker/app.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ services:
file: mysql.yml
service: correctexam-mysql

#To activate to setup rag

# correctexam-es:
# extends:
# file: es.yml
# service: correctexam-es

# correctexam-kibana:
# extends:
# file: es.yml
# service: correctexam-kibana

front:
image: barais/correctexam-front
build:
Expand Down Expand Up @@ -67,3 +79,8 @@ services:
volumes:
- ./exampleconf/smtprelay.ini:/app/smtprelay.ini:ro
- ./tmp:/tmp:rw

# To activate to setup rag

#networks:
# elastic:
35 changes: 35 additions & 0 deletions src/main/docker/es.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
version: '1'
services:
correctexam-es:
image: elasticsearch:8.8.0
ports:
- 9200:9200
- 9300:9300
networks:
- elastic
environment:
- discovery.type=single-node
- xpack.security.enabled=false
- "ES_JAVA_OPTS=-Xms512m -Xmx2048m"
- cluster.routing.allocation.disk.threshold_enabled=false
deploy:
resources:
limits:
cpus: '2.0'
reservations:
cpus: '1.0'
correctexam-kibana:
image: docker.elastic.co/kibana/kibana:8.7.1
container_name: kibana
environment:
XPACK_ENCRYPTEDSAVEDOBJECTS_ENCRYPTIONKEY: d1a66dfd-c4d3-4a0a-8290-2abcb83ab3aa
ports:
- 5601:5601
networks:
- elastic
deploy:
resources:
limits:
cpus: '2.0'
reservations:
cpus: '1.0'
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,8 @@ data:

INSERT INTO `question_type` (`id`, `algo_name`, `endpoint`, `js_function`) VALUES
(2, 'manual', '', ''),
(3, 'QCM', NULL, NULL);
(3, 'QCM', NULL, NULL),
(4, 'manuscrit', '', '');

-- --------------------------------------------------------

Expand Down
6 changes: 6 additions & 0 deletions src/main/java/fr/istic/domain/Course.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public class Course extends PanacheEntityBase implements Serializable {
@Column(name = "name", nullable = false)
public String name;

@NotNull
@Column(name = "archived", nullable = false)
public Boolean archived = false;


@OneToMany(mappedBy = "course", cascade = CascadeType.REMOVE, fetch = FetchType.LAZY)
@Cache(usage = CacheConcurrencyStrategy.READ_WRITE)
public Set<Exam> exams = new HashSet<>();
Expand Down Expand Up @@ -92,6 +97,7 @@ public static Course update(Course course) {
var entity = Course.<Course>findById(course.id);
if (entity != null) {
entity.name = course.name;
entity.archived = course.archived;
entity.exams = course.exams;
entity.groups = course.groups;
entity.profs = course.profs;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/fr/istic/domain/Exam.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import jakarta.json.bind.annotation.JsonbTransient;
import io.quarkus.hibernate.orm.panache.PanacheQuery;
import io.quarkus.runtime.annotations.RegisterForReflection;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import jakarta.persistence.*;
import jakarta.transaction.Transactional;
Expand Down Expand Up @@ -33,6 +31,8 @@ public class Exam extends PanacheEntityBase implements Serializable {
@Column(name = "name", nullable = false)
public String name;



@OneToOne(cascade = CascadeType.REMOVE)
@JoinColumn(unique = true)
public Template template;
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/fr/istic/domain/ExamSheet.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,11 @@ public class ExamSheet extends PanacheEntityBase implements Serializable {
@JsonbTransient
public Set<Student> students = new HashSet<>();


@OneToMany(mappedBy = "sheet")
@JsonbTransient
public Set<Prediction> predictions ;

// jhipster-needle-entity-add-field - JHipster will add fields here, do not remove

@Override
Expand Down
Loading