Permalink
Browse files

Merge branch 'MDL-58628-32' of git://github.com/jleyva/moodle into MO…

…ODLE_32_STABLE
  • Loading branch information...
dmonllao committed Apr 27, 2017
2 parents 070262c + c35f42e commit c1d089b1beadda2b3ede6f29556ec384525309c6
Showing with 14 additions and 15 deletions.
  1. +8 −9 mod/quiz/classes/external.php
  2. +6 −6 mod/quiz/tests/external_test.php
@@ -110,7 +110,11 @@ public static function get_quizzes_by_courses($courseids = array()) {
$quizdetails['introfiles'] = external_util::get_area_files($context->id, 'mod_quiz', 'intro', false, false);
$viewablefields = array('timeopen', 'timeclose', 'grademethod', 'section', 'visible', 'groupmode',
'groupingid');
'groupingid', 'attempts', 'timelimit', 'grademethod', 'decimalpoints',
'questiondecimalpoints', 'sumgrades', 'grade', 'preferredbehaviour');
// Some times this function returns just empty.
$hasfeedback = quiz_has_feedback($quiz);
$quizdetails['hasfeedback'] = (!empty($hasfeedback)) ? 1 : 0;
$timenow = time();
$quizobj = quiz::create($quiz->id, $USER->id);
@@ -119,20 +123,15 @@ public static function get_quizzes_by_courses($courseids = array()) {
// Fields the user could see if have access to the quiz.
if (!$accessmanager->prevent_access()) {
// Some times this function returns just empty.
$hasfeedback = quiz_has_feedback($quiz);
$quizdetails['hasfeedback'] = (!empty($hasfeedback)) ? 1 : 0;
$quizdetails['hasquestions'] = (int) $quizobj->has_questions();
$quizdetails['autosaveperiod'] = get_config('quiz', 'autosaveperiod');
$additionalfields = array('timelimit', 'attempts', 'attemptonlast', 'grademethod', 'decimalpoints',
'questiondecimalpoints', 'reviewattempt', 'reviewcorrectness', 'reviewmarks',
$additionalfields = array('attemptonlast', 'reviewattempt', 'reviewcorrectness', 'reviewmarks',
'reviewspecificfeedback', 'reviewgeneralfeedback', 'reviewrightanswer',
'reviewoverallfeedback', 'questionsperpage', 'navmethod', 'sumgrades', 'grade',
'reviewoverallfeedback', 'questionsperpage', 'navmethod',
'browsersecurity', 'delay1', 'delay2', 'showuserpicture', 'showblocks',
'completionattemptsexhausted', 'completionpass', 'overduehandling',
'graceperiod', 'preferredbehaviour', 'canredoquestions',
'allowofflineattempts');
'graceperiod', 'canredoquestions', 'allowofflineattempts');
$viewablefields = array_merge($viewablefields, $additionalfields);
}
@@ -192,15 +192,15 @@ public function test_mod_quiz_get_quizzes_by_courses() {
// Create what we expect to be returned when querying the two courses.
// First for the student user.
$allusersfields = array('id', 'coursemodule', 'course', 'name', 'intro', 'introformat', 'introfiles', 'timeopen',
'timeclose', 'grademethod', 'section', 'visible', 'groupmode', 'groupingid');
$userswithaccessfields = array('timelimit', 'attempts', 'attemptonlast', 'grademethod', 'decimalpoints',
'questiondecimalpoints', 'reviewattempt', 'reviewcorrectness', 'reviewmarks',
'timeclose', 'grademethod', 'section', 'visible', 'groupmode', 'groupingid',
'attempts', 'timelimit', 'grademethod', 'decimalpoints', 'questiondecimalpoints', 'sumgrades',
'grade', 'preferredbehaviour', 'hasfeedback');
$userswithaccessfields = array('attemptonlast', 'reviewattempt', 'reviewcorrectness', 'reviewmarks',
'reviewspecificfeedback', 'reviewgeneralfeedback', 'reviewrightanswer',
'reviewoverallfeedback', 'questionsperpage', 'navmethod', 'sumgrades', 'grade',
'reviewoverallfeedback', 'questionsperpage', 'navmethod',
'browsersecurity', 'delay1', 'delay2', 'showuserpicture', 'showblocks',
'completionattemptsexhausted', 'completionpass', 'autosaveperiod', 'hasquestions',
'hasfeedback', 'overduehandling', 'graceperiod', 'preferredbehaviour', 'canredoquestions',
'allowofflineattempts');
'overduehandling', 'graceperiod', 'canredoquestions', 'allowofflineattempts');
$managerfields = array('shuffleanswers', 'timecreated', 'timemodified', 'password', 'subnet');
// Add expected coursemodule and other data.

0 comments on commit c1d089b

Please sign in to comment.