-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexternallib.php
45 lines (38 loc) · 1.36 KB
/
externallib.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
defined('MOODLE_INTERNAL') || die();
require_once("$CFG->libdir/externallib.php");
class filter_siyavula_external extends external_api {
public static function save_activity_data_parameters() {
return new external_function_parameters(
array(
'questionid' => new external_value(PARAM_RAW, ''),
'activityid' => new external_value(PARAM_RAW, ''),
'responseid' => new external_value(PARAM_RAW, '')
)
);
}
/**
* Function get courses in tgas relations, event gallery for webservice.
* @return external_function_parameters
*/
public static function save_activity_data($questionid, $activityid, $responseid) {
global $DB;
if ($options = $DB->get_record('question_siyavulaqt', array('question' => $questionid))) {
$options->activityid = $activityid;
$options->responseid = $responseid;
$DB->update_record('question_siyavulaqt', $options);
}
return array('response' => 'success');
}
/**
* Return info data tags and course info
* @return tag_courses_returns
*/
public static function save_activity_data_returns(){
return new external_single_structure(
array(
'response' => new external_value(PARAM_RAW, '')
)
);
}
}