Skip to content
Commits on Source (3)
<?xml version="1.0" encoding="UTF-8"?>
<actions>
<action>
<actionName>run</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.1.0:exec</goal>
</goals>
<properties>
<exec.vmArgs></exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.appArgs></exec.appArgs>
<exec.mainClass>Calcul.Main</exec.mainClass>
<exec.executable>java</exec.executable>
</properties>
</action>
<action>
<actionName>debug</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.1.0:exec</goal>
</goals>
<properties>
<exec.vmArgs>-agentlib:jdwp=transport=dt_socket,server=n,address=${jpda.address}</exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.appArgs></exec.appArgs>
<exec.mainClass>Calcul.Main</exec.mainClass>
<exec.executable>java</exec.executable>
<jpda.listen>true</jpda.listen>
</properties>
</action>
<action>
<actionName>profile</actionName>
<packagings>
<packaging>jar</packaging>
</packagings>
<goals>
<goal>process-classes</goal>
<goal>org.codehaus.mojo:exec-maven-plugin:3.1.0:exec</goal>
</goals>
<properties>
<exec.vmArgs></exec.vmArgs>
<exec.args>${exec.vmArgs} -classpath %classpath ${exec.mainClass} ${exec.appArgs}</exec.args>
<exec.mainClass>Calcul.Main</exec.mainClass>
<exec.executable>java</exec.executable>
<exec.appArgs></exec.appArgs>
</properties>
</action>
</actions>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>activite</groupId>
<artifactId>Activite_calcul</artifactId>
<version>01</version>
<groupId>com.mycompany</groupId>
<artifactId>Groupe_05</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
......@@ -23,7 +23,6 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>
<exec.mainClass>activité_calcul.Activite_calcul</exec.mainClass>
<exec.mainClass>com.mycompany.groupe_05.Groupe_05</exec.mainClass>
</properties>
<name>Activite_calcul</name>
</project>
\ No newline at end of file
......@@ -5,9 +5,4 @@ package Calcul;
* @author stag
*/
public class Main {
public static void main(String[] args) {
Calcul test = new Calcul();
}
}
......@@ -4,8 +4,10 @@
*/
package com.mycompany.groupe_05;
import Calcul.Calcul;
import beans.Drawing;
import gui.MainMenu;
import gui.NewQuestion;
import gui.QuestionsGui;
import java.awt.BorderLayout;
import java.awt.Container;
......@@ -14,6 +16,7 @@ import javax.swing.JFrame;
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
/**
......@@ -27,7 +30,8 @@ public class ContentFrame extends JFrame {
private final JPanel content;
private final MainMenu menuPanel;
private final Drawing drawingPane;
private final Container mathPane;
private final Calcul mathPane;
private final NewQuestion newQuest;
private final QuestionsGui questionsPane;
private final JMenuBar menuBar;
......@@ -35,7 +39,8 @@ public class ContentFrame extends JFrame {
content = new JPanel(new BorderLayout());
drawingPane = new Drawing();
questionsPane = new QuestionsGui();
mathPane = new JPanel();
mathPane = new Calcul();
newQuest = new NewQuestion();
menuPanel = new MainMenu();
menuBar = new JMenuBar();
......@@ -125,6 +130,8 @@ public class ContentFrame extends JFrame {
content.add(menuPanel, BorderLayout.WEST);
revalidate();
});
newQuestI.addActionListener(ae -> switchActivities(newQuest));
helpI.addActionListener(ae -> JOptionPane.showMessageDialog(content, "Mdr gl"));
exitI.addActionListener(ae -> System.exit(0));
}
......
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package gui;
import beans.Question;
import dao.DaoQuestion;
import java.awt.Container;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.util.ArrayList;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JTextArea;
/**
*
* @author stag
*/
public class NewQuestion extends JPanel {
private JPanel contentPan, confirmPan;
private JLabel lvlLab, staLab, ansLab;
private JTextArea staTxt, ansTxt;
private JButton confirmBtn, cancelBtn;
private JComboBox<Integer> lvlCb;
public NewQuestion() {
initGui();
initEvent();
}
private void initGui() {
contentPan = new JPanel();
confirmPan = new JPanel(new GridLayout(0, 1));
lvlLab = new JLabel("Niveau: ");
staLab = new JLabel("Question :");
ansLab = new JLabel("Réponse :");
staTxt = new JTextArea(5, 30);
ansTxt = new JTextArea(5, 30);
confirmBtn = new JButton("Valider");
cancelBtn = new JButton("Annuler");
ArrayList<Integer> values = new ArrayList<>();
values.add(1);
values.add(2);
lvlCb = new JComboBox<>(values.toArray(new Integer[0]));
addToContent(lvlLab);
addToContent(lvlCb);
addToContent(staLab);
addToContent(staTxt);
addToContent(ansLab);
addToContent(ansTxt);
confirmPan.add(confirmBtn);
confirmPan.add(cancelBtn);
addToContent(confirmPan);
contentPan.setLayout(new BoxLayout(contentPan, BoxLayout.Y_AXIS));
add(contentPan);
}
private void addToContent(Container c) {
contentPan.add(c);
}
private void initEvent() {
confirmBtn.addActionListener((ActionEvent ae) -> {
DaoQuestion daoq = new DaoQuestion();
Question q = new Question();
q.setLevel((int)lvlCb.getSelectedIndex());
q.setStatement(staTxt.getText());
q.setAnswer(ansTxt.getText());
daoq.create(q);
JOptionPane.showMessageDialog(contentPan, "Nouvelle question ajoutée a la base de donnée");
staTxt.setText("");
ansTxt.setText("");
});
cancelBtn.addActionListener((ActionEvent ae) -> {
staTxt.setText("");
ansTxt.setText("");
});
}
}
......@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Hôte : localhost
-- Généré le : jeu. 19 sep. 2024 à 12:14
-- Généré le : ven. 20 sep. 2024 à 09:12
-- Version du serveur : 10.1.48-MariaDB-0+deb9u2
-- Version de PHP : 7.4.33
......@@ -48,8 +48,7 @@ INSERT INTO `questions` (`id`, `level`, `statement`, `answer`) VALUES
(6, 1, 'Combien y a-t-il de saisons dans une année?', 'Quatre'),
(7, 1, 'Combien de côtés a un carré?', 'Quatre'),
(8, 1, 'Quelle est la couleur de l\'herbe?', 'Verte'),
(13, 1, 'Quel est le meilleur formateur?', 'Herbert'),
(15, 1, 'Quel est le meilleur formateur?', 'Herbert');
(9, 1, 'Quel est le meilleur formateur?', 'Herbert');
--
-- Index pour les tables déchargées
......@@ -69,7 +68,7 @@ ALTER TABLE `questions`
-- AUTO_INCREMENT pour la table `questions`
--
ALTER TABLE `questions`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=17;
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=21;
COMMIT;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
......