@@ -68,6 +68,12 @@ class Rest extends WebService
68
68
const DELETE_WORK_STUDENT_ITEM = 'delete_work_student_item ' ;
69
69
const DELETE_WORK_CORRECTIONS = 'delete_work_corrections ' ;
70
70
71
+ const VIEW_DOCUMENT_IN_FRAME = 'view_document_in_frame ' ;
72
+
73
+ const VIEW_QUIZ_TOOL = 'view_quiz_tool ' ;
74
+
75
+ const VIEW_SURVEY_TOOL = 'view_survey_tool ' ;
76
+
71
77
const CREATE_CAMPUS = 'add_campus ' ;
72
78
const EDIT_CAMPUS = 'edit_campus ' ;
73
79
const DELETE_CAMPUS = 'delete_campus ' ;
@@ -2858,6 +2864,67 @@ function ($userId) use ($courseId, $sessionId, $workParents, $workIdList) {
2858
2864
);
2859
2865
}
2860
2866
2867
+ public function viewDocumentInFrame (int $ documentId )
2868
+ {
2869
+ $ courseCode = $ this ->course ->getCode ();
2870
+ $ sessionId = $ this ->session ? $ this ->session ->getId () : 0 ;
2871
+
2872
+ $ url = api_get_path (WEB_CODE_PATH ).'document/showinframes.php? '
2873
+ .http_build_query (
2874
+ [
2875
+ 'cidReq ' => $ courseCode ,
2876
+ 'id_session ' => $ sessionId ,
2877
+ 'gidReq ' => 0 ,
2878
+ 'gradebook ' => 0 ,
2879
+ 'origin ' => self ::SERVICE_NAME ,
2880
+ 'id ' => $ documentId ,
2881
+ ]
2882
+ );
2883
+
2884
+ header ("Location: $ url " );
2885
+ exit ;
2886
+ }
2887
+
2888
+ public function viewQuizTool ()
2889
+ {
2890
+ $ courseCode = $ this ->course ->getCode ();
2891
+ $ sessionId = $ this ->session ? $ this ->session ->getId () : 0 ;
2892
+
2893
+ $ url = api_get_path (WEB_CODE_PATH ).'exercise/exercise.php? '
2894
+ .http_build_query (
2895
+ [
2896
+ 'cidReq ' => $ courseCode ,
2897
+ 'id_session ' => $ sessionId ,
2898
+ 'gidReq ' => 0 ,
2899
+ 'gradebook ' => 0 ,
2900
+ 'origin ' => self ::SERVICE_NAME ,
2901
+ ]
2902
+ );
2903
+
2904
+ header ("Location: $ url " );
2905
+ exit ;
2906
+ }
2907
+
2908
+ public function viewSurveyTool ()
2909
+ {
2910
+ $ courseCode = $ this ->course ->getCode ();
2911
+ $ sessionId = $ this ->session ? $ this ->session ->getId () : 0 ;
2912
+
2913
+ $ url = api_get_path (WEB_CODE_PATH ).'survey/survey_list.php? '
2914
+ .http_build_query (
2915
+ [
2916
+ 'cidReq ' => $ courseCode ,
2917
+ 'id_session ' => $ sessionId ,
2918
+ 'gidReq ' => 0 ,
2919
+ 'gradebook ' => 0 ,
2920
+ 'origin ' => self ::SERVICE_NAME ,
2921
+ ]
2922
+ );
2923
+
2924
+ header ("Location: $ url " );
2925
+ exit ;
2926
+ }
2927
+
2861
2928
public static function isAllowedByRequest (bool $ inpersonate = false ): bool
2862
2929
{
2863
2930
$ username = $ _GET ['username ' ] ?? null ;
0 commit comments