Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-66863

Unable to update to 3.7.2+ from 3.7.1 due to local changes?

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Not a bug
    • Affects Version/s: 3.7.1
    • Fix Version/s: None
    • Component/s: Quiz
    • Labels:
      None
    • Database:
      MySQL
    • Affected Branches:
      MOODLE_37_STABLE

      Description

      When trying to perform a git pull on the moodle directory to download the latest updates, I get the following error:

      Updating 79bd60b..8b89ab5
       error: Your local changes to the following files would be overwritten by merge:
       {{ mod/quiz/review.php}}
       Please, commit your changes or stash them before you can merge.
       Aborting

       

      I have not performed any local changes to this file, I have no idea what these changes are. Performing a git diff on this file, I get the following:

      diff --git a/mod/quiz/review.php b/mod/quiz/review.php
       index 28e94b0..e2f640c 100644
       --- a/mod/quiz/review.php
       +++ b/mod/quiz/review.php
       @@ -187,6 +187,17 @@ if (!empty($overtime)) {
      {{ // Show marks (if the user is allowed to see marks at the moment).}}
       {{ $grade = quiz_rescale_grade($attempt->sumgrades, $quiz, false);}}
       +$additional_summary_data = $attemptobj->get_additional_summary_data($options);
       +$cbmattempt = array_key_exists('cbmdata',$additional_summary_data);
       +if($cbmattempt) {
       + $cbmdata = $additional_summary_data['cbmdata'];
       + //Scale CB grade to $quiz->grade
       + $a = new stdClass();
       + $a->grade = html_writer::tag('b', quiz_format_grade($quiz, $cbmdata['cbgradefraction'] * $quiz->grade));
       + $a->maxgrade = quiz_format_grade($quiz, $quiz->grade);
       + $formattedgrade = get_string('cbgradeoutof', 'qbehaviour_deferredcbm', $a);
       + $additional_summary_data['qbehaviour_cbm_entire_quiz_cb_grade']['content'] = $formattedgrade;
       +}
       {{ if ($options->marks >= question_display_options::MARK_AND_MAX && quiz_has_grades($quiz)) {}}
      {{ if ($attempt->state != quiz_attempt::FINISHED) {}}
       @@ 199,10 +210,42 @@ if ($options>marks >= question_display_options::MARK_AND_MAX && quiz_has_grades
       {{ );}}
      {{ } else {}}
       + // Default values without CBM
       + $marks = $attempt->sumgrades;
       + $showgrade = $grade;
       + $percent = $marks * 100 / $quiz->sumgrades;
       + // Handle if quiz and/or attempt use CBM
       + $cbmquiz = ($quiz->preferredbehaviour === 'immediatecbm') || ($quiz->preferredbehaviour === 'deferredcbm');
       + if ($cbmattempt) {
       + // Attempt was done with CBM
       + if ($cbmquiz) {
       + $marks = $cbmdata['averagecbm'] * $quiz->sumgrades;
       + $showgrade = $cbmdata['gradefraction'] * $quiz->grade;
       + $percent = $cbmdata['gradefraction'] * 100;
       {{+ }}}
       + else {
       + $marks = $cbmdata['accuracy'] * $quiz->sumgrades;
       + $showgrade = $cbmdata['accuracy'] * $quiz->grade;
       + $percent = $cbmdata['accuracy'] * 100;
       + $additional_summary_data['qbehaviour_cbm_grade_explanation'] = array(
       + 'title' => '',
       + 'content' => get_string('attemptwithcbm', 'qbehaviour_deferredcbm'),
       + );
       {{+ }}}
       {{+ }}}
       + else {
       + if ($cbmquiz) {
       + $additional_summary_data['qbehaviour_cbm_grade_explanation'] = array(
       + 'title' => '',
       + 'content' => get_string('attemptwithoutcbm', 'qbehaviour_deferredcbm'),
       + );
       {{+ }}}
       {{+ }}}
       +
       {{ // Show raw marks only if they are different from the grade (like on the view page).}}
       {{ if ($quiz->grade != $quiz->sumgrades) {}}
       {{ $a = new stdClass();}}
       - $a->grade = quiz_format_grade($quiz, $attempt->sumgrades);
       + $a->grade = quiz_format_grade($quiz, $marks);
       {{ $a->maxgrade = quiz_format_grade($quiz, $quiz->sumgrades);}}
       {{ $summarydata['marks'] = array(}}
       {{ 'title' => get_string('marks', 'quiz'),}}
       @@ 212,11 +255,11 @@ if ($options>marks >= question_display_options::MARK_AND_MAX && quiz_has_grades
      {{ // Now the scaled grade.}}
       {{ $a = new stdClass();}}
       - $a->grade = html_writer::tag('b', quiz_format_grade($quiz, $grade));
       + $a->grade = html_writer::tag('b', quiz_format_grade($quiz, $showgrade));
       {{ $a->maxgrade = quiz_format_grade($quiz, $quiz->grade);}}
       {{ if ($quiz->grade != 100) {}}
       {{ $a->percent = html_writer::tag('b', format_float(}}
       - $attempt->sumgrades * 100 / $quiz->sumgrades, 0));
       + $percent, 0));
       {{ $formattedgrade = get_string('outofpercent', 'quiz', $a);}}
       {{ } else {}}
       {{ $formattedgrade = get_string('outof', 'quiz', $a);}}
       @@ 229,7 +272,7 @@ if ($options>marks >= question_display_options::MARK_AND_MAX && quiz_has_grades
       {{ }}}
      {{ // Any additional summary data from the behaviour.}}
       $summarydata = array_merge($summarydata, $attemptobj>get_additional_summary_data($options));
       +$summarydata = array_merge($summarydata, $additional_summary_data);
      {{ // Feedback if there is any, and the user is allowed to see it now.}}
       {{ $feedback = $attemptobj->get_overall_feedback($grade);}}
      

       

      I'm not sure what has changed or how to resolve this.

      Your prompt assistance is greatly appreciated.

      Cheers,
      Ray

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            uncleraymondo UncleRaymondo
            Participants:
            Component watchers:
            Tim Hunt, Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: