I can't use if & else & var


#1
$scope.hesapla = function(midterm1,midterm2,speaking,reading,quiz,portfolio,kanaat,oralexam,proje,islem){


 

if(midterm2){
  var islem=0 (midterm2=1);
}else{
  islem=midterm2*20/100
}



$scope.cvp=(midterm1*20/100)+(midterm2*20/100)+(quiz*10/100)+(reading*10/100)+(speaking*10/100)+(portfolio*10/100)+(proje*8/100)+(oralexam*7/100)+(kanaat*5/100);
}

})

Here is my code, but it doesn't work how can I solve this.