Cisco Packet Tracer Extensions API 8.1.0
API for communication between Cisco Packet Tracer application and its extension applications and modules.
Public Member Functions | List of all members
ActivityFile Class Reference

ActivityFile extends from NetworkFile. It adds the activity layer to the file. More...

Inheritance diagram for ActivityFile:
NetworkFile

Public Member Functions

QString getInstruction (int)
 Returns the evaluated instructions at the specified index. More...
 
QString getInstructionSource (int)
 Returns the instruction source at the specified index. More...
 
QString getCurrentInstructionSource ()
 Returns the current intruction source. More...
 
QString getCurrentInstruction ()
 Returns the current evaluated instructions. More...
 
int getInstructionCount ()
 Returns the number of instruction pages. More...
 
void resetActivity ()
 Resets the activity. More...
 
double getPercentageComplete ()
 Returns the percentage complete. More...
 
double getAssessmentItemsCount ()
 Returns the total number of assessment items. More...
 
double getCorrectAssessmentItemsCount ()
 Returns the number of correct assessment items. More...
 
double getAssessmentScoreCount ()
 Returns the total number of assessment scores. More...
 
double getCorrectAssessmentScoreCount ()
 Returns the number of correct assessment scores. More...
 
void runConnectivityTests ()
 Runs the connectivity tests. More...
 
double getConnectivityCount ()
 Returns the total number of connectivity tests. More...
 
QString getLastConnectivityTestResultAt (int)
 Returns the connectivity test result of the last run at index. More...
 
int getLastConnectivityTestCorrectCount ()
 Returns the number of correct connectivity tests at the last run. More...
 
TreeNode getComparatorTree ()
 Returns the assessment item tree. More...
 
TreeNode getAssessedComparatorTree ()
 Returns the item's assessed assessment item tree. More...
 
TreeNode getLastAssessedComparatorTree ()
 Returns the item's last assessed assessment item tree. More...
 
QString nextInstructionPage ()
 Go to the next instruction page and returns the evaluated instruction. More...
 
QString prevInstructionPage ()
 Go to the previous instruction page and returns the evaluated instruction. More...
 
QString removeInstructionPage ()
 Remove the current instruction page and returns the evaluated instruction. More...
 
QString insertInstructionPage ()
 Insert an instruction page and returns the current page evaluated instruction. More...
 
LockingTree getLockingTree ()
 Returns the locking tree. More...
 
NetworkFile getInitNetworkFile ()
 Returns the initial network file. More...
 
NetworkFile getAnsNetworkFile ()
 Returns the answer network file. More...
 
NetworkFile getUserNetworkFile ()
 Returns the user network file. More...
 
NetworkFile getVarNetworkFile ()
 Returns the var network file. More...
 
NetworkFile getCurrentNetworkFile ()
 Returns the current network file in activity wizard, which can be the init, answer, or user network file. More...
 
QString getHashedPassword ()
 Returns the MD5 hash of the activity password. More...
 
vector< QString > getComponentList ()
 Returns the list of components. More...
 
void setCountDownTime (int)
 Sets the countdown time. More...
 
int getCountDownTime ()
 Returns the total countdown time in milliseconds. More...
 
int getCountDownTimeLeft ()
 Returns the countdown time left in milliseconds. More...
 
void setTimerType (ACTIVITYTIMERTYPE)
 Sets the timer type. More...
 
ACTIVITYTIMERTYPE getTimerType ()
 Returns the current timer type. More...
 
DYNAMICTYPE getDynamicPercentageFeedbackType ()
 Returns the dynamic feedback type. More...
 
void setDynamicPF (bool)
 Sets the dynamic feedback to be enabled or disabled. More...
 
bool isDynamicPercentageFeedback ()
 Returns the state of the dynamic feedback. More...
 
VariableManager getVariableManager ()
 Returns the Variable Manager. More...
 
void percentageCompleteChanged (int, int)
 This event is emitted when the percentage complete changes. More...
 
void activityReset ()
 This event is emitted when the percentage complete changes. More...
 
void networkSwitched (ActivityNetworkType)
 This event is emitted when changing between networks, like switching to the answer network or the initial network. More...
 
void networkFileClosing ()
 This event is emitted when the network file is closed, like when testing the pka. More...
 
QString getDyFeedbackString ()
 Returns the dynamic feedback percentage points, percentage score, points, or score. More...
 
double getPercentageCompleteScore ()
 Returns the percentage complete score. More...
 
bool isUserProfileLocked ()
 Returns whether this activity file is profile locked or not. More...
 
void setCompletedFeedback (QString)
 Sets the text shown on activity completion to be the given text. More...
 
QString getCompletedFeedback ()
 Returns the activity completion feedback text. More...
 
void setInCompleteFeedback (QString)
 Sets the text shown on activity is not yet completed. More...
 
QString getIncompleteFeedback ()
 Returns the activity incomplete feedback text. More...
 
int getTimeElapsed ()
 Returns the activity run time. More...
 
void setTimeElapsed (int)
 Sets the activity current run time. More...
 
vector< int > getChallengeKeyAsInts ()
 Get the challenge key for the password. More...
 
QString getChallengeKeyAsBase64 ()
 Get the challenge key for the password. More...
 
bool confirmPassword (QString)
 Confirm the password, only then will IPC work. More...
 
bool isPasswordConfirmed ()
 Check if password is confirmed. More...
 
QString getCertInfo ()
 
bool isActivityFile ()
 Returns whether this file is an activity file or regular network file. More...
 
- Public Member Functions inherited from NetworkFile
QString getSavedFilename ()
 Returns the filename of the currently opened file. More...
 
QString getVersion ()
 Returns the version the current file was saved in. More...
 
QString getNetworkDescription ()
 Returns the network description of the current file. More...
 
void setNetworkDescription (QString)
 Sets the network description for the current file. More...
 
Options getOptions ()
 Returns the option settings of the current file. More...
 
Network getMainNetwork ()
 Returns the network of the current file. More...
 
UserProfile getUserProfile ()
 Returns the user profile of the current file. More...
 
Simulation getMainSimulation ()
 Returns the simulation of the current file. More...
 
Workspace getWorkspace ()
 Returns the workspace of the current file. More...
 
ActivityScriptEngine getActivityScriptEngine ()
 Returns the activity script engine of the current file. More...
 
ActivityScriptEngine getScriptEngine ()
 Returns the script engine of the current file. More...
 
void resetScriptEngine ()
 Removes the current activity script engine and creates a new one. More...
 
bool addScript (QString, QString)
 Adds a script to the activity file. More...
 
bool addScriptFile (QString, QString)
 Adds the script contents to the activity file from a file path. More...
 
void addDefaultScripts ()
 Resets the scripts to the default scripts. More...
 
bool removeScript (QString)
 Removes the specified script from the activity file hash. More...
 
QString getScript (QString)
 Returns the content of the script with the specified ID. More...
 
vector< QString > getScriptIDs ()
 Returns the list of IDs currently in the system. More...
 
bool addScriptDataStore (QString, QString)
 Adds script data store for persistent storage (e.g. constants, options, settings). More...
 
bool removeScriptDataStore (QString)
 Removes the specified script data store for persistent storage (e.g. constants, options, settings). More...
 
QString getScriptDataStore (QString)
 Returns the content of the specified script data store. More...
 
vector< QString > getScriptDataStoreIDs ()
 Returns the list of IDs of script data stores. More...
 
FilterSet getFilterSet ()
 Returns the engine filter set for simulation packets, what is filtered out. More...
 
bool addCustomTrafficType (QString)
 Adds a custom traffic type. Returns true if successful, false otherwise. More...
 
bool hasCustomTrafficType (QString)
 Returns whether a custom traffic type is already added. More...
 
bool addCustomPduType (QString, QString)
 Adds a custom PDU type. Returns true if successful, false otherwise. More...
 
bool hasCustomPduType (QString)
 Returns whether a custom PDU type is already added. More...
 
void duplicateDevice (Device)
 Creates and stores a copy of the given device. More...
 
bool isActivityFile ()
 Returns whether this file is an activity file or regular network file. More...
 

Detailed Description

ActivityFile extends from NetworkFile. It adds the activity layer to the file.

Member Function Documentation

◆ activityReset()

void ActivityFile::activityReset ( )

This event is emitted when the percentage complete changes.

  • oldPercent, the last percentage complete.
  • newPercent, the new percentage complete.

IPC event.

◆ confirmPassword()

bool ActivityFile::confirmPassword ( QString  )

Confirm the password, only then will IPC work.

◆ getAnsNetworkFile()

NetworkFile ActivityFile::getAnsNetworkFile ( )

Returns the answer network file.

Remarks
The answer network file is used to compare against the user network.
Returns
NetworkFile, the answer network file.

◆ getAssessedComparatorTree()

TreeNode ActivityFile::getAssessedComparatorTree ( )

Returns the item's assessed assessment item tree.

Remarks
This tree is compared.
Returns
TreeNode, the item's assessed assessment item tree.

◆ getAssessmentItemsCount()

double ActivityFile::getAssessmentItemsCount ( )

Returns the total number of assessment items.

Returns
double, the total number of assessment items.

◆ getAssessmentScoreCount()

double ActivityFile::getAssessmentScoreCount ( )

Returns the total number of assessment scores.

Returns
double, the total number of assessment scores.

◆ getCertInfo()

QString ActivityFile::getCertInfo ( )

◆ getChallengeKeyAsBase64()

QString ActivityFile::getChallengeKeyAsBase64 ( )

Get the challenge key for the password.

◆ getChallengeKeyAsInts()

vector< int > ActivityFile::getChallengeKeyAsInts ( )

Get the challenge key for the password.

◆ getComparatorTree()

TreeNode ActivityFile::getComparatorTree ( )

Returns the assessment item tree.

    \brief Returns a structure representing users progress towards the completion of this activity.
    \param refresh - refresh results obtained from the most recent call to this method.
    \param format - defines string representation for the information: "json", "xml", etc.
    \return int, the number of correct connectivity tests at the last run.

    \NOT PORTED TO PT DESKTOP

QString getActivityProgressInfo(bool refresh, QString format) - PrivActivityWizard;

Remarks
This tree defines what assessment items can be and what is currently being assessed by this activity.
Returns
TreeNode, the assessment item tree.

◆ getCompletedFeedback()

QString ActivityFile::getCompletedFeedback ( )

Returns the activity completion feedback text.

Returns
QString, the activity completion feedback text.

◆ getComponentList()

vector< QString > ActivityFile::getComponentList ( )

Returns the list of components.

Returns
vector<QString>, the list of components.

◆ getConnectivityCount()

double ActivityFile::getConnectivityCount ( )

Returns the total number of connectivity tests.

Returns
double, the the total number of connectivity tests.

◆ getCorrectAssessmentItemsCount()

double ActivityFile::getCorrectAssessmentItemsCount ( )

Returns the number of correct assessment items.

Returns
double, the number of correct assessment items.

◆ getCorrectAssessmentScoreCount()

double ActivityFile::getCorrectAssessmentScoreCount ( )

Returns the number of correct assessment scores.

Returns
double, the number of correct assessment scores.

◆ getCountDownTime()

int ActivityFile::getCountDownTime ( )

Returns the total countdown time in milliseconds.

Returns
int, the total countdown time in milliseconds.

◆ getCountDownTimeLeft()

int ActivityFile::getCountDownTimeLeft ( )

Returns the countdown time left in milliseconds.

Returns
int, countdown time left in milliseconds.

◆ getCurrentInstruction()

QString ActivityFile::getCurrentInstruction ( )

Returns the current evaluated instructions.

Returns
QString, the current evaluated instructions.

◆ getCurrentInstructionSource()

QString ActivityFile::getCurrentInstructionSource ( )

Returns the current intruction source.

Returns
QString, the current intruction source.

◆ getCurrentNetworkFile()

NetworkFile ActivityFile::getCurrentNetworkFile ( )

Returns the current network file in activity wizard, which can be the init, answer, or user network file.

Returns
NetworkFile, the current network file.

◆ getDyFeedbackString()

QString ActivityFile::getDyFeedbackString ( )

Returns the dynamic feedback percentage points, percentage score, points, or score.

Returns
QString, the dynamic feedback if the type is not set to NOFEEDBACK, otherwise an empty string.

◆ getDynamicPercentageFeedbackType()

DYNAMICTYPE ActivityFile::getDynamicPercentageFeedbackType ( )

Returns the dynamic feedback type.

Returns
enum<DYNAMICTYPE>, the dynamic feedback type. Dynamic feedback types: NOFEEDBACK = 0, PERCENTAGEPOINT = 1, PERCENTAGESCORE = 2, POINTS = 3, SCORE = 4

◆ getHashedPassword()

QString ActivityFile::getHashedPassword ( )

Returns the MD5 hash of the activity password.

Returns
QString, the MD5 hash of the activity password.

◆ getIncompleteFeedback()

QString ActivityFile::getIncompleteFeedback ( )

Returns the activity incomplete feedback text.

Returns
QString, the activity incomplete completion feedback text.

◆ getInitNetworkFile()

NetworkFile ActivityFile::getInitNetworkFile ( )

Returns the initial network file.

Remarks
The initial network file is the starting network file. It is used to replace the user network on a new activity or when the user resets the activity.
Returns
NetworkFile, the initial network file.

◆ getInstruction()

QString ActivityFile::getInstruction ( int  )

Returns the evaluated instructions at the specified index.

Parameters
index,theinstruction page index. -1 returns the current page.
Returns
QString, the evaluated instructions at the specified index.

◆ getInstructionCount()

int ActivityFile::getInstructionCount ( )

Returns the number of instruction pages.

Returns
int, the number of instruction pages.

◆ getInstructionSource()

QString ActivityFile::getInstructionSource ( int  )

Returns the instruction source at the specified index.

Parameters
index,theinstruction page index.
Returns
QString, the instruction source at the specified index.

◆ getLastAssessedComparatorTree()

TreeNode ActivityFile::getLastAssessedComparatorTree ( )

Returns the item's last assessed assessment item tree.

Remarks
This tree is compared.
Returns
TreeNode, the item's last assessed assessment item tree.

◆ getLastConnectivityTestCorrectCount()

int ActivityFile::getLastConnectivityTestCorrectCount ( )

Returns the number of correct connectivity tests at the last run.

Returns
int, the number of correct connectivity tests at the last run.

◆ getLastConnectivityTestResultAt()

QString ActivityFile::getLastConnectivityTestResultAt ( int  )

Returns the connectivity test result of the last run at index.

Remarks
Valid strings are:
  • "Correct" - correct
  • "Incorrect" - incorrect
  • "Do Not Test" - the connectivity test is not configured to be tested
  • "" - the connectivity test has not been ran yet
Returns
QString, the connectivity test result at index.

◆ getLockingTree()

LockingTree ActivityFile::getLockingTree ( )

Returns the locking tree.

Returns
LockingTree, the locking tree.

◆ getPercentageComplete()

double ActivityFile::getPercentageComplete ( )

Returns the percentage complete.

Returns
double, the percentage complete.

◆ getPercentageCompleteScore()

double ActivityFile::getPercentageCompleteScore ( )

Returns the percentage complete score.

Returns
double, the percentage complete score.

◆ getTimeElapsed()

int ActivityFile::getTimeElapsed ( )

Returns the activity run time.

Returns
int, how long the activity has been running, in milliseconds.

◆ getTimerType()

ACTIVITYTIMERTYPE ActivityFile::getTimerType ( )

Returns the current timer type.

Returns
enum<TIMER_TYPE>, the current timer type. Timer types: ELAPSED = 0, COUNTDOWN = 1, NONE = 2

◆ getUserNetworkFile()

NetworkFile ActivityFile::getUserNetworkFile ( )

Returns the user network file.

Remarks
The user network file is the network file that the user works with during an activity.
Returns
NetworkFile, the user network file.

◆ getVariableManager()

VariableManager ActivityFile::getVariableManager ( )

Returns the Variable Manager.

Returns
VariableManager, the Variable Manager.

◆ getVarNetworkFile()

NetworkFile ActivityFile::getVarNetworkFile ( )

Returns the var network file.

Returns
NetworkFile, the var network file.

◆ insertInstructionPage()

QString ActivityFile::insertInstructionPage ( )

Insert an instruction page and returns the current page evaluated instruction.

Returns
QString, the evaluated instructions on the current page.

◆ isActivityFile()

bool ActivityFile::isActivityFile ( )

Returns whether this file is an activity file or regular network file.

◆ isDynamicPercentageFeedback()

bool ActivityFile::isDynamicPercentageFeedback ( )

Returns the state of the dynamic feedback.

Returns
bool, true if dynamic percentage feedback is enabled, otherwise false.

◆ isPasswordConfirmed()

bool ActivityFile::isPasswordConfirmed ( )

Check if password is confirmed.

◆ isUserProfileLocked()

bool ActivityFile::isUserProfileLocked ( )

Returns whether this activity file is profile locked or not.

Returns
bool, true if the user profile is locked and false if not.

◆ networkFileClosing()

void ActivityFile::networkFileClosing ( )

This event is emitted when the network file is closed, like when testing the pka.

IPC event.

◆ networkSwitched()

void ActivityFile::networkSwitched ( ActivityNetworkType  )

This event is emitted when changing between networks, like switching to the answer network or the initial network.

IPC event.

◆ nextInstructionPage()

QString ActivityFile::nextInstructionPage ( )

Go to the next instruction page and returns the evaluated instruction.

Returns
QString, the evaluated instructions the next page.

◆ percentageCompleteChanged()

void ActivityFile::percentageCompleteChanged ( int  ,
int   
)

This event is emitted when the percentage complete changes.

  • oldPercent, the last percentage complete.
  • newPercent, the new percentage complete.

IPC event.

◆ prevInstructionPage()

QString ActivityFile::prevInstructionPage ( )

Go to the previous instruction page and returns the evaluated instruction.

Returns
QString, the evaluated instructions the previous page.

◆ removeInstructionPage()

QString ActivityFile::removeInstructionPage ( )

Remove the current instruction page and returns the evaluated instruction.

Returns
QString, the evaluated instructions on the page after the removal.

◆ resetActivity()

void ActivityFile::resetActivity ( )

Resets the activity.

◆ runConnectivityTests()

void ActivityFile::runConnectivityTests ( )

Runs the connectivity tests.

Remarks
Use getLastConnectivityTestResultAt() and getLastConnectivityTestCorrectCount() to get results afterwards.

◆ setCompletedFeedback()

void ActivityFile::setCompletedFeedback ( QString  )

Sets the text shown on activity completion to be the given text.

Parameters
str,thetext to use for activity completion message.

◆ setCountDownTime()

void ActivityFile::setCountDownTime ( int  )

Sets the countdown time.

Parameters
ms,countdowntime in milliseconds.

◆ setDynamicPF()

void ActivityFile::setDynamicPF ( bool  )

Sets the dynamic feedback to be enabled or disabled.

Parameters
enable,trueenables dynamic percentage feedback, false disables it.

◆ setInCompleteFeedback()

void ActivityFile::setInCompleteFeedback ( QString  )

Sets the text shown on activity is not yet completed.

Parameters
str,thetext to use for activity incomplete message.

◆ setTimeElapsed()

void ActivityFile::setTimeElapsed ( int  )

Sets the activity current run time.

Parameters
ms,runtimetime in milliseconds.

◆ setTimerType()

void ActivityFile::setTimerType ( ACTIVITYTIMERTYPE  )

Sets the timer type.

Parameters
e,thetype of timer. Timer types: ELAPSED = 0, COUNTDOWN = 1, NONE = 2

The documentation for this class was generated from the following file: