Converted tabs to spaces for the grade subplugin
This commit is contained in:
parent
1d7c5b2c56
commit
930179e093
1 changed files with 29 additions and 29 deletions
|
@ -92,8 +92,8 @@ class customcert_element_grade extends customcert_element_base {
|
||||||
|
|
||||||
// Array of data we will be storing in the database.
|
// Array of data we will be storing in the database.
|
||||||
$arrtostore = array(
|
$arrtostore = array(
|
||||||
'gradeitem' => $gradeitem,
|
'gradeitem' => $gradeitem,
|
||||||
'gradeformat' => $gradeformat
|
'gradeformat' => $gradeformat
|
||||||
);
|
);
|
||||||
|
|
||||||
// Encode these variables before saving into the DB.
|
// Encode these variables before saving into the DB.
|
||||||
|
@ -118,35 +118,35 @@ class customcert_element_grade extends customcert_element_base {
|
||||||
* @return array the array of gradeable items in the course
|
* @return array the array of gradeable items in the course
|
||||||
*/
|
*/
|
||||||
public function get_grade_items() {
|
public function get_grade_items() {
|
||||||
global $COURSE, $DB;
|
global $COURSE, $DB;
|
||||||
|
|
||||||
$strtopic = get_string("topic");
|
$strtopic = get_string("topic");
|
||||||
$strweek = get_string("week");
|
$strweek = get_string("week");
|
||||||
$strsection = get_string("section");
|
$strsection = get_string("section");
|
||||||
|
|
||||||
// Array to store the grade items.
|
// Array to store the grade items.
|
||||||
$modules = array();
|
$modules = array();
|
||||||
$modules['coursegrade'] = get_string('coursegrade', 'customcertelement_grade');
|
$modules['coursegrade'] = get_string('coursegrade', 'customcertelement_grade');
|
||||||
|
|
||||||
// Collect course modules data
|
// Collect course modules data
|
||||||
$modinfo = get_fast_modinfo($COURSE);
|
$modinfo = get_fast_modinfo($COURSE);
|
||||||
$mods = $modinfo->get_cms();
|
$mods = $modinfo->get_cms();
|
||||||
$sections = $modinfo->get_section_info_all();
|
$sections = $modinfo->get_section_info_all();
|
||||||
|
|
||||||
// Create the section label depending on course format.
|
// Create the section label depending on course format.
|
||||||
switch ($COURSE->format) {
|
switch ($COURSE->format) {
|
||||||
case "topics": $sectionlabel = $strtopic;
|
case "topics": $sectionlabel = $strtopic;
|
||||||
case "weeks": $sectionlabel = $strweek;
|
case "weeks": $sectionlabel = $strweek;
|
||||||
default: $sectionlabel = $strsection;
|
default: $sectionlabel = $strsection;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Loop through each course section.
|
// Loop through each course section.
|
||||||
for ($i = 0; $i <= count($sections) - 1; $i++) {
|
for ($i = 0; $i <= count($sections) - 1; $i++) {
|
||||||
// Confirm the index exists, should always be true.
|
// Confirm the index exists, should always be true.
|
||||||
if (isset($sections[$i])) {
|
if (isset($sections[$i])) {
|
||||||
// Get the individual section.
|
// Get the individual section.
|
||||||
$section = $sections[$i];
|
$section = $sections[$i];
|
||||||
// Get the mods for this section.
|
// Get the mods for this section.
|
||||||
$sectionmods = explode(",", $section->sequence);
|
$sectionmods = explode(",", $section->sequence);
|
||||||
// Loop through the section mods.
|
// Loop through the section mods.
|
||||||
foreach ($sectionmods as $sectionmod) {
|
foreach ($sectionmods as $sectionmod) {
|
||||||
|
@ -166,10 +166,10 @@ class customcert_element_grade extends customcert_element_base {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $modules;
|
return $modules;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -178,11 +178,11 @@ class customcert_element_grade extends customcert_element_base {
|
||||||
* @return array returns an array of grade formats
|
* @return array returns an array of grade formats
|
||||||
*/
|
*/
|
||||||
function get_grade_format_options() {
|
function get_grade_format_options() {
|
||||||
$gradeformat = array();
|
$gradeformat = array();
|
||||||
$gradeformat[1] = get_string('gradepercent', 'customcertelement_grade');
|
$gradeformat[1] = get_string('gradepercent', 'customcertelement_grade');
|
||||||
$gradeformat[2] = get_string('gradepoints', 'customcertelement_grade');
|
$gradeformat[2] = get_string('gradepoints', 'customcertelement_grade');
|
||||||
$gradeformat[3] = get_string('gradeletter', 'customcertelement_grade');
|
$gradeformat[3] = get_string('gradeletter', 'customcertelement_grade');
|
||||||
|
|
||||||
return $gradeformat;
|
return $gradeformat;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue