Replacement String for course section? - desire2learn

Is there a replacement string I can use to target a specific section within a course? I know that I can use {OrgUnitName} as a replacement string for the course name, but is there a replacement string I can use for specific sections within a course?
Thanks!

There doesn't appear to be any course section tokens as of version 10. These are the ones that seem to be available:
orgunitid
orgunittypeid
orgunitpath
orgunitname
orgunitcode
orgid
orgname
userid
username
firstname
lastname
orgdefinedid
email
internalemail
externalemail
roleid
rolecode
rolename

Related

Why AspNetUser create a string id? Id string is method safe?

can someone explain me this please? It's about AspNetUser, when we create a table, it generates an id in string, but how good is it? Isn't it bad in terms of security? Because if I want to show something only with one user, I need to compare my id (int) with id (string), I know it's simple and possible but I just need to convert the int to string, but is this method safe?
I was trying this and it worked but i'm comparing a string.
var userId = User.FindFirstValue(ClaimTypes.NameIdentifier);
var plans = _unitOfWork.Games.GetAll().Where(p => p.UserId.Equals(userId));
return View(plans);
The AspNetUser is a part of ASP.NET Identity, which is a framework that provides authentication and authorization services. The Id column of the AspNetUser table is typically generated as a string (GUID) to ensure that it is unique across all users. Comparing the user ID as a string with another string value (such as the value from ClaimTypes.NameIdentifier) is not a security issue. The string comparison is a simple and efficient way to retrieve the data for a specific user. Converting the user ID to an integer would not provide any additional security benefits, but it may impact performance if the integer comparison involves a large number of operations.
Refrence link:
https://learn.microsoft.com/en-us/dotnet/api/system.identitymodel.claims.claimtypes.nameidentifier?view=netframework-4.8.1
Also :
What are the best practices for using a GUID as a primary key, specifically regarding performance?

Possible problems after changing type of id from string (GUID) to int?

I use ASP.NET Identity 2.0 in my MVC5 project and wanted to change the data type of id field of AspNetUsers from string (GUID) to int because of that I have some tables related to AspNetUsers table. I look at many pages as on How to change type of id in Microsoft.AspNet.Identity.EntityFramework.IdentityUser but it seems to be not easy to apply. On the other hand, I see that changing the data type of id field of AspNetUsers entity will not be enough as there are some pk/fk relations between the other identity types i.e. AspNetUserRoles, ApplicationGroupRoles, etc.. In that case, should I use the original data type for identity tables and change the id type for my tables from int to string? Or how can I change data type of all of the identity tables easily in ASP.NET Identity 2.0? If this is easier in version 3.0 I can also use it.
I want to extend my comment because, few months ago I was trying to do the same.
In my case, I was not sure if I can create relations string -> int, comming from Database first, and used to create relations between productId(int) and userId(int), I wanted to have int ids all over.
Mate you can let userId like string and create relations like this;
public class Customer
{
public int Id {get;set;}
public string Name {get;set;}
public string SalesManId {get;set;}
[ForeignKey("SalesManId ")]
public virtual ApplicationUser SalesMan {get;set;}
}
Here is the Customer Entity, and I have declared a navigation property!
So, the SalesManId is of type string. In this way you can create all your relations with ApplicationUser class.
If you still want to change to int, here is a youtube tutorial, which I followed few months ago and I manged to change from string to int
YouTube tutorial-How to change UserId from string to int

Grails application design

In Grails application i have EmploymentSeeker domain as below :
class EmploymentSeeker {
String fullName
String expYears
Boolean haveDrivingLic
String gender
String eduQualification
String courses
String currentTitle
int age
}
I want to make the user in the create view to add previous references. user may add up to 4 references , but I don't know how to do it - shall I create Emp references domain and link it to employment seeker domain static belongsTo?

Desire2Learn Replace Strings in Content

I understand there is a function called "replace strings" that allow information to be substituted in the D2L tools. What strings are available and can I use them in the content tools?
In the Desire2Learn Content tool the replace strings functionality substitutes at save time and not render time. This limits the applicability of the the replace strings in content.
The replace strings that are available include:
email
externalemail
firstname
internalemail
lastname
orgdefinedid
orgid
orgname
orgunitcode
orgunitid
orgunitname
orgunitpath
orgunittypeid
rolecode
roleid
rolename
userid
username

Inheritance for domain class in Grails or a flag would do?

I am making a website where Doctors and Patient both can login.
class Doctors {
String firstName
String lastName
String email
String password
String hospitalName
String NPINumber
}
And patients
class Patients{
String firstName
String lastName
String email
String password
}
As it is evident that there are lot of overlapping fields which are only used for authetication/login purpose, I was wondering if inheritance is a good idea or should I just create a flag in a single class.
So two options are:
OPTION-1
class Users{
String firstName
String lastName
String email
String password
}
class Doctors extends Users {
String hospitalName
String NPINumber
}
class Patients extends Users{
}
OPTION-2
class Users{
String firstName
String lastName
String email
String password
boolean isDoctor
String NPINumber
String hospitalName
}
I am not sure which of these designs I should choose so that it is extendable in future!
Option 1 is more OO for sure. However, I would still make a little bit of a change in order to make the design even better. Instead of extending User, why not have a User property which contains some of the common attributes. Extending the User class could make your design more complex. Maybe this topic can help you.
Also, as a suggestion, don't use the classes' names in the plural form. Imagine it's an entity for itself and not a collection of entities. Clearly your class Doctor, for example, represents one doctor specifically. Not more than one. So you should use Doctor, Patient and User.
Hope it helps.

Resources