1616$ questionTypeId = isset ($ _REQUEST ['questionTypeId ' ]) ? (int ) $ _REQUEST ['questionTypeId ' ] : 0 ;
1717$ exportXls = isset ($ _REQUEST ['export_xls ' ]) && !empty ($ _REQUEST ['export_xls ' ]) ? (int ) $ _REQUEST ['export_xls ' ] : 0 ;
1818$ action = $ _REQUEST ['a ' ] ?? null ;
19+ $ startDate = isset ($ _REQUEST ['start_date ' ]) ? $ _REQUEST ['start_date ' ] : '' ;
20+ $ endDate = isset ($ _REQUEST ['end_date ' ]) ? $ _REQUEST ['end_date ' ] : '' ;
1921
2022api_block_anonymous_users ();
2123
@@ -170,6 +172,14 @@ function updateExerciseList(courseId) {
170172 }
171173</script> ' ;
172174
175+ $ htmlHeadXtra [] = '<script>
176+ $(function() {
177+ $(".datepicker").datepicker({
178+ dateFormat: "yy-mm-dd"
179+ });
180+ });
181+ </script> ' ;
182+
173183if ($ exportXls ) {
174184 ExerciseLib::exportPendingAttemptsToExcel ($ _REQUEST );
175185}
@@ -293,16 +303,27 @@ function updateExerciseList(courseId) {
293303 4 => get_lang ('Unclosed ' ),
294304 5 => get_lang ('Ongoing ' ),
295305];
296-
297306$ form ->addSelect ('status ' , get_lang ('Status ' ), $ status );
298307
299308$ questionType = [
300309 0 => get_lang ('All ' ),
301310 1 => get_lang ('QuestionsWithNoAutomaticCorrection ' ),
302311];
303-
304312$ form ->addSelect ('questionTypeId ' , get_lang ('QuestionType ' ), $ questionType );
305313
314+ $ form ->addElement (
315+ 'text ' ,
316+ 'start_date ' ,
317+ get_lang ('StartDate ' ),
318+ ['id ' => 'start_date ' , 'class ' => 'datepicker ' , 'autocomplete ' => 'off ' , 'style ' => 'width:120px ' ]
319+ );
320+ $ form ->addElement (
321+ 'text ' ,
322+ 'end_date ' ,
323+ get_lang ('EndDate ' ),
324+ ['id ' => 'end_date ' , 'class ' => 'datepicker ' , 'autocomplete ' => 'off ' , 'style ' => 'width:120px ' ]
325+ );
326+
306327$ form ->addButtonSearch (get_lang ('Search ' ), 'pendingSubmit ' );
307328$ content = $ form ->returnForm ();
308329
@@ -315,7 +336,9 @@ function updateExerciseList(courseId) {
315336
316337$ url = api_get_path (WEB_AJAX_PATH ).
317338 'model.ajax.php?a=get_exercise_pending_results&filter_by_user= ' .$ filter_user .
318- '&course_id= ' .$ courseId .'&exercise_id= ' .$ exerciseId .'&status= ' .$ statusId .'&questionType= ' .$ questionTypeId .'&showAttemptsInSessions= ' .$ showAttemptsInSessions ;
339+ '&course_id= ' .$ courseId .'&exercise_id= ' .$ exerciseId .'&status= ' .$ statusId .'&questionType= ' .$ questionTypeId .
340+ '&showAttemptsInSessions= ' .$ showAttemptsInSessions .
341+ '&start_date= ' .$ startDate .'&end_date= ' .$ endDate ;
319342$ action_links = '' ;
320343
321344$ officialCodeInList = api_get_setting ('show_official_code_exercise_result_list ' );
@@ -375,16 +398,6 @@ function updateExerciseList(courseId) {
375398 'align ' => 'left ' ,
376399 'search ' => 'false ' ,
377400 'sortable ' => 'false ' ,
378- //'stype' => 'select',
379- //for the bottom bar
380- /*'searchoptions' => [
381- 'defaultValue' => '',
382- 'value' => ':'.get_lang('All').';1:'.get_lang('Validated').';0:'.get_lang('NotValidated'),
383- ],*/
384- //for the top bar
385- /*'editoptions' => [
386- 'value' => ':'.get_lang('All').';1:'.get_lang('Validated').';0:'.get_lang('NotValidated'),
387- ],*/
388401 ],
389402 [
390403 'name ' => 'qualificator_fullname ' ,
0 commit comments