Skip to content
This repository was archived by the owner on Jul 25, 2022. It is now read-only.

Commit 2720baf

Browse files
committed
うーん
1 parent 88b5563 commit 2720baf

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

src/content/question/Question.php

+8-2
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,16 @@ public function __construct(Client $client, string $url){
4545
$dom = $client->getDom($url);
4646
$this->postUrl = 'https://video.classi.jp' . $dom->find('form')->action;
4747
foreach($dom->find('form')->find('input') as $input){
48+
/*
4849
if(strpos($input->name, 'answer_data[sections][][questions][][user_answer]') !== false){
4950
continue;
5051
}
51-
$this->postData[$input->name][] = $input->value;
52+
*/
53+
if($input->name === 'utf8'){
54+
$this->postData[$input->name] = '';
55+
}else{
56+
$this->postData[$input->name][] = $input->value;
57+
}
5258
}
5359
}
5460

@@ -59,7 +65,7 @@ protected function sendAnswer(bool $complete = false) : ResponseInterface{
5965
*/
6066
$query = \GuzzleHttp\Psr7\build_query($this->postData, PHP_QUERY_RFC1738);
6167

62-
68+
//var_dump($query);
6369
if($complete){
6470
$query .= '&commit=完了する';
6571
}

src/content/question/TrueFalseQuestion.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ protected function prepare() : array{
5555

5656
$result = [];
5757
foreach($this->answers as $key => $value){
58-
$result[$this->choiceNames[$key]][] = $this->choices[$value];
58+
$result[$this->choiceNames[$key]][] = $this->choices[$key][$value];
5959
}
6060
if(empty($result)){
6161
throw new \RuntimeException('Final result is empty');

0 commit comments

Comments
 (0)