質問編集履歴
4
htmlの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -88,4 +88,31 @@
|
|
88
88
|
</div>
|
89
89
|
</div>
|
90
90
|
</div>
|
91
|
+
```
|
92
|
+
|
93
|
+
|
94
|
+
-----------------------------------------追記2
|
95
|
+
|
96
|
+
どのように変化させたいかというと、上のHTML文が現状ですが、下のHTML文のように処理されるのが理想です。
|
97
|
+
```HTML
|
98
|
+
<div class="card">
|
99
|
+
<div class="card-header bg-primary">解答</div>
|
100
|
+
<div class="card-body">
|
101
|
+
<!--解答の読み込み-->
|
102
|
+
<div style="display:inline-flex"><form id="result" method="POST" action="insert_clear.php?id='2'" autocomplete="off">
|
103
|
+
public class HelloWorld{<br />
|
104
|
+
public static void main(String[] args){<br />
|
105
|
+
System.out.println("
|
106
|
+
<input type="text" id="textbox1" name="input01" size="30">1");<br />
|
107
|
+
<input type="text" id="textbox2" name="input02" size="30">2<br />
|
108
|
+
}<br />
|
109
|
+
}<br />
|
110
|
+
</form></div>
|
111
|
+
<div class="text-right">
|
112
|
+
<button id="button1" type="button" class="btn-warning btn-lg" onclick="check();">チェック</button>
|
113
|
+
<button id="button2" type="submit" class="btn-secondary btn-lg" disabled form="result">送信</button>
|
114
|
+
</div>
|
115
|
+
</div>
|
116
|
+
</div>
|
117
|
+
</div>
|
91
118
|
```
|
3
キャプチャ画像の削除
title
CHANGED
File without changes
|
body
CHANGED
@@ -52,8 +52,6 @@
|
|
52
52
|
|
53
53
|
空欄が1つであれば、実装することができたのですが、複数というところで苦戦しております。
|
54
54
|
|
55
|
-
ここで表示しているデータベースの中身は下記の通りです。
|
56
|
-

|
57
55
|
|
58
56
|
データベースについてはこちらです。
|
59
57
|
```CREATE
|
2
コードの追記
title
CHANGED
File without changes
|
body
CHANGED
@@ -53,4 +53,41 @@
|
|
53
53
|
空欄が1つであれば、実装することができたのですが、複数というところで苦戦しております。
|
54
54
|
|
55
55
|
ここで表示しているデータベースの中身は下記の通りです。
|
56
|
-

|
56
|
+

|
57
|
+
|
58
|
+
データベースについてはこちらです。
|
59
|
+
```CREATE
|
60
|
+
CREATE TABLE `test_01`.`mondai1` ( `id` INT NOT NULL AUTO_INCREMENT , `top` TEXT NOT NULL , `source1` TEXT NOT NULL , `question` TEXT NOT NULL , `source2` TEXT NOT NULL , `answer` TEXT NOT NULL , `category` TEXT NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;
|
61
|
+
```
|
62
|
+
```INSERT
|
63
|
+
INSERT INTO `mondai` (`id`, `top`, `source1`, `question`, `source2`, `answer`, `category`) VALUES (NULL, '1.1「Hello World!」の表示 ', 'Hello World!', 'Hello Worldと表示されるプログラムを作成してください。', 'public class HelloWorld{\r\n public static void main(String[] args){\r\n System.out.println(\"index1\");\r\n index2\r\n }\r\n}', 'Hello World!', '1.1');
|
64
|
+
```
|
65
|
+
処理を行っている部分のHTMLはこのようになっています。
|
66
|
+
|
67
|
+
```HTML
|
68
|
+
<div class="card">
|
69
|
+
<div class="card-header bg-primary">解答</div>
|
70
|
+
<div class="card-body">
|
71
|
+
<!--解答の読み込み-->
|
72
|
+
<div style="display:inline-flex"><form id="result" method="POST" action="insert_clear.php?id='2'" autocomplete="off">
|
73
|
+
public class HelloWorld{<br />
|
74
|
+
public static void main(String[] args){<br />
|
75
|
+
System.out.println("<input type="text" id="textbox1" name="input01" size="30">1");<br />
|
76
|
+
<input type="text" id="textbox1" name="input01" size="30">2<br />
|
77
|
+
}<br />
|
78
|
+
}<br />
|
79
|
+
2public class HelloWorld{<br />
|
80
|
+
public static void main(String[] args){<br />
|
81
|
+
System.out.println("<input type="text" id="textbox2" name="input01" size="30">1");<br />
|
82
|
+
<input type="text" id="textbox2" name="input01" size="30">2<br />
|
83
|
+
}<br />
|
84
|
+
}<br />
|
85
|
+
2 </form></div>
|
86
|
+
<div class="text-right">
|
87
|
+
<button id="button1" type="button" class="btn-warning btn-lg" onclick="check();">チェック</button>
|
88
|
+
<button id="button2" type="submit" class="btn-secondary btn-lg" disabled form="result">送信</button>
|
89
|
+
</div>
|
90
|
+
</div>
|
91
|
+
</div>
|
92
|
+
</div>
|
93
|
+
```
|
1
このサイトについて、表示しているデータベースの中身を追記いたしました。
title
CHANGED
File without changes
|
body
CHANGED
@@ -4,6 +4,8 @@
|
|
4
4
|
|
5
5
|
何か良い方法はありますでしょうか。
|
6
6
|
|
7
|
+
|
8
|
+
|
7
9
|
```php
|
8
10
|
function read_kaitou(){ //問題ページの読み込み&空欄の作成
|
9
11
|
$a=null;
|
@@ -39,4 +41,16 @@
|
|
39
41
|
</form></div>
|
40
42
|
```
|
41
43
|
|
42
|
-

|
44
|
+

|
45
|
+
|
46
|
+
ーーーーーーーーーーーーーーーーーーーーーーーーーーーー追記
|
47
|
+
サイトについて・・・
|
48
|
+
|
49
|
+
PHPとmysqlを使用し、answer(答え)というテーブルに格納されている文字列と今回用意するフォームの中身を照合し、合致すれば赤い背景のフォームが緑に変わるというコンパイルと実行は必要ないタイプのサイトです。
|
50
|
+
|
51
|
+
下記のphpはindexという文字(自分で設定した文字列)を検索し、indexという文字列を見つけたら空欄(inputタグ)を作成するというものです。
|
52
|
+
|
53
|
+
空欄が1つであれば、実装することができたのですが、複数というところで苦戦しております。
|
54
|
+
|
55
|
+
ここで表示しているデータベースの中身は下記の通りです。
|
56
|
+

|