Minor fixes and updated ksoap2-library
git-svn-id: https://forja.rediris.es/svn/cusl6-swadroid/trunk@172 5bc14d19-1e4b-4ba2-aa50-860af135f48c
This commit is contained in:
parent
d5869ac87c
commit
bee2c9dc04
|
@ -148,21 +148,21 @@ public final class R {
|
|||
public static final int coursesProgressDescription=0x7f07001e;
|
||||
public static final int coursesProgressTitle=0x7f07001d;
|
||||
public static final int dateMsg=0x7f070031;
|
||||
public static final int errorBadLoginMsg=0x7f070050;
|
||||
public static final int errorConnectionMsg=0x7f070052;
|
||||
public static final int errorBadLoginMsg=0x7f070051;
|
||||
public static final int errorConnectionMsg=0x7f070053;
|
||||
public static final int errorCopyMsg_DB=0x7f070021;
|
||||
public static final int errorMsgLaunchingActivity=0x7f07001f;
|
||||
public static final int errorMsgNoConnection=0x7f070022;
|
||||
public static final int errorMsgWorkaroundEmulator=0x7f070020;
|
||||
public static final int errorServerResponseMsg=0x7f070051;
|
||||
public static final int errorTimeoutMsg=0x7f070053;
|
||||
public static final int errorServerResponseMsg=0x7f070052;
|
||||
public static final int errorTimeoutMsg=0x7f070054;
|
||||
public static final int evaluation=0x7f07002c;
|
||||
public static final int examAnnouncement=0x7f070025;
|
||||
public static final int falseMsg=0x7f070037;
|
||||
public static final int firstRunMsg=0x7f07004e;
|
||||
public static final int firstRunMsg=0x7f07004f;
|
||||
public static final int forumReply=0x7f070029;
|
||||
public static final int fromMsg=0x7f070030;
|
||||
public static final int initialDialogTitle=0x7f07004d;
|
||||
public static final int initialDialogTitle=0x7f07004e;
|
||||
public static final int loginModuleLabel=0x7f070001;
|
||||
public static final int loginProgressDescription=0x7f070017;
|
||||
public static final int loginProgressTitle=0x7f070016;
|
||||
|
@ -190,26 +190,27 @@ public final class R {
|
|||
public static final int selectCourseTitle=0x7f07003b;
|
||||
public static final int set_preferences=0x7f070007;
|
||||
public static final int survey=0x7f07002e;
|
||||
public static final int testAnswerTypesMsg=0x7f070045;
|
||||
public static final int testEvaluateMsg=0x7f070047;
|
||||
public static final int testNoAnswerTypesSelectedMsg=0x7f070046;
|
||||
public static final int testNoDetailsMsg=0x7f07004b;
|
||||
public static final int testAnswerTypesMsg=0x7f070046;
|
||||
public static final int testEvaluateMsg=0x7f070048;
|
||||
public static final int testNoAnswerTypesSelectedMsg=0x7f070047;
|
||||
public static final int testNoDetailsMsg=0x7f07004c;
|
||||
public static final int testNoQuestionsCourseMsg=0x7f070040;
|
||||
public static final int testNoQuestionsMeetsSpecifiedCriteriaMsg=0x7f070042;
|
||||
public static final int testNoQuestionsMsg=0x7f070041;
|
||||
public static final int testNoResultsMsg=0x7f07004c;
|
||||
public static final int testNoTagsSelectedMsg=0x7f070044;
|
||||
public static final int testNumQuestionsMsg=0x7f070042;
|
||||
public static final int testResultsTextMsg=0x7f070048;
|
||||
public static final int testShowResultsDetailsMsg=0x7f07004a;
|
||||
public static final int testShowResultsMsg=0x7f070049;
|
||||
public static final int testTagsMsg=0x7f070043;
|
||||
public static final int testNoResultsMsg=0x7f07004d;
|
||||
public static final int testNoTagsSelectedMsg=0x7f070045;
|
||||
public static final int testNumQuestionsMsg=0x7f070043;
|
||||
public static final int testResultsTextMsg=0x7f070049;
|
||||
public static final int testShowResultsDetailsMsg=0x7f07004b;
|
||||
public static final int testShowResultsMsg=0x7f07004a;
|
||||
public static final int testTagsMsg=0x7f070044;
|
||||
public static final int testsDownloadProgressDescription=0x7f07001c;
|
||||
public static final int testsDownloadProgressTitle=0x7f07001b;
|
||||
public static final int testsModuleLabel=0x7f070004;
|
||||
public static final int title_error_dialog=0x7f070005;
|
||||
public static final int trueMsg=0x7f070036;
|
||||
public static final int unknownNotification=0x7f07002f;
|
||||
public static final int upgradeMsg=0x7f07004f;
|
||||
public static final int upgradeMsg=0x7f070050;
|
||||
public static final int upgradeMsg_DB=0x7f070023;
|
||||
public static final int userIDName_preferences=0x7f070009;
|
||||
public static final int userIDSummary_preferences=0x7f07000a;
|
||||
|
|
Binary file not shown.
|
@ -10,6 +10,7 @@
|
|||
android:id="@+id/testResultsText"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/actionBarLayout"
|
||||
android:layout_above="@+id/testResultsScore"
|
||||
android:gravity="center"
|
||||
android:padding="20dip"
|
||||
|
|
|
@ -71,6 +71,8 @@
|
|||
<string name="testNoQuestionsCourseMsg">No se ha descargado ninguna pregunta de test para esta asignatura</string>
|
||||
<string name="testNoQuestionsMsg">Antes de realizar un test debe descargar las preguntas de test de al menos una
|
||||
asignatura</string>
|
||||
<string name="testNoQuestionsMeetsSpecifiedCriteriaMsg">No hay ninguna pregunta que se ajuste a los criterios
|
||||
especificados</string>
|
||||
<string name="testNumQuestionsMsg">Indique el número de preguntas del test</string>
|
||||
<string name="testTagsMsg">Seleccione los descriptores que desea incluir en el test</string>
|
||||
<string name="testNoTagsSelectedMsg">Debe seleccionar al menos un descriptor</string>
|
||||
|
@ -78,7 +80,7 @@
|
|||
<string name="testNoAnswerTypesSelectedMsg">Debe seleccionar al menos un tipo de respuesta</string>
|
||||
<string name="testEvaluateMsg">Corregir</string>
|
||||
<string name="testResultsTextMsg">Puntuación</string>
|
||||
<string name="testShowResultsMsg">Ver resultados</string>
|
||||
<string name="testShowResultsMsg">Ver totales</string>
|
||||
<string name="testShowResultsDetailsMsg">Ver detalles</string>
|
||||
<string name="testNoDetailsMsg">El profesor no permite ver los detalles</string>
|
||||
<string name="testNoResultsMsg">El profesor no permite ver los resultados del test</string>
|
||||
|
|
|
@ -70,6 +70,8 @@
|
|||
<string name="testNoQuestionsCourseMsg">Not downloaded any test question for this course</string>
|
||||
<string name="testNoQuestionsMsg">Before performing a test you should download the test questions for at least
|
||||
one course</string>
|
||||
<string name="testNoQuestionsMeetsSpecifiedCriteriaMsg">There is no question that meets the specified
|
||||
criteria</string>
|
||||
<string name="testNumQuestionsMsg">Indicate the number of test questions</string>
|
||||
<string name="testTagsMsg">Select the tags that will be included in the test</string>
|
||||
<string name="testNoTagsSelectedMsg">You must select at least one tag</string>
|
||||
|
@ -77,7 +79,7 @@
|
|||
<string name="testNoAnswerTypesSelectedMsg">You must select at least one answer type</string>
|
||||
<string name="testEvaluateMsg">Evaluate</string>
|
||||
<string name="testResultsTextMsg">Score</string>
|
||||
<string name="testShowResultsMsg">Show results</string>
|
||||
<string name="testShowResultsMsg">Show totals</string>
|
||||
<string name="testShowResultsDetailsMsg">Show details</string>
|
||||
<string name="testNoDetailsMsg">The teacher does not allow to see the details</string>
|
||||
<string name="testNoResultsMsg">The teacher does not allow to see the results</string>
|
||||
|
|
|
@ -352,7 +352,7 @@ public class Test extends Model {
|
|||
a = la.get(0);
|
||||
|
||||
userAnswerText = a.getUserAnswer();
|
||||
if(userAnswerText == "") {
|
||||
if(userAnswerText.equals("")) {
|
||||
a.setCorrectAnswered(false);
|
||||
} else {
|
||||
userFloatAnswer = new Float(userAnswerText);
|
||||
|
@ -372,7 +372,7 @@ public class Test extends Model {
|
|||
a = la.get(0);
|
||||
|
||||
userAnswerText = a.getUserAnswer();
|
||||
if(userAnswerText == "") {
|
||||
if(userAnswerText.equals("")) {
|
||||
a.setCorrectAnswered(false);
|
||||
} else {
|
||||
a.setCorrectAnswered(a.getAnswer().equals(a.getUserAnswer()));
|
||||
|
@ -387,7 +387,7 @@ public class Test extends Model {
|
|||
score = (float) (correctUserAnswers-errors);
|
||||
} else if(answerType.equals("int")) {
|
||||
a = la.get(0);userAnswerText = a.getUserAnswer();
|
||||
if(userAnswerText == "") {
|
||||
if(userAnswerText.equals("")) {
|
||||
a.setCorrectAnswered(false);
|
||||
} else {
|
||||
a.setCorrectAnswered(a.getAnswer().equals(a.getUserAnswer()));
|
||||
|
|
|
@ -49,6 +49,15 @@ public class Courses extends Module {
|
|||
*/
|
||||
public static final String TAG = Global.APP_TAG + " Courses";
|
||||
|
||||
@Override
|
||||
protected void runConnection() {
|
||||
super.runConnection();
|
||||
if (!isConnected) {
|
||||
setResult(RESULT_CANCELED);
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see android.app.Activity#onCreate()
|
||||
*/
|
||||
|
|
|
@ -252,7 +252,7 @@ public abstract class Module extends Activity {
|
|||
{
|
||||
isConnected = connectionAvailable(this);
|
||||
if (!isConnected) {
|
||||
Toast.makeText(this, R.string.errorMsgNoConnection, Toast.LENGTH_SHORT).show();
|
||||
Toast.makeText(this, R.string.errorMsgNoConnection, Toast.LENGTH_SHORT).show();
|
||||
} else {
|
||||
//If this is not the Login module, launch login check
|
||||
if(!(this instanceof Login)) {
|
||||
|
|
|
@ -64,7 +64,9 @@ public class CheckedAnswersArrayAdapter extends ArrayAdapter<TestAnswer> {
|
|||
tt.setText(Html.fromHtml(a.getAnswer()));
|
||||
|
||||
if(evaluated && feedback.equals("eachGoodBad") && a.getCorrect()) {
|
||||
tt.setTextColor(Color.BLUE);
|
||||
tt.setTextColor(Color.BLUE);
|
||||
} else {
|
||||
tt.setTextColor(Color.BLACK);
|
||||
}
|
||||
|
||||
return convertView;
|
||||
|
|
|
@ -339,10 +339,14 @@ public class TestsMake extends Module {
|
|||
a = answers.get(0);
|
||||
sp.setAdapter(tfAdapter);
|
||||
|
||||
if(a.getUserAnswer().equals("T")) {
|
||||
sp.setSelection(0);
|
||||
} else {
|
||||
if(a.getUserAnswer().equals("F")) {
|
||||
sp.setSelection(1);
|
||||
} else {
|
||||
sp.setSelection(0);
|
||||
}
|
||||
|
||||
if(a.getUserAnswer().equals("")) {
|
||||
a.setUserAnswer(a.getAnswer());
|
||||
}
|
||||
|
||||
sp.setVisibility(View.VISIBLE);
|
||||
|
@ -372,6 +376,11 @@ public class TestsMake extends Module {
|
|||
}
|
||||
}
|
||||
|
||||
a = answers.get(0);
|
||||
if(a.getUserAnswer().equals("")) {
|
||||
a.setUserAnswer(a.getAnswer());
|
||||
}
|
||||
|
||||
sp.setAdapter(uniqueChoiceAdapter);
|
||||
sp.setSelection(selectedChoice);
|
||||
sp.setVisibility(View.VISIBLE);
|
||||
|
@ -533,23 +542,28 @@ public class TestsMake extends Module {
|
|||
|
||||
//Generates the test
|
||||
questions = dbHelper.getCourseQuestionsByTagAndAnswerType(selectedCourseCode, tagsList, answerTypesList);
|
||||
Collections.shuffle(questions);
|
||||
|
||||
if(questions.size() > numQuestions) {
|
||||
questions = questions.subList(0, numQuestions);
|
||||
}
|
||||
|
||||
test.setQuestions(questions);
|
||||
|
||||
//Shuffles related answers in a question if necessary
|
||||
for(TestQuestion q : questions) {
|
||||
if(q.getShuffle()) {
|
||||
q.shuffleAnswers();
|
||||
if(!questions.isEmpty()) {
|
||||
Collections.shuffle(questions);
|
||||
|
||||
if(questions.size() > numQuestions) {
|
||||
questions = questions.subList(0, numQuestions);
|
||||
}
|
||||
|
||||
test.setQuestions(questions);
|
||||
|
||||
//Shuffles related answers in a question if necessary
|
||||
for(TestQuestion q : questions) {
|
||||
if(q.getShuffle()) {
|
||||
q.shuffleAnswers();
|
||||
}
|
||||
}
|
||||
|
||||
//Shows the test
|
||||
showTest();
|
||||
} else {
|
||||
Toast.makeText(this, R.string.testNoQuestionsMeetsSpecifiedCriteriaMsg, Toast.LENGTH_LONG);
|
||||
finish();
|
||||
}
|
||||
|
||||
//Shows the test
|
||||
showTest();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -584,7 +598,7 @@ public class TestsMake extends Module {
|
|||
textView.setText(df.format(score) + "/" + test.getQuestions().size() + "\n"
|
||||
+ df.format(scoreDec) + "/10");
|
||||
|
||||
if(score < 5) {
|
||||
if(scoreDec < 5) {
|
||||
textView.setTextColor(Color.RED);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user