From c6ae2fb6a2228e93b9dd3ba329afa5676bdb0d22 Mon Sep 17 00:00:00 2001 From: Marco De Donno Date: Fri, 27 Jul 2018 14:06:48 +0200 Subject: [PATCH] Change the comparison notification for latent declared as no-value --- backend/TE/TakeExercise.php | 38 +++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) diff --git a/backend/TE/TakeExercise.php b/backend/TE/TakeExercise.php index cc0b028..167ee6b 100644 --- a/backend/TE/TakeExercise.php +++ b/backend/TE/TakeExercise.php @@ -316,8 +316,42 @@ class TakeExerciseFrame extends ExerciseFrame $moreSettings[ 'updatedMinutiaeTimestamp' ] = $db->getAssignmentSubmissionTime( $aid, 'ANALYSIS' ); } - if( ! $isTutorReview && $progress[ 'step' ] == 'ANALYSIS' ) - $moreSettings[ 'defaultSuitabilityApproach' ] = $db->getSuitabilityApproach(); + if( ! $isTutorReview ) + { + if( $progress[ 'step' ] == 'ANALYSIS' ) + { + $moreSettings[ 'defaultSuitabilityApproach' ] = $db->getSuitabilityApproach(); + } else if( $progress[ 'step' ] == 'COMPARISON' && $progress[ 'status' ] < 4 ) + { + if( $db->isMarkOfNoValue( $aid ) ) + { + $jsCode .= " + settings[ 'onExerciseStartup' ] = function( pianos, params ) + { + if ( params.phase == 'comparison' ) + { + var dlg = $( '
' ) + .text( 'The latent has been declared as no-value. No comparison is needed in this case.' ); + + pianos.dialog( dlg, { + modal: true, + title: 'Information', + close: function() { + $( this ).remove(); + window.location.href = '?'; + }, + buttons: { + 'Return to the homepage': function() { + $( this ).dialog( 'close' ); + window.location.href = '?'; + } + } + } ); + } + };"; + } + } + } if( isset( $moreSettings ) ) $settings = array_merge( $settings, $moreSettings ); -- GitLab