Skip to content
Snippets Groups Projects
Commit 77283e30 authored by a.croix's avatar a.croix
Browse files

Remove Populate and DropFeedbacks button

parent 63c7c43b
No related branches found
No related tags found
1 merge request!1Include Wowa Training
Pipeline #6132 failed
......@@ -118,47 +118,4 @@ class FeedbackController extends Controller
return redirect(action("FeedbackController@index"));
}
public function populate()
{
$instance = Mark::get();
$data = $instance->findEvidence("agregation.wowa");
//var_dump($data);
$i = 0;
$logger = new Logger('populate-db');
$logger->pushHandler(new StreamHandler(__DIR__.'/../../storage/logs/populate.log', Logger::DEBUG));
foreach ($data as $el) {
$this->addFeedbackInDatabase($el);
$logger->info("Element number " . $i);
$i++;
}
return redirect(action("FeedbackController@index"));
}
private function addFeedbackInDatabase($element)
{
set_time_limit(120);
$file = fopen('./../webshell_expected_new_version.csv', 'r');
$feedback = new Feedback();
$feedback->report_id = $element->id;
while (($line = fgetcsv($file)) !== false) {
if ($line[0] == $element->subject['id']) {
//var_dump($line[1]);
if ($line[1] == "0") {
//var_dump($el->subject['name']);
$feedback->is_true_alert = false;
} elseif ($line[1] == "1") {
//var_dump($el->subject['name']);
$feedback->is_true_alert = true;
}
}
}
fclose($file);
$feedback->user_id = Auth::id();
$feedback->save();
}
public function dropFeedbacks()
{
Feedback::truncate();
return redirect(action("FeedbackController@index"));
}
}
......@@ -9,12 +9,6 @@
<a href="{{action('WowaController@create')}}" class="btn btn-outline-danger">
<i class="fas fa-calculator"></i> Compute Wowa Weights
</a>
<a href="{{action('FeedbackController@populate')}}" class="btn btn-warning">
<i class="fas fa-grimace"></i> Populate Feedback (Test)
</a>
<a href="{{action('FeedbackController@dropFeedbacks')}}" class="btn btn-danger">
<i class="fas fa-trash-alt">Drop all Feedbacks</i>
</a>
</p>
<table class="table table-striped">
<tr>
......
......@@ -9,9 +9,6 @@
<a href="{{action('WowaController@create')}}" class="btn btn-outline-danger">
<i class="fas fa-calculator"></i> Compute Wowa Weights
</a>
<a href="{{action('WowaController@dropWowas')}}" class="btn btn-danger">
<i class="fas fa-trash-alt">Drop all Feedbacks</i>
</a>
</p>
<table class="table table-striped">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment