function createRating(totalPoints) {
  var ratingElem = document.getElementById('modal-rating');
  var totalStars;
  if (totalPoints <= 150) {
    totalStars = 1;
  } else if (totalPoints > 150 && totalPoints <= 300) {
    totalStars = 2;
  } else if (totalPoints > 300 && totalPoints <= 450) {
    totalStars = 3;
  } else if (totalPoints > 450 && totalPoints <= 600) {
    totalStars = 4;
  } else if (totalPoints > 600) {
    totalStars = 5;
  }
  for (var i = 0; i < totalStars; i++) {
    var star = document.createElement('img');
    star.setAttribute('class', 'star');
    star.setAttribute('src', 'img/star.gif');
    ratingElem.appendChild(star);
  }
}
/* CREATE A STAR RATING DEPENDING ON MOVES COUNT */
CREATE A STAR RATING DEPENDING ON MOVES COUNT
CREATE A STAR RATING DEPENDING ON MOVES COUNT
function createRating(totalPoints) {
  var ratingElem = document.getElementById('modal-rating');
  var totalStars;
  if (totalPoints <= 150) {
    totalStars = 1;
  } else if (totalPoints > 150 && totalPoints <= 300) {
    totalStars = 2;
  } else if (totalPoints > 300 && totalPoints <= 450) {
    totalStars = 3;
  } else if (totalPoints > 450 && totalPoints <= 600) {
    totalStars = 4;
  } else if (totalPoints > 600) {
    totalStars = 5;
  }
  for (var i = 0; i < totalStars; i++) {
    var star = document.createElement('img');
    star.setAttribute('class', 'star');
    star.setAttribute('src', 'img/star.gif');
    ratingElem.appendChild(star);
  }
}
function createRating ( totalPoints ) { var ratingElem = document . getElementById ( 'modal-rating' ) ; var totalStars ; if ( totalPoints <= 150 ) { totalStars = 1 ; } else if ( totalPoints > 150 && totalPoints <= 300 ) { totalStars = 2 ; } else if ( totalPoints > 300 && totalPoints <= 450 ) { totalStars = 3 ; } else if ( totalPoints > 450 && totalPoints <= 600 ) { totalStars = 4 ; } else if ( totalPoints > 600 ) { totalStars = 5 ; } for ( var i = 0 ; i < totalStars ; i ++ ) { var star = document . createElement ( 'img' ) ; star . setAttribute ( 'class' , 'star' ) ; star . setAttribute ( 'src' , 'img/star.gif' ) ; ratingElem . appendChild ( star ) ; } }
CREATE A STAR RATING DEPENDING ON MOVES COUNT
CREATE A STAR RATING DEPENDING ON MOVES COUNT