Skip to content

Commit

Permalink
Merge pull request #334 from gloggi/consecutive-observations
Browse files Browse the repository at this point in the history
Simplify creating multiple consecutive observations in the same block
  • Loading branch information
carlobeltrame authored Mar 7, 2024
2 parents f3dac1e + d224373 commit e9814b7
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 17 deletions.
9 changes: 3 additions & 6 deletions .docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ RUN apt-get -y update && apt-get -y upgrade && apt-get -y install libxml2-dev li
RUN echo "de_CH.UTF-8 UTF-8" >> /etc/locale.gen && echo "fr_CH.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen

ENV COMPOSER_ALLOW_SUPERUSER=1
RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer

RUN yes | pecl install xdebug-3.2.0 && docker-php-ext-enable xdebug
ENV XDEBUG_MODE="debug,develop"
ENV XDEBUG_CONFIG="client_host=docker-host"

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
RUN install-php-extensions xdebug @composer
RUN docker-php-ext-install pdo pdo_mysql mbstring xml bcmath zip gd
COPY docker-php-ext-xdebug.ini /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini

RUN a2enmod rewrite
COPY apache-vhost.conf /etc/apache2/sites-enabled/000-default.conf
Expand Down
5 changes: 5 additions & 0 deletions .docker/docker-php-ext-xdebug.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[xdebug]
zend_extension=xdebug.so
xdebug.mode=develop,debug
xdebug.client_host = "host.docker.internal"
xdebug.idekey="PHPSTORM"
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Changelog

##### März 2024
- Nachdem man via Blöcke-Ansicht eine Beobachtung hinzugefügt hat, bleibt man nun auf dem Beobachtungs-Formular, um noch weitere Beobachtungen erfassen zu können. Das vorherige Verhalten war noch aus der Zeit als der Spick und die Blöcke-Ansicht noch separat waren, und war für Beobachtungsaufträge mit genau einer Beobachtung pro Auftrag optimiert. Das neue Verhalten ist hoffentlich hilfreicher, um mehrere kleine Beobachtungen zu erfassen [#334](https://github.com/gloggi/qualix/pull/334)

##### Februar 2024
- Qualix enthält neu ein Namenslernspiel! Auf der TN-Liste hat es einen Link zum Spiel [#332](https://github.com/gloggi/qualix/pull/332)

Expand Down
1 change: 0 additions & 1 deletion app/Http/Controllers/BlockListController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class BlockListController extends Controller
public function crib(Request $request, Course $course, User $user)
{
$userId = $user->id ?? Auth::id();
$request->session()->flash('return_url', $request->url());
return view('crib', [
'blockManagementLink' => $this->blockManagementLink($course, 't.views.crib.here'),
'showObservationAssignments' => $course->observationAssignments()->count(),
Expand Down
3 changes: 0 additions & 3 deletions app/Http/Controllers/ObservationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ public function edit(Request $request, Course $course, Observation $observation)
*/
protected function rememberPreviouslyActiveView(Request $request) {
$returnTo = $this->extractPathParameter(URL::previous(), 'participants.detail', 'participant');
$request->session()->keep(['return_url']);
$request->session()->flash('participant_before_edit', $request->session()->get('participant_before_edit', $returnTo));
}

Expand All @@ -110,8 +109,6 @@ protected function rememberPreviouslyActiveView(Request $request) {
* @return RedirectResponse
*/
protected function redirectToPreviouslyActiveView(Request $request, Course $course, Collection $returnOptions, $fallback = null) {
if ($request->session()->has('return_url')) return Redirect::to($request->session()->get('return_url'));

$returnTo = $request->session()->get('participant_before_edit');
if (!$returnOptions->contains($returnTo)) {
$returnTo = $returnOptions->first();
Expand Down
3 changes: 0 additions & 3 deletions app/Http/Controllers/ParticipantController.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ public function edit(Request $request, Course $course, Participant $participant)
*/
protected function rememberPreviouslyActiveView(Request $request) {
$returnTo = $this->extractPathParameter(URL::previous(), 'participants.detail', 'participant');
$request->session()->keep(['return_url']);
$request->session()->flash('participant_before_edit', $request->session()->get('participant_before_edit', $returnTo));
}

Expand All @@ -130,8 +129,6 @@ protected function rememberPreviouslyActiveView(Request $request) {
* @return RedirectResponse
*/
protected function redirectToPreviouslyActiveView(Request $request, Course $course) {
if ($request->session()->has('return_url')) return Redirect::to($request->session()->get('return_url'));

$returnTo = $request->session()->get('participant_before_edit');
if ($returnTo) return Redirect::to(route('participants.detail', ['course' => $course->id, 'participant' => $returnTo]));

Expand Down
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ services:
volumes:
- .:/var/www
- ./public/.htaccess.docker:/var/www/public/.htaccess
extra_hosts:
- "host.docker.internal:host-gateway"

db:
image: mariadb:10.3
Expand Down
8 changes: 4 additions & 4 deletions tests/Feature/Crib/ReadCribTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ public function test_shouldCalculateObservationAssignmentsCorrectly() {

}

public function test_shouldReturnToCrib_afterAddingObservationInAssignment() {
public function test_shouldReturnToObservationForm_afterAddingObservationInAssignment() {
// given
$block1 = $this->createBlock('Block 1', '1.1', '01.01.2019');
$block2 = $this->createBlock('Block 2', '1.2', '01.01.2019');
Expand All @@ -218,10 +218,10 @@ public function test_shouldReturnToCrib_afterAddingObservationInAssignment() {

// then
$response->assertStatus(302);
$response->assertRedirect('/course/' . $this->courseId . '/crib');
$response->assertRedirect('/course/' . $this->courseId . '/observation/new?participant=' . $participant1 . '&block=' . $block1);
}

public function test_shouldReturnToCrib_afterAddingObservationInBlock() {
public function test_shouldReturnToObservationForm_afterAddingObservationInBlock() {
// given
$block1 = $this->createBlock('Block 1', '1.1', '01.01.2019');
$participant1 = $this->createParticipant('One');
Expand All @@ -241,6 +241,6 @@ public function test_shouldReturnToCrib_afterAddingObservationInBlock() {

// then
$response->assertStatus(302);
$response->assertRedirect('/course/' . $this->courseId . '/crib');
$response->assertRedirect('/course/' . $this->courseId . '/observation/new?participant=' . $participant1 . '&block=' . $block1);
}
}

0 comments on commit e9814b7

Please sign in to comment.