solved default method and instruction names

parent ad3a84b0
...@@ -120,10 +120,15 @@ module.exports = { ...@@ -120,10 +120,15 @@ module.exports = {
if (!student.surname || student.surname.length == 0) if (!student.surname || student.surname.length == 0)
student.surname = sails.__({phrase: 'no_surname', locale: student.lang}); student.surname = sails.__({phrase: 'no_surname', locale: student.lang});
student.attributes = Student.getValidAttributes(student.attributes); student.attributes = Student.getValidAttributes(student.attributes);
if (student.lastInstruction && student.lastInstruction[0]) { if (student.lastInstruction && student.lastInstruction[0] && student.lastInstruction[0].met_name) {
student.current_method = student.lastInstruction[0] ? student.lastInstruction[0].met_name : "no_method"; student.current_method = student.lastInstruction[0].met_name;
student.current_instruction = student.lastInstruction[0] ? student.lastInstruction[0].ins_name : "no_instruction"; student.current_instruction = student.lastInstruction[0].ins_name;
} }
else {
student.current_method = "no_method";
student.current_instruction = "no_instruction";
}
delete student.password; delete student.password;
return student; return student;
}, },
......
...@@ -129,6 +129,8 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl( ...@@ -129,6 +129,8 @@ dashboardControllers.controller('StudentSetupCtrl', function StudentSetupCtrl(
$scope.formUser.gender = data.gender; $scope.formUser.gender = data.gender;
$scope.formUser.lang = data.lang; $scope.formUser.lang = data.lang;
$scope.formUser.name = data.name; $scope.formUser.name = data.name;
$scope.studentData.name = data.name;
$scope.studentData.surname = data.surname;
$scope.formUser.notes = data.notes; $scope.formUser.notes = data.notes;
$scope.formUser.surname = data.surname; $scope.formUser.surname = data.surname;
$scope.formUser.username = data.username; $scope.formUser.username = data.username;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment