@@ -39,6 +39,11 @@ protected function specific_definition($mform) {
3939 $ mform ->addElement ('header ' , 'config_vmchecker_header ' , get_string ('header ' , 'block_vmchecker ' ));
4040 $ mform ->setExpanded ('config_vmchecker_header ' );
4141
42+ $ mform ->addElement ('select ' , 'config_assignment_type ' , get_string ('assignment_type ' , 'block_vmchecker ' ), [
43+ 'standard ' => get_string ('assignment_type_standard ' , 'block_vmchecker ' ),
44+ 'interactive ' => get_string ('assignment_type_interactive ' , 'block_vmchecker ' ),
45+ ]);
46+
4247 $ mform ->addElement (
4348 'select ' ,
4449 'config_autograding ' ,
@@ -53,17 +58,21 @@ protected function specific_definition($mform) {
5358 $ mform ->settype ('config_autograding ' , PARAM_BOOL );
5459
5560 $ mform ->addElement ('text ' , 'config_gitlab_project_id ' , get_string ('gitlab_project_id ' , 'block_vmchecker ' ));
56- $ mform ->addRule ('config_gitlab_project_id ' , null , 'required ' , null , 'client ' );
5761 $ mform ->settype ('config_gitlab_project_id ' , PARAM_INT );
62+ $ mform ->hideIf ('config_gitlab_project_id ' , 'config_assignment_type ' , 'eq ' , 'interactive ' );
5863
5964 $ mform ->addElement ('text ' , 'config_gitlab_private_token ' , get_string ('gitlab_private_token ' , 'block_vmchecker ' ));
60- $ mform ->addRule ('config_gitlab_private_token ' , null , 'required ' , null , 'client ' );
6165 $ mform ->settype ('config_gitlab_private_token ' , PARAM_TEXT );
66+ $ mform ->hideIf ('config_gitlab_private_token ' , 'config_assignment_type ' , 'eq ' , 'interactive ' );
6267
6368 $ mform ->addElement ('text ' , 'config_gitlab_branch ' , get_string ('gitlab_branch ' , 'block_vmchecker ' ));
64- $ mform ->addRule ('config_gitlab_branch ' , null , 'required ' , null , 'client ' );
6569 $ mform ->settype ('config_gitlab_branch ' , PARAM_TEXT );
6670 $ mform ->setDefault ('config_gitlab_branch ' , 'main ' );
71+ $ mform ->hideIf ('config_gitlab_branch ' , 'config_assignment_type ' , 'eq ' , 'interactive ' );
72+
73+ $ mform ->addElement ('textarea ' , 'config_public_key ' , get_string ('assignment_public_key ' , 'block_vmchecker ' ), 'rows="10" cols="50" wrap="virtual" ' );
74+ $ mform ->setType ('config_public_key ' , PARAM_TEXT );
75+ $ mform ->hideIf ('config_public_key ' , 'config_assignment_type ' , 'eq ' , 'standard ' );
6776
6877 $ courseactivities = get_fast_modinfo ($ this ->page ->course ->id )->get_cms ();
6978 $ assignments = array ();
0 commit comments