/* Dont listen to what the user says about his name / type / level -
 *	rely on the user model's opinion
 */
u_mdl_thinks(user_name, nokey, _User_name, _Who_set) :-
	( abolish(user_name,1) ; true ),
	assert(user_name(_User_name)).

u_mdl_thinks(user_type, nokey, _User_type, _Who_set) :- %% new user_type
	( called(_Cpt_set),			%% redo existing cpt sets
		_Pred=..[_Cpt_set, refresh],
		_Pred,
		fail
	;
		true				 %% replaced
	).

u_mdl_thinks(user_level, nokey, _User_level, _Who_set) :-
	( intro(_User_level) ; abolish(user_level,1) ),
	assert(user_level(_User_level)).  /*for speed in feedback selection*/



intro(expert) :-
	user_name(_User_name),
	chat_usr([
		['Hi ',_User_name,'.'],
		'What is the problem this time?',
		'']),
	retract(intro(expert)).		% leave novice mesage in case needed
intro(novice) :-
	user_name(_User_name),
	chat_usr([
		['Hi ',_User_name,'.'],
		'Just fill in the forms, changing defaults if you',
		'want, as I will ask on the forms for any data I',
		'need.  I will try not to ask too many questions!',
		'Anytime I want to chat to you, I will place the',
		'message in this box.  Urgent messages will also',
		'be placed in a popup box near the field causing',
		'the problem. Click in the box to make it go away.',
		'']),
	abolish(intro,1).

project(help).	%%%%% stupid form package
project(description).	%%%%% stupid form package
project( _Project) :-			/* existing project */
	proj_exists(_Project, _Session, _Started, _Data, _LogFile),
	kset(session, _Session),
	kset(started, _Started),
	ask_usr(session, _Session),
	ask_usr(started, _Started),
	[_Data],		%%%%% retrieve existing master cpts!!!!!
	( called(_Cpt_set),		%% set up previously done cpt sets
		_Pred=..[_Cpt_set, refresh],
		_Pred,
		fail
	;
		true				 %% replaced
	),
	to_bb(load_log, _Log),
	uset(project, _Project),
	focus_concept(master,uc_startup),
	start_session.

project(_Project) :-		/* new project */
	kset(session, 1),
	get_date(_Date),
	kset(started, _Date),
	ask_usr(session, 1),
	ask_usr(started, _Date),
	uset(project, _Project),
	focus_concept(master,uc_startup),
	start_session.

